Documentation

CslibFrontier.Computability.QueryComplexity.OrBlocks

Sensitivity of a disjunction of blocks #

A disjunction over disjoint blocks of input bits changes value under a single-bit flip only when the flip changes the block containing the bit and that block change changes the disjunction. When some block accepts, only that block can change the disjunction; when every block rejects, every block can. sum_le_max_of_or is this count-level argument, independent of how blocks are laid out or how their local sensitivities are measured. It is shared by the homogeneous QueryComplexity.SensitivitySeparation.Internal.sensitivity_orCopies_le and by the dependent, unequal-size native layout below.

The native layout orBlocks puts blocks of sizes sizes b consecutively in block order using Mathlib's finSigmaFinEquiv, transported along a length equation ∑ b, sizes b = n.

Main definitions #

Main results #

theorem Cslib.BitString.sum_le_max_of_or {K : Type u_1} [Fintype K] (y : K → Bool) (T : Finset K) (s : K → ℕ) {S₀ S₁ : ℕ} (hT : ∀ (j : K), y j = true → T ⊆ {j}) (h₀ : ∀ (k : K), y k = false → s k ≤ S₀) (h₁ : ∀ (k : K), y k = true → s k ≤ S₁) :
∑ k ∈ T, s k ≤ max (Fintype.card K * S₀) S₁

Dependent-OR counting. Let y k be the value of block k, T the blocks whose change changes the disjunction, and s k a count attached to block k (for instance its local sensitivity). If every accepting block j forces T ⊆ {j}, rejected blocks have count at most S₀ and accepted blocks at most S₁, then the counts over T sum to at most max (card K * S₀) S₁.

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

The consecutive layout of blocks of the given sizes in block-index order.

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

The restriction of an input to block b of the consecutive layout.

theorem Cslib.BitString.blockOf_update_self {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (x : BitString n) (b : Fin k) (j : Fin (sizes b)) (v : Bool) :

Changing a coordinate of block b changes only that coordinate of block b.

theorem Cslib.BitString.blockOf_update_of_ne {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (x : BitString n) {b c : Fin k} (hc : c ≠ b) (j : Fin (sizes b)) (v : Bool) :
blockOf h (Function.update x ((blockEquiv h) ⟨b, j⟩) v) c = blockOf h x c

Changing a coordinate of block b leaves every other block unchanged.

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

The OR of the local functions g b on the blocks of the consecutive layout.

theorem Cslib.BitString.orBlocks_eq_true_iff {k n : ℕ} {sizes : Fin k → ℕ} {h : ∑ b : Fin k, sizes b = n} {g : (b : Fin k) → BooleanFunction (sizes b)} {x : BitString n} :
orBlocks h g x = true ↔ ∃ (b : Fin k), g b (blockOf h x b) = true

The disjunction accepts exactly when some block accepts.

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

The blocks whose value flip changes the disjunction at x.

theorem Cslib.BitString.orSensitiveBlocks_subset {k n : ℕ} {sizes : Fin k → ℕ} {h : ∑ b : Fin k, sizes b = n} {g : (b : Fin k) → BooleanFunction (sizes b)} {x : BitString n} {j : Fin k} (hj : g j (blockOf h x j) = true) :

If block j accepts, then no other block can change the disjunction.

theorem Cslib.BitString.isSensitiveCoord_orBlocks_iff {k n : ℕ} {sizes : Fin k → ℕ} {h : ∑ b : Fin k, sizes b = n} {g : (b : Fin k) → BooleanFunction (sizes b)} {x : BitString n} {b : Fin k} {j : Fin (sizes b)} :

A coordinate is sensitive for the disjunction iff it is sensitive for its block and that block is one whose flip changes the disjunction.

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

The sensitive coordinates of the disjunction are the sensitive coordinates of the blocks whose flip changes the disjunction, placed by the layout.

theorem Cslib.BitString.sensitivityAt_orBlocks {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (g : (b : Fin k) → BooleanFunction (sizes b)) (x : BitString n) :
sensitivityAt (orBlocks h g) x = ∑ b ∈ orSensitiveBlocks h g x, sensitivityAt (g b) (blockOf h x b)

Sensitivity of a disjunction of blocks. The sensitivity at x is the sum of the local sensitivities over the blocks whose flip changes the disjunction.

theorem Cslib.BitString.sensitivity_orBlocks_le {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (g : (b : Fin k) → BooleanFunction (sizes b)) {S₀ S₁ : ℕ} (h₀ : ∀ (b : Fin k) (x : BitString (sizes b)), g b x = false → sensitivityAt (g b) x ≤ S₀) (h₁ : ∀ (b : Fin k) (x : BitString (sizes b)), g b x = true → sensitivityAt (g b) x ≤ S₁) :
sensitivity (orBlocks h g) ≤ max (k * S₀) S₁

If rejected blocks have local sensitivity at most S₀ and accepted blocks at most S₁, then the disjunction of k blocks has sensitivity at most max (k * S₀) S₁.

theorem Cslib.BitString.sensitivityAt_orBlocks_of_unique {k n : ℕ} {sizes : Fin k → ℕ} (h : ∑ b : Fin k, sizes b = n) (g : (b : Fin k) → BooleanFunction (sizes b)) {x : BitString n} {b : Fin k} (hb : g b (blockOf h x b) = true) (hother : ∀ (c : Fin k), c ≠ b → g c (blockOf h x c) = false) :

If exactly block b accepts, the disjunction has the local sensitivity of block b.