Skip to content

Commit 2a556ee

Browse files
committed
feat(RingTheory/IsAdjoinRoot): add mkOfAdjoinEqTop' (#36421)
Alternative hypothesis to existing theorem: prove the result from a `Module.Free `hypothesis instead of `IsIntegrallyClosed`. If `α` generates `S` as an algebra, then `S` is given by adjoining a root of `minpoly R α`.
1 parent dc24f22 commit 2a556ee

File tree

11 files changed

+91
-21
lines changed

11 files changed

+91
-21
lines changed

Mathlib/Analysis/Complex/Polynomial/Basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public import Mathlib.Analysis.Complex.Liouville
1010
public import Mathlib.FieldTheory.PolynomialGaloisGroup
1111
public import Mathlib.LinearAlgebra.Complex.FiniteDimensional
1212
public import Mathlib.Topology.Algebra.Polynomial
13+
public import Mathlib.LinearAlgebra.Charpoly.Basic
1314

1415
/-!
1516
# The fundamental theorem of algebra
@@ -198,10 +199,9 @@ lemma Irreducible.natDegree_le_two {p : ℝ[X]} (hp : Irreducible p) : natDegree
198199
obtain ⟨z, hz⟩ : ∃ z : ℂ, aeval z p = 0 :=
199200
IsAlgClosed.exists_aeval_eq_zero _ p (degree_pos_of_irreducible hp).ne'
200201
rw [← finrank_real_complex]
201-
convert minpoly.natDegree_le z using 1
202-
· rw [← minpoly.eq_of_irreducible hp hz, natDegree_mul hp.ne_zero (by simpa using hp.ne_zero),
203-
natDegree_C, add_zero]
204-
infer_instance
202+
suffices p.natDegree = (minpoly ℝ z).natDegree from this ▸ minpoly.natDegree_le (R := ℝ) z
203+
rw [← minpoly.eq_of_irreducible hp hz, natDegree_mul hp.ne_zero (by simpa using hp.ne_zero),
204+
natDegree_C, add_zero]
205205

206206
/-- An irreducible real polynomial has degree at most two. -/
207207
lemma Irreducible.degree_le_two {p : ℝ[X]} (hp : Irreducible p) : degree p ≤ 2 :=

Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,6 @@ theorem exists_lt_finrank_of_infinite_dimensional
531531
have h2 : F⟮x⟯ ≤ L' := le_sup_right
532532
exact hx <| (h1.symm ▸ h2) <| mem_adjoin_simple_self F x
533533

534-
theorem _root_.minpoly.natDegree_le (x : L) [FiniteDimensional K L] :
535-
(minpoly K x).natDegree ≤ finrank K L :=
536-
le_of_eq_of_le (IntermediateField.adjoin.finrank (.of_finite _ _)).symm
537-
K⟮x⟯.toSubmodule.finrank_le
538-
539-
theorem _root_.minpoly.degree_le (x : L) [FiniteDimensional K L] :
540-
(minpoly K x).degree ≤ finrank K L :=
541-
degree_le_of_natDegree_le (minpoly.natDegree_le x)
542-
543534
/-- If `x : L` is an integral element in a field extension `L` over `K`, then the degree of the
544535
minimal polynomial of `x` over `K` divides `[L : K]`. -/
545536
theorem _root_.minpoly.degree_dvd {x : L} (hx : IsIntegral K x) :

Mathlib/FieldTheory/Minpoly/MinpolyDiv.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
99
public import Mathlib.FieldTheory.PrimitiveElement
1010
public import Mathlib.FieldTheory.IsAlgClosed.Basic
11+
public import Mathlib.LinearAlgebra.Charpoly.Basic
1112

1213
/-!
1314
# Results about `minpoly R x / (X - C x)`

Mathlib/FieldTheory/Normal/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public import Mathlib.FieldTheory.Extension
99
public import Mathlib.FieldTheory.Normal.Defs
1010
public import Mathlib.GroupTheory.Solvable
1111
public import Mathlib.FieldTheory.SplittingField.Construction
12+
public import Mathlib.LinearAlgebra.Charpoly.Basic
1213

1314
/-!
1415
# Normal field extensions

Mathlib/FieldTheory/PurelyInseparable/Exponent.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Michal Staromiejski
66
module
77

88
public import Mathlib.FieldTheory.PurelyInseparable.Basic
9+
public import Mathlib.LinearAlgebra.Charpoly.Basic
910

1011
/-!
1112

Mathlib/LinearAlgebra/Charpoly/Basic.lean

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ in any basis is in `LinearAlgebra/Charpoly/ToMatrix`.
2929

3030
universe u v w
3131

32-
variable {R : Type u} {M : Type v} [CommRing R]
33-
variable [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] (f : M →ₗ[R] M)
34-
3532
open Matrix Polynomial
3633

3734
noncomputable section
@@ -40,6 +37,9 @@ open Module.Free Polynomial Matrix
4037

4138
namespace LinearMap
4239

40+
variable {R : Type u} {M : Type v} [CommRing R]
41+
variable [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] (f : M →ₗ[R] M)
42+
4343
section Basic
4444

4545
/-- The characteristic polynomial of `f : M →ₗ[R] M`. -/
@@ -75,8 +75,9 @@ theorem charpoly_monic : f.charpoly.Monic :=
7575
Matrix.charpoly_monic _
7676

7777
open Module in
78-
lemma charpoly_natDegree [Nontrivial R] [StrongRankCondition R] :
78+
lemma charpoly_natDegree [StrongRankCondition R] :
7979
natDegree (charpoly f) = finrank R M := by
80+
haveI := nontrivial_of_invariantBasisNumber
8081
rw [charpoly, Matrix.charpoly_natDegree_eq_dim, finrank_eq_card_chooseBasisIndex]
8182

8283
end Coeff
@@ -133,3 +134,26 @@ theorem minpoly_coeff_zero_of_injective [Nontrivial R] (hf : Function.Injective
133134
end CayleyHamilton
134135

135136
end LinearMap
137+
138+
section Algebra
139+
variable {R M} [CommRing R] [Ring M] [Algebra R M]
140+
[Module.Finite R M] [Module.Free R M]
141+
142+
theorem Algebra.aeval_self_charpoly_lmul (α : M) :
143+
aeval α (Algebra.lmul R M α).charpoly = 0 :=
144+
Algebra.lmul_injective (R := R) <| by
145+
simpa [← aeval_algHom_apply] using LinearMap.aeval_self_charpoly <| Algebra.lmul _ _ α
146+
147+
theorem minpoly.natDegree_le (α : M) :
148+
(minpoly R α).natDegree ≤ Module.finrank R M := by
149+
nontriviality R
150+
let f := Algebra.lmul R _ α
151+
have : (minpoly R α).natDegree ≤ f.charpoly.natDegree := natDegree_le_natDegree <|
152+
minpoly.min _ _ f.charpoly_monic (Algebra.aeval_self_charpoly_lmul α)
153+
simpa [← (Algebra.lmul _ _ α).charpoly_natDegree]
154+
155+
theorem minpoly.degree_le (α : M) :
156+
(minpoly R α).degree ≤ Module.finrank R M :=
157+
degree_le_of_natDegree_le (minpoly.natDegree_le α)
158+
159+
end Algebra

Mathlib/LinearAlgebra/Dimension/Constructions.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ theorem Submodule.finrank_quotient_le [StrongRankCondition R] [Module.Finite R M
104104
toNat_le_toNat ((Submodule.mkQ s).rank_le_of_surjective Quot.mk_surjective)
105105
(rank_lt_aleph0 _ _)
106106

107+
theorem LinearMap.finrank_le_finrank_of_surjective
108+
[Module R M'] [StrongRankCondition R] [Module.Finite R M]
109+
{f : M →ₗ[R] M'} (h : Function.Surjective f) : Module.finrank R M' ≤ Module.finrank R M := by
110+
rw [← f.quotKerEquivOfSurjective h |>.finrank_eq]
111+
exact Submodule.finrank_quotient_le _
112+
107113
end Quotient
108114

109115
variable [Semiring R] [CommSemiring S] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M₁]

Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.Algebra.Algebra.Hom.Rat
99
public import Mathlib.Analysis.Complex.Polynomial.Basic
1010
public import Mathlib.NumberTheory.NumberField.Basic
11+
public import Mathlib.LinearAlgebra.Charpoly.Basic
1112

1213
/-!
1314
# Embeddings of number fields

Mathlib/RingTheory/IsAdjoinRoot.lean

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.Algebra.Polynomial.AlgebraMap
99
public import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
1010
public import Mathlib.RingTheory.PowerBasis
11+
public import Mathlib.LinearAlgebra.Charpoly.Basic
1112

1213
/-!
1314
# A predicate on adjoining roots of polynomial
@@ -591,10 +592,10 @@ end lift
591592
section mkOfAdjoinEqTop
592593

593594
variable [IsDomain R] [IsDomain S] [IsTorsionFree R S] [IsIntegrallyClosed R]
594-
{α : S} {hα : IsIntegral R α} {hα₂ : Algebra.adjoin R {α} = ⊤}
595+
{α : S} (hα : IsIntegral R α) (hα₂ : Algebra.adjoin R {α} = ⊤)
595596

596-
variable (hα hα₂) in
597597
/-- If `α` generates `S` as an algebra, then `S` is given by adjoining a root of `minpoly R α`. -/
598+
@[simps]
598599
def mkOfAdjoinEqTop : IsAdjoinRoot S (minpoly R α) where
599600
map := aeval α
600601
map_surjective := by
@@ -604,15 +605,14 @@ def mkOfAdjoinEqTop : IsAdjoinRoot S (minpoly R α) where
604605
ext
605606
simpa [Ideal.mem_span_singleton] using minpoly.isIntegrallyClosed_dvd_iff hα _
606607

607-
variable (hα hα₂) in
608608
/-- If `α` generates `S` as an algebra, then `S` is given by adjoining a root of `minpoly R α`. -/
609609
abbrev _root_.IsAdjoinRootMonic.mkOfAdjoinEqTop : IsAdjoinRootMonic S (minpoly R α) where
610610
__ := IsAdjoinRoot.mkOfAdjoinEqTop hα hα₂
611611
monic := minpoly.monic hα
612612

613613
@[simp]
614614
theorem mkOfAdjoinEqTop_root : (IsAdjoinRoot.mkOfAdjoinEqTop hα hα₂).root = α := by
615-
simp [IsAdjoinRoot.mkOfAdjoinEqTop, IsAdjoinRoot.root]
615+
simp [IsAdjoinRoot.root]
616616

617617
end mkOfAdjoinEqTop
618618

@@ -647,6 +647,44 @@ theorem minpoly_eq [IsDomain R] [IsDomain S] [IsTorsionFree R S] [IsIntegrallyCl
647647
(hirr.isUnit_or_isUnit hq).resolve_left <| minpoly.not_isUnit R h.root
648648
rw [mul_one]
649649

650+
/-- If `α` generates `S` as an algebra and `S` is free and finite,
651+
then `S` is given by adjoining a root of `minpoly R α`.
652+
Does not require that `R` is an integral domain, unlike `mkOfAdjoinEqTop`. -/
653+
@[simps]
654+
def mkOfAdjoinEqTop'
655+
[Module.Finite R S] [Module.Free R S]
656+
{α : S} (hα : Algebra.adjoin R {α} = ⊤) :
657+
IsAdjoinRootMonic S (minpoly R α) where
658+
__ : IsAdjoinRoot S (minpoly R α) :=
659+
let f := minpoly R α
660+
have hf := minpoly.monic (Algebra.IsIntegral.isIntegral (R := R) α)
661+
let φ : AdjoinRoot f →ₐ[R] S :=
662+
AdjoinRoot.liftAlgHom f (Algebra.ofId R S) α (minpoly.aeval R α)
663+
IsAdjoinRoot.ofAdjoinRootEquiv <| AlgEquiv.ofBijective φ <| by
664+
have hφ : Function.Surjective φ := by
665+
rw [Algebra.adjoin_singleton_eq_range_aeval, AlgHom.range_eq_top] at hα
666+
intro s; obtain ⟨p, hp⟩ := hα s
667+
exact ⟨AdjoinRoot.mk f p, by simp [φ, ← aeval_def, hp]⟩
668+
haveI := hf.free_adjoinRoot; haveI := hf.finite_adjoinRoot
669+
by_cases h : Nontrivial R
670+
· letI e := LinearEquiv.ofFinrankEq (R := R) (AdjoinRoot f) S <|
671+
le_antisymm (finrank_quotient_span_eq_natDegree' hf ▸ minpoly.natDegree_le α)
672+
(LinearMap.finrank_le_finrank_of_surjective (f := φ.toLinearMap) hφ)
673+
exact OrzechProperty.bijective_of_surjective_of_injective
674+
e.toLinearMap φ e.injective hφ
675+
· apply not_nontrivial_iff_subsingleton.mp at h
676+
haveI := Module.subsingleton R (AdjoinRoot f)
677+
exact ⟨Function.injective_of_subsingleton φ, hφ⟩
678+
map := aeval α
679+
monic := minpoly.monic (Algebra.IsIntegral.isIntegral α)
680+
681+
@[simp]
682+
theorem mkOfAdjoinEqTop'_root
683+
[Module.Finite R S] [Module.Free R S]
684+
{α : S} (hα : Algebra.adjoin R {α} = ⊤) :
685+
(mkOfAdjoinEqTop' hα).root = α := by
686+
simp [IsAdjoinRoot.root]
687+
650688
end IsAdjoinRootMonic
651689

652690
section Algebra

Mathlib/RingTheory/OrzechProperty.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ theorem injective_of_surjective_of_injective
9191
replace hf : Surjective f' := by simpa [f'] using hf
9292
simpa [f'] using injective_of_surjective_of_submodule' f' hf
9393

94+
theorem bijective_of_surjective_of_injective
95+
{N : Type w} [AddCommMonoid N] [Module R N]
96+
(i f : N →ₗ[R] M) (hi : Function.Injective i)
97+
(hf : Function.Surjective f) : Function.Bijective f :=
98+
⟨OrzechProperty.injective_of_surjective_of_injective _ _ hi hf, hf⟩
99+
94100
theorem injective_of_surjective_of_submodule
95101
{N : Submodule R M} (f : N →ₗ[R] M) (hf : Surjective f) : Injective f :=
96102
injective_of_surjective_of_injective N.subtype f N.injective_subtype hf

0 commit comments

Comments
 (0)