Skip to content

Commit 4016936

Browse files
committed
chore(RingTheory): generalize to Nonempty NormalizedGCDMonoid in GaussLemma (#31874)
because there is an instance from `UniqueFactorizationMonoid` to `Nonempty NormalizedGCDMonoid` but not to `NormalizedGCDMonoid`.
1 parent 4a2711a commit 4016936

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Mathlib/RingTheory/Polynomial/GaussLemma.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ open IsLocalization
214214

215215
section NormalizedGCDMonoid
216216

217-
variable [IsDomain R] [NormalizedGCDMonoid R]
217+
variable [IsDomain R]
218218

219-
theorem isUnit_or_eq_zero_of_isUnit_integerNormalization_primPart {p : K[X]} (h0 : p ≠ 0)
220-
(h : IsUnit (integerNormalization R⁰ p).primPart) : IsUnit p := by
219+
theorem isUnit_or_eq_zero_of_isUnit_integerNormalization_primPart [NormalizedGCDMonoid R]
220+
{p : K[X]} (h0 : p ≠ 0) (h : IsUnit (integerNormalization R⁰ p).primPart) : IsUnit p := by
221221
rcases isUnit_iff.1 h with ⟨_, ⟨u, rfl⟩, hu⟩
222222
obtain ⟨⟨c, c0⟩, hc⟩ := integerNormalization_map_to_map R⁰ p
223223
rw [Subtype.coe_mk, Algebra.smul_def, algebraMap_apply] at hc
@@ -233,6 +233,8 @@ theorem isUnit_or_eq_zero_of_isUnit_integerNormalization_primPart {p : K[X]} (h0
233233
· apply h0 con
234234
· apply Units.ne_zero _ con
235235

236+
variable [Nonempty (NormalizedGCDMonoid R)]
237+
236238
/-- **Gauss's Lemma** for GCD domains states that a primitive polynomial is irreducible iff it is
237239
irreducible in the fraction field. -/
238240
theorem IsPrimitive.irreducible_iff_irreducible_map_fraction_map {p : R[X]} (hp : p.IsPrimitive) :
@@ -250,6 +252,7 @@ theorem IsPrimitive.irreducible_iff_irreducible_map_fraction_map {p : R[X]} (hp
250252
apply map_injective (algebraMap R K) (IsFractionRing.injective _ _) _
251253
rw [Polynomial.map_mul, Polynomial.map_mul, Polynomial.map_mul, hc, hd, map_C, map_C, hab]
252254
ring
255+
have := Classical.arbitrary (NormalizedGCDMonoid R)
253256
obtain ⟨u, hu⟩ :
254257
Associated (c * d)
255258
(content (integerNormalization R⁰ a) * content (integerNormalization R⁰ b)) := by
@@ -285,6 +288,7 @@ theorem IsPrimitive.dvd_of_fraction_map_dvd_fraction_map {p q : R[X]} (hp : p.Is
285288
apply map_injective (algebraMap R K) (IsFractionRing.injective _ _)
286289
rw [Polynomial.map_mul, Polynomial.map_mul, hs, hr, mul_assoc, mul_comm r]
287290
simp
291+
have := Classical.arbitrary (NormalizedGCDMonoid R)
288292
rw [← hp.dvd_primPart_iff_dvd, primPart_mul, hq.primPart_eq, Associated.dvd_iff_dvd_right] at h
289293
· exact h
290294
· symm

0 commit comments

Comments
 (0)