Documentation

CslibFrontier.Computability.QueryComplexity.AdjacentPair.Blocks

Adjacent-pair predicates on unequal consecutive blocks #

The function in [AB07], Chapter 11 Exercise 2, is the OR of the local adjacent-pair predicate adjacentPair over disjoint contiguous blocks. This module permits arbitrary, possibly unequal block sizes laid out by Cslib.BitString.orBlocks. Every adjacent pair of a block is accepted, including overlapping choices; the block-sensitivity witness family uses only the disjoint pairs starting at even local positions.

Main definitions #

Main results #

def Cslib.BitString.adjacentPairBlocks {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) :

An input is accepted when some block has exactly two adjacent true positions. The blocks are consecutive in block-index order and may have different sizes.

theorem Cslib.BitString.adjacentPairBlocks_eq_true_iff {k n : ℕ} {sizes : Fin k → ℕ} {h : ∑ b : Fin k, sizes b = n} {x : BitString n} :
adjacentPairBlocks h x = true ↔ ∃ (b : Fin k), adjacentPair (sizes b) (blockOf h x b) = true

The block function accepts exactly when one of its local predicates accepts.

@[simp]
theorem Cslib.BitString.adjacentPairBlocks_zero {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) :
(adjacentPairBlocks h fun (x : Fin n) => false) = false

No block of the all-false word is accepted.

theorem Cslib.BitString.sensitivity_adjacentPairBlocks_le {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) {M : ℕ} (hM : ∀ (b : Fin k), sizes b ≤ M) :

Sensitivity upper bound. A rejected block has local sensitivity at most three and an accepted block of size at most M has local sensitivity at most M.

def Cslib.BitString.adjacentPairStart {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (b : Fin k) :

The input whose only true bits are the first two positions of block b.

theorem Cslib.BitString.le_sensitivity_adjacentPairBlocks {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) {b : Fin k} (hb : 2 ≤ sizes b) :

Sensitivity lower bound. Every block with room for a pair has all of its coordinates sensitive at the input accepting only in that block.

def Cslib.BitString.adjacentPairWitness {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (p : (b : Fin k) × Fin (sizes b / 2)) :

The j-th disjoint pair in block b consists of local positions 2 * j and 2 * j + 1. These are witnesses for block sensitivity; the function itself also accepts overlapping pairs.

theorem Cslib.BitString.isSensitiveBlock_adjacentPairWitness {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (p : (b : Fin k) × Fin (sizes b / 2)) :

Flipping a designated pair at zero creates an accepted local adjacent pair.

theorem Cslib.BitString.pairwise_disjoint_adjacentPairWitness {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) :
Pairwise fun (p q : (b : Fin k) × Fin (sizes b / 2)) => Disjoint (adjacentPairWitness h p) (adjacentPairWitness h q)

Witnesses with distinct indices are disjoint, within a block and across blocks.

theorem Cslib.BitString.adjacentPairWitness_injective {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) :

Different witness indices give different blocks.

def Cslib.BitString.adjacentPairSensitiveFamily {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) :

All disjoint even-starting pairs across all the blocks.

The concrete family is sensitive at zero and pairwise disjoint.

theorem Cslib.BitString.card_adjacentPairSensitiveFamily {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) :
(adjacentPairSensitiveFamily h).card = ∑ b : Fin k, sizes b / 2

There are exactly as many designated disjoint pairs as the sum of the half block sizes.

theorem Cslib.BitString.sum_half_le_blockSensitivity_adjacentPairBlocks {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) :

Block-sensitivity lower bound. The disjoint pair family at zero gives ∑ b, sizes b / 2 ≤ bs(f).

theorem Cslib.BitString.card_le_three_mul_blockSensitivity_adjacentPairBlocks {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (hsizes : ∀ (b : Fin k), 2 ≤ sizes b) :

If every block has at least two coordinates, three times block sensitivity covers every input coordinate. Odd and unequal block sizes are permitted.