@@ -68,11 +68,7 @@ section CommRing
6868
6969variable [CommRing R] (f g : R[X])
7070
71- instance instCommRing : CommRing (AdjoinRoot f) :=
72- Ideal.Quotient.commRing _
73-
74- instance : Inhabited (AdjoinRoot f) :=
75- ⟨0 ⟩
71+ deriving instance CommRing, Inhabited for AdjoinRoot
7672
7773instance : DecidableEq (AdjoinRoot f) :=
7874 Classical.decEq _
@@ -97,10 +93,10 @@ def of : R →+* AdjoinRoot f :=
9793 (mk f).comp C
9894
9995instance instSMulAdjoinRoot [DistribSMul S R] [IsScalarTower S R R] : SMul S (AdjoinRoot f) :=
100- Submodule.Quotient.instSMul' _
96+ inferInstanceAs <| SMul S (_ ⧸ _)
10197
10298instance [DistribSMul S R] [IsScalarTower S R R] : DistribSMul S (AdjoinRoot f) :=
103- Submodule.Quotient.distribSMul' _
99+ inferInstanceAs <| DistribSMul S (_ ⧸ _)
104100
105101@[simp]
106102theorem smul_mk [DistribSMul S R] [IsScalarTower S R R] (a : S) (x : R[X]) :
@@ -113,25 +109,25 @@ theorem smul_of [DistribSMul S R] [IsScalarTower S R R] (a : S) (x : R) :
113109instance (R₁ R₂ : Type *) [SMul R₁ R₂] [DistribSMul R₁ R] [DistribSMul R₂ R] [IsScalarTower R₁ R R]
114110 [IsScalarTower R₂ R R] [IsScalarTower R₁ R₂ R] (f : R[X]) :
115111 IsScalarTower R₁ R₂ (AdjoinRoot f) :=
116- Submodule.Quotient.isScalarTower _ _
112+ inferInstanceAs <| IsScalarTower R₁ R₂ (_ ⧸ _)
117113
118114instance (R₁ R₂ : Type *) [DistribSMul R₁ R] [DistribSMul R₂ R] [IsScalarTower R₁ R R]
119115 [IsScalarTower R₂ R R] [SMulCommClass R₁ R₂ R] (f : R[X]) :
120116 SMulCommClass R₁ R₂ (AdjoinRoot f) :=
121- Submodule.Quotient.smulCommClass _ _
117+ inferInstanceAs <| SMulCommClass R₁ R₂ (_ ⧸ _)
122118
123119instance isScalarTower_right [DistribSMul S R] [IsScalarTower S R R] :
124120 IsScalarTower S (AdjoinRoot f) (AdjoinRoot f) :=
125- Ideal.Quotient.isScalarTower_right
121+ inferInstanceAs <| IsScalarTower S (_ ⧸ _) (_ ⧸ _)
126122
127123instance [Monoid S] [DistribMulAction S R] [IsScalarTower S R R] (f : R[X]) :
128124 DistribMulAction S (AdjoinRoot f) :=
129- Submodule.Quotient.distribMulAction' _
125+ inferInstanceAs <| DistribMulAction S (_ ⧸ _)
130126
131127/-- `R[x]/(f)` is `R`-algebra -/
132128@ [stacks 09FX "second part" ]
133129instance [CommSemiring S] [Algebra S R] : Algebra S (AdjoinRoot f) :=
134- Ideal.Quotient.algebra S
130+ inferInstanceAs <| Algebra S (_ ⧸ _)
135131
136132/- TODO : generalise base ring -/
137133/-- `R`-algebra homomorphism from `R[x]` to `AdjoinRoot f` sending `X` to the `root`. -/
@@ -152,11 +148,12 @@ theorem algebraMap_eq' [CommSemiring S] [Algebra S R] :
152148 rfl
153149
154150instance finiteType [CommSemiring S] [Algebra S R] [FiniteType S R] :
155- FiniteType S (AdjoinRoot f) := by
156- unfold AdjoinRoot; infer_instance
151+ FiniteType S (AdjoinRoot f) :=
152+ inferInstanceAs <| FiniteType S (_ ⧸ (_ : Ideal R[X]))
157153
158154instance finitePresentation [CommRing S] [Algebra S R] [FinitePresentation S R] :
159- FinitePresentation S (AdjoinRoot f) := .quotient (Submodule.fg_span_singleton f)
155+ FinitePresentation S (AdjoinRoot f) :=
156+ .quotient (Submodule.fg_span_singleton f)
160157
161158/-- The adjoined root. -/
162159def root : AdjoinRoot f :=
@@ -400,7 +397,6 @@ theorem isDomain_of_prime (hf : Prime f) : IsDomain (AdjoinRoot f) :=
400397 (Ideal.Quotient.isDomain_iff_prime (span {f} : Ideal R[X])).mpr <|
401398 (Ideal.span_singleton_prime hf.ne_zero).mpr hf
402399
403- set_option backward.isDefEq.respectTransparency false in
404400theorem noZeroSMulDivisors_of_prime_of_degree_ne_zero [IsDomain R] (hf : Prime f)
405401 (hf' : f.degree ≠ 0 ) : IsTorsionFree R (AdjoinRoot f) :=
406402 haveI := isDomain_of_prime hf
@@ -551,7 +547,7 @@ instance span_maximal_of_irreducible [Fact (Irreducible f)] : (span {f}).IsMaxim
551547 PrincipalIdealRing.isMaximal_of_irreducible <| Fact.out
552548
553549noncomputable instance instGroupWithZero [Fact (Irreducible f)] : GroupWithZero (AdjoinRoot f) :=
554- Quotient.groupWithZero (span {f} : Ideal K[X])
550+ fast_instance% Quotient.groupWithZero (span {f} : Ideal K[X])
555551
556552/-- If `R` is a field and `f` is irreducible, then `AdjoinRoot f` is a field -/
557553@ [stacks 09FX "first part, see also 09FI" ]
@@ -601,7 +597,6 @@ variable [CommRing R] {g : R[X]}
601597theorem isIntegral_root' (hg : g.Monic) : IsIntegral R (root g) :=
602598 ⟨g, hg, eval₂_root g⟩
603599
604- set_option backward.isDefEq.respectTransparency false in
605600/-- `AdjoinRoot.modByMonicHom` sends the equivalence class of `f` mod `g` to `f %ₘ g`.
606601
607602This is a well-defined right inverse to `AdjoinRoot.mk`, see `AdjoinRoot.mk_leftInverse`. -/
@@ -624,7 +619,6 @@ theorem mk_leftInverse (hg : g.Monic) : Function.LeftInverse (mk g) (modByMonicH
624619theorem mk_surjective : Function.Surjective (mk g) :=
625620 Ideal.Quotient.mk_surjective
626621
627- set_option backward.isDefEq.respectTransparency false in
628622/-- The elements `1, root g, ..., root g ^ (d - 1)` form a basis for `AdjoinRoot g`,
629623where `g` is a monic polynomial of degree `d`. -/
630624def powerBasisAux' (hg : g.Monic) : Basis (Fin g.natDegree) R (AdjoinRoot g) :=
@@ -652,14 +646,12 @@ def powerBasisAux' (hg : g.Monic) : Basis (Fin g.natDegree) R (AdjoinRoot g) :=
652646-- This lemma could be autogenerated by `@[simps]` but unfortunately that would require
653647-- unfolding that causes a timeout.
654648-- This lemma should have the simp tag but this causes a lint issue.
655- set_option backward.isDefEq.respectTransparency false in
656649theorem powerBasisAux'_repr_symm_apply (hg : g.Monic) (c : Fin g.natDegree →₀ R) :
657650 (powerBasisAux' hg).repr.symm c = mk g (∑ i : Fin _, monomial i (c i)) :=
658651 rfl
659652
660653-- This lemma could be autogenerated by `@[simps]` but unfortunately that would require
661654-- unfolding that causes a timeout.
662- set_option backward.isDefEq.respectTransparency false in
663655@[simp]
664656theorem powerBasisAux'_repr_apply_to_fun (hg : g.Monic) (f : AdjoinRoot g) (i : Fin g.natDegree) :
665657 (powerBasisAux' hg).repr f i = (modByMonicHom hg f).coeff ↑i :=
@@ -683,11 +675,9 @@ def powerBasis' (hg : g.Monic) : PowerBasis R (AdjoinRoot g) where
683675 have := Finset.mem_univ i
684676 contradiction
685677
686- set_option backward.isDefEq.respectTransparency false in
687678lemma _root_.Polynomial.Monic.free_adjoinRoot (hg : g.Monic) : Module.Free R (AdjoinRoot g) :=
688679 .of_basis (powerBasis' hg).basis
689680
690- set_option backward.isDefEq.respectTransparency false in
691681lemma _root_.Polynomial.Monic.finite_adjoinRoot (hg : g.Monic) : Module.Finite R (AdjoinRoot g) :=
692682 .of_basis (powerBasis' hg).basis
693683
@@ -724,7 +714,6 @@ theorem minpoly_root (hf : f ≠ 0) : minpoly K (root f) = f * C f.leadingCoeff
724714 · exact q_monic.ne_zero
725715 · rwa [Ne, C_eq_zero, inv_eq_zero, leadingCoeff_eq_zero]
726716
727- set_option backward.isDefEq.respectTransparency false in
728717/-- The elements `1, root f, ..., root f ^ (d - 1)` form a basis for `AdjoinRoot f`,
729718where `f` is an irreducible polynomial over a field of degree `d`. -/
730719def powerBasisAux (hf : f ≠ 0 ) : Basis (Fin f.natDegree) K (AdjoinRoot f) := by
@@ -1084,7 +1073,6 @@ theorem Irreducible.exists_dvd_monic_irreducible_of_isIntegral {K L : Type*}
10841073 have h3 := (AdjoinRoot.minpoly_root h) ▸ minpoly.dvd_map_of_isScalarTower K L (AdjoinRoot.root f)
10851074 exact ⟨_, minpoly.monic h2, minpoly.irreducible h2, dvd_of_mul_right_dvd h3⟩
10861075
1087- set_option backward.isDefEq.respectTransparency false in
10881076/-- If `p : R[X]` is monic, then there exists a finite free extension of `R` that splits `p`. -/
10891077lemma Polynomial.Monic.exists_splits_map. {u}
10901078 {R : Type u} [CommRing R] [Nontrivial R] {p : R[X]} (hp : p.Monic) :
0 commit comments