Bridging Ext P to AdjoinRoot P.poly #
The computable coefficient-vector arithmetic of CompPoly/Fields/Extension/Defs.lean is related
to its specification AdjoinRoot f by
toQuot x = ∑ i, algebraMap F _ (x.coeff i) * root ^ i,
which is shown to be an injective ring homomorphism. The ring axioms on Ext P are then
discharged by pushing through toQuot rather than proved on coordinates.
The load-bearing lemma is toQuot_shiftReduce: shiftReduce is "multiply by X, reduce mod
f", and correspondingly toQuot (shiftReduce e) = rt * toQuot e. Everything about
multiplication follows from it: monomialMod k = X^k mod f satisfies toQuot (monomialMod k) = rt ^ k by a one-line induction, and toQuot_mul is then a direct double sum with no case
analysis on wrap-around.
Main definitions and statements #
Ext.toQuot: the map toAdjoinRoot P.poly.Ext.rt_relation: the defining relationrt ^ d = -∑ lowerᵢ rt ^ i, fromAdjoinRoot.mk_self.Ext.toQuot_shiftReduce: the multiply-by-Xhomomorphism law.Ext.toQuot_mul,Ext.toQuot_add, ...:toQuotis a ring homomorphism.Ext.toQuot_injective: injective for any monic modulus; irreducibility is not needed.Ext.instCommRing: theCommRingstructure.Ext.toQuotRingHom:toQuotpackaged as aRingHom.
Bijectivity, cardinality and the Field structure are in
CompPoly/Fields/Extension/Field.lean.
The specification of the extension: the quotient ring F[X] / f.
Instances For
The image of X in the quotient, i.e. the adjoined root of f.
Instances For
The degree of the defining polynomial, as a WithBot ℕ.
The map from coefficient vectors to the quotient ring.
Instances For
Only the constant coefficient of 1 is nonzero, so toQuot 1 collapses to 1.
Injectivity #
toQuot as the class of an explicit degree-< d polynomial representative.
The defining relation and the multiply-by-X homomorphism law #
toQuot as a sum over Finset.range, using the total coeffNat. Convenient for the shift
reindexing in toQuot_shiftReduce.
The defining relation, from AdjoinRoot.mk_self: the adjoined root rt satisfies
rt ^ d + ∑ lowerᵢ · rt ^ i = 0.
In range form: ∑_{m < d} lowerₘ · rt ^ m = -rt ^ d.
The coefficient formula for shiftReduce, in coeffNat form.
The multiply-by-X homomorphism law. shiftReduce is multiplication by X in the quotient,
so toQuot (shiftReduce e) = rt * toQuot e. This is the one place rt_relation is consumed, and
everything about multiplication reduces to it.
Reduced monomials #
monomialMod k really is X^k reduced: its image under toQuot is rt ^ k.
Exponentiation #
x ^ n on Ext P is npowBinRec, i.e. repeated squaring, so it costs O(log n)
multiplications. npowBinRec_succ needs only Semigroup, and associativity is already
available from toQuot_mul plus injectivity — so exponentiation can be handled before the full
ring structure is transported.
Algebraic structure #
The axioms are all discharged by pushing through the injective toQuot, but the instances are
built field-by-field with where rather than via Function.Injective.commRing. That transport
takes toQuot as data, which would make the resulting instance noncomputable and — because
Monoid.toNatPow then outranks Ext.instPow — would silently break compiled x ^ n. Building
by hand keeps every operation computable, matching how CPolynomial assembles its instances in
CompPoly/Univariate/Basic.lean.
The base field and the adjoined root #
ofBase lands on the constant coefficient, so it agrees with algebraMap into the quotient.
gen is the class of X, i.e. the adjoined root.
The base-field embedding, as a ring homomorphism.
Instances For
The extension is an F-algebra.
The defining relation at the level of Ext: gen ^ d equals the reduced monomial
monomialMod d.
gen is a root of the defining polynomial, in the form Mathlib's aeval expects.
toQuot packaged as a ring homomorphism.
Instances For
Binomial compatibility #
For a binomial modulus X^d - W, the general defining relation rt ^ d = -∑ lowerᵢ rt ^ i
collapses (the only nonzero lower coefficient is lower₀ = -W) to rt ^ d = W, recovering the
gen ^ d = ofBase W law the degree-4 extensions rely on.
The collapsed defining relation for a binomial modulus: rt ^ d = W.