Polynomial Division Algorithm
Statement
Let be a commutative ring and a monic polynomial (leading coefficient ) of degree . For every there exist unique with
More generally, if the leading coefficient of is a unit in , the same division exists. Over a field, any non-zero suffices.
Visualization
Divide by (monic, degree 1).
x^2 + x - 1
_______________
x - 1 | x^3 + 0x^2 - 2x + 1
x^3 - x^2
-----------
x^2 - 2x
x^2 - x
---------
-x + 1
-x + 1
------
0
Result: .
Verification: . Quotient , remainder .
Non-zero remainder example. Divide by :
| Step | Dividend | Multiplier | Subtract |
|---|---|---|---|
| 1 | |||
| 2 |
So . Here , .
Proof Sketch
-
Existence by induction on . If , take , . Otherwise, let with and subtract to reduce degree: has degree . Induct.
-
Monic hypothesis is used. When is monic, has the same leading term as , so subtracting strictly reduces degree. If were not monic (or its leading coeff not a unit), this step might fail over a general ring.
-
Uniqueness. If , then . If , then , a contradiction. So , hence .
Connections
Polynomial division is the analogue for of the division algorithm in that powers the Euclidean AlgorithmEuclidean AlgorithmThe oldest surviving algorithm, computing the greatest common divisor via iterated remaindersRead more →. It makes a Euclidean domain, explaining why is a PID (see Euclidean DomainEuclidean DomainA domain with a division algorithm: any a, b give a = qb + r with r smaller than b under a norm function.Read more →). The remainder theorem — iff — is an immediate corollary.
Lean4 Proof
-- Mathlib: Polynomial.modByMonic_add_div
-- in Mathlib.Algebra.Polynomial.Div (line 259)
-- States: p %ₘ q + q * (p /ₘ q) = p for monic q
open Polynomial in
/-- Division algorithm: for monic g, we have r + g * q = f
where r = f %ₘ g and q = f /ₘ g. -/
theorem poly_division_algorithm {R : Type*} [CommRing R] (f g : R[X]) (hg : g.Monic) :
f %ₘ g + g * (f /ₘ g) = f :=
Polynomial.modByMonic_add_div f hg
/-- The degree of the remainder is less than the degree of the divisor. -/
theorem poly_remainder_degree {R : Type*} [CommRing R] [Nontrivial R]
(f g : R[X]) (hg : g.Monic) :
(f %ₘ g).natDegree < g.natDegree :=
Polynomial.natDegree_modByMonic_lt f hg (Polynomial.Monic.ne_zero hg)Referenced by
- Euclidean DomainRing Theory