Documentation

CslibFrontier.Foundations.Algebra.Polynomial.Bivariate

Bivariate polynomial shifts, Hasse derivatives, vanishing order, and weighted degree #

General algebra for bivariate polynomials Q : R[X][Y] represented as iterated univariate polynomials (Polynomial (Polynomial R)), independent of coding theory:

  1. Bivariate shifts and Hasse derivatives. The Taylor shift Q(X + x, Y + y) (Polynomial.Bivariate.shift) is a ring homomorphism R[X][Y] →+* R[X][Y] whose (i, j)-th coefficient is the evaluation at (x, y) of the (i, j)-th bivariate Hasse derivative Polynomial.Bivariate.hasseDerivBiv i j Q (Polynomial.Bivariate.coeff_coeff_shift_eq_evalEval_hasseDerivBiv). Because Hasse derivatives avoid division by factorials, the theory works over arbitrary commutative semirings and fields of any characteristic and commutes with arbitrary ring homomorphisms (Polynomial.Bivariate.map_shift).
  2. Multiplicity-m vanishing. Polynomial.Bivariate.VanishesToOrder m x y Q asserts that every monomial X ^ i * Y ^ j with i + j < m vanishes in shift x y Q, equivalently that all bivariate Hasse derivatives of total order < m vanish at (x, y) (Polynomial.Bivariate.vanishesToOrder_iff_hasseDerivBiv). Over any commutative ring, VanishesToOrder m x (P.eval x) Q implies (X - C x) ^ m ∣ Q.eval P (Polynomial.Bivariate.VanishesToOrder.X_sub_C_pow_dvd_eval).
  3. (1, d)-weighted degree. Polynomial.Bivariate.weightedDegree d Q is the maximum of a + d * b over nonzero monomials X ^ a * Y ^ b of Q. Over a domain it is additive on nonzero products (Polynomial.Bivariate.weightedDegree_mul), monotone under division (Polynomial.Bivariate.weightedDegree_le_of_dvd), and evaluates to d on Y - C P whenever P.natDegree ≤ d (Polynomial.Bivariate.weightedDegree_X_sub_C).
  4. Factor refinement. Primitive, square-free (radical Q.primPart), exact root-multiplicity, and primitive irreducible factorizations in F[X][Y] over arbitrary fields (Polynomial.Bivariate.eval_radical_primPart_eq_zero_iff, Polynomial.Bivariate.exists_eq_pow_mul_eval_ne_zero, Polynomial.Bivariate.exists_eq_C_mul_prod_irreducible).

Main definitions #

Main results #

Bivariate shift and Hasse derivatives #

noncomputable def Polynomial.Bivariate.shift {R : Type u_1} [CommSemiring R] (x y : R) :

The bivariate Taylor shift Q(X + x, Y + y) as a ring homomorphism R[X][Y] →+* R[X][Y].

theorem Polynomial.Bivariate.shift_apply {R : Type u_1} [CommSemiring R] (x y : R) (Q : Polynomial (Polynomial R)) :
(shift x y) Q = (taylor (C y)) (map (↑(taylorAlgHom x)) Q)

Unfolding shift x y Q into nested univariate Polynomial.taylor shifts.

@[simp]
theorem Polynomial.Bivariate.coeff_coeff_shift_zero {R : Type u_1} [CommSemiring R] (x y : R) (Q : Polynomial (Polynomial R)) :
(((shift x y) Q).coeff 0).coeff 0 = evalEval x y Q

The constant term of shift x y Q is Q.evalEval x y.

theorem Polynomial.Bivariate.coeff_coeff_shift_monomial {R : Type u_1} [CommSemiring R] (x y : R) (a b r s : ℕ) (c : R) :
(((shift x y) ((monomial b) ((monomial a) c))).coeff s).coeff r = ↑(a.choose r) * ↑(b.choose s) * c * x ^ (a - r) * y ^ (b - s)

The (r, s) coefficient of shift x y (c * X ^ a * Y ^ b) is (a.choose r) * (b.choose s) * c * x ^ (a - r) * y ^ (b - s).

The i-th Hasse derivative in the X-variable of a bivariate polynomial Q : R[X][Y].

@[simp]

The b-th Y-coefficient of hasseDerivX i Q is hasseDeriv i (Q.coeff b).

@[simp]

hasseDerivX i on 0 is 0.

@[simp]

hasseDerivX i on a monomial in Y.

theorem Polynomial.Bivariate.eval_C_hasseDerivX {R : Type u_1} [CommSemiring R] (i : ℕ) (Q : Polynomial (Polynomial R)) (y : R) :
eval (C y) (hasseDerivX i Q) = (hasseDeriv i) (eval (C y) Q)

Evaluating hasseDerivX i Q at Y = C y commutes with hasseDeriv i.

noncomputable def Polynomial.Bivariate.hasseDerivBiv {R : Type u_1} [CommSemiring R] (i j : ℕ) (Q : Polynomial (Polynomial R)) :

The (i, j)-th bivariate Hasse derivative of Q : R[X][Y]: hasseDeriv i in X and hasseDeriv j in Y.

theorem Polynomial.Bivariate.coeff_coeff_hasseDerivBiv {R : Type u_1} [CommSemiring R] (i j a b : ℕ) (Q : Polynomial (Polynomial R)) :
((hasseDerivBiv i j Q).coeff b).coeff a = ↑((a + i).choose i) * (↑((b + j).choose j) * (Q.coeff (b + j)).coeff (a + i))

The (a, b) coefficient of hasseDerivBiv i j Q.

Bivariate Taylor / Hasse derivative identity. The coefficient of X ^ i * Y ^ j in Q(X + x, Y + y) is the value of the (i, j)-th bivariate Hasse derivative of Q at (x, y).

theorem Polynomial.Bivariate.map_shift {R : Type u_1} {S : Type u_2} [CommSemiring R] [CommSemiring S] (φ : R →+* S) (x y : R) (Q : Polynomial (Polynomial R)) :
(shift (φ x) (φ y)) (map (mapRingHom φ) Q) = map (mapRingHom φ) ((shift x y) Q)

Base change for bivariate shift. Mapping the coefficients of Q through any ring homomorphism φ : R →+* S commutes with shift.

Multiplicity-m vanishing #

Q : R[X][Y] vanishes to multiplicity (order) at least m at (x, y) if every monomial X ^ i * Y ^ j with i + j < m has zero coefficient in Q(X + x, Y + y).

theorem Polynomial.Bivariate.vanishesToOrder_iff_hasseDerivBiv {R : Type u_1} [CommSemiring R] (m : ℕ) (x y : R) (Q : Polynomial (Polynomial R)) :
VanishesToOrder m x y Q ↔ ∀ (i j : ℕ), i + j < m → evalEval x y (hasseDerivBiv i j Q) = 0

Multiplicity-m vanishing is equivalent to the vanishing of all bivariate Hasse derivatives of total order less than m at (x, y).

@[simp]

Every polynomial vanishes to order 0.

Vanishing to order 1 at (x, y) is ordinary vanishing Q(x, y) = 0.

theorem Polynomial.Bivariate.VanishesToOrder.mono {R : Type u_1} [CommSemiring R] {m m' : ℕ} {x y : R} {Q : Polynomial (Polynomial R)} (h : VanishesToOrder m x y Q) (hm : m' ≤ m) :

Monotonicity of vanishing order.

@[simp]

The zero polynomial vanishes to every order.

theorem Polynomial.Bivariate.VanishesToOrder.add {R : Type u_1} [CommSemiring R] {m : ℕ} {x y : R} {P Q : Polynomial (Polynomial R)} (hP : VanishesToOrder m x y P) (hQ : VanishesToOrder m x y Q) :
VanishesToOrder m x y (P + Q)

Vanishing to order m is closed under addition.

theorem Polynomial.Bivariate.VanishesToOrder.map {R : Type u_1} {S : Type u_2} [CommSemiring R] [CommSemiring S] (φ : R →+* S) {m : ℕ} {x y : R} {Q : Polynomial (Polynomial R)} (hQ : VanishesToOrder m x y Q) :
VanishesToOrder m (φ x) (φ y) (Polynomial.map (mapRingHom φ) Q)

Vanishing to order m is preserved by any ring homomorphism φ : R →+* S.

theorem Polynomial.Bivariate.VanishesToOrder.of_map_injective {R : Type u_1} {S : Type u_2} [CommSemiring R] [CommSemiring S] {φ : R →+* S} (hφ : Function.Injective ⇑φ) {m : ℕ} {x y : R} {Q : Polynomial (Polynomial R)} (hQ : VanishesToOrder m (φ x) (φ y) (Polynomial.map (mapRingHom φ) Q)) :

Vanishing to order m reflects along any injective ring homomorphism φ : R →+* S.

theorem Polynomial.Bivariate.VanishesToOrder.mul {R : Type u_1} [CommSemiring R] {m₁ m₂ : ℕ} {x y : R} {Q₁ Q₂ : Polynomial (Polynomial R)} (h₁ : VanishesToOrder m₁ x y Q₁) (h₂ : VanishesToOrder m₂ x y Q₂) :
VanishesToOrder (m₁ + m₂) x y (Q₁ * Q₂)

Product rule for vanishing order. If Q₁ vanishes to order m₁ and Q₂ to order m₂, then Q₁ * Q₂ vanishes to order m₁ + m₂.

theorem Polynomial.Bivariate.VanishesToOrder.pow {R : Type u_1} [CommSemiring R] {m : ℕ} {x y : R} {Q : Polynomial (Polynomial R)} (hQ : VanishesToOrder m x y Q) (r : ℕ) :
VanishesToOrder (r * m) x y (Q ^ r)

Power rule for vanishing order.

theorem Polynomial.Bivariate.VanishesToOrder.of_mul_left_of_evalEval_ne_zero {R : Type u_1} [CommSemiring R] [NoZeroDivisors R] {m : ℕ} {x y : R} {Q₁ Q₂ : Polynomial (Polynomial R)} (h₁ : evalEval x y Q₁ ≠ 0) (h : VanishesToOrder m x y (Q₁ * Q₂)) :
VanishesToOrder m x y Q₂

If Q₁(x, y) ≠ 0 and Q₁ * Q₂ vanishes to order m at (x, y) over a domain, then Q₂ already vanishes to order m at (x, y).

theorem Polynomial.Bivariate.vanishesToOrder_one_X_sub_C {R : Type u_3} [CommRing R] {x y : R} {P : Polynomial R} (hP : eval x P = y) :
VanishesToOrder 1 x y (X - C P)

Over a commutative ring, if P(x) = y then Y - C P vanishes to order 1 at (x, y).

theorem Polynomial.Bivariate.VanishesToOrder.X_sub_C_pow_dvd_eval {R : Type u_3} [CommRing R] {m : ℕ} {x y : R} {Q : Polynomial (Polynomial R)} (hQ : VanishesToOrder m x y Q) {P : Polynomial R} (hP : eval x P = y) :
(X - C x) ^ m ∣ eval P Q

Multiplicity root divisibility. Over any commutative ring R, if Q : R[X][Y] vanishes to multiplicity at least m at (x, P(x)), then (X - C x) ^ m divides Q.eval P in R[X].

(1, d)-weighted degree #

noncomputable def Polynomial.Bivariate.weightedDegree {R : Type u_1} [Semiring R] (d : ℕ) (Q : Polynomial (Polynomial R)) :

The (1, d)-weighted degree of a bivariate polynomial Q : R[X][Y]: the maximum of a + d * b over all nonzero monomials X ^ a * Y ^ b of Q (and 0 for Q = 0).

@[simp]

The weighted degree of 0 is 0.

theorem Polynomial.Bivariate.weightedDegree_le_iff {R : Type u_1} [Semiring R] {d D : ℕ} {Q : Polynomial (Polynomial R)} :
weightedDegree d Q ≤ D ↔ ∀ (a b : ℕ), (Q.coeff b).coeff a ≠ 0 → a + d * b ≤ D

weightedDegree d Q ≤ D iff every nonzero coefficient (Q.coeff b).coeff a has a + d * b ≤ D.

theorem Polynomial.Bivariate.le_weightedDegree {R : Type u_1} [Semiring R] {d a b : ℕ} {Q : Polynomial (Polynomial R)} (hab : (Q.coeff b).coeff a ≠ 0) :
a + d * b ≤ weightedDegree d Q

Every nonzero monomial X ^ a * Y ^ b of Q satisfies a + d * b ≤ weightedDegree d Q.

theorem Polynomial.Bivariate.weightedDegree_map_le {R : Type u_1} {S : Type u_2} [Semiring R] [Semiring S] (φ : R →+* S) (d : ℕ) (Q : Polynomial (Polynomial R)) :

Mapping coefficients through any ring homomorphism φ : R →+* S does not increase (1, d)-weighted degree.

Mapping coefficients through an injective ring homomorphism preserves (1, d)-weighted degree.

Subadditivity of (1, d)-weighted degree under multiplication.

theorem Polynomial.Bivariate.weightedDegree_mul {R : Type u_1} [Semiring R] [NoZeroDivisors R] {d : ℕ} {A B : Polynomial (Polynomial R)} (hA : A ≠ 0) (hB : B ≠ 0) :

Additivity of (1, d)-weighted degree. Over a domain, if A ≠ 0 and B ≠ 0, then weightedDegree d (A * B) = weightedDegree d A + weightedDegree d B.

@[simp]

The constant polynomial 1 has (1, d)-weighted degree 0.

theorem Polynomial.Bivariate.weightedDegree_le_of_dvd {R : Type u_1} [Semiring R] [NoZeroDivisors R] {d : ℕ} {A Q : Polynomial (Polynomial R)} (hQ : Q ≠ 0) (hdvd : A ∣ Q) :

Divisors of a nonzero bivariate polynomial have no larger (1, d)-weighted degree.

theorem Polynomial.Bivariate.weightedDegree_X_sub_C {R : Type u_3} [CommRing R] [Nontrivial R] {d : ℕ} {P : Polynomial R} (hP : P.natDegree ≤ d) :
weightedDegree d (X - C P) = d

Y - C P has (1, d)-weighted degree d whenever P.natDegree ≤ d.

theorem Polynomial.Bivariate.weightedDegree_X_sub_C_pow {R : Type u_3} [CommRing R] [IsDomain R] {d : ℕ} {P : Polynomial R} (hP : P.natDegree ≤ d) (r : ℕ) :
weightedDegree d ((X - C P) ^ r) = r * d

Powers (Y - C P) ^ r have (1, d)-weighted degree r * d whenever P.natDegree ≤ d.

theorem Polynomial.Bivariate.weightedDegree_le_of_X_sub_C_pow_mul {R : Type u_3} [CommRing R] [IsDomain R] {d D r : ℕ} {P : Polynomial R} (hP : P.natDegree ≤ d) {S : Polynomial (Polynomial R)} (h : weightedDegree d ((X - C P) ^ r * S) ≤ D) :
weightedDegree d S ≤ D - r * d

Division by (Y - C P) ^ r lowers the (1, d)-weighted degree bound by r * d.

Over a commutative domain, (1, d)-weighted degree is additive on products of nonzero bivariate polynomials.

theorem Polynomial.Bivariate.sum_weightedDegree_le_of_eq_C_mul_prod {R : Type u_3} [CommSemiring R] [NoZeroDivisors R] {d : ℕ} {Q : Polynomial (Polynomial R)} {c : Polynomial R} {fs : Multiset (Polynomial (Polynomial R))} (hc : c ≠ 0) (hfs : ∀ P ∈ fs, P ≠ 0) (hQeq : Q = C c * fs.prod) :

If Q = C c * fs.prod with c ≠ 0 and nonzero factors in fs, then the (1, d)-weighted degrees of the factors sum to at most weightedDegree d Q, and every factor has (1, d)-weighted degree at most weightedDegree d Q.

Factor refinement over arbitrary fields (primitive, square-free, irreducible) #

Q.primPart has (1, d)-weighted degree at most that of Q.

theorem Polynomial.Bivariate.eval_primPart_eq_zero_iff {F : Type u_1} [Field F] [DecidableEq F] {Q : Polynomial (Polynomial F)} (hQ : Q ≠ 0) (P : Polynomial F) :
eval P Q.primPart = 0 ↔ eval P Q = 0

For Q ≠ 0, Q and its primitive part Q.primPart have the same roots in F[X].

radical Q.primPart has (1, d)-weighted degree at most that of Q.

The Y-degree of radical Q.primPart is at most that of Q.

Square-free root preservation. For Q ≠ 0, radical Q.primPart is a nonzero, primitive, square-free divisor of Q having the exact same F[X]-roots as Q.

theorem Polynomial.Bivariate.exists_eq_mul_eval_ne_zero_of_squarefree {F : Type u_1} [Field F] {Q : Polynomial (Polynomial F)} (hsq : Squarefree Q) {P : Polynomial F} (hQP : eval P Q = 0) :
∃ (S : Polynomial (Polynomial F)), Q = (X - C P) * S ∧ eval P S ≠ 0

Every root of a square-free bivariate polynomial Q : F[X][Y] is a simple root.

theorem Polynomial.Bivariate.exists_eq_pow_mul_eval_ne_zero {R : Type u_2} [CommRing R] {Q : Polynomial (Polynomial R)} (hQ : Q ≠ 0) {P : Polynomial R} (hQP : eval P Q = 0) :
∃ (r : ℕ) (S : Polynomial (Polynomial R)), 1 ≤ r ∧ Q = (X - C P) ^ r * S ∧ eval P S ≠ 0

Every root P of a nonzero Q : R[X][Y] over a commutative ring factors out with exact positive multiplicity r, derived from Polynomial.exists_eq_pow_rootMultiplicity_mul_and_not_dvd.

Primitive irreducible factorization. Every nonzero Q : F[X][Y] factors as C c * fs.prod with c : F[X] nonzero and every R ∈ fs irreducible, primitive, and of positive Y-degree, preserving total Y-degree.