Skip to content

Commit 5d2ad00

Browse files
committed
feat(FieldTheory/Minpoly/IsIntegrallyClosed): if an element is the root of a polynomial of minimal degree which is monic up to a constant then it is integral (#31412)
and versions of `minpoly.unique` given `p.degree ≤ minpoly.degree`.
1 parent bd350e6 commit 5d2ad00

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

Mathlib/FieldTheory/Minpoly/Field.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ theorem unique {p : A[X]} (pmonic : p.Monic) (hp : Polynomial.aeval x p = 0)
5858
· rw [(monic hx).leadingCoeff, pmonic.leadingCoeff]
5959
· exact le_antisymm (min A x pmonic hp) (pmin (minpoly A x) (monic hx) (aeval A x))
6060

61+
theorem unique_of_degree_le_degree_minpoly {p : A[X]} (pmonic : p.Monic) (hp : p.aeval x = 0)
62+
(pmin : p.degree ≤ (minpoly A x).degree) : p = minpoly A x :=
63+
unique _ _ pmonic hp fun _ qm hq ↦ pmin.trans <| min _ _ qm hq
64+
6165
/-- If an element `x` is a root of a polynomial `p`, then the minimal polynomial of `x` divides `p`.
6266
See also `minpoly.isIntegrallyClosed_dvd` which relaxes the assumptions on `A` in exchange for
6367
stronger assumptions on `B`. -/

Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ theorem ker_eval {s : S} (hs : IsIntegral R s) :
100100
/-- If an element `x` is a root of a nonzero polynomial `p`, then the degree of `p` is at least the
101101
degree of the minimal polynomial of `x`. See also `minpoly.degree_le_of_ne_zero` which relaxes the
102102
assumptions on `S` in exchange for stronger assumptions on `R`. -/
103-
theorem IsIntegrallyClosed.degree_le_of_ne_zero {s : S} (hs : IsIntegral R s) {p : R[X]}
103+
theorem IsIntegrallyClosed.degree_le_of_ne_zero {s : S} {p : R[X]}
104104
(hp0 : p ≠ 0) (hp : Polynomial.aeval s p = 0) : degree (minpoly R s) ≤ degree p := by
105+
by_cases! hs : ¬IsIntegral R s
106+
· simp [minpoly, hs]
105107
rw [degree_eq_natDegree (minpoly.ne_zero hs), degree_eq_natDegree hp0]
106108
norm_cast
107109
exact natDegree_le_of_dvd ((isIntegrallyClosed_dvd_iff hs _).mp hp) hp0
@@ -117,11 +119,38 @@ theorem _root_.IsIntegrallyClosed.minpoly.unique {s : S} {P : R[X]} (hmo : P.Mon
117119
have hs : IsIntegral R s := ⟨P, hmo, hP⟩
118120
symm; apply eq_of_sub_eq_zero
119121
by_contra hnz
120-
refine IsIntegrallyClosed.degree_le_of_ne_zero hs hnz (by simp [hP]) |>.not_gt ?_
122+
refine IsIntegrallyClosed.degree_le_of_ne_zero (s := s) hnz (by simp [hP]) |>.not_gt ?_
121123
refine degree_sub_lt ?_ (ne_zero hs) ?_
122124
· exact le_antisymm (min R s hmo hP) (Pmin (minpoly R s) (monic hs) (aeval R s))
123125
· rw [(monic hs).leadingCoeff, hmo.leadingCoeff]
124126

127+
theorem IsIntegrallyClosed.unique_of_degree_le_degree_minpoly {s : S} {p : R[X]} (hmo : p.Monic)
128+
(hp : p.aeval s = 0) (pmin : p.degree ≤ (minpoly R s).degree) : p = minpoly R s :=
129+
IsIntegrallyClosed.minpoly.unique hmo hp fun _ qm hq ↦ pmin.trans <| min _ _ qm hq
130+
131+
theorem IsIntegrallyClosed.isIntegral_iff_leadingCoeff_dvd {s : S} {p : R[X]} (hp : p.aeval s = 0)
132+
(h₀ : p ≠ 0) (pmin : ∀ q : R[X], q.Monic → q.aeval s = 0 → p.degree ≤ q.degree) :
133+
IsIntegral R s ↔ C p.leadingCoeff ∣ p := by
134+
refine ⟨fun hInt ↦ ?_, fun ⟨q, hMul⟩ ↦ minpoly.ne_zero_iff.mp ?_⟩
135+
· use minpoly R s
136+
have ⟨q, hMul⟩ := isIntegrallyClosed_dvd hInt hp
137+
suffices q.degree ≤ 0 by simp [degree_le_zero_iff.mp this ▸ hMul, minpoly.monic hInt, mul_comm]
138+
apply WithBot.le_of_add_le_add_left <| Polynomial.degree_ne_bot.mpr <| minpoly.ne_zero hInt
139+
convert pmin _ (minpoly.monic hInt) (minpoly.aeval ..)
140+
· rw [hMul, degree_mul]
141+
· rw [add_zero]
142+
· convert right_ne_zero_of_mul <| hMul ▸ h₀
143+
refine IsIntegrallyClosed.minpoly.unique ?_ ?_ ?_ |>.symm
144+
· have := hMul ▸ leadingCoeff_mul .. |>.symm
145+
simp only [leadingCoeff_C, ne_eq, leadingCoeff_eq_zero, h₀, not_false_eq_true, mul_eq_left₀]
146+
at this
147+
exact this
148+
· have := congrArg (Polynomial.aeval s) hMul
149+
simp only [hp, h₀, map_mul, aeval_C, zero_eq_mul, FaithfulSMul.algebraMap_eq_zero_iff,
150+
leadingCoeff_eq_zero, false_or] at this
151+
exact this
152+
· exact (hMul ▸ degree_C_mul <| by simp [h₀]) ▸ pmin
153+
125154
theorem prime_of_isIntegrallyClosed {x : S} (hx : IsIntegral R x) : Prime (minpoly R x) := by
126155
refine
127156
⟨(minpoly.monic hx).ne_zero,

0 commit comments

Comments
 (0)