Division of univariate polynomials #
The main defs are divByMonic
and modByMonic
.
The compatibility between these is given by modByMonic_add_div
.
We also define rootMultiplicity
.
See divByMonic
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
divByMonic
gives the quotient of p
by a monic polynomial q
.
Equations
- p /ₘ q = if hq : Polynomial.Monic q then (Polynomial.divModByMonicAux p hq).1 else 0
Instances For
modByMonic
gives the remainder of p
by a monic polynomial q
.
Equations
- p %ₘ q = if hq : Polynomial.Monic q then (Polynomial.divModByMonicAux p hq).2 else p
Instances For
divByMonic
gives the quotient of p
by a monic polynomial q
.
Equations
- Polynomial.«term_/ₘ_» = Lean.ParserDescr.trailingNode `Polynomial.term_/ₘ_ 70 70 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " /ₘ ") (Lean.ParserDescr.cat `term 71))
Instances For
modByMonic
gives the remainder of p
by a monic polynomial q
.
Equations
- Polynomial.«term_%ₘ_» = Lean.ParserDescr.trailingNode `Polynomial.term_%ₘ_ 70 70 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " %ₘ ") (Lean.ParserDescr.cat `term 71))
Instances For
An algorithm for deciding polynomial divisibility.
The algorithm is "compute p %ₘ q
and compare to 0
".
See polynomial.modByMonic
for the algorithm that computes %ₘ
.
Equations
- Polynomial.decidableDvdMonic p hq = decidable_of_iff (p %ₘ q = 0) (_ : p %ₘ q = 0 ↔ q ∣ p)
Instances For
The largest power of X - C a
which divides p
.
This could be computable via the divisibility algorithm Polynomial.decidableDvdMonic
,
as shown by Polynomial.rootMultiplicity_eq_nat_find_of_nonzero
which has a computable RHS.
Equations
- Polynomial.rootMultiplicity a p = if h0 : p = 0 then 0 else let x := fun (n : ℕ) => Not.decidable; Nat.find (_ : multiplicity.Finite (Polynomial.X - Polynomial.C a) p)