Analysis of Boolean Functions in Lean

1.4. Basic Fourier formulas🔗

Proposition1.4.1
Statement uses 2
Statement dependency previews
Preview
Theorem 1.2.3
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Proposition 1.8. For f:\{-1,1\}^n\to\mathbb R and S\subseteq[n], the Fourier coefficient of f on S is \widehat f(S)=\langle f,\chi_S\rangle =\mathbb E_{\boldsymbol{x}\sim\{-1,1\}^n} [f(\boldsymbol{x})\chi_S(\boldsymbol{x})].

Lean code for Proposition1.4.11 theorem
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.fourierCoeff_eq_uniformInner {n : } (f : FABL.SignCube n  )
      (S : Finset (Fin n)) :
      FABL.fourierCoeff f S = FABL.uniformInner f (FABL.monomial S)
    theorem FABL.fourierCoeff_eq_uniformInner {n : }
      (f : FABL.SignCube n  )
      (S : Finset (Fin n)) :
      FABL.fourierCoeff f S =
        FABL.uniformInner f (FABL.monomial S)
    O'Donnell, Proposition 1.8: a Fourier coefficient is an inner product with a parity. 

Parseval's Theorem. For every f:\{-1,1\}^n\to\mathbb R, \langle f,f\rangle =\mathbb E_{\boldsymbol{x}\sim\{-1,1\}^n}[f(\boldsymbol{x})^2] =\sum_{S\subseteq[n]}\widehat f(S)^2. In particular, if f:\{-1,1\}^n\to\{-1,1\} is Boolean-valued, then \sum_{S\subseteq[n]}\widehat f(S)^2=1.

Lean code for Theorem1.4.22 theorems
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.parseval {n : } (f : FABL.SignCube n  ) :
      FABL.uniformInner f f =  S, FABL.fourierCoeff f S ^ 2
    theorem FABL.parseval {n : }
      (f : FABL.SignCube n  ) :
      FABL.uniformInner f f =
         S, FABL.fourierCoeff f S ^ 2
    Parseval's identity on `{-1,1}ⁿ`. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.sum_sq_fourierCoeff_eq_one {n : } (f : FABL.BooleanFunction n) :
       S, FABL.fourierCoeff f.toReal S ^ 2 = 1
    theorem FABL.sum_sq_fourierCoeff_eq_one {n : }
      (f : FABL.BooleanFunction n) :
       S, FABL.fourierCoeff f.toReal S ^ 2 =
        1
    The Boolean-valued specialization following Parseval's identity. 
Theorem1.4.3
Statement uses 2
Statement dependency previews
Preview
Theorem 1.3.3
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Plancherel's Theorem. For every f,g:\{-1,1\}^n\to\mathbb R, \langle f,g\rangle =\mathbb E_{\boldsymbol{x}\sim\{-1,1\}^n}[f(\boldsymbol{x})g(\boldsymbol{x})] =\sum_{S\subseteq[n]}\widehat f(S)\widehat g(S).

Lean code for Theorem1.4.31 theorem
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.plancherel {n : } (f g : FABL.SignCube n  ) :
      FABL.uniformInner f g =
         S, FABL.fourierCoeff f S * FABL.fourierCoeff g S
    theorem FABL.plancherel {n : }
      (f g : FABL.SignCube n  ) :
      FABL.uniformInner f g =
         S,
          FABL.fourierCoeff f S *
            FABL.fourierCoeff g S
    Plancherel's identity on `{-1,1}ⁿ`. 
Proposition1.4.4
Statement uses 2
Statement dependency previews
Preview
Definition 1.3.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

Proposition 1.9. If f,g:\{-1,1\}^n\to\{-1,1\}, then \langle f,g\rangle =\Pr[f(\boldsymbol{x})=g(\boldsymbol{x})] -\Pr[f(\boldsymbol{x})\ne g(\boldsymbol{x})] =1-2\operatorname{dist}(f,g).

Lean code for Proposition1.4.42 theorems
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.uniformInner_eq_uniformProbability_eq_sub_ne {n : }
      (f g : FABL.BooleanFunction n) :
      FABL.uniformInner f.toReal g.toReal =
        (FABL.uniformProbability fun x => f x = g x) -
          FABL.uniformProbability fun x => f x  g x
    theorem FABL.uniformInner_eq_uniformProbability_eq_sub_ne
      {n : } (f g : FABL.BooleanFunction n) :
      FABL.uniformInner f.toReal g.toReal =
        (FABL.uniformProbability fun x =>
            f x = g x) -
          FABL.uniformProbability fun x =>
            f x  g x
    The first equality in O'Donnell, Proposition 1.9: correlation is agreement probability minus
    disagreement probability. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.uniformInner_eq_one_sub_two_mul_relativeHammingDist {n : }
      (f g : FABL.BooleanFunction n) :
      FABL.uniformInner f.toReal g.toReal =
        1 - 2 * FABL.relativeHammingDist f g
    theorem FABL.uniformInner_eq_one_sub_two_mul_relativeHammingDist
      {n : } (f g : FABL.BooleanFunction n) :
      FABL.uniformInner f.toReal g.toReal =
        1 - 2 * FABL.relativeHammingDist f g
    O'Donnell, Proposition 1.9: correlation of sign-valued functions is one minus twice their
    relative Hamming distance. 
Definition1.4.5

Definition 1.10. For f,g:\{-1,1\}^n\to\{-1,1\}, their relative Hamming distance is \operatorname{dist}(f,g) =\Pr_{\boldsymbol{x}}[f(\boldsymbol{x})\ne g(\boldsymbol{x})], the fraction of inputs on which they disagree.

Lean code for Definition1.4.51 definition
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.relativeHammingDist.{u_1, u_2} {Ω : Type u_1} {β : Type u_2}
      [Fintype Ω] [Nonempty Ω] [DecidableEq β] (f g : Ω  β) : 
    def FABL.relativeHammingDist.{u_1, u_2}
      {Ω : Type u_1} {β : Type u_2}
      [Fintype Ω] [Nonempty Ω] [DecidableEq β]
      (f g : Ω  β) : 
    O'Donnell, Definition 1.10: relative Hamming distance, obtained by normalizing Mathlib's
    `hammingDist`. 
Definition1.4.6
uses 1
Used by 2
Reverse dependency previews
Preview
Lemma 1.4.9
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 1.11. The mean of f:\{-1,1\}^n\to\mathbb R is \mathbb E[f]. When f has mean 0, it is called unbiased, or balanced. If f:\{-1,1\}^n\to\{-1,1\} is Boolean-valued, then \mathbb E[f]=\Pr[f=1]-\Pr[f=-1]; thus f is unbiased if and only if it takes value 1 on exactly half of the points of the Hamming cube.

Lean code for Definition1.4.64 declarations
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.mean.{u_1} {Ω : Type u_1} [Fintype Ω] (f : Ω  ) : 
    def FABL.mean.{u_1} {Ω : Type u_1} [Fintype Ω]
      (f : Ω  ) : 
    O'Donnell, Definition 1.11: the uniform mean of a real-valued function. 
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.IsBalanced.{u_1} {Ω : Type u_1} [Fintype Ω] (f : Ω  ) : Prop
    def FABL.IsBalanced.{u_1} {Ω : Type u_1}
      [Fintype Ω] (f : Ω  ) : Prop
    A function is balanced (unbiased) when its uniform mean is zero. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.mean_eq_probability_one_sub_probability_neg_one {n : }
      (f : FABL.BooleanFunction n) :
      FABL.mean f.toReal =
        (FABL.uniformProbability fun x => f x = 1) -
          FABL.uniformProbability fun x => f x = -1
    theorem FABL.mean_eq_probability_one_sub_probability_neg_one
      {n : } (f : FABL.BooleanFunction n) :
      FABL.mean f.toReal =
        (FABL.uniformProbability fun x =>
            f x = 1) -
          FABL.uniformProbability fun x =>
            f x = -1
    The probability formula for the mean of a sign-valued Boolean function from Definition 1.11. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.isBalanced_iff_uniformProbability_one_eq_half {n : }
      (f : FABL.BooleanFunction n) :
      FABL.IsBalanced f.toReal 
        (FABL.uniformProbability fun x => f x = 1) = 2⁻¹
    theorem FABL.isBalanced_iff_uniformProbability_one_eq_half
      {n : } (f : FABL.BooleanFunction n) :
      FABL.IsBalanced f.toReal 
        (FABL.uniformProbability fun x =>
            f x = 1) =
          2⁻¹
    The Boolean specialization in O'Donnell, Definition 1.11: balanced means that `+1` occurs
    with probability one half. 
Lemma1.4.7
uses 1
Used by 5
Reverse dependency previews
L∃∀N

Fact 1.12. If f:\{-1,1\}^n\to\mathbb R, then \mathbb E[f]=\widehat f(\varnothing). In particular, a Boolean-valued f is unbiased if and only if its empty-set Fourier coefficient is 0.

Lean code for Lemma1.4.72 theorems
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.mean_eq_fourierCoeff_empty {n : } (f : FABL.SignCube n  ) :
      FABL.mean f = FABL.fourierCoeff f 
    theorem FABL.mean_eq_fourierCoeff_empty {n : }
      (f : FABL.SignCube n  ) :
      FABL.mean f = FABL.fourierCoeff f 
    O'Donnell, Fact 1.12: the mean is the constant Fourier coefficient. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.isBalanced_iff_fourierCoeff_empty_eq_zero {n : }
      (f : FABL.SignCube n  ) :
      FABL.IsBalanced f  FABL.fourierCoeff f  = 0
    theorem FABL.isBalanced_iff_fourierCoeff_empty_eq_zero
      {n : } (f : FABL.SignCube n  ) :
      FABL.IsBalanced f 
        FABL.fourierCoeff f  = 0
    The consequence following O'Donnell, Fact 1.12: balanced functions are exactly those whose
    constant Fourier coefficient vanishes. 
Proposition1.4.8
Statement uses 2
Statement dependency previews
Preview
Theorem 1.4.2
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 3
Reverse dependency previews
Preview
Lemma 1.4.9
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Proposition 1.13. The variance of f:\{-1,1\}^n\to\mathbb R is \operatorname{Var}[f] =\langle f-\mathbb E[f],f-\mathbb E[f]\rangle =\mathbb E[f^2]-\mathbb E[f]^2 =\sum_{\substack{S\subseteq[n]\\S\ne\varnothing}}\widehat f(S)^2.

Lean code for Proposition1.4.83 declarations
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.variance.{u_1} {Ω : Type u_1} [Fintype Ω] (f : Ω  ) : 
    def FABL.variance.{u_1} {Ω : Type u_1}
      [Fintype Ω] (f : Ω  ) : 
    The variance of a real-valued function under the uniform distribution. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.variance_eq_uniformInner_centered {n : }
      (f : FABL.SignCube n  ) :
      FABL.variance f =
        FABL.uniformInner (fun x => f x - FABL.mean f) fun x =>
          f x - FABL.mean f
    theorem FABL.variance_eq_uniformInner_centered
      {n : } (f : FABL.SignCube n  ) :
      FABL.variance f =
        FABL.uniformInner
          (fun x => f x - FABL.mean f)
          fun x => f x - FABL.mean f
    The centered-inner-product expression in O'Donnell, Proposition 1.13. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.variance_eq_sum_sq_fourierCoeff {n : } (f : FABL.SignCube n  ) :
      FABL.variance f =
          (Finset.univ.expect fun x => f x ^ 2) - FABL.mean f ^ 2 
        FABL.variance f =  S with S  , FABL.fourierCoeff f S ^ 2
    theorem FABL.variance_eq_sum_sq_fourierCoeff
      {n : } (f : FABL.SignCube n  ) :
      FABL.variance f =
          (Finset.univ.expect fun x =>
              f x ^ 2) -
            FABL.mean f ^ 2 
        FABL.variance f =
           S with S  ,
            FABL.fourierCoeff f S ^ 2
    O'Donnell, Proposition 1.13: the variance identities and nonconstant Fourier mass formula. 
Lemma1.4.9
Statement uses 2
Statement dependency previews
Preview
Definition 1.4.6
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 2
Reverse dependency previews
Preview
Lemma 1.4.10
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Fact 1.14. If f:\{-1,1\}^n\to\{-1,1\}, then \operatorname{Var}[f] =1-\mathbb E[f]^2 =4\Pr[f(\boldsymbol{x})=1]\Pr[f(\boldsymbol{x})=-1] \in[0,1].

Lean code for Lemma1.4.91 theorem
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.variance_eq_four_mul_probabilities {n : }
      (f : FABL.BooleanFunction n) :
      FABL.variance f.toReal = 1 - FABL.mean f.toReal ^ 2 
        (FABL.variance f.toReal =
            (4 * FABL.uniformProbability fun x => f x = 1) *
              FABL.uniformProbability fun x => f x = -1) 
          FABL.variance f.toReal  Set.Icc 0 1
    theorem FABL.variance_eq_four_mul_probabilities
      {n : } (f : FABL.BooleanFunction n) :
      FABL.variance f.toReal =
          1 - FABL.mean f.toReal ^ 2 
        (FABL.variance f.toReal =
            (4 *
                FABL.uniformProbability
                  fun x => f x = 1) *
              FABL.uniformProbability fun x =>
                f x = -1) 
          FABL.variance f.toReal  Set.Icc 0 1
    O'Donnell, Fact 1.14: the variance of a sign-valued Boolean function. 
Lemma1.4.10
Statement uses 2
Statement dependency previews
Preview
Definition 1.4.5
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

Exercise 1.16. For f:\{-1,1\}^n\to\{-1,1\}, \operatorname{dist}(f,1)=\Pr[f=-1], \qquad \operatorname{dist}(f,-1)=\Pr[f=1], and therefore \operatorname{Var}[f]=4\operatorname{dist}(f,1)\operatorname{dist}(f,-1).

Lean code for Lemma1.4.103 theorems
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.relativeHammingDist_one_eq_uniformProbability_neg_one {n : }
      (f : FABL.BooleanFunction n) :
      (FABL.relativeHammingDist f fun x => 1) =
        FABL.uniformProbability fun x => f x = -1
    theorem FABL.relativeHammingDist_one_eq_uniformProbability_neg_one
      {n : } (f : FABL.BooleanFunction n) :
      (FABL.relativeHammingDist f fun x =>
          1) =
        FABL.uniformProbability fun x =>
          f x = -1
    Distance from a sign-valued function to the constant `+1` is the probability of output
    `-1`. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.relativeHammingDist_neg_one_eq_uniformProbability_one {n : }
      (f : FABL.BooleanFunction n) :
      (FABL.relativeHammingDist f fun x => -1) =
        FABL.uniformProbability fun x => f x = 1
    theorem FABL.relativeHammingDist_neg_one_eq_uniformProbability_one
      {n : } (f : FABL.BooleanFunction n) :
      (FABL.relativeHammingDist f fun x =>
          -1) =
        FABL.uniformProbability fun x =>
          f x = 1
    Distance from a sign-valued function to the constant `-1` is the probability of output
    `+1`. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.variance_eq_four_mul_relativeHammingDist_one_mul_neg_one {n : }
      (f : FABL.BooleanFunction n) :
      FABL.variance f.toReal =
        (4 * FABL.relativeHammingDist f fun x => 1) *
          FABL.relativeHammingDist f fun x => -1
    theorem FABL.variance_eq_four_mul_relativeHammingDist_one_mul_neg_one
      {n : } (f : FABL.BooleanFunction n) :
      FABL.variance f.toReal =
        (4 *
            FABL.relativeHammingDist f
              fun x => 1) *
          FABL.relativeHammingDist f fun x =>
            -1
    O'Donnell, Exercise 1.16: Boolean variance is four times the product of the distances to the
    two constant functions. 
Proposition1.4.11
Statement uses 2
Statement dependency previews
Preview
Lemma 1.4.9
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0L∃∀N

Proposition 1.15. Let f:\{-1,1\}^n\to\{-1,1\} and set \epsilon=\min\{\operatorname{dist}(f,1),\operatorname{dist}(f,-1)\}. Then 2\epsilon\le\operatorname{Var}[f]\le4\epsilon.

Lean code for Proposition1.4.112 declarations
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.distanceToNearestConstant {n : } (f : FABL.BooleanFunction n) : 
    def FABL.distanceToNearestConstant {n : }
      (f : FABL.BooleanFunction n) : 
    The distance from `f` to the nearer constant sign function. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.variance_bounds_distanceToNearestConstant {n : }
      (f : FABL.BooleanFunction n) :
      2 * FABL.distanceToNearestConstant f  FABL.variance f.toReal 
        FABL.variance f.toReal  4 * FABL.distanceToNearestConstant f
    theorem FABL.variance_bounds_distanceToNearestConstant
      {n : } (f : FABL.BooleanFunction n) :
      2 * FABL.distanceToNearestConstant f 
          FABL.variance f.toReal 
        FABL.variance f.toReal 
          4 * FABL.distanceToNearestConstant f
    O'Donnell, Proposition 1.15: variance is controlled by distance to the nearer constant. 
Proposition1.4.12
Statement uses 2
Statement dependency previews
Preview
Theorem 1.4.3
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0L∃∀N

Proposition 1.16. The covariance of f,g:\{-1,1\}^n\to\mathbb R is \operatorname{Cov}[f,g] =\langle f-\mathbb E[f],g-\mathbb E[g]\rangle =\mathbb E[fg]-\mathbb E[f]\mathbb E[g] =\sum_{\substack{S\subseteq[n]\\S\ne\varnothing}} \widehat f(S)\widehat g(S).

Lean code for Proposition1.4.123 declarations
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.covariance.{u_1} {Ω : Type u_1} [Fintype Ω] (f g : Ω  ) : 
    def FABL.covariance.{u_1} {Ω : Type u_1}
      [Fintype Ω] (f g : Ω  ) : 
    The covariance of two real-valued functions under the uniform distribution. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.covariance_eq_uniformInner_centered {n : }
      (f g : FABL.SignCube n  ) :
      FABL.covariance f g =
        FABL.uniformInner (fun x => f x - FABL.mean f) fun x =>
          g x - FABL.mean g
    theorem FABL.covariance_eq_uniformInner_centered
      {n : } (f g : FABL.SignCube n  ) :
      FABL.covariance f g =
        FABL.uniformInner
          (fun x => f x - FABL.mean f)
          fun x => g x - FABL.mean g
    The centered-inner-product expression in O'Donnell, Proposition 1.16. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.covariance_eq_sum_fourierCoeff_mul {n : }
      (f g : FABL.SignCube n  ) :
      FABL.covariance f g =
          (Finset.univ.expect fun x => f x * g x) -
            FABL.mean f * FABL.mean g 
        FABL.covariance f g =
           S with S  , FABL.fourierCoeff f S * FABL.fourierCoeff g S
    theorem FABL.covariance_eq_sum_fourierCoeff_mul
      {n : } (f g : FABL.SignCube n  ) :
      FABL.covariance f g =
          (Finset.univ.expect fun x =>
              f x * g x) -
            FABL.mean f * FABL.mean g 
        FABL.covariance f g =
           S with S  ,
            FABL.fourierCoeff f S *
              FABL.fourierCoeff g S
    O'Donnell, Proposition 1.16: the covariance identities and Fourier formula. 
Definition1.4.13
uses 1
Used by 4
Reverse dependency previews
Preview
Definition 1.4.14
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 1.17. For f:\{-1,1\}^n\to\mathbb R and S\subseteq[n], the Fourier weight of f on S is \widehat f(S)^2.

Lean code for Definition1.4.131 definition
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.fourierWeight {n : } (f : FABL.SignCube n  )
      (S : Finset (Fin n)) : 
    def FABL.fourierWeight {n : }
      (f : FABL.SignCube n  )
      (S : Finset (Fin n)) : 
    O'Donnell, Definition 1.17: Fourier weight on `S`. 
Definition1.4.14
Statement uses 2
Statement dependency previews
Preview
Theorem 1.4.2
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 4
Reverse dependency previews
Preview
Definition 1.4.15
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 1.18. Given f:\{-1,1\}^n\to\{-1,1\}, the spectral sample \mathcal S_f is the probability distribution on subsets of [n] in which the set S has probability \widehat f(S)^2. Write \boldsymbol{S}\sim\mathcal S_f for a draw from this distribution.

Lean code for Definition1.4.142 declarations
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.spectralSample {n : } (f : FABL.BooleanFunction n) :
      PMF (Finset (Fin n))
    def FABL.spectralSample {n : }
      (f : FABL.BooleanFunction n) :
      PMF (Finset (Fin n))
    O'Donnell, Definition 1.18: the spectral sample of a Boolean function. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.spectralSample_apply_toReal {n : } (f : FABL.BooleanFunction n)
      (S : Finset (Fin n)) :
      ((FABL.spectralSample f) S).toReal = FABL.fourierWeight f.toReal S
    theorem FABL.spectralSample_apply_toReal {n : }
      (f : FABL.BooleanFunction n)
      (S : Finset (Fin n)) :
      ((FABL.spectralSample f) S).toReal =
        FABL.fourierWeight f.toReal S
    The spectral sample has point mass `f̂(S)²`. 
Definition1.4.15
Statement uses 2
Statement dependency previews
Preview
Definition 1.4.13
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 1.19. For f:\{-1,1\}^n\to\mathbb R and an integer k with 0\le k\le n, the Fourier weight of f at degree k is \mathbf W^k[f] =\sum_{\substack{S\subseteq[n]\\|S|=k}}\widehat f(S)^2. If f is Boolean-valued, equivalently \mathbf W^k[f]=\Pr_{\boldsymbol{S}\sim\mathcal S_f}[|\boldsymbol{S}|=k]. Define the degree-k part of f by f^{=k}=\sum_{|S|=k}\widehat f(S)\chi_S. Then Parseval's Theorem gives \mathbf W^k[f]=\lVert f^{=k}\rVert_2^2. Also write \mathbf W^{>k}[f]=\sum_{|S|>k}\widehat f(S)^2, \qquad f^{\le k}=\sum_{|S|\le k}\widehat f(S)\chi_S.

Lean code for Definition1.4.157 declarations
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.fourierWeightAtLevel {n : } (k : ) (f : FABL.SignCube n  ) : 
    def FABL.fourierWeightAtLevel {n : } (k : )
      (f : FABL.SignCube n  ) : 
    O'Donnell, Definition 1.19: level-`k` Fourier weight `𝐖ᵏ[f]`. 
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.fourierWeightAtMost {n : } (k : ) (f : FABL.SignCube n  ) : 
    def FABL.fourierWeightAtMost {n : } (k : )
      (f : FABL.SignCube n  ) : 
    O'Donnell, Definition 1.19: Fourier weight through level `k`, denoted `𝐖≤ᵏ[f]`. 
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.degreePart {n : } (k : ) (f : FABL.SignCube n  ) :
      FABL.SignCube n  
    def FABL.degreePart {n : } (k : )
      (f : FABL.SignCube n  ) :
      FABL.SignCube n  
    The homogeneous degree-`k` part `f⁼ᵏ`. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.fourierWeightAtLevel_eq_uniformLpNorm_degreePart_sq {n : } (k : )
      (f : FABL.SignCube n  ) :
      FABL.fourierWeightAtLevel k f =
        FABL.uniformLpNorm 2 (FABL.degreePart k f) ^ 2
    theorem FABL.fourierWeightAtLevel_eq_uniformLpNorm_degreePart_sq
      {n : } (k : )
      (f : FABL.SignCube n  ) :
      FABL.fourierWeightAtLevel k f =
        FABL.uniformLpNorm 2
            (FABL.degreePart k f) ^
          2
    The norm identity in O'Donnell, Definition 1.19: level-`k` Fourier weight is the squared
    normalized `L²` quantity of the degree-`k` part. 
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.fourierWeightAbove {n : } (k : ) (f : FABL.SignCube n  ) : 
    def FABL.fourierWeightAbove {n : } (k : )
      (f : FABL.SignCube n  ) : 
    The Fourier weight above degree `k`. 
  • defdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    def FABL.lowDegreePart {n : } (k : ) (f : FABL.SignCube n  ) :
      FABL.SignCube n  
    def FABL.lowDegreePart {n : } (k : )
      (f : FABL.SignCube n  ) :
      FABL.SignCube n  
    The degree-at-most-`k` part `f≤ᵏ`. 
  • theoremdefined in FABL/Chapter01/BasicFourierFormulas.lean
    complete
    theorem FABL.spectralSample_card_eq {n : } (f : FABL.BooleanFunction n)
      (k : ) :
       S with S.card = k, ((FABL.spectralSample f) S).toReal =
        FABL.fourierWeightAtLevel k f.toReal
    theorem FABL.spectralSample_card_eq {n : }
      (f : FABL.BooleanFunction n) (k : ) :
       S with S.card = k,
          ((FABL.spectralSample f) S).toReal =
        FABL.fourierWeightAtLevel k f.toReal
    The probability interpretation included in O'Donnell, Definition 1.19.