Stafford38/Geometry/ConormalPrincipalOpenDensity.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Mathlib.RingTheory.Nullstellensatz
3 public import Stafford38.Geometry.AffineConormalClosure
4 
5 @[expose] public section
6 
7 /-!
8 # Density of the equation conormal over a principal open
9 
10 The first lemma is the algebraic Nullstellensatz/primality core used by the
11 principal-open density argument.  The conormal-specific graph construction is
12 kept as a separate theorem below, so its hypotheses and its use of the
13 equation-defined conormal are visible at the call site.
14 -/
15 
16 namespace Stafford38.Geometry.ConormalPrincipalOpenDensity
17 
18 open Stafford38.Characteristic
19 open Stafford38.Geometry.AffineConormalClosure
20 open Stafford38.Geometry.AffineConormalSpan
21 open Stafford38.Geometry.CoisotropicTranslation
22 
23 noncomputable section
24 
25 variable {k : Type*} [Field k] [IsAlgClosed k] {n : ℕ}
26 
27 theorem mem_of_vanishes_on_principal_open
28     (I : Ideal (MvPolynomial (Fin n) k)) (hI : I.IsPrime)
29     {f p : MvPolynomial (Fin n) k} (hf : f ∉ I)
30     (hp : ∀ y : Fin n → k, y ∈ MvPolynomial.zeroLocus k I →
31       MvPolynomial.eval y f ≠ 0 → MvPolynomial.eval y p = 0) :
32     p ∈ I := by
33   have hfp : f * p ∈ MvPolynomial.vanishingIdeal k
34       (MvPolynomial.zeroLocus k I) := by
35     rw [MvPolynomial.mem_vanishingIdeal_iff]
36     intro y hy
37     by_cases hfy : MvPolynomial.eval y f = 0
38     · simp [hfy]
39     · rw [map_mul]
40       change MvPolynomial.eval y f * MvPolynomial.eval y p = 0
41       rw [hp y hy hfy]
42       simp
43   letI : I.IsPrime := hI
44   have hfpI : f * p ∈ I := by
45     rw [MvPolynomial.IsPrime.vanishingIdeal_zeroLocus I] at hfp
46     exact hfp
47   rcases hI.mem_or_mem hfpI with hfi | hpi
48   · exact False.elim (hf hfi)
49   · exact hpi
50 
51 def restrictedEquationConormalLocus
52     (I : Ideal (MvPolynomial (Fin n) k)) (S : Set (Fin n → k)) :
53     Set (PhaseVar n → k) :=
54   {q | q ∈ equationConormalLocus I ∧
55     (fun i => q (Sum.inl i)) ∈ S}
56 
57 theorem restricted_subset_equationConormalLocus
58     (I : Ideal (MvPolynomial (Fin n) k)) (S : Set (Fin n → k)) :
59     restrictedEquationConormalLocus I S ⊆ equationConormalLocus I := by
60   intro q hq
61   exact hq.1
62 
63 /-- A covector in the equation conormal is the gradient of one equation of
64 the ideal; finite linear combinations can be absorbed into that equation. -/
65 theorem exists_equation_with_differentialAt_eq
66     (I : Ideal (MvPolynomial (Fin n) k)) (y ξ : Fin n → k)
67     (hξ : coordinateCovector ξ ∈ affineConormalSpace y I) :
68     ∃ h ∈ I, ∀ i, differentialAt y h i = ξ i := by
69   classical
70   obtain ⟨c, hc⟩ :=
71     coordinate_mem_affineConormalSpace_exists_finsupp y ξ I hξ
72   let h : MvPolynomial (Fin n) k :=
73     ∑ p ∈ c.support, MvPolynomial.C (c p) * p.1
74   refine ⟨h, ?_, fun i => ?_⟩
75   · apply Ideal.sum_mem
76     intro p hp
77     exact I.mul_mem_left _ p.2
78   · rw [hc i]
79     simp only [h, differentialAt, map_sum, MvPolynomial.pderiv_mul,
80       MvPolynomial.pderiv_C, zero_mul, zero_add, MvPolynomial.eval_sum,
81       MvPolynomial.eval_mul, MvPolynomial.eval_C]
82 
83 def gradientGraphSubstitution (h : MvPolynomial (Fin n) k) :
84     SymbolRing k n →+* MvPolynomial (Fin n) k :=
85   MvPolynomial.eval₂Hom MvPolynomial.C
86     (Sum.elim MvPolynomial.X (fun i => MvPolynomial.pderiv i h))
87 
88 theorem eval_gradientGraphSubstitution
89     (h : MvPolynomial (Fin n) k) (P : SymbolRing k n) (y : Fin n → k) :
90     MvPolynomial.eval y (gradientGraphSubstitution h P) =
91       MvPolynomial.eval (Sum.elim y (differentialAt y h)) P := by
92   induction P using MvPolynomial.induction_on with
93   | C a => simp [gradientGraphSubstitution]
94   | add P Q hP hQ =>
95       simp only [gradientGraphSubstitution] at hP hQ
96       simp only [gradientGraphSubstitution, map_add, MvPolynomial.eval_add]
97       rw [hP, hQ]
98   | mul_X P i hP =>
99       simp only [gradientGraphSubstitution] at hP
100       rcases i with i | i
101       · simp only [gradientGraphSubstitution, map_mul, MvPolynomial.eval₂Hom_X',
102           Sum.elim_inl, MvPolynomial.eval_mul, MvPolynomial.eval_X]
103         rw [hP]
104       · simp only [gradientGraphSubstitution, map_mul, MvPolynomial.eval₂Hom_X',
105           Sum.elim_inr, MvPolynomial.eval_mul]
106         rw [hP]
107         simp [differentialAt]
108 
109 /-- Restricting the equation conormal to any subset containing the principal
110 open part of the prime base variety does not change its algebraic closure. -/
111 theorem equationConormalClosure_restricted_eq
112     (I : Ideal (MvPolynomial (Fin n) k)) (hI : I.IsPrime)
113     (f : MvPolynomial (Fin n) k) (hf : f ∉ I)
114     (S : Set (Fin n → k))
115     (hS : S ⊆ MvPolynomial.zeroLocus k I)
116     (hopen : ∀ y : Fin n → k, y ∈ MvPolynomial.zeroLocus k I →
117       MvPolynomial.eval y f ≠ 0 → y ∈ S) :
118     MvPolynomial.zeroLocus k
119         (MvPolynomial.vanishingIdeal k (restrictedEquationConormalLocus I S)) =
120       equationConormalClosure I := by
121   apply Set.Subset.antisymm
122   · exact zeroLocus_vanishingIdeal_mono_of_subset_zeroLocus
123       (restrictedEquationConormalLocus I S)
124       (MvPolynomial.vanishingIdeal k (equationConormalLocus I))
125       (fun q hq P hP => hP q hq.1)
126   · apply zeroLocus_vanishingIdeal_mono_of_subset_zeroLocus
127     intro q qlocus P hP
128     let y : Fin n → k := fun i => q (.inl i)
129     let ξ : Fin n → k := fun i => q (.inr i)
130     obtain ⟨h, hhI, hgrad⟩ :=
131       exists_equation_with_differentialAt_eq I y ξ qlocus.2
132     have hrho : gradientGraphSubstitution h P ∈ I := by
133       apply mem_of_vanishes_on_principal_open I hI hf
134       intro z hzI hzf
135       have hzS : z ∈ S := hopen z hzI hzf
136       have hgraph : Sum.elim z (differentialAt z h) ∈
137           restrictedEquationConormalLocus I S := by
138         refine ⟨⟨hzI, ?_⟩, hzS⟩
139         rw [affineConormalSpace_eq_equationCovectorSpan]
140         apply Submodule.subset_span
141         exact ⟨⟨h, hhI⟩, rfl⟩
142       rw [eval_gradientGraphSubstitution]
143       exact hP _ hgraph
144     have hyrho := qlocus.1 _ hrho
145     rw [eval_gradientGraphSubstitution] at hyrho
146     change MvPolynomial.eval (Sum.elim y (differentialAt y h)) P = 0 at hyrho
147     have hgradfun : differentialAt y h = ξ := funext hgrad
148     have hsplit : Sum.elim y ξ = q := by
149       funext i
150       rcases i with i | i <;> rfl
151     rw [hgradfun, hsplit] at hyrho
152     exact hyrho
153 
154 #print axioms exists_equation_with_differentialAt_eq
155 #print axioms equationConormalClosure_restricted_eq
156 
157 end
158 
159 end Stafford38.Geometry.ConormalPrincipalOpenDensity
160