@[reducible, inline]
The rational cast of an executable integer polynomial.
Equations
Instances For
theorem
HexPolyZMathlib.size_le_one_iff_natDegree_eq_zero
{R : Type u_1}
[Semiring R]
[DecidableEq R]
(g : Hex.DensePoly R)
:
A dense polynomial stores at most one coefficient exactly when its Mathlib image has natural degree zero.
toRatPoly corresponds to the rational cast under toPolynomial.
@[simp]
Coefficients of the rational cast are the rational casts of the integer coefficients.
theorem
HexPolyZMathlib.eval_toPolyℚ
(p : Hex.ZPoly)
(x : ℚ)
:
Polynomial.eval x (toPolyℚ p) = ∑ i ∈ Finset.range (Hex.DensePoly.size p), ↑(Hex.DensePoly.coeff p i) * x ^ i
Evaluation of the rational cast is the degree-indexed coefficient sum.
For a nonzero executable integer polynomial, the executable rational-gcd test is equivalent to squarefreeness of its rational cast.
theorem
HexPolyZMathlib.isRoot_squareFreeCore
{f : Hex.ZPoly}
(hf : f ≠ 0)
{z : ℂ}
(hz : (Polynomial.map (Int.castRingHom ℂ) (toPolynomial f)).IsRoot z)
:
Passing to the executable square-free core preserves every complex root of a nonzero integer polynomial.