Documentation

CslibFrontier.Computability.QueryComplexity.AdjacentPair.Balanced

Balanced square-root block sizes #

The partition used in [AB07], Chapter 11 Exercise 2, has Nat.sqrt n contiguous blocks of size approximately sqrt n. The quotient/remainder split Fin.balancedBlockSize covers every input length, not just squares. For n ≥ 4 every block has at least Nat.sqrt n ≥ 2 and at most 3 * Nat.sqrt n coordinates.

Main definitions #

Main results #

The sizes of the Nat.sqrt n balanced contiguous blocks of n coordinates: with k = Nat.sqrt n, q = n / k and r = n % k, block i has size q + [i < r].

The square-root blocks cover every coordinate. For n = 0 there are no blocks.

Each square-root block has at least Nat.sqrt n coordinates.

theorem Cslib.BitString.two_le_sqrtBlockSizes {n : ℕ} (hn : 4 ≤ n) (i : Fin n.sqrt) :

For n ≥ 4 each square-root block has room for an adjacent pair.

Each square-root block has at most three times as many coordinates as there are blocks.