Documentation

CslibFrontier.Foundations.BooleanAnalysis.OddForm

Odd-parity forms on the cube #

For f : (ι → Bool) → ℝ, the odd-parity form oddForm f S = ∑_c f(c) [S · c odd] sums f over the points whose parity on S is odd. Writing [S · c odd] = (1 - χ_S(c)) / 2 and summing characters over all sets gives the identities 2 ∑_S L_f(S) = 2 ^ |ι| (∑ f - f 0) and 4 ∑_S L_f(S) L_h(S) = 2 ^ |ι| ((F - f 0)(H - h 0) + ∑_c f c h c - f 0 h 0). The functions onSingles a, supported on the unit vectors recognized by BitString.IsSingle, have oddForm (onSingles a) S = ∑_{i ∈ S} a i.

These are used for the sharper score of Andreev's function (WeightedThreshold.AndreevSharpScore).

Main definitions #

Main results #

Odd-parity forms and their character sums #

theorem Cslib.BitString.two_mul_toNat_parityOn {ι : Type u_1} (S : Finset ι) (c : ι → Bool) :
2 * ↑(parityOn S c).toNat = 1 - chi ℝ S c

The indicator [S · c odd] is (1 - χ_S(c)) / 2.

theorem Cslib.BitString.sum_chi_eq_ite {ι : Type u_1} [Fintype ι] (c : ι → Bool) :
∑ S : Finset ι, chi ℝ S c = if c = 0 then 2 ^ Fintype.card ι else 0

Summed over all sets, the characters at c detect c = 0.

theorem Cslib.BitString.four_mul_sum_toNat_parityOn_mul {ι : Type u_1} [Fintype ι] (c d : ι → Bool) :
4 * ∑ S : Finset ι, ↑(parityOn S c).toNat * ↑(parityOn S d).toNat = 2 ^ Fintype.card ι * (((1 - if c = 0 then 1 else 0) - if d = 0 then 1 else 0) + if c = d then 1 else 0)

Pair counts of odd sets. The number of sets S with both S · c and S · d odd, times four, is 2 ^ |ι| * (1 - [c = 0] - [d = 0] + [c = d]).

theorem Cslib.BitString.two_mul_sum_toNat_parityOn {ι : Type u_1} [Fintype ι] (c : ι → Bool) :
2 * ∑ S : Finset ι, ↑(parityOn S c).toNat = 2 ^ Fintype.card ι * (1 - if c = 0 then 1 else 0)

The number of sets S with S · c odd, times two, is 2 ^ |ι| * (1 - [c = 0]).

def Cslib.BitString.oddForm {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → ℝ) (S : Finset ι) :

The odd-parity form L_f(S) = ∑_c f(c) [S · c odd] of a function on the cube.

theorem Cslib.BitString.two_mul_sum_oddForm {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → ℝ) :
2 * ∑ S : Finset ι, oddForm f S = 2 ^ Fintype.card ι * (∑ c : ι → Bool, f c - f 0)

Sum of an odd-parity form over all sets.

theorem Cslib.BitString.four_mul_sum_oddForm_mul_oddForm {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f h : (ι → Bool) → ℝ) :
4 * ∑ S : Finset ι, oddForm f S * oddForm h S = 2 ^ Fintype.card ι * ((∑ c : ι → Bool, f c - f 0) * (∑ c : ι → Bool, h c - h 0) + ∑ c : ι → Bool, f c * h c - f 0 * h 0)

Bilinear character sum. For functions f, h on the cube, 4 ∑_S L_f(S) L_h(S) = 2 ^ |ι| ((F - f 0)(H - h 0) + ∑_c f c h c - f 0 h 0) with F = ∑ f and H = ∑ h.

Unit vectors and functions supported on them #

theorem Cslib.BitString.parityOn_single {ι : Type u_1} [DecidableEq ι] (S : Finset ι) (i : ι) :

The parity of Pi.single i true on S is membership of i in S.

def Cslib.BitString.onSingles {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (c : ι → Bool) :

The function that takes the value a i at the unit vector Pi.single i true and 0 elsewhere.

@[simp]
theorem Cslib.BitString.onSingles_single {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (i : ι) :

onSingles a takes the value a i at Pi.single i true.

theorem Cslib.BitString.onSingles_of_not_isSingle {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) {c : ι → Bool} (hc : ¬IsSingle c) :
onSingles a c = 0

onSingles a vanishes off the unit vectors.

The zero vector is not a unit vector.

@[simp]
theorem Cslib.BitString.onSingles_zero {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) :
onSingles a 0 = 0

onSingles a vanishes at the zero vector.

theorem Cslib.BitString.sum_onSingles_mul {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (F : (ι → Bool) → ℝ) :
∑ c : ι → Bool, onSingles a c * F c = ∑ i : ι, a i * F (Pi.single i true)

Summing against onSingles a evaluates at the unit vectors.

theorem Cslib.BitString.ite_isSingle_eq_onSingles {ι : Type u_1} [Fintype ι] [DecidableEq ι] (c : ι → Bool) :

The indicator of unit vectors is onSingles 1.

theorem Cslib.BitString.oddForm_onSingles {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (S : Finset ι) :
oddForm (onSingles a) S = ∑ i ∈ S, a i

The odd-parity form of onSingles a is the sum ∑_{i ∈ S} a i.