Stafford38/Geometry/PrescribedAffineResidueCompletion.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.AffinePointCompletion
3 public import Stafford38.Geometry.EtalePointCompletion
4 
5 @[expose] public section
6 
7 set_option autoImplicit false
8 set_option maxHeartbeats 1000000
9 
10 namespace Stafford38.Geometry.PrescribedAffineResidueCompletion
11 
12 noncomputable section
13 
14 variable {k σ B : Type*} [Field k] [CommRing B] [Algebra k B]
15   [Algebra (MvPolynomial σ k) B] [IsScalarTower k (MvPolynomial σ k) B]
16 
17 local notation "R" => MvPolynomial σ k
18 
19 /-- The point of affine coordinate space read from the chosen residue map at `M`. -/
20 def residueCoordinates (M : Ideal B) (eM : (B ⧸ M) ≃ₐ[k] k) : σ → k :=
21   fun i => eM (Ideal.Quotient.mkₐ k M (algebraMap R B (MvPolynomial.X i)))
22 
23 /-- The original coordinate map followed by the chosen residue identification. -/
24 def residueEvaluation (M : Ideal B) (eM : (B ⧸ M) ≃ₐ[k] k) : R →ₐ[k] k :=
25   eM.toAlgHom.comp
26     ((Ideal.Quotient.mkₐ k M).comp (IsScalarTower.toAlgHom k R B))
27 
28 theorem residueEvaluation_eq_aeval (M : Ideal B) (eM : (B ⧸ M) ≃ₐ[k] k) :
29     residueEvaluation (σ := σ) M eM =
30       MvPolynomial.aeval (residueCoordinates (σ := σ) M eM) := by
31   apply MvPolynomial.algHom_ext
32   intro i
33   simp [residueEvaluation, residueCoordinates]
34 
35 theorem pointIdeal_eq_residueEvaluation_ker (M : Ideal B)
36     (eM : (B ⧸ M) ≃ₐ[k] k) :
37     Stafford38.Geometry.AffinePointCompletion.pointIdeal (residueCoordinates (σ := σ) M eM) =
38       RingHom.ker (residueEvaluation (σ := σ) M eM) := by
39   change RingHom.ker ((MvPolynomial.aeval (residueCoordinates (σ := σ) M eM)).toRingHom) =
40     RingHom.ker (residueEvaluation (σ := σ) M eM : R →+* k)
41   exact congrArg RingHom.ker
42     (congrArg AlgHom.toRingHom (residueEvaluation_eq_aeval (σ := σ) M eM)).symm
43 
44 theorem residueEvaluation_surjective (M : Ideal B) (eM : (B ⧸ M) ≃ₐ[k] k) :
45     Function.Surjective (residueEvaluation (σ := σ) M eM) := by
46   intro c
47   refine ⟨MvPolynomial.C c, ?_⟩
48   simp [residueEvaluation]
49 
50 /-- The residue point gives the actual maximal ideal of the polynomial coordinate ring. -/
51 theorem residuePoint_isMaximal (M : Ideal B) (eM : (B ⧸ M) ≃ₐ[k] k) :
52     (Stafford38.Geometry.AffinePointCompletion.pointIdeal (residueCoordinates (σ := σ) M eM)).IsMaximal := by
53   rw [pointIdeal_eq_residueEvaluation_ker (σ := σ)]
54   apply RingHom.ker_isMaximal_of_surjective
55   intro c
56   obtain ⟨a, ha⟩ := residueEvaluation_surjective (σ := σ) M eM c
57   exact ⟨a, ha⟩
58 
59 /-- The polynomial coordinate ring modulo the residue point is the ground field. -/
60 noncomputable def residuePointQuotientEquiv (M : Ideal B)
61     (eM : (B ⧸ M) ≃ₐ[k] k) :
62     (R ⧸ Stafford38.Geometry.AffinePointCompletion.pointIdeal (residueCoordinates (σ := σ) M eM)) ≃ₐ[k] k := by
63   let hq := pointIdeal_eq_residueEvaluation_ker (σ := σ) M eM
64   exact (Ideal.quotientEquivAlgOfEq k hq).trans
65     (Ideal.quotientKerAlgEquivOfSurjective
66       (residueEvaluation_surjective (σ := σ) M eM))
67 
68 theorem residuePointQuotientEquiv_apply (M : Ideal B)
69     (eM : (B ⧸ M) ≃ₐ[k] k) (a : R) :
70     residuePointQuotientEquiv (σ := σ) M eM
71       (Ideal.Quotient.mk
72         (Stafford38.Geometry.AffinePointCompletion.pointIdeal
73           (residueCoordinates (σ := σ) M eM)) a) =
74       residueEvaluation (σ := σ) M eM a := by
75   let hq := pointIdeal_eq_residueEvaluation_ker (σ := σ) M eM
76   change ((Ideal.quotientEquivAlgOfEq k hq).trans
77     (Ideal.quotientKerAlgEquivOfSurjective
78       (residueEvaluation_surjective (σ := σ) M eM)))
79       (Ideal.Quotient.mk (Stafford38.Geometry.AffinePointCompletion.pointIdeal
80         (residueCoordinates (σ := σ) M eM)) a) = _
81   rw [AlgEquiv.trans_apply, Ideal.quotientEquivAlgOfEq_mk]
82   exact Ideal.quotientKerAlgEquivOfSurjective_mk
83     (residueEvaluation_surjective (σ := σ) M eM) a
84 
85 /-- At an actual ground-rational point of the original `R`-algebra, the residue
86 equivalence over `R` is induced by the same evaluation map. The quotient-kernel
87 equivalence and the supplied `B/M ≃ k` are the only ingredients. -/
88 noncomputable def residueEquivOverCoordinates
89     (M : Ideal B) [M.IsMaximal] (eM : (B ⧸ M) ≃ₐ[k] k)
90     [Algebra R k] [IsScalarTower R k k]
91     [IsScalarTower R k (B ⧸ M)]
92     [IsScalarTower R k
93       (R ⧸ Stafford38.Geometry.AffinePointCompletion.pointIdeal
94         (residueCoordinates (σ := σ) M eM))] :
95     (B ⧸ M) ≃ₐ[R]
96       (R ⧸ Stafford38.Geometry.AffinePointCompletion.pointIdeal (residueCoordinates M eM)) := by
97   let eQ := residuePointQuotientEquiv (σ := σ) M eM
98   let eM' : (B ⧸ M) ≃ₐ[R] k := eM.restrictScalars R
99   let eQ' : (R ⧸ Stafford38.Geometry.AffinePointCompletion.pointIdeal
100     (residueCoordinates (σ := σ) M eM)) ≃ₐ[R] k := eQ.restrictScalars R
101   exact eM'.trans eQ'.symm
102 
103 /-- The contraction of the chosen maximal ideal is precisely evaluation at its
104 residue-coordinate point in the original polynomial ring. -/
105 theorem residuePoint_under_eq (M : Ideal B) (eM : (B ⧸ M) ≃ₐ[k] k) :
106     Ideal.under R M = Stafford38.Geometry.AffinePointCompletion.pointIdeal
107       (residueCoordinates (σ := σ) M eM) := by
108   let ρ := residueEvaluation (σ := σ) M eM
109   have hker : Ideal.under R M = RingHom.ker ρ := by
110     ext a
111     change algebraMap R B a ∈ M ↔ ρ a = 0
112     constructor
113     · intro ha
114       have hmk : Ideal.Quotient.mk M (algebraMap R B a) = 0 :=
115         Ideal.Quotient.eq_zero_iff_mem.mpr ha
116       simp [ρ, residueEvaluation, hmk]
117     · intro ha
118       have hmk : Ideal.Quotient.mk M (algebraMap R B a) = 0 :=
119         eM.injective (by simpa [ρ, residueEvaluation] using ha)
120       exact Ideal.Quotient.eq_zero_iff_mem.mp hmk
121   have hpoint : Stafford38.Geometry.AffinePointCompletion.pointIdeal
122       (residueCoordinates (σ := σ) M eM) = RingHom.ker ρ := by
123     simpa [ρ] using pointIdeal_eq_residueEvaluation_ker (σ := σ) M eM
124   exact hker.trans hpoint.symm
125 
126 /-- The affine point completion and the formally-etale local completion compose using
127 the original coordinate map and the actual residue point. The hypothesis `hEt` is
128 the local formal-etaleness at the chosen closed point. -/
129 noncomputable def powerSeriesCompletionAtGroundPoint
130     (M : Ideal B) [M.IsMaximal] (eM : (B ⧸ M) ≃ₐ[k] k)
131     [Fintype σ]
132     [Algebra.EssFiniteType R B]
133     [Algebra.FormallyEtale R (Localization.AtPrime M)] :
134     MvPowerSeries σ k ≃+*
135       AdicCompletion (IsLocalRing.maximalIdeal (Localization.AtPrime M))
136         (Localization.AtPrime M) := by
137   let x := residueCoordinates (σ := σ) M eM
138   let q := Stafford38.Geometry.AffinePointCompletion.pointIdeal x
139   letI : q.IsMaximal := residuePoint_isMaximal (σ := σ) M eM
140   letI : q.IsPrime := inferInstance
141   let ρ := residueEvaluation (σ := σ) M eM
142   letI : Algebra R k := ρ.toRingHom.toAlgebra
143   letI : IsScalarTower R k k := IsScalarTower.of_algebraMap_eq (fun _ => by simp)
144   let eQ := residuePointQuotientEquiv (σ := σ) M eM
145   letI : IsScalarTower R k (B ⧸ M) := IsScalarTower.of_algebraMap_eq (fun a => by
146     apply eM.injective
147     rw [← Ideal.Quotient.mk_algebraMap R M a, eM.commutes]
148     change eM (Ideal.Quotient.mk M (algebraMap R B a)) = ρ a
149     rfl)
150   letI : SMul k (R ⧸ q) :=
151     @Algebra.toSMul k (R ⧸ q) _ _ (inferInstance : Algebra k (R ⧸ q))
152   letI : SMul R (R ⧸ q) :=
153     @Algebra.toSMul R (R ⧸ q) _ _ (inferInstance : Algebra R (R ⧸ q))
154   letI : IsScalarTower R k (R ⧸ q) := IsScalarTower.of_algebraMap_eq (fun a => by
155     apply eQ.injective
156     calc
157       eQ (algebraMap R (R ⧸ q) a) = ρ a := by
158         change eQ (Ideal.Quotient.mk q a) = ρ a
159         simpa [ρ] using residuePointQuotientEquiv_apply (σ := σ) M eM a
160       _ = eQ (algebraMap k (R ⧸ q) (ρ a)) := by
161         rw [eQ.commutes]
162         rfl)
163   have hq : Ideal.under R M = q := by
164     simpa [x, q] using residuePoint_under_eq (σ := σ) M eM
165   let e := residueEquivOverCoordinates (σ := σ) M eM
166   exact (Stafford38.Geometry.AffinePointCompletion.powerSeriesCompletionAtPoint x).trans
167     (Stafford38.Geometry.EtalePointCompletion.completionEquivOfEtaleResidue q M hq e)
168 
169 /-- The second stage of the prescribed-point completion map sends a polynomial class
170 to the class of the same polynomial under the original coordinate algebra map. -/
171 theorem etaleCompletion_apply_of
172     {A B : Type*} [CommRing A] [CommRing B] [Algebra A B]
173     [Algebra.EssFiniteType A B]
174     (q : Ideal A) [q.IsPrime] (p : Ideal B) [p.IsPrime] [p.IsMaximal]
175     (hq : Ideal.under A p = q)
176     (e : (B ⧸ p) ≃ₐ[A] (A ⧸ q))
177     [Algebra.FormallyEtale A (Localization.AtPrime p)] (a : A) :
178     Stafford38.Geometry.EtalePointCompletion.completionEquivOfEtaleResidue
179       q p hq e (AdicCompletion.of q A a) =
180       AdicCompletion.of (IsLocalRing.maximalIdeal (Localization.AtPrime p))
181         (Localization.AtPrime p) (algebraMap A (Localization.AtPrime p) a) := by
182   change Stafford38.Geometry.AdicCompletionMap.mapOfRingHom
183       (algebraMap A (Localization.AtPrime p)) q
184       (IsLocalRing.maximalIdeal (Localization.AtPrime p))
185       (Stafford38.Geometry.EtalePointCompletion.maximalIdeal_eq_map_of_formallyEtale
186         q p hq)
187       (AdicCompletion.of q A a) = _
188   exact Stafford38.Geometry.AdicCompletionMap.mapOfRingHom_apply_of
189     (algebraMap A (Localization.AtPrime p)) q
190     (IsLocalRing.maximalIdeal (Localization.AtPrime p))
191     (Stafford38.Geometry.EtalePointCompletion.maximalIdeal_eq_map_of_formallyEtale
192       q p hq) a
193 
194 end
195 end Stafford38.Geometry.PrescribedAffineResidueCompletion
196