1.9. Algebraic degree, distance, and affine functions
-
CryptBoolean.functionAlgebraicDegree[complete] -
CryptBoolean.functionAlgebraicDegree_le_dimension[complete] -
CryptBoolean.algebraicDegree_le_iff[complete] -
CryptBoolean.anfCoeff_zero[complete] -
CryptBoolean.algebraicDegree_zero[complete] -
CryptBoolean.functionAlgebraicDegree_zero[complete]
Algebraic degree (Carlet, p. 12). Let
f(x)=\bigoplus_{S\subseteq[n]}c_{f,S}x^S
be the unique ANF of f:V_n\to\mathbb F_2. Define
\deg_{\mathrm{alg}}(f)
=\max\{|S|:c_{f,S}\ne0\},
with \deg_{\mathrm{alg}}(0)=0. Then
\deg_{\mathrm{alg}}(f)\le n,
and, for every r\ge0,
\deg_{\mathrm{alg}}(f)\le r
\quad\Longleftrightarrow\quad
c_{f,S}\ne0\Longrightarrow |S|\le r
\quad\text{for every }S\subseteq[n].
Lean code for Definition1.9.1●6 declarations
Associated Lean declarations
-
CryptBoolean.functionAlgebraicDegree[complete]
-
CryptBoolean.functionAlgebraicDegree_le_dimension[complete]
-
CryptBoolean.algebraicDegree_le_iff[complete]
-
CryptBoolean.anfCoeff_zero[complete]
-
CryptBoolean.algebraicDegree_zero[complete]
-
CryptBoolean.functionAlgebraicDegree_zero[complete]
-
CryptBoolean.functionAlgebraicDegree[complete] -
CryptBoolean.functionAlgebraicDegree_le_dimension[complete] -
CryptBoolean.algebraicDegree_le_iff[complete] -
CryptBoolean.anfCoeff_zero[complete] -
CryptBoolean.algebraicDegree_zero[complete] -
CryptBoolean.functionAlgebraicDegree_zero[complete]
-
defdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
def CryptBoolean.functionAlgebraicDegree {n : ℕ} (f : CryptBoolean.BooleanFunction n) : ℕ
def CryptBoolean.functionAlgebraicDegree {n : ℕ} (f : CryptBoolean.BooleanFunction n) : ℕ
The algebraic degree of a Boolean function, through its unique ANF.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_le_dimension {n : ℕ} (f : CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree f ≤ n
theorem CryptBoolean.functionAlgebraicDegree_le_dimension {n : ℕ} (f : CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree f ≤ n
Function-level algebraic degree is bounded by the number of variables.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.algebraicDegree_le_iff {n : ℕ} (c : CryptBoolean.ANFCoefficients n) (r : ℕ) : CryptBoolean.algebraicDegree c ≤ r ↔ ∀ (S : Finset (Fin n)), c S ≠ 0 → S.card ≤ r
theorem CryptBoolean.algebraicDegree_le_iff {n : ℕ} (c : CryptBoolean.ANFCoefficients n) (r : ℕ) : CryptBoolean.algebraicDegree c ≤ r ↔ ∀ (S : Finset (Fin n)), c S ≠ 0 → S.card ≤ r
Degree at most `r` is exactly the coefficientwise vanishing condition above `r`.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.anfCoeff_zero {n : ℕ} : CryptBoolean.anfCoeff 0 = fun x => 0
theorem CryptBoolean.anfCoeff_zero {n : ℕ} : CryptBoolean.anfCoeff 0 = fun x => 0
The zero Boolean function has the zero canonical ANF.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.algebraicDegree_zero {n : ℕ} : (CryptBoolean.algebraicDegree fun x => 0) = 0
theorem CryptBoolean.algebraicDegree_zero {n : ℕ} : (CryptBoolean.algebraicDegree fun x => 0) = 0
The zero coefficient family has algebraic degree zero.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_zero {n : ℕ} : CryptBoolean.functionAlgebraicDegree 0 = 0
theorem CryptBoolean.functionAlgebraicDegree_zero {n : ℕ} : CryptBoolean.functionAlgebraicDegree 0 = 0
The zero Boolean function has algebraic degree zero.
-
CryptBoolean.anfCoeff_add[complete] -
CryptBoolean.algebraicDegree_add_le_max[complete] -
CryptBoolean.functionAlgebraicDegree_add_le_max[complete]
Degree under addition. For all Boolean functions f,g:V_n\to\mathbb F_2,
their ANF coefficients satisfy
c_{f+g,S}=c_{f,S}+c_{g,S}
\qquad(S\subseteq[n]),
and therefore
\deg_{\mathrm{alg}}(f+g)
\le\max\{\deg_{\mathrm{alg}}(f),\deg_{\mathrm{alg}}(g)\}.
Lean code for Lemma1.9.2●3 theorems
Associated Lean declarations
-
CryptBoolean.anfCoeff_add[complete]
-
CryptBoolean.algebraicDegree_add_le_max[complete]
-
CryptBoolean.functionAlgebraicDegree_add_le_max[complete]
-
CryptBoolean.anfCoeff_add[complete] -
CryptBoolean.algebraicDegree_add_le_max[complete] -
CryptBoolean.functionAlgebraicDegree_add_le_max[complete]
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.anfCoeff_add {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.anfCoeff (f + g) = fun S => CryptBoolean.anfCoeff f S + CryptBoolean.anfCoeff g S
theorem CryptBoolean.anfCoeff_add {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.anfCoeff (f + g) = fun S => CryptBoolean.anfCoeff f S + CryptBoolean.anfCoeff g S
The canonical ANF transform is additive.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.algebraicDegree_add_le_max {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) : (CryptBoolean.algebraicDegree fun S => c S + d S) ≤ max (CryptBoolean.algebraicDegree c) (CryptBoolean.algebraicDegree d)
theorem CryptBoolean.algebraicDegree_add_le_max {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) : (CryptBoolean.algebraicDegree fun S => c S + d S) ≤ max (CryptBoolean.algebraicDegree c) (CryptBoolean.algebraicDegree d)
Algebraic degree of a coefficient sum is bounded by the maximum of the two degrees.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_add_le_max {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree (f + g) ≤ max (CryptBoolean.functionAlgebraicDegree f) (CryptBoolean.functionAlgebraicDegree g)
theorem CryptBoolean.functionAlgebraicDegree_add_le_max {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree (f + g) ≤ max (CryptBoolean.functionAlgebraicDegree f) (CryptBoolean.functionAlgebraicDegree g)
Algebraic degree is submaximal under addition of Boolean functions.
-
CryptBoolean.hammingDistance[complete] -
CryptBoolean.hammingDistance_eq_hammingWeight_add[complete]
Hamming distance (Carlet, p. 8). For Boolean functions
f,g:V_n\to\mathbb F_2, define
d_H(f,g)
=\bigl|\{x\in V_n:f(x)\ne g(x)\}\bigr|.
Then
d_H(f,g)=w_H(f+g),
where addition is pointwise in \mathbb F_2.
Lean code for Definition1.9.3●2 declarations
Associated Lean declarations
-
CryptBoolean.hammingDistance[complete]
-
CryptBoolean.hammingDistance_eq_hammingWeight_add[complete]
-
CryptBoolean.hammingDistance[complete] -
CryptBoolean.hammingDistance_eq_hammingWeight_add[complete]
-
abbrevdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
abbrev CryptBoolean.hammingDistance {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : ℕ
abbrev CryptBoolean.hammingDistance {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : ℕ
The unnormalized Hamming distance between Boolean functions, reusing Mathlib.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.hammingDistance_eq_hammingWeight_add {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.hammingDistance f g = CryptBoolean.hammingWeight (f + g)
theorem CryptBoolean.hammingDistance_eq_hammingWeight_add {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.hammingDistance f g = CryptBoolean.hammingWeight (f + g)
On `GF(2)`, distance is the weight of the pointwise sum.
Relative-distance normalization bridge. Define
d_{\mathrm{rel}}(f,g)
=2^{-n}\bigl|\{x\in V_n:f(x)\ne g(x)\}\bigr|.
Then, for all f,g:V_n\to\mathbb F_2,
d_H(f,g)=2^n d_{\mathrm{rel}}(f,g).
Lean code for Theorem1.9.4●1 theorem
Associated Lean declarations
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.hammingDistance_eq_two_pow_mul_relativeHammingDist {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : ↑(CryptBoolean.hammingDistance f g) = 2 ^ n * FABL.relativeHammingDist f g
theorem CryptBoolean.hammingDistance_eq_two_pow_mul_relativeHammingDist {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : ↑(CryptBoolean.hammingDistance f g) = 2 ^ n * FABL.relativeHammingDist f g
Raw distance scales FABL's relative Hamming distance by the cube cardinality.
Formalization note. The raw distance is implemented by
Mathlib's hammingDist, while
d_{\mathrm{rel}} is FABL's
relativeHammingDist. Neither implementation choice is part of Carlet's definition.
-
CryptBoolean.affineFunction[complete] -
CryptBoolean.affineCoefficients[complete] -
CryptBoolean.anfEval_affineCoefficients[complete] -
CryptBoolean.anfCoeff_affineFunction[complete] -
CryptBoolean.functionAlgebraicDegree_affineFunction_le_one[complete] -
CryptBoolean.exists_affineFunction_of_functionAlgebraicDegree_le_one[complete]
Affine Boolean functions (Carlet, p. 14). For a\in V_n and
b\in\mathbb F_2, set
A_{a,b}(x)=b+a\mathbin\cdot x.
Its ANF coefficients are
c_{A_{a,b},\varnothing}=b,
\qquad
c_{A_{a,b},\{i\}}=a_i,
\qquad
c_{A_{a,b},S}=0\quad(|S|>1).
For every f:V_n\to\mathbb F_2,
\deg_{\mathrm{alg}}(f)\le1
\quad\Longleftrightarrow\quad
\exists a\in V_n\;\exists b\in\mathbb F_2\;
\forall x\in V_n,\ f(x)=A_{a,b}(x).
Lean code for Definition1.9.5●6 declarations
Associated Lean declarations
-
CryptBoolean.affineFunction[complete]
-
CryptBoolean.affineCoefficients[complete]
-
CryptBoolean.anfEval_affineCoefficients[complete]
-
CryptBoolean.anfCoeff_affineFunction[complete]
-
CryptBoolean.functionAlgebraicDegree_affineFunction_le_one[complete]
-
CryptBoolean.exists_affineFunction_of_functionAlgebraicDegree_le_one[complete]
-
CryptBoolean.affineFunction[complete] -
CryptBoolean.affineCoefficients[complete] -
CryptBoolean.anfEval_affineCoefficients[complete] -
CryptBoolean.anfCoeff_affineFunction[complete] -
CryptBoolean.functionAlgebraicDegree_affineFunction_le_one[complete] -
CryptBoolean.exists_affineFunction_of_functionAlgebraicDegree_le_one[complete]
-
defdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
def CryptBoolean.affineFunction {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.BooleanFunction n
def CryptBoolean.affineFunction {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.BooleanFunction n
The affine Boolean function `x ↦ b + a · x`.
-
defdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
def CryptBoolean.affineCoefficients {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.ANFCoefficients n
def CryptBoolean.affineCoefficients {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.ANFCoefficients n
The ANF coefficients of an affine function.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.anfEval_affineCoefficients {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.anfEval (CryptBoolean.affineCoefficients b a) = CryptBoolean.affineFunction b a
theorem CryptBoolean.anfEval_affineCoefficients {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.anfEval (CryptBoolean.affineCoefficients b a) = CryptBoolean.affineFunction b a
Evaluating the affine coefficient family gives the affine function.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.anfCoeff_affineFunction {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.anfCoeff (CryptBoolean.affineFunction b a) = CryptBoolean.affineCoefficients b a
theorem CryptBoolean.anfCoeff_affineFunction {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.anfCoeff (CryptBoolean.affineFunction b a) = CryptBoolean.affineCoefficients b a
The canonical ANF transform recovers the affine coefficient family.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_affineFunction_le_one {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.functionAlgebraicDegree (CryptBoolean.affineFunction b a) ≤ 1
theorem CryptBoolean.functionAlgebraicDegree_affineFunction_le_one {n : ℕ} (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : CryptBoolean.functionAlgebraicDegree (CryptBoolean.affineFunction b a) ≤ 1
Affine functions have algebraic degree at most one.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.exists_affineFunction_of_functionAlgebraicDegree_le_one {n : ℕ} (f : CryptBoolean.BooleanFunction n) (hdegree : CryptBoolean.functionAlgebraicDegree f ≤ 1) : ∃ b a, f = CryptBoolean.affineFunction b a
theorem CryptBoolean.exists_affineFunction_of_functionAlgebraicDegree_le_one {n : ℕ} (f : CryptBoolean.BooleanFunction n) (hdegree : CryptBoolean.functionAlgebraicDegree f ≤ 1) : ∃ b a, f = CryptBoolean.affineFunction b a
Every Boolean function of algebraic degree at most one is affine.
-
CryptBoolean.anfMonomial_mul[complete] -
CryptBoolean.anfMul[complete] -
CryptBoolean.anfEval_anfMul[complete] -
CryptBoolean.algebraicDegree_anfMul_le_add[complete] -
CryptBoolean.anfCoeff_mul[complete] -
CryptBoolean.functionAlgebraicDegree_mul_le_add[complete] -
CryptBoolean.functionAlgebraicDegree_one[complete] -
CryptBoolean.functionAlgebraicDegree_finset_prod_le[complete] -
CryptBoolean.functionAlgebraicDegree_finset_sum_le[complete] -
CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one[complete] -
CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card[complete] -
CryptBoolean.functionAlgebraicDegree_comp_affineMap_le[complete] -
CryptBoolean.functionAlgebraicDegree_comp_affineEquiv[complete]
Affine invariance of algebraic degree (Carlet, p. 12). Let
L:V_n\to V_n be an affine isomorphism, so that
L(x)=Mx+t for some M\in\operatorname{GL}_n(\mathbb F_2) and t\in V_n.
Then every Boolean function f:V_n\to\mathbb F_2 satisfies
\deg_{\mathrm{alg}}(f\circ L)=\deg_{\mathrm{alg}}(f).
Lean code for Theorem1.9.6●13 declarations
Associated Lean declarations
-
CryptBoolean.anfMonomial_mul[complete]
-
CryptBoolean.anfMul[complete]
-
CryptBoolean.anfEval_anfMul[complete]
-
CryptBoolean.algebraicDegree_anfMul_le_add[complete]
-
CryptBoolean.anfCoeff_mul[complete]
-
CryptBoolean.functionAlgebraicDegree_mul_le_add[complete]
-
CryptBoolean.functionAlgebraicDegree_one[complete]
-
CryptBoolean.functionAlgebraicDegree_finset_prod_le[complete]
-
CryptBoolean.functionAlgebraicDegree_finset_sum_le[complete]
-
CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one[complete]
-
CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card[complete]
-
CryptBoolean.functionAlgebraicDegree_comp_affineMap_le[complete]
-
CryptBoolean.functionAlgebraicDegree_comp_affineEquiv[complete]
-
CryptBoolean.anfMonomial_mul[complete] -
CryptBoolean.anfMul[complete] -
CryptBoolean.anfEval_anfMul[complete] -
CryptBoolean.algebraicDegree_anfMul_le_add[complete] -
CryptBoolean.anfCoeff_mul[complete] -
CryptBoolean.functionAlgebraicDegree_mul_le_add[complete] -
CryptBoolean.functionAlgebraicDegree_one[complete] -
CryptBoolean.functionAlgebraicDegree_finset_prod_le[complete] -
CryptBoolean.functionAlgebraicDegree_finset_sum_le[complete] -
CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one[complete] -
CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card[complete] -
CryptBoolean.functionAlgebraicDegree_comp_affineMap_le[complete] -
CryptBoolean.functionAlgebraicDegree_comp_affineEquiv[complete]
-
theoremdefined in CryptBoolean/Carlet/Chapter02/ANF.leancomplete
theorem CryptBoolean.anfMonomial_mul {n : ℕ} (S T : Finset (Fin n)) (x : FABL.F₂Cube n) : CryptBoolean.anfMonomial S x * CryptBoolean.anfMonomial T x = CryptBoolean.anfMonomial (S ∪ T) x
theorem CryptBoolean.anfMonomial_mul {n : ℕ} (S T : Finset (Fin n)) (x : FABL.F₂Cube n) : CryptBoolean.anfMonomial S x * CryptBoolean.anfMonomial T x = CryptBoolean.anfMonomial (S ∪ T) x
Products of square-free monomials are indexed by the union of their variables.
-
defdefined in CryptBoolean/Carlet/Chapter02/ANF.leancomplete
def CryptBoolean.anfMul {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) : CryptBoolean.ANFCoefficients n
def CryptBoolean.anfMul {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) : CryptBoolean.ANFCoefficients n
Multiplication of square-free ANFs, with repeated variables reduced by `xᵢ²=xᵢ`.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/ANF.leancomplete
theorem CryptBoolean.anfEval_anfMul {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) (x : FABL.F₂Cube n) : CryptBoolean.anfEval (CryptBoolean.anfMul c d) x = CryptBoolean.anfEval c x * CryptBoolean.anfEval d x
theorem CryptBoolean.anfEval_anfMul {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) (x : FABL.F₂Cube n) : CryptBoolean.anfEval (CryptBoolean.anfMul c d) x = CryptBoolean.anfEval c x * CryptBoolean.anfEval d x
Evaluation of the square-free ANF product is pointwise multiplication.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.algebraicDegree_anfMul_le_add {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) : CryptBoolean.algebraicDegree (CryptBoolean.anfMul c d) ≤ CryptBoolean.algebraicDegree c + CryptBoolean.algebraicDegree d
theorem CryptBoolean.algebraicDegree_anfMul_le_add {n : ℕ} (c d : CryptBoolean.ANFCoefficients n) : CryptBoolean.algebraicDegree (CryptBoolean.anfMul c d) ≤ CryptBoolean.algebraicDegree c + CryptBoolean.algebraicDegree d
Multiplication of square-free ANFs adds their algebraic-degree bounds.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.anfCoeff_mul {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.anfCoeff (f * g) = CryptBoolean.anfMul (CryptBoolean.anfCoeff f) (CryptBoolean.anfCoeff g)
theorem CryptBoolean.anfCoeff_mul {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.anfCoeff (f * g) = CryptBoolean.anfMul (CryptBoolean.anfCoeff f) (CryptBoolean.anfCoeff g)
The canonical ANF of a pointwise product is the square-free ANF product.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_mul_le_add {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree (f * g) ≤ CryptBoolean.functionAlgebraicDegree f + CryptBoolean.functionAlgebraicDegree g
theorem CryptBoolean.functionAlgebraicDegree_mul_le_add {n : ℕ} (f g : CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree (f * g) ≤ CryptBoolean.functionAlgebraicDegree f + CryptBoolean.functionAlgebraicDegree g
Algebraic degree is subadditive under pointwise multiplication.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_one {n : ℕ} : CryptBoolean.functionAlgebraicDegree 1 = 0
theorem CryptBoolean.functionAlgebraicDegree_one {n : ℕ} : CryptBoolean.functionAlgebraicDegree 1 = 0
The constant-one Boolean function has algebraic degree zero.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_finset_prod_le.{u_1} {n : ℕ} {ι : Type u_1} (s : Finset ι) (g : ι → CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree (∏ i ∈ s, g i) ≤ ∑ i ∈ s, CryptBoolean.functionAlgebraicDegree (g i)
theorem CryptBoolean.functionAlgebraicDegree_finset_prod_le.{u_1} {n : ℕ} {ι : Type u_1} (s : Finset ι) (g : ι → CryptBoolean.BooleanFunction n) : CryptBoolean.functionAlgebraicDegree (∏ i ∈ s, g i) ≤ ∑ i ∈ s, CryptBoolean.functionAlgebraicDegree (g i)
The degree of a finite pointwise product is bounded by the sum of factor degrees.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/AlgebraicDegree.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_finset_sum_le.{u_1} {n : ℕ} {ι : Type u_1} (s : Finset ι) (g : ι → CryptBoolean.BooleanFunction n) (r : ℕ) (hg : ∀ i ∈ s, CryptBoolean.functionAlgebraicDegree (g i) ≤ r) : CryptBoolean.functionAlgebraicDegree (∑ i ∈ s, g i) ≤ r
theorem CryptBoolean.functionAlgebraicDegree_finset_sum_le.{u_1} {n : ℕ} {ι : Type u_1} (s : Finset ι) (g : ι → CryptBoolean.BooleanFunction n) (r : ℕ) (hg : ∀ i ∈ s, CryptBoolean.functionAlgebraicDegree (g i) ≤ r) : CryptBoolean.functionAlgebraicDegree (∑ i ∈ s, g i) ≤ r
A finite sum of functions of degree at most `r` again has degree at most `r`.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one {n : ℕ} (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) (i : Fin n) : (CryptBoolean.functionAlgebraicDegree fun x => L x i) ≤ 1
theorem CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one {n : ℕ} (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) (i : Fin n) : (CryptBoolean.functionAlgebraicDegree fun x => L x i) ≤ 1
Every coordinate of an affine map on the binary cube has algebraic degree at most one.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card {n : ℕ} (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) (S : Finset (Fin n)) : (CryptBoolean.functionAlgebraicDegree fun x => CryptBoolean.anfMonomial S (L x)) ≤ S.card
theorem CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card {n : ℕ} (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) (S : Finset (Fin n)) : (CryptBoolean.functionAlgebraicDegree fun x => CryptBoolean.anfMonomial S (L x)) ≤ S.card
Substituting affine coordinates into a square-free monomial does not increase its degree.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_comp_affineMap_le {n : ℕ} (f : CryptBoolean.BooleanFunction n) (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : CryptBoolean.functionAlgebraicDegree (f ∘ ⇑L) ≤ CryptBoolean.functionAlgebraicDegree f
theorem CryptBoolean.functionAlgebraicDegree_comp_affineMap_le {n : ℕ} (f : CryptBoolean.BooleanFunction n) (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : CryptBoolean.functionAlgebraicDegree (f ∘ ⇑L) ≤ CryptBoolean.functionAlgebraicDegree f
Composition with an affine map on the binary cube cannot increase algebraic degree.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Affine.leancomplete
theorem CryptBoolean.functionAlgebraicDegree_comp_affineEquiv {n : ℕ} (f : CryptBoolean.BooleanFunction n) (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : CryptBoolean.functionAlgebraicDegree (f ∘ ⇑L) = CryptBoolean.functionAlgebraicDegree f
theorem CryptBoolean.functionAlgebraicDegree_comp_affineEquiv {n : ℕ} (f : CryptBoolean.BooleanFunction n) (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : CryptBoolean.functionAlgebraicDegree (f ∘ ⇑L) = CryptBoolean.functionAlgebraicDegree f
Carlet, p. 12: algebraic degree is invariant under affine equivalences of the binary cube.
Formalization note. The proof first establishes nonincrease under an arbitrary affine map by
substituting affine coordinate functions into the unique square-free ANF, then applies the same
bound to L^{-1}.
-
CryptBoolean.supportPrecedes[complete] -
CryptBoolean.supportPrecedesDecidable[complete] -
CryptBoolean.lowWeightInputs[complete] -
CryptBoolean.restrictionRecoveryCoefficient[complete] -
CryptBoolean.card_powerset_filter_card_le[complete] -
CryptBoolean.card_intermediate_subsets_le[complete] -
CryptBoolean.restrictionRecoveryFormula_f₂CubeOfFinset[complete] -
CryptBoolean.restrictionRecoveryFormula[complete] -
CryptBoolean.eq_of_eq_on_lowWeightInputs[complete] -
CryptBoolean.eq_of_eq_on_affineImage_lowWeightInputs[complete]
Recovery from low-weight restrictions (Carlet, pp. 13--14). Write
y\preceq x when \operatorname{supp}(y)\subseteq\operatorname{supp}(x), and
let E_d=\{y\in V_n:w_H(y)\le d\}. If
f:V_n\to\mathbb F_2 satisfies \deg_{\mathrm{alg}}(f)\le d<n, then for
every x\in V_n,
f(x)
=\bigoplus_{\substack{y\preceq x\\y\in E_d}}
f(y)
\left[
\sum_{i=0}^{d-w_H(y)}
\binom{w_H(x)-w_H(y)}{i}
\bmod 2
\right].
Consequently, f is uniquely determined by its restriction to E_d. More generally, for every
affine automorphism L\in\operatorname{AGL}(V_n), it is uniquely determined by its restriction
to L(E_d).
Lean code for Theorem1.9.7●10 declarations
Associated Lean declarations
-
CryptBoolean.supportPrecedes[complete]
-
CryptBoolean.supportPrecedesDecidable[complete]
-
CryptBoolean.lowWeightInputs[complete]
-
CryptBoolean.restrictionRecoveryCoefficient[complete]
-
CryptBoolean.card_powerset_filter_card_le[complete]
-
CryptBoolean.card_intermediate_subsets_le[complete]
-
CryptBoolean.restrictionRecoveryFormula_f₂CubeOfFinset[complete]
-
CryptBoolean.restrictionRecoveryFormula[complete]
-
CryptBoolean.eq_of_eq_on_lowWeightInputs[complete]
-
CryptBoolean.eq_of_eq_on_affineImage_lowWeightInputs[complete]
-
CryptBoolean.supportPrecedes[complete] -
CryptBoolean.supportPrecedesDecidable[complete] -
CryptBoolean.lowWeightInputs[complete] -
CryptBoolean.restrictionRecoveryCoefficient[complete] -
CryptBoolean.card_powerset_filter_card_le[complete] -
CryptBoolean.card_intermediate_subsets_le[complete] -
CryptBoolean.restrictionRecoveryFormula_f₂CubeOfFinset[complete] -
CryptBoolean.restrictionRecoveryFormula[complete] -
CryptBoolean.eq_of_eq_on_lowWeightInputs[complete] -
CryptBoolean.eq_of_eq_on_affineImage_lowWeightInputs[complete]
-
defdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
def CryptBoolean.supportPrecedes {n : ℕ} (y x : FABL.F₂Cube n) : Prop
def CryptBoolean.supportPrecedes {n : ℕ} (y x : FABL.F₂Cube n) : Prop
The coordinatewise support order on the binary cube.
-
defdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
def CryptBoolean.supportPrecedesDecidable {n : ℕ} (y x : FABL.F₂Cube n) : Decidable (CryptBoolean.supportPrecedes y x)
def CryptBoolean.supportPrecedesDecidable {n : ℕ} (y x : FABL.F₂Cube n) : Decidable (CryptBoolean.supportPrecedes y x)
-
defdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
def CryptBoolean.lowWeightInputs {n : ℕ} (d : ℕ) : Finset (FABL.F₂Cube n)
def CryptBoolean.lowWeightInputs {n : ℕ} (d : ℕ) : Finset (FABL.F₂Cube n)
Carlet's set `E_d` of binary vectors of Hamming weight at most `d`.
-
defdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
def CryptBoolean.restrictionRecoveryCoefficient {n : ℕ} (d : ℕ) (x y : FABL.F₂Cube n) : FABL.𝔽₂
def CryptBoolean.restrictionRecoveryCoefficient {n : ℕ} (d : ℕ) (x y : FABL.F₂Cube n) : FABL.𝔽₂
The binomial-parity coefficient in Carlet's restriction-recovery formula.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
theorem CryptBoolean.card_powerset_filter_card_le {n : ℕ} (U : Finset (Fin n)) (k : ℕ) : {S ∈ U.powerset | S.card ≤ k}.card = ∑ i ∈ Finset.range (k + 1), U.card.choose i
theorem CryptBoolean.card_powerset_filter_card_le {n : ℕ} (U : Finset (Fin n)) (k : ℕ) : {S ∈ U.powerset | S.card ≤ k}.card = ∑ i ∈ Finset.range (k + 1), U.card.choose i
The number of subsets of `U` of cardinality at most `k`.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
theorem CryptBoolean.card_intermediate_subsets_le {n : ℕ} (T U : Finset (Fin n)) (d : ℕ) (hTU : T ⊆ U) (hTd : T.card ≤ d) : {S ∈ U.powerset | T ⊆ S ∧ S.card ≤ d}.card = ∑ i ∈ Finset.range (d - T.card + 1), (U.card - T.card).choose i
theorem CryptBoolean.card_intermediate_subsets_le {n : ℕ} (T U : Finset (Fin n)) (d : ℕ) (hTU : T ⊆ U) (hTd : T.card ≤ d) : {S ∈ U.powerset | T ⊆ S ∧ S.card ≤ d}.card = ∑ i ∈ Finset.range (d - T.card + 1), (U.card - T.card).choose i
The number of intermediate subsets `S` with `T ⊆ S ⊆ U` and `|S| ≤ d`.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
theorem CryptBoolean.restrictionRecoveryFormula_f₂CubeOfFinset {n : ℕ} (f : CryptBoolean.BooleanFunction n) (d : ℕ) (hdegree : CryptBoolean.functionAlgebraicDegree f ≤ d) (U : Finset (Fin n)) : f (FABL.f₂CubeOfFinset U) = ∑ T ∈ U.powerset, if T.card ≤ d then f (FABL.f₂CubeOfFinset T) * ↑(∑ i ∈ Finset.range (d - T.card + 1), (U.card - T.card).choose i) else 0
theorem CryptBoolean.restrictionRecoveryFormula_f₂CubeOfFinset {n : ℕ} (f : CryptBoolean.BooleanFunction n) (d : ℕ) (hdegree : CryptBoolean.functionAlgebraicDegree f ≤ d) (U : Finset (Fin n)) : f (FABL.f₂CubeOfFinset U) = ∑ T ∈ U.powerset, if T.card ≤ d then f (FABL.f₂CubeOfFinset T) * ↑(∑ i ∈ Finset.range (d - T.card + 1), (U.card - T.card).choose i) else 0
Carlet's recovery identity at the indicator vector of a coordinate subset.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
theorem CryptBoolean.restrictionRecoveryFormula {n : ℕ} (f : CryptBoolean.BooleanFunction n) (d : ℕ) (hdegree : CryptBoolean.functionAlgebraicDegree f ≤ d) (_hdn : d < n) (x : FABL.F₂Cube n) : f x = ∑ y ∈ CryptBoolean.lowWeightInputs d with CryptBoolean.supportPrecedes y x, f y * CryptBoolean.restrictionRecoveryCoefficient d x y
theorem CryptBoolean.restrictionRecoveryFormula {n : ℕ} (f : CryptBoolean.BooleanFunction n) (d : ℕ) (hdegree : CryptBoolean.functionAlgebraicDegree f ≤ d) (_hdn : d < n) (x : FABL.F₂Cube n) : f x = ∑ y ∈ CryptBoolean.lowWeightInputs d with CryptBoolean.supportPrecedes y x, f y * CryptBoolean.restrictionRecoveryCoefficient d x y
Carlet, pp. 13--14: a Boolean function of degree at most `d < n` is recovered at every input from its values on `E_d`.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
theorem CryptBoolean.eq_of_eq_on_lowWeightInputs {n : ℕ} (f g : CryptBoolean.BooleanFunction n) (d : ℕ) (hf : CryptBoolean.functionAlgebraicDegree f ≤ d) (hg : CryptBoolean.functionAlgebraicDegree g ≤ d) (hdn : d < n) (hfg : ∀ y ∈ CryptBoolean.lowWeightInputs d, f y = g y) : f = g
theorem CryptBoolean.eq_of_eq_on_lowWeightInputs {n : ℕ} (f g : CryptBoolean.BooleanFunction n) (d : ℕ) (hf : CryptBoolean.functionAlgebraicDegree f ≤ d) (hg : CryptBoolean.functionAlgebraicDegree g ≤ d) (hdn : d < n) (hfg : ∀ y ∈ CryptBoolean.lowWeightInputs d, f y = g y) : f = g
Values on `E_d` uniquely determine a Boolean function of degree at most `d < n`.
-
theoremdefined in CryptBoolean/Carlet/Chapter02/Restrictions.leancomplete
theorem CryptBoolean.eq_of_eq_on_affineImage_lowWeightInputs {n : ℕ} (f g : CryptBoolean.BooleanFunction n) (d : ℕ) (hf : CryptBoolean.functionAlgebraicDegree f ≤ d) (hg : CryptBoolean.functionAlgebraicDegree g ≤ d) (hdn : d < n) (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) (hfg : ∀ z ∈ Finset.image (fun y => L y) (CryptBoolean.lowWeightInputs d), f z = g z) : f = g
theorem CryptBoolean.eq_of_eq_on_affineImage_lowWeightInputs {n : ℕ} (f g : CryptBoolean.BooleanFunction n) (d : ℕ) (hf : CryptBoolean.functionAlgebraicDegree f ≤ d) (hg : CryptBoolean.functionAlgebraicDegree g ≤ d) (hdn : d < n) (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) (hfg : ∀ z ∈ Finset.image (fun y => L y) (CryptBoolean.lowWeightInputs d), f z = g z) : f = g
Values on an affine image of `E_d` uniquely determine a Boolean function of degree at most `d < n`.