File size: 11,770 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/-
Copyright 2026 The Formal Conjectures Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file has been modified.
-/
import OAI.AlgebraicGeometry.Cycle.ComponentLocalGenerator
import OAI.AlgebraicGeometry.Cycle.ComponentDimension
import OAI.AlgebraicGeometry.Smooth.DimensionFormula
import OAI.AlgebraicGeometry.Smooth.PointwiseDimension
import OAI.Algebra.Foundations.PolynomialCatenaryT
import OAI.AlgebraicGeometry.Cycle.ComponentNormal
import OAI.AlgebraicGeometry.Smooth.CatenaryDimension
import Mathlib.RingTheory.IntegralClosure.GoingDown
import Mathlib.RingTheory.KrullDimension.Field
import Mathlib.RingTheory.KrullDimension.Polynomial
import Mathlib.RingTheory.NoetherNormalization
import Mathlib.RingTheory.Polynomial.RationalRoot
import Mathlib.RingTheory.Polynomial.UniqueFactorization

/-! # Component Closed Point Dimension -/

namespace OAI.AlgebraicGeometry.Cycle.ComponentClosedPointDimension

noncomputable section

open _root_.Algebra
open _root_.AlgebraicGeometry
open _root_.RingHom

/-!
# Dimensions at closed points of cycle components

This file proves that every closed point of the reduced closure of a codimension-`p` point in a
smooth complex `d`-fold has coheight `d - p`. The commutative-algebra input is the
equidimensionality of a finite-type domain over a field: every maximal ideal has height equal to
the ring's Krull dimension. It is proved directly from Noether normalization, incomparability,
and going down.

The closed-point formula removes the small-dimensional restriction from the separate component
and ambient coordinate package and from the resulting component-local fundamental-class
generator. The two coordinate systems remain independent of one another; a simultaneous normal
form for the closed immersion is a separate statement.
-/

open _root_.CategoryTheory _root_.Ideal _root_.MvPolynomial _root_.Topology _root_.TopologicalSpace

namespace Algebra

variable {k A : Type*} [Field k] [CommRing A] [IsDomain A] [Algebra k A]
  [Algebra.FiniteType k A]

include k

/-- Every maximal ideal of a finite-type domain over a field has height equal to the Krull
dimension of the domain. -/
lemma FiniteType.height_eq_ringKrullDim_of_isMaximal
    (P : Ideal A) [P.IsMaximal] :
    (↑P.height : WithBot ℕ∞) = ringKrullDim A := by
  obtain ⟨n, g, hg, hfinite⟩ := exists_finite_inj_algHom_of_fg k A
  let : Algebra (MvPolynomial (Fin n) k) A := g.toAlgebra
  let : FaithfulSMul (MvPolynomial (Fin n) k) A :=
    (faithfulSMul_iff_algebraMap_injective _ _).mpr hg
  let : Algebra.IsIntegral (MvPolynomial (Fin n) k) A :=
    ⟨hfinite.to_isIntegral⟩
  have hheight : P.height = (P.under (MvPolynomial (Fin n) k)).height := by
    calc
      P.height = Order.height (⟨P, inferInstance⟩ : PrimeSpectrum A) :=
        by
          change (⟨P, inferInstance⟩ : PrimeSpectrum A).asIdeal.height =
            Order.height (⟨P, inferInstance⟩ : PrimeSpectrum A)
          exact PrimeSpectrum.height_eq_orderHeight _
      _ = Order.height (PrimeSpectrum.comap
          (algebraMap (MvPolynomial (Fin n) k) A)
          (⟨P, inferInstance⟩ : PrimeSpectrum A)) := by
        apply Order.height_eq_of_strictMono
          (PrimeSpectrum.comap (algebraMap (MvPolynomial (Fin n) k) A))
          (fun _ _ hQQ' ↦ Ideal.IsIntegral.under_lt_under hQQ')
        intro Q q hq
        have hq' : q.asIdeal < Q.asIdeal.under (MvPolynomial (Fin n) k) := by
          change q.asIdeal <
            (PrimeSpectrum.comap (algebraMap (MvPolynomial (Fin n) k) A) Q).asIdeal at hq
          simpa only [PrimeSpectrum.comap_asIdeal] using hq
        obtain ⟨Q', hQ'Q, hQ'prime, hQ'over⟩ :=
          Q.asIdeal.exists_ideal_lt_liesOver_of_lt
            (R := MvPolynomial (Fin n) k) (p := q.asIdeal)
              (q := Q.asIdeal.under (MvPolynomial (Fin n) k)) hq'
        refine ⟨⟨Q', hQ'prime⟩, hQ'Q, ?_⟩
        apply PrimeSpectrum.ext
        simpa [Ideal.under] using hQ'over.over.symm
      _ = (P.under (MvPolynomial (Fin n) k)).height := by
        rw [show P.under (MvPolynomial (Fin n) k) =
          (PrimeSpectrum.comap (algebraMap (MvPolynomial (Fin n) k) A)
            (⟨P, inferInstance⟩ : PrimeSpectrum A)).asIdeal from rfl]
        exact (PrimeSpectrum.height_eq_orderHeight _).symm
  rw [OAI.Algebra.Foundations.PolynomialCatenaryT.PolynomialCatenary.ringKrullDim_eq_of_isIntegral_of_injective hg,
    MvPolynomial.ringKrullDim_of_isNoetherianRing,
    ringKrullDim_eq_zero_of_field, ENat.card_eq_coe_fintype_card, Fintype.card_fin, hheight,
    OAI.Algebra.RingTheory.SmoothKrullDimension.MvPolynomial.height_eq_fin_of_isMaximal k n (P.under (MvPolynomial (Fin n) k))]
  norm_num

end Algebra

namespace RingHom

/-- The quotient by a prime of height `p` in a standard-smooth complex algebra of relative
dimension `d` has Krull dimension `d - p`. -/
lemma IsStandardSmoothOfRelativeDimension.ringKrullDim_quotient_eq_sub_complex
    {A : Type} [CommRing A] {f : ℂ →+* A} {d p : ℕ}
    (hf : f.IsStandardSmoothOfRelativeDimension d)
    (P : Ideal A) [P.IsPrime] (hP : P.height = p) :
    ringKrullDim (A ⧸ P) = d - p := by
  have hsum := (AlgebraicGeometry.Smooth.CatenaryDimension.RingHom.IsStandardSmoothOfRelativeDimension.height_add_ringKrullDim_quotient_eq_complex hf) P
  rw [hP] at hsum
  obtain ⟨a, b, ha, hb, hab⟩ := WithBot.add_eq_coe.mp hsum
  have ha' : a = (p : ℕ∞) := WithBot.coe_injective ha
  subst a
  have hbtop : b ≠ ⊤ := by
    intro htop
    rw [htop, add_top] at hab
    exact ENat.top_ne_natCast d hab
  lift b to ℕ using hbtop with n
  have hpn : p + n = d := by exact_mod_cast hab
  rw [← hb, WithBot.coe_natCast]
  congr
  lia

end RingHom

attribute [local instance] AlgebraicGeometry.Over.Basic.overSpecAlgebra

variable (X : Over (Spec ↧ℂ)) {d p : ℕ}

/-- Every closed point of the reduced closure of a codimension-`p` point in a smooth complex
`d`-fold has coheight `d - p` inside that reduced closure. -/
lemma cycleComponent_closedPoint_coheight_eq_sub
    [IsIntegral X.left] [Smooth X.hom] [Foundations.ProjectiveSpaceIs.IsProjective X.hom] (x : X.left)
    (z : Support.cycleComponent X.left x)
    [SmoothOfRelativeDimension d X.hom]
    (hx : Order.coheight x = p) (hz : IsClosed {z}) :
    Order.coheight z = d - p := by
  let c : Support.cycleComponent X.left x ⟶ X.left := Support.cycleComponentι X.left x
  let y : X.left := c z
  have hyx : y ≤ x := (ComponentDimension.cycleComponentOrderIsoIic X.left x z).2
  obtain ⟨U, hU, hyU, hstandard⟩ :=
    ComplexPoint.SmoothCoordinates.SmoothOfRelativeDimension.exists_affine_isStandardSmoothOfRelativeDimension
      (d := d) X.hom y
  have hxU : x ∈ U := by
    rw [Scheme.le_iff_specializes] at hyx
    exact hyx.mem_open U.isOpen hyU
  let W : (Support.cycleComponent X.left x).Opens := c ⁻¹ᵁ U
  have hW : IsAffineOpen W := hU.preimage c
  have hzW : z ∈ W := hyU
  let : Nonempty W := ⟨⟨z, hzW⟩⟩
  let xu : U.toScheme := ⟨x, hxU⟩
  let zw : W.toScheme := ⟨z, hzW⟩
  let q : Γ(X.left, U) →+* Γ(Support.cycleComponent X.left x, W) :=
    (c.app U).hom
  have hqsurj : Function.Surjective q := c.app_surjective U hU
  let P : Ideal Γ(X.left, U) :=
    (hU.primeIdealOf xu).asIdeal
  let I := Scheme.IdealSheafData.vanishingIdeal
    (X := X.left) ⟨closure {x}, isClosed_closure⟩
  have hsingleton : hU.fromSpec ⁻¹' ({x} : Set X.left) =
      ({hU.primeIdealOf xu} : Set (Spec Γ(X.left, U))) := by
    ext Q
    simp only [Set.mem_preimage, Set.mem_singleton_iff]
    refine ⟨fun hQ ↦ hU.fromSpec.isOpenEmbedding.injective
      (hQ.trans (hU.fromSpec_primeIdealOf xu).symm), ?_⟩
    rintro rfl
    exact hU.fromSpec_primeIdealOf xu
  have hpreimage : hU.fromSpec ⁻¹' closure {x} =
      closure {hU.primeIdealOf xu} := by
    have hclosure := congrArg
      (fun T : Set (Spec Γ(X.left, U)) ↦ closure T) hsingleton
    exact (hU.fromSpec.isOpenEmbedding.isOpenMap.preimage_closure_eq_closure_preimage
      hU.fromSpec.continuous ({x} : Set X.left)).trans hclosure
  have hideal : I.ideal ⟨U, hU⟩ = P := by
    change PrimeSpectrum.vanishingIdeal (hU.fromSpec ⁻¹' closure {x}) = P
    erw [hpreimage, PrimeSpectrum.vanishingIdeal_closure,
      PrimeSpectrum.vanishingIdeal_singleton]
  have hqker : RingHom.ker q = P := by
    change RingHom.ker (c.app U).hom = P
    rw [← Scheme.Hom.ker_apply c ⟨U, hU⟩]
    calc
      c.ker.ideal ⟨U, hU⟩ = I.ideal ⟨U, hU⟩ := by
        rw [show c = I.subschemeι from rfl]
        exact congrArg (fun J : X.left.IdealSheafData ↦ J.ideal ⟨U, hU⟩)
          I.ker_subschemeι
      _ = P := hideal
  have hPheight : P.height = p := by
    calc
      P.height = Order.coheight xu := by
        change (hU.primeIdealOf xu).asIdeal.height = Order.coheight xu
        exact (AlgebraicGeometry.Smooth.PointwiseDimension.IsAffineOpen.primeIdealOf_height_eq_coheight hU) _
      _ = Order.coheight x := by
        have h := coheight_eq_of_isOpenImmersion
          (x := xu) U.ι
        simpa [xu] using h.symm
      _ = p := hx
  have hquotient : ringKrullDim (Γ(X.left, U) ⧸ P) = d - p :=
    (ComponentClosedPointDimension.RingHom.IsStandardSmoothOfRelativeDimension.ringKrullDim_quotient_eq_sub_complex
      (ComplexPoint.SmoothCoordinates.algebraMap_isStandardSmoothOfRelativeDimension
        (d := d) X hstandard))
        P hPheight
  have hringW : ringKrullDim Γ(Support.cycleComponent X.left x, W) = d - p := by
    calc
      ringKrullDim Γ(Support.cycleComponent X.left x, W) =
          ringKrullDim (Γ(X.left, U) ⧸ RingHom.ker q) :=
        (ringKrullDim_eq_of_ringEquiv
          (RingHom.quotientKerEquivOfSurjective hqsurj)).symm
      _ = ringKrullDim (Γ(X.left, U) ⧸ P) := by rw [hqker]
      _ = d - p := hquotient
  let s : Support.cycleComponent X.left x ⟶ Spec ↧ℂ := c ≫ X.hom
  let : Algebra ℂ Γ(Support.cycleComponent X.left x, W) :=
    AlgebraicGeometry.Over.Basic.overSpecAlgebra (Over.mk s) W
  let : Algebra.FiniteType ℂ Γ(Support.cycleComponent X.left x, W) := by
    rw [← RingHom.finiteType_algebraMap]
    change (algebraMap ℂ Γ(Support.cycleComponent X.left x, W)).FiniteType
    apply (s.finiteType_appLE (isAffineOpen_top (Spec ↧ℂ)) hW (by simp)).comp
    exact RingHom.FiniteType.of_surjective _
      (Scheme.ΓSpecIso ↧ℂ).symm.commRingCatIsoToRingEquiv.surjective
  let Q : Ideal Γ(Support.cycleComponent X.left x, W) :=
    (hW.primeIdealOf zw).asIdeal
  have hQmax : Q.IsMaximal := hW.primeIdealOf_isMaximal_of_isClosed
    zw hz
  have hQheight : (↑Q.height : WithBot ℕ∞) = d - p := by
    rw [ComponentClosedPointDimension.Algebra.FiniteType.height_eq_ringKrullDim_of_isMaximal
      (k := ℂ) Q, hringW]
  have hQcoheight : Q.height = Order.coheight z := by
    calc
      Q.height = Order.coheight zw := by
        change (hW.primeIdealOf zw).asIdeal.height = Order.coheight zw
        exact (AlgebraicGeometry.Smooth.PointwiseDimension.IsAffineOpen.primeIdealOf_height_eq_coheight hW) _
      _ = Order.coheight z := by
        have h := coheight_eq_of_isOpenImmersion
          (x := zw) W.ι
        simpa [zw] using h.symm
  apply WithBot.coe_injective
  rw [← hQcoheight]
  exact hQheight

end

end OAI.AlgebraicGeometry.Cycle.ComponentClosedPointDimension