Documentation

HexPolyZ.Rational

The primitive field of primitiveSquareFreeDecomposition f is the primitive part of f.

Normalizing the primitive sign makes the leading coefficient nonnegative.

A nonzero integer polynomial has nonzero leading coefficient.

Normalizing the primitive sign of a nonzero polynomial makes the leading coefficient positive.

The rational primitive part has nonnegative integer leading coefficient.

The rational primitive part of a nonzero rational polynomial has positive integer leading coefficient.

Sign normalization preserves a primitive integer polynomial.

@[simp]

Sign normalization preserves the stored coefficient count.

@[simp]

Sign normalization preserves optional degree.

The rational primitive part is primitive when its content is nonzero.

theorem Hex.ZPoly.rational_associate_primitive_unit {p q : ZPoly} (hp : p.Primitive) (_hp_ne : p 0) (hq : q.Primitive) (_hq_ne : q 0) {unit : Rat} (hunit : p.toRatPoly = DensePoly.scale unit q.toRatPoly) :
unit = 1 unit = -1

Gauss-style cancellation: if two primitive nonzero integer polynomials are rational associates with rational factor unit, then unit is ±1.

Substitute X ↦ -X in a rational dense polynomial. This local coefficient transform is the rational counterpart of ZPoly.dilate (-1).

Equations
Instances For
    theorem Hex.ZPoly.coeff_reflectRat (p : DensePoly Rat) (n : Nat) :
    (reflectRat p).coeff n = (-1) ^ n * p.coeff n

    Coefficients of rational reflection differ by the parity sign.

    @[simp]

    Rational reflection preserves the stored coefficient count.

    @[simp]

    Rational reflection is an involution.

    Rational reflection preserves nonzeroness.

    Differentiating a reflection contributes one global minus sign.

    Rational reflection is multiplicative.

    Rational reflection transports polynomial divisibility.

    Casting an integer reflection to rational coefficients gives rational reflection.

    theorem Hex.ZPoly.rat_size_scale {u : Rat} (hu : u 0) (p : DensePoly Rat) :

    Scaling a rational polynomial by a nonzero scalar preserves its size.

    theorem Hex.ZPoly.rat_size_mul (f g : DensePoly Rat) (hf : f 0) (hg : g 0) :
    (f * g).size = f.size + g.size - 1

    The size of a product of nonzero rational polynomials is one less than the sum of their sizes.

    theorem Hex.ZPoly.rat_size_le_of_dvd_nonzero {d r : DensePoly Rat} (hd : d.size 0) (hr : r.size 0) :
    d rd.size r.size

    A nonzero rational polynomial divisor has size at most the size of the nonzero polynomial it divides.

    The rational remainder has degree below every positive-degree divisor. This direct wrapper lets downstream computational structures consume the public law without repeatedly elaborating the full typeclass dictionary.

    Remainder degree bound specialized to an integer polynomial cast to rational coefficients.

    Multiplication by -1 preserves executable rational squarefreeness.

    Sign normalization preserves executable rational squarefreeness.

    Reflection in the origin preserves executable rational squarefreeness.