Skip to content

Commit b955f55

Browse files
committed
chore: replace minpoly.eq_of_algebraMap_eq by algebraMap_eq (#7228)
Also changes the repetitive names `minpoly.minpoly_algHom/Equiv` to `minpoly.algHom/Equiv_eq`
1 parent dd84089 commit b955f55

File tree

11 files changed

+36
-68
lines changed

11 files changed

+36
-68
lines changed

Mathlib/FieldTheory/AbelRuffini.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ theorem isSolvable' {α : E} {q : F[X]} (q_irred : Irreducible q) (q_aeval : aev
394394
have : _root_.IsSolvable (q * C q.leadingCoeff⁻¹).Gal := by
395395
rw [minpoly.eq_of_irreducible q_irred q_aeval, ←
396396
show minpoly F (⟨α, hα⟩ : solvableByRad F E) = minpoly F α from
397-
minpoly.eq_of_algebraMap_eq (RingHom.injective _) (isIntegral ⟨α, hα⟩) rfl]
397+
(minpoly.algebraMap_eq (RingHom.injective _) _).symm]
398398
exact isSolvable ⟨α, hα⟩
399399
refine' solvable_of_surjective (Gal.restrictDvd_surjective ⟨C q.leadingCoeff⁻¹, rfl⟩ _)
400400
rw [mul_ne_zero_iff, Ne, Ne, C_eq_zero, inv_eq_zero]

Mathlib/FieldTheory/Adjoin.lean

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -795,20 +795,14 @@ end AdjoinIntermediateFieldLattice
795795

796796
section AdjoinIntegralElement
797797

798-
variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] {α : E}
798+
variable (F : Type*) [Field F] {E : Type*} [Field E] [Algebra F E] {α : E}
799799

800800
variable {K : Type*} [Field K] [Algebra F K]
801801

802-
theorem minpoly_gen {α : E} (h : IsIntegral F α) :
802+
theorem minpoly_gen (α : E) :
803803
minpoly F (AdjoinSimple.gen F α) = minpoly F α := by
804-
rw [← AdjoinSimple.algebraMap_gen F α] at h
805-
have inj := (algebraMap F⟮α⟯ E).injective
806-
exact
807-
minpoly.eq_of_algebraMap_eq inj ((isIntegral_algebraMap_iff inj).mp h)
808-
(AdjoinSimple.algebraMap_gen _ _).symm
809-
#align intermediate_field.minpoly_gen IntermediateField.minpoly_gen
810-
811-
variable (F)
804+
rw [← minpoly.algebraMap_eq (algebraMap F⟮α⟯ E).injective, AdjoinSimple.algebraMap_gen]
805+
#align intermediate_field.minpoly_gen IntermediateField.minpoly_genₓ
812806

813807
theorem aeval_gen_minpoly (α : E) : aeval (AdjoinSimple.gen F α) (minpoly F α) = 0 := by
814808
ext
@@ -899,7 +893,7 @@ noncomputable def algHomAdjoinIntegralEquiv (h : IsIntegral F α) :
899893
(F⟮α⟯ →ₐ[F] K) ≃ { x // x ∈ (minpoly F α).aroots K } :=
900894
(adjoin.powerBasis h).liftEquiv'.trans
901895
((Equiv.refl _).subtypeEquiv fun x => by
902-
rw [adjoin.powerBasis_gen, minpoly_gen h, Equiv.refl_apply])
896+
rw [adjoin.powerBasis_gen, minpoly_gen, Equiv.refl_apply])
903897
#align intermediate_field.alg_hom_adjoin_integral_equiv IntermediateField.algHomAdjoinIntegralEquiv
904898

905899
/-- Fintype of algebra homomorphism `F⟮α⟯ →ₐ[F] K` -/
@@ -911,7 +905,7 @@ theorem card_algHom_adjoin_integral (h : IsIntegral F α) (h_sep : (minpoly F α
911905
(h_splits : (minpoly F α).Splits (algebraMap F K)) :
912906
@Fintype.card (F⟮α⟯ →ₐ[F] K) (fintypeOfAlgHomAdjoinIntegral F h) = (minpoly F α).natDegree := by
913907
rw [AlgHom.card_of_powerBasis] <;>
914-
simp only [adjoin.powerBasis_dim, adjoin.powerBasis_gen, minpoly_gen h, h_sep, h_splits]
908+
simp only [adjoin.powerBasis_dim, adjoin.powerBasis_gen, minpoly_gen, h_sep, h_splits]
915909
#align intermediate_field.card_alg_hom_adjoin_integral IntermediateField.card_algHom_adjoin_integral
916910

917911
end AdjoinIntegralElement
@@ -1067,7 +1061,6 @@ noncomputable def Lifts.upperBoundAlgHom {c : Set (Lifts F E K)} (hc : IsChain (
10671061
simp only [Submonoid.coe_mul, Subsemiring.coe_toSubmonoid, Subalgebra.coe_toSubsemiring,
10681062
coe_toSubalgebra, Lifts.eq_of_le hzw, Lifts.eq_of_le hxw, Lifts.eq_of_le hyw, ← w.2.map_mul,
10691063
Submonoid.mk_mul_mk]
1070-
10711064
commutes' _ := AlgHom.commutes _ _
10721065
#align intermediate_field.lifts.upper_bound_alg_hom IntermediateField.Lifts.upperBoundAlgHom
10731066

@@ -1281,10 +1274,8 @@ open IntermediateField
12811274

12821275
/-- `pb.equivAdjoinSimple` is the equivalence between `K⟮pb.gen⟯` and `L` itself. -/
12831276
noncomputable def equivAdjoinSimple (pb : PowerBasis K L) : K⟮pb.gen⟯ ≃ₐ[K] L :=
1284-
(adjoin.powerBasis pb.isIntegral_gen).equivOfMinpoly pb
1285-
(minpoly.eq_of_algebraMap_eq (algebraMap K⟮pb.gen⟯ L).injective
1286-
(adjoin.powerBasis pb.isIntegral_gen).isIntegral_gen
1287-
(by rw [adjoin.powerBasis_gen, AdjoinSimple.algebraMap_gen]))
1277+
(adjoin.powerBasis pb.isIntegral_gen).equivOfMinpoly pb <| by
1278+
rw [adjoin.powerBasis_gen, minpoly_gen]
12881279
#align power_basis.equiv_adjoin_simple PowerBasis.equivAdjoinSimple
12891280

12901281
@[simp]

Mathlib/FieldTheory/IntermediateField.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,10 +721,8 @@ theorem isIntegral_iff {x : S} : IsIntegral K x ↔ IsIntegral K (x : L) := by
721721
rw [← isAlgebraic_iff_isIntegral, isAlgebraic_iff, isAlgebraic_iff_isIntegral]
722722
#align intermediate_field.is_integral_iff IntermediateField.isIntegral_iff
723723

724-
theorem minpoly_eq (x : S) : minpoly K x = minpoly K (x : L) := by
725-
by_cases hx : IsIntegral K x
726-
· exact minpoly.eq_of_algebraMap_eq (algebraMap S L).injective hx rfl
727-
· exact (minpoly.eq_zero hx).trans (minpoly.eq_zero (mt isIntegral_iff.mpr hx)).symm
724+
theorem minpoly_eq (x : S) : minpoly K x = minpoly K (x : L) :=
725+
(minpoly.algebraMap_eq (algebraMap S L).injective x).symm
728726
#align intermediate_field.minpoly_eq IntermediateField.minpoly_eq
729727

730728
end IntermediateField

Mathlib/FieldTheory/Minpoly/Basic.lean

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,21 @@ theorem eq_zero (hx : ¬IsIntegral A x) : minpoly A x = 0 :=
6464
dif_neg hx
6565
#align minpoly.eq_zero minpoly.eq_zero
6666

67-
theorem minpoly_algHom (f : B →ₐ[A] B') (hf : Function.Injective f) (x : B) :
67+
theorem algHom_eq (f : B →ₐ[A] B') (hf : Function.Injective f) (x : B) :
6868
minpoly A (f x) = minpoly A x := by
6969
refine' dif_ctx_congr (isIntegral_algHom_iff _ hf) (fun _ => _) fun _ => rfl
7070
simp_rw [← Polynomial.aeval_def, aeval_algHom, AlgHom.comp_apply, _root_.map_eq_zero_iff f hf]
71-
#align minpoly.minpoly_alg_hom minpoly.minpoly_algHom
71+
#align minpoly.minpoly_alg_hom minpoly.algHom_eq
72+
73+
theorem algebraMap_eq {B} [CommRing B] [Algebra A B] [Algebra B B'] [IsScalarTower A B B']
74+
(h : Function.Injective (algebraMap B B')) (x : B) :
75+
minpoly A (algebraMap B B' x) = minpoly A x :=
76+
algHom_eq (IsScalarTower.toAlgHom A B B') h x
7277

7378
@[simp]
74-
theorem minpoly_algEquiv (f : B ≃ₐ[A] B') (x : B) : minpoly A (f x) = minpoly A x :=
75-
minpoly_algHom (f : B →ₐ[A] B') f.injective x
76-
#align minpoly.minpoly_alg_equiv minpoly.minpoly_algEquiv
79+
theorem algEquiv_eq (f : B ≃ₐ[A] B') (x : B) : minpoly A (f x) = minpoly A x :=
80+
algHom_eq (f : B →ₐ[A] B') f.injective x
81+
#align minpoly.minpoly_alg_equiv minpoly.algEquiv_eq
7782

7883
variable (A x)
7984

Mathlib/FieldTheory/Minpoly/Field.lean

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,6 @@ theorem eq_of_irreducible [Nontrivial B] {p : A[X]} (hp1 : Irreducible p)
126126
· rwa [Polynomial.Monic, leadingCoeff_mul, leadingCoeff_C, mul_inv_cancel]
127127
#align minpoly.eq_of_irreducible minpoly.eq_of_irreducible
128128

129-
/-- If `y` is the image of `x` in an extension, their minimal polynomials coincide.
130-
131-
We take `h : y = algebraMap L T x` as an argument because `rw h` typically fails
132-
since `IsIntegral R y` depends on y.
133-
-/
134-
theorem eq_of_algebraMap_eq {K S T : Type*} [Field K] [CommRing S] [CommRing T] [Algebra K S]
135-
[Algebra K T] [Algebra S T] [IsScalarTower K S T] (hST : Function.Injective (algebraMap S T))
136-
{x : S} {y : T} (hx : IsIntegral K x) (h : y = algebraMap S T x) : minpoly K x = minpoly K y :=
137-
minpoly.unique _ _ (minpoly.monic hx)
138-
(by rw [h, aeval_algebraMap_apply, minpoly.aeval, RingHom.map_zero]) fun q q_monic root_q =>
139-
minpoly.min _ _ q_monic
140-
((aeval_algebraMap_eq_zero_iff_of_injective hST).mp
141-
(h ▸ root_q : Polynomial.aeval (algebraMap S T x) q = 0))
142-
#align minpoly.eq_of_algebra_map_eq minpoly.eq_of_algebraMap_eq
143-
144129
theorem add_algebraMap {B : Type*} [CommRing B] [Algebra A B] {x : B} (hx : IsIntegral A x)
145130
(a : A) : minpoly A (x + algebraMap A B a) = (minpoly A x).comp (X - C a) := by
146131
refine' (minpoly.unique _ _ ((minpoly.monic hx).comp_X_sub_C _) _ fun q qmo hq => _).symm

Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ polynomial over the fraction field. See `minpoly.isIntegrallyClosed_eq_field_fra
5050
theorem isIntegrallyClosed_eq_field_fractions [IsDomain S] {s : S} (hs : IsIntegral R s) :
5151
minpoly K (algebraMap S L s) = (minpoly R s).map (algebraMap R K) := by
5252
refine' (eq_of_irreducible_of_monic _ _ _).symm
53-
· exact
54-
(Polynomial.Monic.irreducible_iff_irreducible_map_fraction_map (monic hs)).1 (irreducible hs)
53+
· exact ((monic hs).irreducible_iff_irreducible_map_fraction_map).1 (irreducible hs)
5554
· rw [aeval_map_algebraMap, aeval_algebraMap_apply, aeval, map_zero]
5655
· exact (monic hs).map _
5756
#align minpoly.is_integrally_closed_eq_field_fractions minpoly.isIntegrallyClosed_eq_field_fractions
@@ -62,9 +61,7 @@ this version is useful if the element is in a ring that is already a `K`-algebra
6261
theorem isIntegrallyClosed_eq_field_fractions' [IsDomain S] [Algebra K S] [IsScalarTower R K S]
6362
{s : S} (hs : IsIntegral R s) : minpoly K s = (minpoly R s).map (algebraMap R K) := by
6463
let L := FractionRing S
65-
rw [← isIntegrallyClosed_eq_field_fractions K L hs]
66-
refine'
67-
minpoly.eq_of_algebraMap_eq (IsFractionRing.injective S L) (isIntegral_of_isScalarTower hs) rfl
64+
rw [← isIntegrallyClosed_eq_field_fractions K L hs, algebraMap_eq (IsFractionRing.injective S L)]
6865
#align minpoly.is_integrally_closed_eq_field_fractions' minpoly.isIntegrallyClosed_eq_field_fractions'
6966

7067
end

Mathlib/FieldTheory/NormalClosure.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ theorem restrictScalars_eq_iSup_adjoin [h : Normal F L] :
6262
-- Now it can't find a proof by unification, so we have to do it ourselves.
6363
apply PowerBasis.lift_gen
6464
change aeval y (minpoly F (AdjoinSimple.gen F x)) = 0
65-
exact minpoly_gen (hi x) ▸ aeval_eq_zero_of_mem_rootSet (Multiset.mem_toFinset.mpr hy)
65+
exact minpoly_gen F x ▸ aeval_eq_zero_of_mem_rootSet (Multiset.mem_toFinset.mpr hy)
6666

6767
#align normal_closure.restrict_scalars_eq_supr_adjoin normalClosure.restrictScalars_eq_iSup_adjoin
6868

@@ -74,8 +74,7 @@ instance normal [h : Normal F L] : Normal F (normalClosure F K L) := by
7474
intro x
7575
-- Porting note: use the `(_)` trick to obtain an instance by unification.
7676
apply Normal.of_isSplittingField (p := minpoly F x) (hFEp := _)
77-
exact adjoin_rootSet_isSplittingField ((minpoly.eq_of_algebraMap_eq ϕ.injective
78-
((isIntegral_algebraMap_iff ϕ.injective).mp (h.isIntegral (ϕ x))) rfl).symm ▸ h.splits _)
77+
exact adjoin_rootSet_isSplittingField (minpoly.algebraMap_eq ϕ.injective (A := F) x ▸ h.splits _)
7978
#align normal_closure.normal normalClosure.normal
8079

8180
instance is_finiteDimensional [FiniteDimensional F K] :

Mathlib/LinearAlgebra/Matrix/Charpoly/Minpoly.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ variable (M : Matrix n n R)
3838

3939
@[simp]
4040
theorem minpoly_toLin' : minpoly R (toLin' M) = minpoly R M :=
41-
minpoly.minpoly_algEquiv (toLinAlgEquiv' : Matrix n n R ≃ₐ[R] _) M
41+
minpoly.algEquiv_eq (toLinAlgEquiv' : Matrix n n R ≃ₐ[R] _) M
4242
#align matrix.minpoly_to_lin' Matrix.minpoly_toLin'
4343

4444
@[simp]
4545
theorem minpoly_toLin (b : Basis n R N) (M : Matrix n n R) :
4646
minpoly R (toLin b b M) = minpoly R M :=
47-
minpoly.minpoly_algEquiv (toLinAlgEquiv b : Matrix n n R ≃ₐ[R] _) M
47+
minpoly.algEquiv_eq (toLinAlgEquiv b : Matrix n n R ≃ₐ[R] _) M
4848
#align matrix.minpoly_to_lin Matrix.minpoly_toLin
4949

5050
theorem isIntegral : IsIntegral R M :=
@@ -61,13 +61,13 @@ namespace LinearMap
6161

6262
@[simp]
6363
theorem minpoly_toMatrix' (f : (n → R) →ₗ[R] n → R) : minpoly R (toMatrix' f) = minpoly R f :=
64-
minpoly.minpoly_algEquiv (toMatrixAlgEquiv' : _ ≃ₐ[R] Matrix n n R) f
64+
minpoly.algEquiv_eq (toMatrixAlgEquiv' : _ ≃ₐ[R] Matrix n n R) f
6565
#align linear_map.minpoly_to_matrix' LinearMap.minpoly_toMatrix'
6666

6767
@[simp]
6868
theorem minpoly_toMatrix (b : Basis n R N) (f : N →ₗ[R] N) :
6969
minpoly R (toMatrix b b f) = minpoly R f :=
70-
minpoly.minpoly_algEquiv (toMatrixAlgEquiv b : _ ≃ₐ[R] Matrix n n R) f
70+
minpoly.algEquiv_eq (toMatrixAlgEquiv b : _ ≃ₐ[R] Matrix n n R) f
7171
#align linear_map.minpoly_to_matrix LinearMap.minpoly_toMatrix
7272

7373
end LinearMap

Mathlib/RingTheory/Adjoin/PowerBasis.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ noncomputable def adjoin.powerBasisAux {x : S} (hx : IsIntegral K x) :
3737
IsIntegral K (⟨x, subset_adjoin (Set.mem_singleton x)⟩ : adjoin K ({x} : Set S)) := by
3838
apply (isIntegral_algebraMap_iff hST).mp
3939
convert hx
40-
have minpoly_eq := minpoly.eq_of_algebraMap_eq hST hx' rfl
4140
apply
4241
@Basis.mk (Fin (minpoly K x).natDegree) _ (adjoin K {x}) fun i =>
4342
⟨x, subset_adjoin (Set.mem_singleton x)⟩ ^ (i : ℕ)
4443
· have : LinearIndependent K _ := linearIndependent_pow
4544
(⟨x, self_mem_adjoin_singleton _ _⟩ : adjoin K {x})
46-
rwa [minpoly_eq] at this
45+
rwa [← minpoly.algebraMap_eq hST] at this
4746
· rintro ⟨y, hy⟩ _
4847
have := hx'.mem_span_pow (y := ⟨y, hy⟩)
49-
rw [minpoly_eq] at this
48+
rw [← minpoly.algebraMap_eq hST] at this
5049
apply this
5150
· rw [adjoin_singleton_eq_range_aeval] at hy
5251
obtain ⟨f, rfl⟩ := (aeval x).mem_range.mp hy

Mathlib/RingTheory/Norm.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,10 @@ theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
233233
have injKxL := (algebraMap K⟮x⟯ L).injective
234234
by_cases hx : IsIntegral K x; swap
235235
· simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx, aroots_def]
236-
have hx' : IsIntegral K (AdjoinSimple.gen K x) := by
237-
rwa [← isIntegral_algebraMap_iff injKxL, AdjoinSimple.algebraMap_gen]
238236
rw [← adjoin.powerBasis_gen hx, PowerBasis.norm_gen_eq_prod_roots] <;>
239-
rw [adjoin.powerBasis_gen hx, minpoly.eq_of_algebraMap_eq injKxL hx'] <;>
240-
try simp only [AdjoinSimple.algebraMap_gen _ _]
241-
try exact hf
242-
rfl
237+
rw [adjoin.powerBasis_gen hx, ← minpoly.algebraMap_eq injKxL] <;>
238+
try simp only [AdjoinSimple.algebraMap_gen _ _]
239+
exact hf
243240
#align intermediate_field.adjoin_simple.norm_gen_eq_prod_roots IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots
244241

245242
end IntermediateField

0 commit comments

Comments
 (0)