Stafford38/Geometry/SelectedResidueNormalizationLocalization.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.SelectedResidueCoefficientLocalization
3 public import Stafford38.Geometry.ProjectiveChartNormalizationCenter
4 public import Mathlib.RingTheory.Localization.FractionRing
5 public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal
6 
7 @[expose] public section
8 
9 noncomputable section
10 set_option autoImplicit false
11 
12 namespace Stafford38.Geometry.SelectedResidueCoefficientLocalization
13 
14 universe u
15 
16 local instance subringAlgebra {F : Type u} [CommRing F] (R : Subring F) :
17     Algebra R F := R.subtype.toAlgebra
18 
19 /-- The canonical map from an affine chart subalgebra to its integral closure
20 inside the same component function field. This exposes the unique inclusion
21 used by the normalized projective-column bridge. -/
22 noncomputable def chartSubalgebraToIntegralClosure
23     {k F : Type u} [Field k] [Field F] [Algebra k F]
24     (Q : Subalgebra k F) : Q →+* integralClosure Q.toSubring F := by
25   let qToR : Q →+* Q.toSubring :=
26     RingHom.codRestrict Q.val.toRingHom Q.toSubring (by
27       intro q
28       exact q.property)
29   exact RingHom.codRestrict Q.val.toRingHom (integralClosure Q.toSubring F) (by
30     intro q
31     have hval : algebraMap Q.toSubring F (qToR q) = (q : F) := rfl
32     change IsIntegral Q.toSubring (q : F)
33     rw [← hval]
34     exact isIntegral_algebraMap)
35 
36 @[simp] theorem coe_chartSubalgebraToIntegralClosure
37     {k F : Type u} [Field k] [Field F] [Algebra k F]
38     (Q : Subalgebra k F) (q : Q) :
39     ((chartSubalgebraToIntegralClosure Q q : integralClosure Q.toSubring F) : F) =
40       (q : F) := rfl
41 
42 /-- If the residue map is injective on a coefficient ring `A`, every image in a local ring
43 of a non-zero-divisor of `A` is a unit. Thus localizing a containing algebra `B` at the
44 canonical image of `A`'s non-zero-divisors extends its map into the retained local ring. -/
45 theorem exists_localization_map_of_residue_injective
46     {A B T : Type*} [CommRing A] [Nontrivial A] [CommRing B] [CommRing T]
47     [IsLocalRing T]
48     (j : A →+* B) (fB : B →+* T) (fA : A →+* T)
49     (hcomp : fB.comp j = fA)
50     (hres : Function.Injective
51       ((IsLocalRing.residue T).comp fA)) :
52     ∃ f : Localization ((nonZeroDivisors A).map j) →+* T,
53       f.comp (algebraMap B (Localization ((nonZeroDivisors A).map j))) = fB := by
54   classical
55   let S := (nonZeroDivisors A).map j
56   have hunit : ∀ s : S, IsUnit (fB s.1) := by
57     intro s
58     obtain ⟨a, ha, hsa⟩ := Submonoid.mem_map.mp s.property
59     rw [← hsa]
60     have hfa : fB (j a) = fA a := by
61       simpa only [RingHom.comp_apply] using RingHom.congr_fun hcomp a
62     rw [hfa]
63     apply (IsLocalRing.notMem_maximalIdeal).mp
64     intro ham
65     have hzero : IsLocalRing.residue T (fA a) = 0 :=
66       (IsLocalRing.residue_eq_zero_iff _).2 ham
67     have hzero' :
68         ((IsLocalRing.residue T).comp fA) a = 0 := by
69       simpa only [RingHom.comp_apply] using hzero
70     have hzero'' :
71         ((IsLocalRing.residue T).comp fA) a =
72           ((IsLocalRing.residue T).comp fA) 0 := by
73       simpa using hzero'
74     have ha0 : a = 0 := hres hzero''
75     exact (nonZeroDivisors.ne_zero ha) ha0
76   let f : Localization S →+* T := IsLocalization.lift (S := Localization S) hunit
77   refine ⟨f, ?_⟩
78   apply RingHom.ext
79   intro b
80   exact IsLocalization.lift_eq hunit b
81 
82 /-- Apply the denominator-extension lemma to the actual integral closure of a chart subalgebra.
83 The selected coefficient subalgebra maps to the normalization through its inclusion in `Q`,
84 and the normalization maps to the same valuation ring containing `Q`. -/
85 theorem exists_chart_normalization_localization_map
86     {k F : Type u} [Field k] [Field F] [Algebra k F]
87     (Q : Subalgebra k F) (V : ValuationSubring F)
88     [IsLocalRing V.toSubring] [Algebra k V.toSubring]
89     [Algebra k (IsLocalRing.ResidueField V.toSubring)]
90     [IsScalarTower k V.toSubring (IsLocalRing.ResidueField V.toSubring)]
91     (hground : ∀ c : k,
92       (algebraMap k V.toSubring c : F) = algebraMap k F c)
93     (hQV : Q.toSubring ≤ V.toSubring)
94     {t : Set (IsLocalRing.ResidueField V.toSubring)}
95     (htb : IsTranscendenceBasis k ((↑) : t → IsLocalRing.ResidueField V.toSubring))
96     (x : t → Q)
97     (hx : ∀ z, IsLocalRing.residue V.toSubring
98       ⟨(x z : F), hQV (x z).property⟩ =
99         (z : IsLocalRing.ResidueField V.toSubring)) :
100     let A : Subalgebra k Q := Algebra.adjoin k (Set.range x)
101     let B := integralClosure Q.toSubring F
102     ∃ (j : A →+* B) (fB : B →+* V.toSubring)
103       (fLoc : Localization ((nonZeroDivisors A).map j) →+* V.toSubring),
104       (∀ a : A, ((j a : B) : F) = ((a : A) : Q)) ∧
105       (∀ b : B, ((fB b : V.toSubring) : F) = (b : F)) ∧
106       fLoc.comp (algebraMap B (Localization ((nonZeroDivisors A).map j))) = fB ∧
107         fB.comp j = (chartAlgebraToValuation (k := k) (F := F)
108           Q V hground hQV).toRingHom.comp
109           (Subalgebra.val A).toRingHom := by
110   classical
111   let A : Subalgebra k Q := Algebra.adjoin k (Set.range x)
112   let B := integralClosure Q.toSubring F
113   let qToB : Q →+* B := chartSubalgebraToIntegralClosure Q
114   let j : A →+* B := qToB.comp (Subalgebra.val A).toRingHom
115   let hBV : B.toSubring ≤ V.toSubring :=
116     ProjectiveChartNormalizationCenter.integralClosure_subring_le_valuationSubring
117       Q.toSubring V hQV
118   let fB : B →+* V.toSubring :=
119     RingHom.codRestrict B.val.toRingHom V.toSubring (fun b => hBV b.property)
120   let fA : A →+* V.toSubring :=
121     (chartAlgebraToValuation (k := k) (F := F) Q V hground hQV).toRingHom.comp
122       (Subalgebra.val A).toRingHom
123   have hcomp : fB.comp j = fA := by
124     ext a
125     rfl
126   let ψ : A →ₐ[k] IsLocalRing.ResidueField V.toSubring :=
127     selectedCoefficientResidueMap Q V hground hQV t x
128   have hψ : Function.Injective ψ.toRingHom :=
129     (selectedCoefficientResidueMap_injective Q V hQV hground htb x hx).1
130   have hresEq : (IsLocalRing.residue V.toSubring).comp fA = ψ.toRingHom := by
131     ext a
132     rfl
133   have hres : Function.Injective
134       ((IsLocalRing.residue V.toSubring).comp fA) := by
135     rw [hresEq]
136     exact hψ
137   obtain ⟨fLoc, hLoc⟩ :=
138     exists_localization_map_of_residue_injective
139       j fB fA hcomp hres
140   have hjF : ∀ a : A, ((j a : B) : F) = ((a : A) : Q) := by
141     intro a
142     rfl
143   have hfBF : ∀ b : B, ((fB b : V.toSubring) : F) = (b : F) := by
144     intro b
145     rfl
146   exact ⟨j, fB, fLoc, hjF, hfBF, hLoc, hcomp⟩
147 
148 end Stafford38.Geometry.SelectedResidueCoefficientLocalization
149