Equality of packed polynomial representatives follows from equality of their stored reduced polynomials.
Decidable equality on the quotient field GF2nPoly f hirr, decided on
the underlying reduced representative .val; representatives with equal
.val are promoted to equal field elements via eq_of_val_eq.
Finite-index coefficient code for the reduced representative of a packed quotient-field element.
Equations
Instances For
The coefficient code is injective on packed quotient-field elements.
The defining irreducible modulus polynomial of the packed quotient field.
Equations
Instances For
Zero is a reduced representative modulo any packed irreducible.
Reduce a packed polynomial to its canonical residue class modulo f.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The value stored by canonical quotient reduction is the ordinary remainder modulo the irreducible modulus.
Two raw polynomials pack to the same quotient representative exactly when
they agree modulo f; the reduction map is injective up to f-residue.
Reducing an already-computed remainder gives the same quotient class as reducing the original polynomial.
Reduction % f commutes with multiplication: reducing the product of two
remainders gives the same result as reducing the product directly. This makes
multiplication on the quotient GF2nPoly f hirr well-defined on reduced
representatives.
Canonical additive identity.
Equations
- Hex.GF2nPoly.zero = { val := 0, val_reduced := ⋯ }
Instances For
Equations
- Hex.GF2nPoly.instZero = { zero := Hex.GF2nPoly.zero }
Reducing the zero polynomial gives the quotient zero.
A polynomial reduces to the zero quotient element exactly when the modulus
divides it in GF(2)[X].
A list map is duplicate-free when the map is injective on the list's own members. Weaker than global injectivity, which is what the element enumerations need: multiplication by a fixed nonzero quotient element is injective on the nonzero elements without being injective on all of them.
Deleting a member of a duplicate-free list by filtering shortens it by
exactly one. The Nodup hypothesis is what rules out the filter removing
several copies at once.
Evaluate a Boolean coefficient list as a quotient expression in the class of
X. The list is low-coefficient first: bs[i] is the coefficient of X^i.
Equations
Instances For
The value of a Boolean quotient expression is the reduced packed polynomial built from the same coefficient list.
Public quotient-field enumeration: all packed representatives in
GF2[X]/(f), obtained by reducing every length-f.natDegree Boolean coefficient
list. This is exposed for finite-field cardinality, root-count, and Rabin
soundness consumers.
Equations
Instances For
The quotient field GF2[X]/(f) has exactly 2 ^ f.natDegree elements, the
expected cardinality of a degree-f.natDegree extension of GF(2).
Every packed quotient-field element appears in elements.
The quotient expression built from an element's coefficient vector is that element.
Every packed quotient element is generated by a Boolean coefficient list in
the class of X, with exactly f.natDegree coefficients.
The quotient enumeration has no duplicate elements.
The quotient has 2 ^ f.natDegree canonical representatives.
The nonzero packed quotient-field elements, as a duplicate-free sublist of
elements.
Equations
- Hex.GF2nPoly.nonzeroElements = List.filter (fun (a : Hex.GF2nPoly f hirr) => decide (a ≠ 0)) Hex.GF2nPoly.elements
Instances For
Membership in nonzeroElements is exactly nonzero quotient membership.
The nonzero quotient enumeration has no duplicates.
There are 2 ^ f.natDegree - 1 nonzero quotient representatives.
Canonical multiplicative identity.
Equations
Instances For
Equations
- Hex.GF2nPoly.instOne = { one := Hex.GF2nPoly.one }
Natural-number literals reduce to parity in characteristic two.
Equations
Instances For
Equations
- Hex.GF2nPoly.instNatCast = { natCast := Hex.GF2nPoly.natCast }
Equations
- Hex.GF2nPoly.instOfNat k = { ofNat := Hex.GF2nPoly.natCast k }
Addition in characteristic two is XOR on representatives, followed by
canonical reduction modulo f.
Instances For
Equations
- Hex.GF2nPoly.instAdd = { add := Hex.GF2nPoly.add }
Reducing a polynomial sum agrees with adding the reduced quotient representatives.
Negation is the identity in characteristic two.
Instances For
Equations
- Hex.GF2nPoly.instNeg = { neg := Hex.GF2nPoly.neg }
Subtraction coincides with addition in characteristic two.
Instances For
Equations
- Hex.GF2nPoly.instSub = { sub := Hex.GF2nPoly.sub }
Natural scalar multiplication depends only on parity.
Instances For
Equations
- Hex.GF2nPoly.instSMulNat = { smul := Hex.GF2nPoly.nsmul }
Multiplication uses packed GF2Poly multiplication followed by reduction
modulo the irreducible defining polynomial.
Instances For
Equations
- Hex.GF2nPoly.instMul = { mul := Hex.GF2nPoly.mul }
Reducing a polynomial product agrees with multiplying the reduced quotient representatives.
Natural power in the packed quotient field by repeated squaring.
Equations
- a.pow k = Hex.GF2nPoly.pow.go 1 a k
Instances For
Square-and-multiply accumulator loop for GF2nPoly.pow: go acc base k
computes acc * base ^ k.
Equations
Instances For
Equations
- Hex.GF2nPoly.instPowNat = { pow := Hex.GF2nPoly.pow }
Iterated Frobenius squaring in the packed quotient, starting from a specified quotient element.
Equations
- a.frobeniusIter 0 = a
- a.frobeniusIter k.succ = a.frobeniusIter k * a.frobeniusIter k
Instances For
Zero Frobenius iterations leave the quotient element unchanged.
One more Frobenius iteration squares the previous iterate in the quotient field.
Frobenius iterates compose by adding their iteration counts.
Iterated quotient squaring of the class of X follows the executable
xpow2kMod remainder chain used by Rabin soundness.
Integer literals reduce to parity.
Equations
Instances For
Equations
- Hex.GF2nPoly.instIntCast = { intCast := Hex.GF2nPoly.intCast }
Integer scalar multiplication depends only on parity.
Instances For
Equations
- Hex.GF2nPoly.instSMulInt = { smul := Hex.GF2nPoly.zsmul }
The extended Euclidean witness supplies an inverse candidate modulo the packed irreducible.
Equations
Instances For
Inversion follows the packed extended-GCD path and uses the usual junk
value 0⁻¹ = 0.
Equations
Instances For
Equations
- Hex.GF2nPoly.instInv = { inv := Hex.GF2nPoly.inv }
Division is multiplication by the inverse candidate.
Instances For
Equations
- Hex.GF2nPoly.instDiv = { div := Hex.GF2nPoly.div }
Equations
- Hex.GF2nPoly.instHPowInt = { hPow := Hex.GF2nPoly.zpow }
Division in GF2nPoly unfolds to multiplication by the multiplicative
inverse.
The inverse of 0 in GF2nPoly is 0 (the field convention that makes
inversion total).
Every nonzero element of GF2nPoly cancels against its inverse, witnessing
that GF2nPoly is a field.
The value of the multiplicative identity is (1 : GF2Poly) % f.
Negation is the identity on the packed quotient.
The value of the additive identity is the zero polynomial.
A reduced quotient value is its own remainder modulo f.
Addition is commutative on the packed quotient.
Addition is associative on the packed quotient.
Regroup a sum of two pairs by swapping the inner terms. Commutativity and
associativity give this, but as a single rewrite it keeps the characteristic-two
cancellation arguments from turning into long rw chains.
The additive identity is a left identity.
The additive identity is a right identity.
Every packed quotient element is its own additive inverse in characteristic two.
Multiplication by zero on the right is zero.
Multiplication by zero on the left is zero.
Multiplication is commutative on the packed quotient.
Multiplication is associative on the packed quotient.
The multiplicative identity is a left identity.
The multiplicative identity is a right identity.
The quotient identity is not zero under a positive-degree modulus.