Documentation

Sensitivity.Parity

Parity Function and Imbalance Lemma #

The parity function and its interaction with Boolean functions and sensitivity.

Main results #

def Sensitivity.parity {n : } (x : Fin nBool) :

Parity: (-1)^(number of true bits).

Equations
Instances For
    def Sensitivity.BoolFun.pmOne {n : } (f : BoolFun n) (x : Fin nBool) :

    ±1 encoding of a Boolean function: true ↦ 1, false ↦ -1.

    Equations
    Instances For
      def Sensitivity.BoolFun.paritySigned {n : } (f : BoolFun n) (x : Fin nBool) :

      The parity-signed function: g(x) = f_pm(x) · parity(x).

      Equations
      Instances For
        theorem Sensitivity.BoolFun.pmOne_ne_zero {n : } (f : BoolFun n) (x : Fin nBool) :
        f.pmOne x 0
        theorem Sensitivity.parity_ne_zero {n : } (x : Fin nBool) :
        theorem Sensitivity.parity_flipBit {n : } (x : Fin nBool) (i : Fin n) :

        Flipping a bit negates the parity.

        theorem Sensitivity.BoolFun.sensitiveAt_of_paritySigned_eq {n : } (f : BoolFun n) (x : Fin nBool) (i : Fin n) (h : f.paritySigned (flipBit x i) = f.paritySigned x) :

        If paritySigned is the same at x and flipBit x i, then f is sensitive there.

        Proof: parity flips sign under flipBit. If f_pm · parity stays the same, f_pm must also flip, so f changes value.

        theorem Sensitivity.moebius_parity_sum {n : } (f : BoolFun n) (hn : 0 < n) :
        x : Fin nBool, f.paritySigned x = 2 * (-1) ^ n * f.moebius Finset.univ

        Key identity: the parity-weighted sum relates to the top Möbius coefficient. ∑x f_pm(x) · parity(x) = 2 · (-1)^n · c{univ}(f).

        This follows from expanding the Möbius coefficients and using the bijection between Boolean vectors and subsets.

        theorem Sensitivity.fullDegree_paritySigned_sum_ne_zero {n : } (f : BoolFun n) (hn : 0 < n) (h : f.moebius Finset.univ 0) :
        x : Fin nBool, f.paritySigned x 0

        If f has full degree (moebius at univ ≠ 0), the parity-weighted sum is nonzero.

        theorem Sensitivity.fullDegree_imbalance {n : } (f : BoolFun n) (hn : 0 < n) (h : f.moebius Finset.univ 0) :
        ∃ (c : ), (c = 1 c = -1) 2 ^ (n - 1) < {x : Fin nBool | f.paritySigned x = c}.card

        Imbalance: if the parity-weighted sum is nonzero, then one of the two "parity-sign classes" has more than 2^{n-1} elements.