Skip to content

Commit d9d3b4c

Browse files
fbarroerojcommelin
andcommitted
feat(RingTheory/Polynomial/ContentIdeal): more theorems (#25960)
We prove more facts about `contentIdeal`. For instance we prove that `(p * q).contentIdeal $\le$ p.contentIdeal * q.contentIdeal $\le$ (p * q).contentIdeal.radical` which implies the following result, often called Gauss' Lemma ``` Polynomial.contentIdeal_mul_eq_top_of_contentIdeal_eq_top {p q : R[X]} (hp : p.contentIdeal = ⊤) (hq : q.contentIdeal = ⊤) : (p * q).contentIdeal = ⊤ ``` Zulip discussion [here](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/contentIdeal/with/522432790) Co-authored-by: Johan Commelin <[email protected]>
1 parent 80a0eb2 commit d9d3b4c

File tree

3 files changed

+69
-13
lines changed

3 files changed

+69
-13
lines changed

Mathlib/Algebra/Module/PID.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ theorem torsion_by_prime_power_decomposition (hM : Module.IsTorsion' M (Submonoi
218218
rw [Submodule.map_span, Submodule.map_top, range_mkQ] at hs'; simp only [mkQ_apply] at hs'
219219
simp only [s']; rw [← Function.comp_assoc, Set.range_comp (_ ∘ s), Fin.range_succAbove]
220220
rw [← Set.range_comp, ← Set.insert_image_compl_eq_range _ j, Function.comp_apply,
221-
(Quotient.mk_eq_zero _).mpr (Submodule.mem_span_singleton_self _), span_insert_zero] at hs'
221+
(Quotient.mk_eq_zero _).mpr (Submodule.mem_span_singleton_self _),
222+
Submodule.span_insert_zero] at hs'
222223
exact hs'
223224

224225
end PTorsion

Mathlib/RingTheory/Ideal/Span.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ theorem span_singleton_ne_top {α : Type*} [CommSemiring α] {x : α} (hx : ¬Is
125125
@[simp]
126126
theorem span_zero : span (0 : Set α) = ⊥ := by rw [← Set.singleton_zero, span_singleton_eq_bot]
127127

128+
@[simp]
129+
theorem span_insert_zero {s : Set α} : span (insert (0 : α) s) = span s :=
130+
Submodule.span_insert_zero
131+
128132
@[simp]
129133
theorem span_one : span (1 : Set α) = ⊤ := by rw [← Set.singleton_one, span_singleton_one]
130134

Mathlib/RingTheory/Polynomial/ContentIdeal.lean

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Fabrizio Barroero
55
-/
66

77
import Mathlib.Order.CompletePartialOrder
8-
import Mathlib.RingTheory.Ideal.BigOperators
8+
import Mathlib.RingTheory.Ideal.Quotient.Operations
99
import 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

3744
open 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. -/
4249
def 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+
7485
theorem 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+
76104
section CommSemiring
77105

78106
variable {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

91112
theorem _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+
134163
end 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
136187
section NormalizedGCDMonoid
137188

138189
variable {R : Type*} [CommRing R] [IsDomain R] [NormalizedGCDMonoid R] {p : R[X]}

0 commit comments

Comments
 (0)