Cryptographic Boolean Functions in Lean

1.8. Fourier operations and subspaces🔗

Definition1.8.1
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 11
Reverse dependency previews
Preview
Theorem 1.6.2
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Discrete Fourier transform (Carlet, Relation (11), p. 21). For a pseudo-Boolean function \varphi:V_n\to\mathbb R, define \mathcal F\varphi(a) =\widehat\varphi(a) =\sum_{x\in V_n}\varphi(x)(-1)^{a\mathbin\cdot x} \qquad(a\in V_n). If \widetilde\varphi(a)=2^{-n}\widehat\varphi(a) denotes the normalized coefficient, then \widehat\varphi(a)=2^n\widetilde\varphi(a).

Lean code for Definition1.8.12 declarations
  • defdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    def CryptBoolean.rawFourierTransform {n : } (φ : FABL.F₂Cube n  )
      (a : FABL.F₂Cube n) : 
    def CryptBoolean.rawFourierTransform {n : }
      (φ : FABL.F₂Cube n  )
      (a : FABL.F₂Cube n) : 
    Carlet's unnormalized Fourier transform of a pseudo-Boolean function. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    theorem CryptBoolean.rawFourierTransform_eq_two_pow_mul_vectorFourierCoeff
      {n : } (φ : FABL.F₂Cube n  ) (a : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform φ a =
        2 ^ n * FABL.vectorFourierCoeff φ a
    theorem CryptBoolean.rawFourierTransform_eq_two_pow_mul_vectorFourierCoeff
      {n : } (φ : FABL.F₂Cube n  )
      (a : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform φ a =
        2 ^ n * FABL.vectorFourierCoeff φ a
    Carlet's raw transform is the cardinality-scaled normalized FABL coefficient. 
Proposition1.8.2
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 6
Reverse dependency previews
Preview
Corollary 1.8.5
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Proposition 6 (Carlet, p. 24). Let \varphi:V_n\to\mathbb R and a,b,u\in V_n. If \psi(x)=(-1)^{a\mathbin\cdot x}\varphi(x+b), then \widehat\psi(u) =(-1)^{b\mathbin\cdot(a+u)}\widehat\varphi(a+u).

Lean code for Proposition1.8.22 theorems
  • theoremdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    theorem CryptBoolean.vectorFourierCoeff_mul_vectorWalshCharacter {n : }
      (φ : FABL.F₂Cube n  ) (a u : FABL.F₂Cube n) :
      FABL.vectorFourierCoeff
          (fun x => (FABL.vectorWalshCharacter a) x * φ x) u =
        FABL.vectorFourierCoeff φ (a + u)
    theorem CryptBoolean.vectorFourierCoeff_mul_vectorWalshCharacter
      {n : } (φ : FABL.F₂Cube n  )
      (a u : FABL.F₂Cube n) :
      FABL.vectorFourierCoeff
          (fun x =>
            (FABL.vectorWalshCharacter a) x *
              φ x)
          u =
        FABL.vectorFourierCoeff φ (a + u)
    Multiplying by a Walsh character shifts the normalized Fourier index. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    theorem CryptBoolean.rawFourierTransform_modulate_translate {n : }
      (φ : FABL.F₂Cube n  ) (a b u : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform
          (fun x => (FABL.vectorWalshCharacter a) x * φ (x + b)) u =
        (FABL.vectorWalshCharacter (a + u)) b *
          CryptBoolean.rawFourierTransform φ (a + u)
    theorem CryptBoolean.rawFourierTransform_modulate_translate
      {n : } (φ : FABL.F₂Cube n  )
      (a b u : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform
          (fun x =>
            (FABL.vectorWalshCharacter a) x *
              φ (x + b))
          u =
        (FABL.vectorWalshCharacter (a + u))
            b *
          CryptBoolean.rawFourierTransform φ
            (a + u)
    Carlet Proposition 6: modulation and translation shift the raw spectrum. 
Theorem1.8.3
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 2
Reverse dependency previews
Preview
Theorem 1.8.9
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Corollary 2 (Carlet, Relation (19), p. 25). For every \varphi:V_n\to\mathbb R and x\in V_n, \widehat{\widehat\varphi}(x)=2^n\varphi(x).

Lean code for Theorem1.8.31 theorem
  • theoremdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    theorem CryptBoolean.rawFourierTransform_involution {n : }
      (φ : FABL.F₂Cube n  ) (x : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform (CryptBoolean.rawFourierTransform φ)
          x =
        2 ^ n * φ x
    theorem CryptBoolean.rawFourierTransform_involution
      {n : } (φ : FABL.F₂Cube n  )
      (x : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform
          (CryptBoolean.rawFourierTransform φ)
          x =
        2 ^ n * φ x
    Carlet Corollary 2: applying the raw Fourier transform twice multiplies by `2^n`. 
Proposition1.8.4
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 4
Reverse dependency previews
Preview
Theorem 1.6.2
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Proposition 7 (Carlet, Relation (16), pp. 24--25). Let E\le V_n, let E^\perp=\{u\in V_n:u\mathbin\cdot x=0\text{ for every }x\in E\}, and let \mathbf 1_E be the real-valued indicator of E. Then, for every u\in V_n, \widehat{\mathbf 1_E}(u) = \begin{cases} |E|,&u\in E^\perp,\\ 0,&u\notin E^\perp. \end{cases} Equivalently, \widehat{\mathbf 1_E}=|E|\mathbf 1_{E^\perp}.

Lean code for Proposition1.8.42 theorems
  • theoremdefined in CryptBoolean/Carlet/Chapter02/Subspaces.lean
    complete
    theorem CryptBoolean.two_pow_mul_inversePerpendicularCard_eq_card {n : }
      (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) :
      2 ^ n * FABL.inversePerpendicularCard E = (Nat.card E)
    theorem CryptBoolean.two_pow_mul_inversePerpendicularCard_eq_card
      {n : }
      (E :
        Submodule FABL.𝔽₂ (FABL.F₂Cube n)) :
      2 ^ n *
          FABL.inversePerpendicularCard E =
        (Nat.card E)
    The raw scaling factor for a subspace is its cardinality. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/Subspaces.lean
    complete
    theorem CryptBoolean.rawFourierTransform_setIndicator_submodule {n : }
      (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (u : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform (FABL.setIndicator E) u =
        if u  FABL.perpendicularSubspace E then (Nat.card E) else 0
    theorem CryptBoolean.rawFourierTransform_setIndicator_submodule
      {n : }
      (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n))
      (u : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform
          (FABL.setIndicator E) u =
        if
            u 
              FABL.perpendicularSubspace
                E then
          (Nat.card E)
        else 0
    Carlet Proposition 7: the raw transform of a subspace indicator is its
    cardinality on the perpendicular subspace and zero off it. 
Corollary1.8.5
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Proposition 1.8.2
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0L∃∀N

Normalized Poisson summation specialization. Let E\le V_n, let \varphi:V_n\to\mathbb R, and let z\in V_n. Then \frac{1}{|E|}\sum_{h\in E}\varphi(h+z) =\sum_{u\in E^\perp}(-1)^{u\mathbin\cdot z}\widetilde\varphi(u). Here \widetilde\varphi(u)=2^{-n}\widehat\varphi(u).

Lean code for Corollary1.8.51 theorem
  • theoremdefined in FABL/Chapter03/Restrictions.lean
    complete
    theorem FABL.poissonSummationFormula {n : } (f : FABL.F₂Cube n  )
      (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (z : FABL.F₂Cube n) :
      (Finset.univ.expect fun h => f (h + z)) =
         γ, (FABL.vectorWalshCharacter γ) z * FABL.vectorFourierCoeff f γ
    theorem FABL.poissonSummationFormula {n : }
      (f : FABL.F₂Cube n  )
      (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n))
      (z : FABL.F₂Cube n) :
      (Finset.univ.expect fun h =>
          f (h + z)) =
         γ,
          (FABL.vectorWalshCharacter γ) z *
            FABL.vectorFourierCoeff f γ
    O'Donnell's Poisson Summation Formula on the binary cube. 

This normalized coset-average identity is the specialization a=0 of the full Poisson formula below.

Corollary1.8.6
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Proposition 1.8.2
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 14
Reverse dependency previews
Preview
Proposition 1.10.5
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Corollary 1 (Poisson summation; Carlet, Relation (17), p. 25). For every \varphi:V_n\to\mathbb R, every subspace E\le V_n, and all a,b\in V_n, \sum_{u\in a+E}(-1)^{b\mathbin\cdot u}\widehat\varphi(u) =|E|(-1)^{a\mathbin\cdot b} \sum_{x\in b+E^\perp}(-1)^{a\mathbin\cdot x}\varphi(x).

Lean code for Corollary1.8.61 theorem
  • theoremdefined in CryptBoolean/Carlet/Chapter02/Subspaces.lean
    complete
    theorem CryptBoolean.rawPoissonSummationFormula {n : } (φ : FABL.F₂Cube n  )
      (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a b : FABL.F₂Cube n) :
       u,
          (FABL.vectorWalshCharacter b) (a + u) *
            CryptBoolean.rawFourierTransform φ (a + u) =
        (Nat.card E) * (FABL.vectorWalshCharacter b) a *
           x, (FABL.vectorWalshCharacter a) (b + x) * φ (b + x)
    theorem CryptBoolean.rawPoissonSummationFormula
      {n : } (φ : FABL.F₂Cube n  )
      (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n))
      (a b : FABL.F₂Cube n) :
       u,
          (FABL.vectorWalshCharacter b)
              (a + u) *
            CryptBoolean.rawFourierTransform φ
              (a + u) =
        (Nat.card E) *
            (FABL.vectorWalshCharacter b) a *
           x,
            (FABL.vectorWalshCharacter a)
                (b + x) *
              φ (b + x)
    Carlet Corollary 1, Relation (17): the full raw Poisson summation formula
    on affine cosets, with both modulation parameters explicit. 
Definition1.8.7
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0
Used by 3
Reverse dependency previews
Preview
Proposition 1.8.8
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Convolution (Carlet, p. 26). For \varphi,\psi:V_n\to\mathbb R, define their unnormalized convolution by (\varphi\otimes\psi)(x) =\sum_{y\in V_n}\varphi(y)\psi(x+y) \qquad(x\in V_n).

Lean code for Definition1.8.72 declarations
  • defdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    def CryptBoolean.rawConvolution {n : } (φ ψ : FABL.F₂Cube n  )
      (x : FABL.F₂Cube n) : 
    def CryptBoolean.rawConvolution {n : }
      (φ ψ : FABL.F₂Cube n  )
      (x : FABL.F₂Cube n) : 
    Carlet's unnormalized convolution on the additive binary cube. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    theorem CryptBoolean.rawConvolution_eq_two_pow_mul_convolution {n : }
      (φ ψ : FABL.F₂Cube n  ) (x : FABL.F₂Cube n) :
      CryptBoolean.rawConvolution φ ψ x = 2 ^ n * FABL.convolution φ ψ x
    theorem CryptBoolean.rawConvolution_eq_two_pow_mul_convolution
      {n : } (φ ψ : FABL.F₂Cube n  )
      (x : FABL.F₂Cube n) :
      CryptBoolean.rawConvolution φ ψ x =
        2 ^ n * FABL.convolution φ ψ x
    Raw convolution is the cardinality-scaled normalized FABL convolution. 
Proposition1.8.8
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 1.8.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 3
Reverse dependency previews
Preview
Theorem 1.8.9
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Proposition 8 (Carlet, Relation (20), p. 26). For all \varphi,\psi:V_n\to\mathbb R and u\in V_n, \widehat{\varphi\otimes\psi}(u) =\widehat\varphi(u)\widehat\psi(u).

Lean code for Proposition1.8.81 theorem
  • theoremdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    theorem CryptBoolean.rawFourierTransform_rawConvolution {n : }
      (φ ψ : FABL.F₂Cube n  ) (a : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform (CryptBoolean.rawConvolution φ ψ) a =
        CryptBoolean.rawFourierTransform φ a *
          CryptBoolean.rawFourierTransform ψ a
    theorem CryptBoolean.rawFourierTransform_rawConvolution
      {n : } (φ ψ : FABL.F₂Cube n  )
      (a : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform
          (CryptBoolean.rawConvolution φ ψ)
          a =
        CryptBoolean.rawFourierTransform φ a *
          CryptBoolean.rawFourierTransform ψ a
    Carlet Proposition 8: the raw Fourier transform sends raw convolution to pointwise product. 
Theorem1.8.9
Group: Chapter 1: Generalities on Boolean functions (40)
Group member previews
Preview
Definition 1.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 1.8.3
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 2
Reverse dependency previews
Preview
Theorem 3.8.4
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Relation (22) and Parseval's relation (Carlet, p. 27). For all \varphi,\psi:V_n\to\mathbb R, \sum_{u\in V_n}\widehat\varphi(u)\widehat\psi(u) =2^n\sum_{x\in V_n}\varphi(x)\psi(x). In particular, taking \psi=\varphi gives Corollary 3: \sum_{u\in V_n}\widehat\varphi(u)^2 =2^n\sum_{x\in V_n}\varphi(x)^2.

Lean code for Theorem1.8.91 theorem
  • theoremdefined in CryptBoolean/Carlet/Chapter02/FourierOperations.lean
    complete
    theorem CryptBoolean.sum_rawFourierTransform_mul {n : }
      (φ ψ : FABL.F₂Cube n  ) :
       a,
          CryptBoolean.rawFourierTransform φ a *
            CryptBoolean.rawFourierTransform ψ a =
        2 ^ n *  x, φ x * ψ x
    theorem CryptBoolean.sum_rawFourierTransform_mul
      {n : } (φ ψ : FABL.F₂Cube n  ) :
       a,
          CryptBoolean.rawFourierTransform φ
              a *
            CryptBoolean.rawFourierTransform ψ
              a =
        2 ^ n *  x, φ x * ψ x
    Carlet Corollary 3: Plancherel for the unnormalized transform.