Consider a variant of link-by-size implementation of the Union–Find data structure, in which trees will be linked by the logarithm of the size. Let $\ell_i$ = $⌊\log_2|T_i|⌋$ and, when merging $T_i$ and $T_j$, we use the following rules:
• if $\ell_i$ < $\ell_j$ , we make the root of $T_i$ point to the root of $T_j$ ;
• if $\ell_i$ > $\ell_j$ , we make the root of $T_j$ point to the root of $T_i$;
• if $\ell_i$ = $\ell_j$ , we choose one of the two options above arbitrarily.
Recall that we define the height of a rooted tree as the length of the longest path from a leaf to the root; e.g., the height of a tree that only contains one node is $0$. Prove that under our rules, the height of a tree that contains $s$ nodes does not exceed $2\log_2s$.
I think this is meant to be solved using induction - I've solved the $\ell_i>\ell_j$ case (the $\ell_j$>$\ell_i$ is symmetric).
I'm stuck on the $\ell_i$ = $\ell_j$ case, here's my attempt:
$\ell_i \le \log_2|T_i|$
$\implies 2^{\ell_i} \le |T_i|$
as $\ell_i = \ell_j$ we have $2^{\ell_i} = 2^{\ell_j}$
$\therefore 2\log_2(|T_i|+|T_j|) \ge 2\log_2(2^{\ell_i} + 2^{\ell_j})$
$ = 2\log_2(2\cdot2^{\ell_i})$
$ = 2\log_2(2^{\ell_i + 1})$
(which should be but I can't prove)$ > h + 1$ where $h$ is the height of $T_i$
How do I prove this?