Documentation

CslibFrontier.Foundations.Data.Code.BinaryJohnson

The binary Johnson bound in correlation form #

Read binary words X → Bool as ±1 vectors, so that the inner product of two words is their sign correlation ∑ x, signVal (f x) * signVal (g x) (Cslib.BitString.inner_signWord). If words c i, i ∈ s, each have correlation at least α |X| with a fixed word w, where α ≥ 0, and pairwise correlation at most β |X|, then the Cauchy–Schwarz inequality for w and ∑ i, c i gives #s (α ^ 2 - β) ≤ 1 - β for nonempty s (Cslib.Code.card_mul_sq_sub_le_of_le_sum_signVal_mul_signVal). Only an upper bound on the pairwise correlations is needed: pairs of nearly complementary words are allowed.

A word agrees with w on at least a 1 / 2 + ε fraction of the positions exactly when their correlation is at least 2 ε |X| (Cslib.BitString.sum_signVal_mul_signVal_eq_two_mul_card_sub). With α = 2 ε and β = 2 ε ^ 2 this is the binary Johnson bound: fewer than 1 / (2 ε ^ 2) words with pairwise correlation at most 2 ε ^ 2 |X| agree with w on a 1 / 2 + ε fraction of the positions (Cslib.Code.card_mul_two_mul_sq_lt_one). In terms of distances: a binary code of relative minimum distance at least 1 / 2 - ε ^ 2 has fewer than 1 / (2 ε ^ 2) codewords within relative distance 1 / 2 - ε of any word (Cslib.Code.card_filter_hammingDist_le_mul_two_mul_sq_lt_one). This is the binary Johnson bound as stated in Arora and Barak, Chapter 19 for distance 1 / 2 - ε ^ 2 and radius 1 / 2 - ε, with a strict inequality. The alphabet-free and q-ary bounds of Cslib.Code.card_filter_hammingDist_le_le and Cslib.Code.card_filter_hammingDist_le_le_of_mul_le reach comparable radii but bound the list by the length of the code.

For an encoding of messages that are not themselves separated, the list is first covered by the Hamming balls of radius r around a subset of messages pairwise farther than r apart (Cslib.Code.exists_subset_pairwise_lt_hammingDist_forall_exists_le). If the encodings of messages farther than r apart have correlation at most 2 ε ^ 2 |X|, the Johnson bound applies to that subset, so at most V / (2 ε ^ 2) messages have encodings agreeing with w on a 1 / 2 + ε fraction of the positions, where V bounds the size of a ball of radius r (Cslib.Code.card_filter_mul_two_mul_sq_le).

Main results #

References #

theorem Cslib.Code.card_mul_sq_sub_le_of_le_sum_signVal_mul_signVal {X : Type u_1} [Fintype X] [Nonempty X] {ι : Type u_2} {s : Finset ι} (hs : s.Nonempty) (c : ι → X → Bool) (w : X → Bool) {α β : ℝ} (hα : 0 ≤ α) (hβ : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → ∑ x : X, BitString.signVal (c i x) * BitString.signVal (c j x) ≤ β * ↑(Fintype.card X)) (hw : ∀ i ∈ s, α * ↑(Fintype.card X) ≤ ∑ x : X, BitString.signVal (c i x) * BitString.signVal (w x)) :
↑s.card * (α ^ 2 - β) ≤ 1 - β

The Johnson bound in correlation form: if the words c i, i ∈ s, of a nonempty family each have sign correlation at least α |X| with w, where α ≥ 0, and pairwise sign correlation at most β |X|, then #s (α ^ 2 - β) ≤ 1 - β.

theorem Cslib.Code.card_mul_two_mul_sq_lt_one {X : Type u_1} [Fintype X] [Nonempty X] {ι : Type u_2} {s : Finset ι} (c : ι → X → Bool) (w : X → Bool) {ε : ℝ} (hε : 0 ≤ ε) (hβ : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → ∑ x : X, BitString.signVal (c i x) * BitString.signVal (c j x) ≤ 2 * ε ^ 2 * ↑(Fintype.card X)) (hagree : ∀ i ∈ s, (1 / 2 + ε) * ↑(Fintype.card X) ≤ ↑{x : X | c i x = w x}.card) :
↑s.card * (2 * ε ^ 2) < 1

The binary Johnson bound in agreement form: if the words c i, i ∈ s, have pairwise sign correlation at most 2 ε ^ 2 |X| and each agrees with w on at least a 1 / 2 + ε fraction of the positions, where ε ≥ 0, then #s * (2 ε ^ 2) < 1: there are fewer than 1 / (2 ε ^ 2) of them.

theorem Cslib.Code.card_filter_hammingDist_le_mul_two_mul_sq_lt_one {X : Type u_1} [Fintype X] [Nonempty X] {C : Finset (X → Bool)} {ε : ℝ} (hε : 0 ≤ ε) (hC : ∀ c ∈ C, ∀ c' ∈ C, c ≠ c' → (1 / 2 - ε ^ 2) * ↑(Fintype.card X) ≤ ↑(hammingDist c c')) (w : X → Bool) :
↑{c ∈ C | ↑(hammingDist c w) ≤ (1 / 2 - ε) * ↑(Fintype.card X)}.card * (2 * ε ^ 2) < 1

The binary Johnson bound for codes Arora and Barak, Chapter 19: if any two distinct words of a binary code C differ on at least a 1 / 2 - ε ^ 2 fraction of the positions, where ε ≥ 0, then fewer than 1 / (2 ε ^ 2) codewords lie within distance (1 / 2 - ε) |X| of any word w.

theorem Cslib.Code.card_filter_mul_two_mul_sq_le {X : Type u_1} [Fintype X] [Nonempty X] {ι : Type u_2} {A : Type u_3} [Fintype ι] [DecidableEq ι] [Fintype A] [DecidableEq A] (E : (ι → A) → X → Bool) (w : X → Bool) {ε V : ℝ} (hε : 0 ≤ ε) (hV : 0 ≤ V) (r : ℕ) (hfar : ∀ (m m' : ι → A), r < hammingDist m m' → ∑ x : X, BitString.signVal (E m x) * BitString.signVal (E m' x) ≤ 2 * ε ^ 2 * ↑(Fintype.card X)) (hball : ∀ (m : ι → A), ↑{m' : ι → A | hammingDist m m' ≤ r}.card ≤ V) :
↑{m : ι → A | (1 / 2 + ε) * ↑(Fintype.card X) ≤ ↑{x : X | E m x = w x}.card}.card * (2 * ε ^ 2) ≤ V

List size by covering: let E encode messages m : ι → A as binary words on X. Suppose the encodings of messages farther than r apart have sign correlation at most 2 ε ^ 2 |X|, where ε ≥ 0, and every Hamming ball of radius r holds at most V ≥ 0 messages. Then the messages whose encodings agree with w on at least a 1 / 2 + ε fraction of the positions number at most V / (2 ε ^ 2).