@@ -5,7 +5,7 @@ Authors: Fabrizio Barroero
55-/
66
77import Mathlib.Order.CompletePartialOrder
8- import Mathlib.RingTheory.Ideal.BigOperators
8+ import Mathlib.RingTheory.Ideal.Quotient.Operations
99import Mathlib.RingTheory.Polynomial.Content
1010
1111/-!
@@ -19,12 +19,19 @@ Let `p : R[X]`.
1919- `p.contentIdeal` is the `Ideal R` generated by the coefficients of `p`.
2020
2121 ## Main Results
22+ - `Polynomial.contentIdeal_mul_le_mul_contentIdeal`: the content ideal of the product of two
23+ polynomials is contained in the product of their content ideals.
2224- `Polynomial.isPrimitive_of_contentIdeal_eq_top`: if the content ideal of `p` is the whole ring,
2325 then `p` is primitive.
2426- `Submodule.IsPrincipal.isPrimitive_iff_contentIdeal_eq_top`: in case the content ideal of `p` is
2527 principal, `p` is primitive if and only if its content ideal is the whole ring.
28+ - `Polynomial.mul_contentIdeal_le_radical_contentIdeal_mul`: the product of the content ideals of
29+ two polynomials is contained in the radical of the content ideal of their product.
2630- `Submodule.IsPrincipal.contentIdeal_eq_span_content_of_isPrincipal`: if the content ideal of `p`
2731 is principal, then it is equal to the ideal generated by the content of `p`.
32+ - `contentIdeal_mul_eq_top_of_contentIdeal_eq_top`: if the content ideals of two
33+ polynomials are the whole ring, then the content ideal of their product is the whole ring. This
34+ is also often called Gauss' Lemma.
2835
2936 ## TODO
3037
@@ -36,7 +43,7 @@ namespace Polynomial
3643
3744open Ideal
3845
39- variable {R : Type *} [Semiring R] (p : R[X])
46+ variable {R S : Type *} [Semiring R] [Semiring S ] (p : R[X])
4047
4148/-- The content ideal of a polynomial `p` is the ideal generated by its coefficients. -/
4249def contentIdeal := span p.coeffs.toSet
@@ -71,22 +78,36 @@ theorem contentIdeal_C (r : R) : (C r).contentIdeal = span {r} := by
7178 rw [← monomial_zero_left]
7279 exact contentIdeal_monomial 0 r
7380
81+ @[simp]
82+ theorem contentIdeal_one : (1 : R[X]).contentIdeal = ⊤ := by
83+ rw [← span_singleton_one, ← contentIdeal_C 1 , C_1]
84+
7485theorem contentIdeal_FG : p.contentIdeal.FG := ⟨p.coeffs, rfl⟩
7586
87+ theorem contentIdeal_map_eq_map_contentIdeal (f : R →+* S) :
88+ (p.map f).contentIdeal = p.contentIdeal.map f := by
89+ suffices span ((map f p).coeffs ∪ {0 }) = span (f '' p.coeffs ∪ {0 }) by
90+ simpa [contentIdeal_def, map_span]
91+ congr 1
92+ ext s
93+ by_cases hs : s = 0
94+ · simp [hs]
95+ · aesop (add simp mem_coeffs_iff)
96+
97+ theorem contentIdeal_mul_le_mul_contentIdeal (q : R[X]) :
98+ (p * q).contentIdeal ≤ p.contentIdeal * q.contentIdeal := by
99+ rw [contentIdeal_def, span_le]
100+ simp only [Set.subset_def, Finset.mem_coe, mem_coeffs_iff]
101+ rintro r ⟨n, _, rfl⟩
102+ simp [coeff_mul, _root_.sum_mem, Submodule.mul_mem_mul, coeff_mem_contentIdeal]
103+
76104section CommSemiring
77105
78106variable {R : Type *} [CommSemiring R] {p q : R[X]}
79107
80- theorem contentIdeal_le_contentIdeal_of_dvd (hpq : p ∣ q) :
81- q.contentIdeal ≤ p.contentIdeal := by
82- rw [contentIdeal_def, span_le]
83- intro _ h1
84- rw [Finset.mem_coe, mem_coeffs_iff] at h1
85- obtain ⟨_, _, h2⟩ := h1
86- obtain ⟨_, h3⟩ := hpq
87- rw [h3, coeff_mul] at h2
88- rw [h2]
89- exact Ideal.sum_mem _ <| fun _ _ ↦ mul_mem_right _ _ <| coeff_mem_contentIdeal p _
108+ theorem contentIdeal_le_contentIdeal_of_dvd (hpq : p ∣ q) : q.contentIdeal ≤ p.contentIdeal := by
109+ obtain ⟨p', rfl⟩ := hpq
110+ exact le_trans (p.contentIdeal_mul_le_mul_contentIdeal p') mul_le_right
90111
91112theorem _root_.Submodule.IsPrincipal.contentIdeal_generator_dvd_coeff
92113 (h_prin : p.contentIdeal.IsPrincipal) (n : ℕ) : h_prin.generator ∣ p.coeff n := by
@@ -131,8 +152,38 @@ theorem _root_.Submodule.IsPrincipal.isPrimitive_iff_contentIdeal_eq_top
131152 use h_prin.generator, h_prin.contentIdeal_generator_dvd
132153 simp_all [← Ideal.span_singleton_eq_top]
133154
155+ theorem contentIdeal_eq_top_of_contentIdeal_mul_eq_top
156+ (h : (p * q).contentIdeal = ⊤) : p.contentIdeal = ⊤ := by
157+ apply le_antisymm le_top
158+ calc
159+ ⊤ = (p * q).contentIdeal := h.symm
160+ _ ≤ p.contentIdeal * q.contentIdeal := contentIdeal_mul_le_mul_contentIdeal p q
161+ _ ≤ p.contentIdeal := mul_le_right
162+
134163end CommSemiring
135164
165+ section Ring
166+
167+ variable {R : Type *} [CommRing R] {p q : R[X]}
168+
169+ theorem mul_contentIdeal_le_radical_contentIdeal_mul :
170+ p.contentIdeal * q.contentIdeal ≤ ((p * q).contentIdeal).radical := by
171+ rw [radical_eq_sInf, le_sInf_iff]
172+ intro P ⟨hpq, hPprime⟩
173+ rw [hPprime.mul_le]
174+ rw [← Ideal.mk_ker (I := P)] at hpq ⊢
175+ simpa only [← map_eq_bot_iff_le_ker, ← contentIdeal_map_eq_map_contentIdeal, Polynomial.map_mul,
176+ contentIdeal_eq_bot_iff, mul_eq_zero] using hpq
177+
178+ theorem contentIdeal_mul_eq_top_of_contentIdeal_eq_top (hp : p.contentIdeal = ⊤)
179+ (hq : q.contentIdeal = ⊤) : (p * q).contentIdeal = ⊤ := by
180+ rw [← Ideal.radical_eq_top]
181+ apply le_antisymm le_top
182+ calc
183+ ⊤ = p.contentIdeal * q.contentIdeal := by simp [hp, hq]
184+ _ ≤ ((p * q).contentIdeal).radical := mul_contentIdeal_le_radical_contentIdeal_mul
185+
186+ end Ring
136187section NormalizedGCDMonoid
137188
138189variable {R : Type *} [CommRing R] [IsDomain R] [NormalizedGCDMonoid R] {p : R[X]}
0 commit comments