Boolean algebraic normal forms #
A squarefree monomial is a finite set of input variables. Multiplication is
set union, so the resulting monoid algebra over ZMod 2 is exactly the Boolean
ANF quotient in canonical normal form.
The two-element field of Boolean coefficients.
Equations
Instances For
Identify a squarefree monomial with its finite set of variables.
Equations
- UnrestrictedBooleanMul.Monomial.equivFinset = { toFun := UnrestrictedBooleanMul.Monomial.vars, invFun := UnrestrictedBooleanMul.Monomial.mk, left_inv := ⋯, right_inv := ⋯ }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Canonical Boolean algebraic normal forms in m variables.
Equations
Instances For
The ANF consisting of one squarefree monomial.
Equations
- UnrestrictedBooleanMul.monomial s = MonoidAlgebra.single { vars := s } 1
Instances For
The ith input variable.
Equations
Instances For
Evaluation of a canonical ANF on a Boolean input.
Equations
- UnrestrictedBooleanMul.eval p x = p.coeff.sum fun (s : UnrestrictedBooleanMul.Monomial m) (c : UnrestrictedBooleanMul.F₂) => c * ∏ i ∈ s.vars, x i
Instances For
Evaluation of a squarefree monomial as a monoid homomorphism.
Equations
- UnrestrictedBooleanMul.monomialEval x = { toFun := fun (s : UnrestrictedBooleanMul.Monomial m) => ∏ i ∈ s.vars, x i, map_one' := ⋯, map_mul' := ⋯ }
Instances For
Simultaneous evaluation at all Boolean inputs, as a linear map.
Equations
- UnrestrictedBooleanMul.evalLinearMap m = { toFun := fun (p : UnrestrictedBooleanMul.ANF m) => UnrestrictedBooleanMul.eval p, map_add' := ⋯, map_smul' := ⋯ }
Instances For
The Boolean polynomial which is one at x and zero at every other input.
Equations
- UnrestrictedBooleanMul.pointIndicator x = ∏ i : Fin m, if x i = 1 then UnrestrictedBooleanMul.X i else 1 + UnrestrictedBooleanMul.X i
Instances For
Canonical Boolean ANFs are determined by their values on Boolean inputs.
Canonical Boolean ANFs are linearly equivalent to all Boolean functions.
Equations
Instances For
The subspace of constants and input-linear functions.