Skip to content

Commit 19a085a

Browse files
committed
golf away simp lemma
1 parent e9ccfff commit 19a085a

1 file changed

Lines changed: 27 additions & 37 deletions

File tree

Mathlib/RingTheory/IsAdjoinRoot.lean

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -653,46 +653,36 @@ theorem minpoly_eq [IsDomain R] [IsDomain S] [IsTorsionFree R S] [IsIntegrallyCl
653653
(hirr.isUnit_or_isUnit hq).resolve_left <| minpoly.not_isUnit R h.root
654654
rw [mul_one]
655655

656-
section mkOfAdjoinEqTop'
657-
658-
variable [Module.Finite R S] [Module.Free R S] [Nontrivial R]
659-
660656
/-- If `α` generates `S` as an algebra, then `S` is given by adjoining a root of `minpoly R α`. -/
661657
def mkOfAdjoinEqTop'
658+
[Module.Finite R S] [Module.Free R S] [Nontrivial R]
662659
{α : S} (hα : Algebra.adjoin R {α} = ⊤) :
663-
IsAdjoinRootMonic S (minpoly R α) := by
664-
set f := minpoly R α
665-
have hf : f.Monic := minpoly.monic (Algebra.IsIntegral.isIntegral α)
666-
letI : Module R (AdjoinRoot f) := Algebra.toModule
667-
haveI := hf.free_adjoinRoot; haveI finite := hf.finite_adjoinRoot
668-
let φ : AdjoinRoot f →ₐ[R] S :=
669-
AdjoinRoot.liftAlgHom f (Algebra.ofId R S) α (minpoly.aeval R α)
670-
have hφ_surj : Function.Surjective φ := by
671-
rw [Algebra.adjoin_singleton_eq_range_aeval, AlgHom.range_eq_top] at hα
672-
exact fun s =>
673-
let ⟨p, hp⟩ := hα s; ⟨AdjoinRoot.mk f p, by simp [φ, ← aeval_def, hp]⟩
674-
have hrank : f.natDegree = Module.finrank R S := le_antisymm (minpoly.natDegree_le') (by
675-
have e := φ.toLinearMap.quotKerEquivRange.trans
676-
(LinearEquiv.ofTop _ (LinearMap.range_eq_top.mpr hφ_surj))
677-
rw [← e.finrank_eq]
678-
exact (Submodule.finrank_quotient_le _).trans (finrank_quotient_span_eq_natDegree' hf).le)
679-
have e := LinearEquiv.ofFinrankEq (R := R) (AdjoinRoot f) S
680-
((finrank_quotient_span_eq_natDegree' hf).trans hrank)
681-
have hφ_inj : Function.Injective φ :=
682-
fun x y h => OrzechProperty.injective_of_surjective_endomorphism
683-
(e.symm.toLinearMap.comp φ.toLinearMap) (e.symm.surjective.comp hφ_surj) (congr_arg e.symm h)
684-
exact
685-
{ IsAdjoinRoot.ofAdjoinRootEquiv
686-
(AlgEquiv.ofBijective φ ⟨hφ_inj, hφ_surj⟩) with monic := hf }
687-
688-
@[simp]
689-
lemma mkOfAdjoinEqTop'_map
690-
{α : S} {hα : Algebra.adjoin R {α} = ⊤} :
691-
(IsAdjoinRootMonic.mkOfAdjoinEqTop' hα).map = (aeval α) := by
692-
unfold IsAdjoinRootMonic.mkOfAdjoinEqTop'
693-
ext; simp
694-
695-
end mkOfAdjoinEqTop'
660+
IsAdjoinRootMonic S (minpoly R α) where
661+
map := aeval α
662+
ker_map := by
663+
set f := minpoly R α
664+
have hf := minpoly.monic (Algebra.IsIntegral.isIntegral (R := R) α)
665+
let φ : AdjoinRoot f →ₐ[R] S :=
666+
AdjoinRoot.liftAlgHom f (Algebra.ofId R S) α (minpoly.aeval R α)
667+
have hφ : Function.Surjective φ := by
668+
rw [Algebra.adjoin_singleton_eq_range_aeval, AlgHom.range_eq_top] at hα
669+
intro s; obtain ⟨p, hp⟩ := hα s
670+
exact ⟨AdjoinRoot.mk f p, by simp [φ, ← aeval_def, hp]⟩
671+
refine IsAdjoinRoot.ofAdjoinRootEquiv (AlgEquiv.ofBijective φ ⟨?_, hφ⟩) |>.ker_map
672+
haveI := hf.free_adjoinRoot; haveI := hf.finite_adjoinRoot
673+
letI : Module R (AdjoinRoot f) := Algebra.toModule
674+
have e := LinearEquiv.ofFinrankEq (R := R) (AdjoinRoot f) S
675+
((finrank_quotient_span_eq_natDegree' hf).trans <|
676+
le_antisymm minpoly.natDegree_le' ?_)
677+
· exact fun x y h => OrzechProperty.injective_of_surjective_endomorphism
678+
(e.symm.toLinearMap.comp φ.toLinearMap)
679+
(e.symm.surjective.comp hφ) (congr_arg e.symm h)
680+
· rw [← φ.toLinearMap.quotKerEquivRange.trans
681+
(LinearEquiv.ofTop _ (LinearMap.range_eq_top.mpr hφ)) |>.finrank_eq]
682+
exact (Submodule.finrank_quotient_le _).trans (finrank_quotient_span_eq_natDegree' hf).le
683+
map_surjective := by
684+
rwa [Algebra.adjoin_singleton_eq_range_aeval, AlgHom.range_eq_top] at *
685+
monic := minpoly.monic (Algebra.IsIntegral.isIntegral α)
696686

697687
end IsAdjoinRootMonic
698688

0 commit comments

Comments
 (0)