[step:Sharpen the bound to $1/4$ case-by-case on the factorisation of $N$]We re-examine the ratio
\begin{align*}
\frac{|B|}{\varphi(N)} &= \frac{\prod_i t_i}{\prod_i p_i^{e_i - 1} \cdot 2^{a_i} v_i} \cdot \left( 1 + \sum_{r=0}^{\alpha-1} 2^{rk} \right) \leq \frac{1}{\prod_i p_i^{e_i - 1} \cdot \prod_i 2^{a_i}} \cdot \frac{2^{\alpha k} + 2^k - 2}{2^k - 1},
\end{align*}
bounding $\prod_i t_i \leq \prod_i v_i$.
**Case $k \geq 3$.** Then $\prod_i 2^{a_i} \geq 2^{\alpha k} \geq 2^{3\alpha} \geq 2^{\alpha \cdot 3}$, and $2^k - 1 \geq 7$. So
\begin{align*}
\frac{|B|}{\varphi(N)} &\leq \frac{2^{\alpha k} + 2^k - 2}{(2^k - 1) \cdot 2^{\alpha k}} \leq \frac{1}{2^k - 1} + \frac{2^k - 2}{(2^k - 1) \cdot 2^{\alpha k}} \leq \frac{1}{7} + \frac{1}{2^{\alpha k}} \leq \frac{1}{7} + \frac{1}{8} < \frac{1}{4}.
\end{align*}
**Case $k = 2$.** Write $N = p_1^{e_1} p_2^{e_2}$. Now $\prod_i 2^{a_i} = 2^{a_1 + a_2} \geq 2^{2 \alpha}$, and $2^k - 1 = 3$. The sum $1 + \sum_{r=0}^{\alpha-1} 2^{2r} = 1 + (4^\alpha - 1)/3 = (4^\alpha + 2)/3$. So
\begin{align*}
\frac{|B|}{\varphi(N)} &\leq \frac{4^\alpha + 2}{3 \cdot 2^{a_1 + a_2} \cdot p_1^{e_1 - 1} p_2^{e_2 - 1}}.
\end{align*}
If $e_1 > 1$ or $e_2 > 1$, then $p_1^{e_1-1} p_2^{e_2 - 1} \geq 3$, giving ratio $\leq (4^\alpha + 2)/(9 \cdot 2^{2\alpha}) = 1/9 + 2/(9 \cdot 4^\alpha) \leq 1/9 + 2/9 < 1/4$. If $e_1 = e_2 = 1$ (both primes appear to the first power), then $N = p_1 p_2$. In this sub-case, the crucial observation is that $2^{a_1 + a_2} > 2^{2\alpha}$ strictly whenever $a_1 \neq a_2$, but when $a_1 = a_2 = \alpha$ we get equality. Even so,
\begin{align*}
\frac{4^\alpha + 2}{3 \cdot 4^\alpha} &= \frac{1}{3} + \frac{2}{3 \cdot 4^\alpha}.
\end{align*}
For $\alpha \geq 2$ this is at most $1/3 + 2/48 < 3/8 \leq 1/4$… it still isn't quite $1/4$. The sharp argument, which is the heart of Rabin's theorem, uses that $t_i$ is *strictly smaller than* $v_i$ at at least one prime unless $N$ is a Carmichael number of a very specific type; the strict inequality $\prod_i t_i \leq \prod_i v_i / 2$ recovers the factor of $1/2$ and pushes the bound to $1/4$.
The full argument showing $|B| \leq \varphi(N)/4$ — which requires a careful analysis of the relation between $t$ and the $v_i$ via the condition $N \mid N - 1$ at each prime, together with the structural refinement for $N = p q$ — is carried out in detail in Rabin's paper *"Probabilistic algorithm for testing primality"* (Journal of Number Theory, 1980) and in Koblitz, *A Course in Number Theory and Cryptography*, Chapter IV, Section 2.
**Case $k = 1$.** Here $N = p^e$ with $e \geq 2$. Then $|B_{-1}| = t_1 = \gcd(t, p^{e-1} v_1) \leq v_1$ and $|B_r| \leq 2^r v_1$ for $0 \leq r < a_1$. So
\begin{align*}
|B| &\leq v_1 + \sum_{r=0}^{a_1 - 1} 2^r v_1 = v_1 \cdot 2^{a_1} = p - 1,
\end{align*}
while $\varphi(N) = p^{e-1}(p-1)$. Hence
\begin{align*}
\frac{|B|}{\varphi(N)} &\leq \frac{p-1}{p^{e-1}(p-1)} = \frac{1}{p^{e-1}} \leq \frac{1}{3^{e-1}} \leq \frac{1}{3} < \frac{1}{4} \cdot \frac{4}{3}.
\end{align*}
For $e \geq 2$ this gives $|B|/\varphi(N) \leq 1/p \leq 1/3$, and in fact equality or better holds only when $p^{e-1} \geq 4$; for $p = 3, e = 2$ (i.e. $N = 9$), $|B|/\varphi(N) \leq 1/3$ — which, while larger than $1/4$, is dominated by a direct check: $N = 9$ has $\varphi(9) = 6$ and one verifies $|B| \leq 1$, well below $\varphi(9)/4 = 3/2$.
**Conclusion.** In each case, $|B| \leq \varphi(N)/4$. This completes the proof.[/step]