We will now sum the sizes of the lists over all vertices containing corrupted items.
\lemma
-After~$n$ items have been inserted, the heap contains at most~$n/2^{r-3}$ corrupted
+After~$n$ items have been inserted, the heap contains at most~$n/2^{r-2}$ corrupted
items at any given time.
\proof
above claim guarantees that the total size of the master trees is bounded by the
number of insertions properly.
-So let us have a~complete tree of~rank~$k$. It has exactly $2^{k-i}$ vertices
+So let us consider a~complete tree of~rank~$k$. It has exactly $2^{k-i}$ vertices
of rank~$i$ and each such vertex contains a~list of at most~$2^{\lceil i/2\rceil - r/2}$
items by the previous lemma. Summing over all ranks greater than~$r$, we get that
the total number of corrupted items in this tree is at most:
$$
\sum_{i=r+1}^k 2^{k-i}\cdot 2^{\lceil i/2\rceil - r/2}
-= 2^{k-r/2} \cdot \sum_i 2^{\lceil i/2\rceil - i}
-\le 2^{k-r/2} \cdot \sum_i 2^{-i/2}
+= 2^{k-r/2} \cdot \sum_{i=r+1}^k 2^{\lceil i/2\rceil - i}
+\le 2^{k-r/2} \cdot \sum_{i=r+1}^k 2^{-i/2}
+\le 2^{k-r} \cdot \sum_{i=0}^\infty 2^{-i/2}.
$$
-
-\FIXME{Finish the proof and update the claim of the lemma.}
-
-
+The sum of a~geometric series with quotient $2^{-1/2}$ is less than four, so the
+last formula is less than $2^{k-r+2}$. Since the tree contains $n_k=2^k$ black vertices,
+this makes less than $n_k/2^{k-2}$ corrupted items as we asserted.
\qed
+\paran{Analysis of time complexity}
+
\endpart