Cryptographic Boolean Functions in Lean

1.10. Derivatives and autocorrelation🔗

Definition1.10.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 13
Reverse dependency previews
Preview
Definition 1.10.2
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 2 (Carlet, p. 27). Let f:V_n\to\mathbb F_2 and b\in V_n. The derivative of f in direction b is the Boolean function D_bf(x)=f(x)+f(x+b) \qquad(x\in V_n), where addition is in \mathbb F_2. Its sign function satisfies (D_bf)_\chi(x)=f_\chi(x)f_\chi(x+b).

Lean code for Definition1.10.12 declarations
  • defdefined in FABL/Chapter06/FoolingF₂Polynomials/DirectionalDerivatives.lean
    complete
    def FABL.booleanDerivative {n : } (f : FABL.F₂BooleanFunction n)
      (y : FABL.F₂Cube n) : FABL.F₂BooleanFunction n
    def FABL.booleanDerivative {n : }
      (f : FABL.F₂BooleanFunction n)
      (y : FABL.F₂Cube n) :
      FABL.F₂BooleanFunction n
    The binary directional derivative in direction `y`. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/Derivatives.lean
    complete
    theorem CryptBoolean.realSignView_booleanDerivative {n : }
      (f : CryptBoolean.BooleanFunction n) (b x : FABL.F₂Cube n) :
      CryptBoolean.realSignView (FABL.booleanDerivative f b) x =
        CryptBoolean.realSignView f x * CryptBoolean.realSignView f (x + b)
    theorem CryptBoolean.realSignView_booleanDerivative
      {n : }
      (f : CryptBoolean.BooleanFunction n)
      (b x : FABL.F₂Cube n) :
      CryptBoolean.realSignView
          (FABL.booleanDerivative f b) x =
        CryptBoolean.realSignView f x *
          CryptBoolean.realSignView f (x + b)
    The derivative sign is the product of the two translated function signs. 
Definition1.10.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.
Statement uses 2
Statement dependency previews
Preview
Definition 1.8.7
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 5
Reverse dependency previews
Preview
Theorem 1.10.3
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Autocorrelation (Carlet, Relations (24)--(25), p. 27). For f:V_n\to\mathbb F_2, define \Delta_f(b) =\sum_{x\in V_n}(-1)^{D_bf(x)} =\sum_{x\in V_n}f_\chi(x)f_\chi(x+b) =(f_\chi\otimes f_\chi)(b).

Lean code for Definition1.10.22 declarations
  • defdefined in CryptBoolean/Carlet/Chapter02/Derivatives.lean
    complete
    def CryptBoolean.autocorrelation {n : }
      (f : CryptBoolean.BooleanFunction n) (b : FABL.F₂Cube n) : 
    def CryptBoolean.autocorrelation {n : }
      (f : CryptBoolean.BooleanFunction n)
      (b : FABL.F₂Cube n) : 
    Carlet's autocorrelation value `Δ_f(b) = ∑ₓ (-1)^(D_b f(x))`. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/Derivatives.lean
    complete
    theorem CryptBoolean.autocorrelation_eq_rawConvolution_realSignView {n : }
      (f : CryptBoolean.BooleanFunction n) (b : FABL.F₂Cube n) :
      CryptBoolean.autocorrelation f b =
        CryptBoolean.rawConvolution (CryptBoolean.realSignView f)
          (CryptBoolean.realSignView f) b
    theorem CryptBoolean.autocorrelation_eq_rawConvolution_realSignView
      {n : }
      (f : CryptBoolean.BooleanFunction n)
      (b : FABL.F₂Cube n) :
      CryptBoolean.autocorrelation f b =
        CryptBoolean.rawConvolution
          (CryptBoolean.realSignView f)
          (CryptBoolean.realSignView f) b
    Autocorrelation is the raw self-convolution of the sign view. 
Theorem1.10.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.
Statement uses 3
Statement dependency previews
Preview
Definition 1.7.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 10
Reverse dependency previews
Preview
Corollary 1.10.4
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Wiener--Khinchin identity (Carlet, Relation (25), p. 27). For every f:V_n\to\mathbb F_2 and u\in V_n, \widehat{\Delta_f}(u) =\sum_{b\in V_n}\Delta_f(b)(-1)^{u\mathbin\cdot b} =W_f(u)^2.

Lean code for Theorem1.10.31 theorem
  • theoremdefined in CryptBoolean/Carlet/Chapter02/Derivatives.lean
    complete
    theorem CryptBoolean.rawFourierTransform_autocorrelation {n : }
      (f : CryptBoolean.BooleanFunction n) (a : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform (CryptBoolean.autocorrelation f) a =
        (CryptBoolean.walshTransform f a) ^ 2
    theorem CryptBoolean.rawFourierTransform_autocorrelation
      {n : }
      (f : CryptBoolean.BooleanFunction n)
      (a : FABL.F₂Cube n) :
      CryptBoolean.rawFourierTransform
          (CryptBoolean.autocorrelation f) a =
        (CryptBoolean.walshTransform f a) ^ 2
    Wiener--Khintchine: the raw transform of autocorrelation is the squared Walsh spectrum. 
Corollary1.10.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 2
Reverse dependency previews
Preview
Theorem 3.8.3
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Relation (26) (Carlet, p. 28). For every f:V_n\to\mathbb F_2, \sum_{b\in V_n}\Delta_f(b)=W_f(0)^2.

Lean code for Corollary1.10.41 theorem
  • theoremdefined in CryptBoolean/Carlet/Chapter02/Derivatives.lean
    complete
    theorem CryptBoolean.sum_autocorrelation_eq_walshTransform_zero_sq {n : }
      (f : CryptBoolean.BooleanFunction n) :
       b, CryptBoolean.autocorrelation f b =
        (CryptBoolean.walshTransform f 0) ^ 2
    theorem CryptBoolean.sum_autocorrelation_eq_walshTransform_zero_sq
      {n : }
      (f : CryptBoolean.BooleanFunction n) :
       b, CryptBoolean.autocorrelation f b =
        (CryptBoolean.walshTransform f 0) ^ 2
    The total autocorrelation is the square of the zero-frequency Walsh value. 
Proposition1.10.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 3
Statement dependency previews
Preview
Corollary 1.8.6
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

Proposition 9 (Carlet, Relation (28), p. 28). Let E,E' be complementary subspaces of V_n. For every Boolean function f:V_n\to\mathbb F_2, \sum_{u\in E^\perp}W_f(u)^2 =|E^\perp|\sum_{a\in E'} \left(\sum_{x\in a+E}(-1)^{f(x)}\right)^2.

Lean code for Proposition1.10.53 declarations
  • defdefined in CryptBoolean/Carlet/Chapter02/RestrictionSquareIdentity.lean
    complete
    def CryptBoolean.affineSubspaceRestrictionImbalance {n : }
      (f : CryptBoolean.BooleanFunction n)
      (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : 
    def CryptBoolean.affineSubspaceRestrictionImbalance
      {n : }
      (f : CryptBoolean.BooleanFunction n)
      (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n))
      (a : FABL.F₂Cube n) : 
    The unnormalized sign imbalance of the restriction of `f` to `a + E`. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/RestrictionSquareIdentity.lean
    complete
    theorem CryptBoolean.sum_autocorrelation_submodule_eq_sum_affineSubspaceRestrictionImbalance_sq
      {n : } (f : CryptBoolean.BooleanFunction n)
      (E E' : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (hcompl : IsCompl E E') :
       e, CryptBoolean.autocorrelation f e =
         a, CryptBoolean.affineSubspaceRestrictionImbalance f E a ^ 2
    theorem CryptBoolean.sum_autocorrelation_submodule_eq_sum_affineSubspaceRestrictionImbalance_sq
      {n : }
      (f : CryptBoolean.BooleanFunction n)
      (E E' :
        Submodule FABL.𝔽₂ (FABL.F₂Cube n))
      (hcompl : IsCompl E E') :
       e, CryptBoolean.autocorrelation f e =
         a,
          CryptBoolean.affineSubspaceRestrictionImbalance
              f E a ^
            2
    Summing ambient autocorrelation over `E` separates into the squared
    imbalances of the restrictions on the cosets indexed by a complement `E'`. 
  • theoremdefined in CryptBoolean/Carlet/Chapter02/RestrictionSquareIdentity.lean
    complete
    theorem CryptBoolean.sum_walshTransform_sq_perpendicular_eq_card_mul_sum_restrictionImbalance_sq
      {n : } (f : CryptBoolean.BooleanFunction n)
      (E E' : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (hcompl : IsCompl E E') :
       u, (CryptBoolean.walshTransform f u) ^ 2 =
        (Nat.card (FABL.perpendicularSubspace E)) *
           a, CryptBoolean.affineSubspaceRestrictionImbalance f E a ^ 2
    theorem CryptBoolean.sum_walshTransform_sq_perpendicular_eq_card_mul_sum_restrictionImbalance_sq
      {n : }
      (f : CryptBoolean.BooleanFunction n)
      (E E' :
        Submodule FABL.𝔽₂ (FABL.F₂Cube n))
      (hcompl : IsCompl E E') :
       u,
          (CryptBoolean.walshTransform f
                u) ^
            2 =
        (Nat.card
              (FABL.perpendicularSubspace
                  E)) *
           a,
            CryptBoolean.affineSubspaceRestrictionImbalance
                f E a ^
              2
    Carlet Proposition 9, Relation (28): the Walsh square mass on `E`'s
    perpendicular is the perpendicular cardinality times the second moment of the
    imbalances of the restrictions to the cosets indexed by a complement `E'`.