The degree-two Reed--Muller minimum word #
This file supplies the algebraic flattening ingredient for quadratic Boolean circuits. Quadratic functions are stored recursively as
q(x₀,x') = q₀(x') + x₀ a(x'),
where a is affine. The minimum-weight proof is therefore an induction on
variables, not an enumeration of eight-variable truth tables.
Recursive squarefree encoding of an affine polynomial over the two-element field.
- nil (c : F₂) : AffineCode 0
- cons {n : ℕ} (tail : AffineCode n) (head : F₂) : AffineCode (n + 1)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recursive squarefree encoding of a polynomial of degree at most two.
- nil (c : F₂) : QuadraticCode 0
- cons {n : ℕ} (tail : QuadraticCode n) (cross : AffineCode n) : QuadraticCode (n + 1)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Evaluate a recursively encoded affine polynomial on a Boolean assignment.
Equations
- (UnrestrictedBooleanMul.N4.AffineCode.nil c).eval x_3 = c
- (tail.cons head).eval x_3 = tail.eval (UnrestrictedBooleanMul.N4.assignmentTail x_3) + x_3 0 * head
Instances For
Evaluate a recursively encoded quadratic polynomial on a Boolean assignment.
Equations
- (UnrestrictedBooleanMul.N4.QuadraticCode.nil c).eval x_3 = c
- (tail.cons cross).eval x_3 = tail.eval (UnrestrictedBooleanMul.N4.assignmentTail x_3) + x_3 0 * cross.eval (UnrestrictedBooleanMul.N4.assignmentTail x_3)
Instances For
The natural-number indicator of a nonzero field element.
Instances For
The number of inputs on which a field-valued function is nonzero.
Equations
- UnrestrictedBooleanMul.N4.truthWeight f = ∑ x : X, UnrestrictedBooleanMul.N4.truthBit (f x)
Instances For
The recursively encoded zero affine polynomial.
Equations
Instances For
The recursively encoded constant affine polynomial.
Equations
Instances For
Coefficientwise addition of recursively encoded affine polynomials.
Equations
- (UnrestrictedBooleanMul.N4.AffineCode.nil a).add (UnrestrictedBooleanMul.N4.AffineCode.nil b) = UnrestrictedBooleanMul.N4.AffineCode.nil (a + b)
- (a.cons x_3).add (b.cons y) = (a.add b).cons (x_3 + y)
Instances For
The recursively encoded zero quadratic polynomial.
Equations
Instances For
Coefficientwise addition of recursively encoded quadratic polynomials.
Equations
- (UnrestrictedBooleanMul.N4.QuadraticCode.nil a).add (UnrestrictedBooleanMul.N4.QuadraticCode.nil b) = UnrestrictedBooleanMul.N4.QuadraticCode.nil (a + b)
- (q.cons a).add (r.cons b) = (q.add r).cons (a.add b)
Instances For
View an affine polynomial as a quadratic polynomial.
Equations
Instances For
At least one linear coefficient of the affine code is nonzero.
Equations
- x_2.Nonconstant = False
- (a.cons d).Nonconstant = (a.Nonconstant ∨ d ≠ 0)
Instances For
Multiply every affine coefficient by a field scalar.
Equations
Instances For
Multiply every quadratic coefficient by a field scalar.
Equations
- UnrestrictedBooleanMul.N4.QuadraticCode.smul k (UnrestrictedBooleanMul.N4.QuadraticCode.nil c) = UnrestrictedBooleanMul.N4.QuadraticCode.nil (k * c)
- UnrestrictedBooleanMul.N4.QuadraticCode.smul k (q.cons a) = (UnrestrictedBooleanMul.N4.QuadraticCode.smul k q).cons (UnrestrictedBooleanMul.N4.AffineCode.smul k a)
Instances For
Encode the Boolean product of two affine polynomials as a quadratic polynomial.
Equations
- One or more equations did not get rendered due to their size.
- UnrestrictedBooleanMul.N4.QuadraticCode.mulAffine (UnrestrictedBooleanMul.N4.AffineCode.nil a) (UnrestrictedBooleanMul.N4.AffineCode.nil b) = UnrestrictedBooleanMul.N4.QuadraticCode.nil (a * b)