Stafford38/FixedSourceChallengeTransport.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.FixedSourceStatement
3 public import Stafford38.ChallengeDefinitions
4 public import Mathlib.Order.Lattice.Nat
5 
6 /-!
7 # Transport for the Mathlib-only exact-source challenge
8 
9 `FixedSourceChallenge.lean` states the exact fixed-source theorem using only
10 Mathlib: the Weyl algebra is the `RingQuot` of the free algebra by the Weyl
11 commutator relation, the Bernstein filtration is the span of the images of the
12 ordered PBW words of bounded total degree, and the Bernstein degree of an
13 element is the least filtration level containing it.
14 
15 The challenge and this transport import their unique definitions from the
16 Mathlib-only `Stafford38.ChallengeDefinitions` module; this file does not
17 public import the placeholder challenge. It proves that the literal definitions
18 
19 agree with the substantive development:
20 
21 * the challenge quotient is definitionally the presented Weyl algebra
22   `Stafford38.WeylIteratedEquivalence.PresentedWeyl`;
23 * the challenge ordered words are the development's
24   `Stafford38.WeylPBW.presentedOrderedMonomial`;
25 * the challenge filtration is the development's Bernstein filtration
26   `Stafford38.WeylFiltration.bernsteinPiece`;
27 * the challenge degree is the development's checked PBW normal-form degree
28   `Stafford38.FixedSource.bernsteinDegree`;
29 * the two linear-coordinate predicates are definitionally the same.
30 
31 `FixedSourceSolution.lean` combines these identifications with the proved
32 theorem `Stafford38.universalFixedSourceStatement`. No degree and no
33 normal-form datum is supplied as a hypothesis anywhere.
34 -/
35 
36 @[expose] public section
37 
38 namespace Stafford38FixedSourceChallengeTransport
39 
40 open Stafford
41 open Stafford38.WeylPBW
42 open Stafford38.WeylFiltration
43 open Stafford38.WeylIteratedEquivalence
44 
45 universe u
46 
47 variable (k : Type u) [Field k]
48 
49 /-- The challenge quotient is the presented Weyl algebra, definitionally. -/
50 theorem weylAlg_eq (n : ℕ) :
51     Stafford38FixedSourceChallenge.WeylAlg k n = PresentedWeyl k n := rfl
52 
53 /-- The challenge generators are the presented generators, definitionally. -/
54 theorem generator_eq (n : ℕ) (i : Stafford38FixedSourceChallenge.PhaseVar n) :
55     Stafford38FixedSourceChallenge.generator k n i =
56       freeWeylGenerator (Matrix.J (Fin n) k) i := rfl
57 
58 theorem oldIndex_eq {n : ℕ} (i : Stafford38FixedSourceChallenge.PhaseVar n) :
59     Stafford38FixedSourceChallenge.oldIndex i =
60       Stafford38.WeylIteratedEquivalence.oldIndex i := by
61   cases i <;> rfl
62 
63 /-- Inserting an old free word and passing to the quotient agrees with the
64 development's rank-shift embedding of the old quotient. -/
65 theorem mkAlgHom_freeOldMap (n : ℕ)
66     (x : FreeAlgebra k (Stafford38FixedSourceChallenge.PhaseVar n)) :
67     RingQuot.mkAlgHom k
68         (Stafford38FixedSourceChallenge.relation (k := k) (n := n + 1)
69           (Matrix.J (Fin (n + 1)) k))
70         (Stafford38FixedSourceChallenge.freeOldMap k n x) =
71       previousWeylEmbedding k n
72         (RingQuot.mkAlgHom k
73           (Stafford38FixedSourceChallenge.relation (k := k) (n := n)
74             (Matrix.J (Fin n) k)) x) := by
75   have h :
76       (RingQuot.mkAlgHom k
77           (Stafford38FixedSourceChallenge.relation (k := k) (n := n + 1)
78             (Matrix.J (Fin (n + 1)) k))).comp
79           (Stafford38FixedSourceChallenge.freeOldMap k n) =
80         (previousWeylEmbedding k n).comp
81           (RingQuot.mkAlgHom k
82             (Stafford38FixedSourceChallenge.relation (k := k) (n := n)
83               (Matrix.J (Fin n) k))) := by
84     apply FreeAlgebra.hom_ext
85     funext i
86     simp only [Function.comp_apply, AlgHom.comp_apply,
87       Stafford38FixedSourceChallenge.freeOldMap, FreeAlgebra.lift_ι_apply]
88     change freeWeylGenerator (Matrix.J (Fin (n + 1)) k)
89         (Stafford38FixedSourceChallenge.oldIndex i) =
90       previousWeylEmbedding k n (freeWeylGenerator (Matrix.J (Fin n) k) i)
91     rw [previousWeylEmbedding_generator, oldIndex_eq]
92     rfl
93   exact DFunLike.congr_fun h x
94 
95 /-- The challenge ordered words are the development's ordered PBW words. -/
96 theorem orderedMonomial_eq :
97     ∀ (n : ℕ) (a p : Fin n → ℕ),
98       Stafford38FixedSourceChallenge.orderedMonomial k n a p =
99         presentedOrderedMonomial k n a p := by
100   intro n
101   induction n with
102   | zero =>
103       intro a p
104       simp only [Stafford38FixedSourceChallenge.orderedMonomial,
105         Stafford38FixedSourceChallenge.freeOrderedMonomial,
106         presentedOrderedMonomial, map_one]
107   | succ n ih =>
108       intro a p
109       have htail := ih (fun i => a i.succ) (fun i => p i.succ)
110       rw [Stafford38FixedSourceChallenge.orderedMonomial] at htail
111       simp only [Stafford38FixedSourceChallenge.orderedMonomial,
112         Stafford38FixedSourceChallenge.freeOrderedMonomial, map_mul, map_pow,
113         presentedOrderedMonomial]
114       rw [mkAlgHom_freeOldMap, htail]
115       rfl
116 
117 /-- The Bernstein weight of a split exponent is the challenge's total phase
118 degree. -/
119 theorem monomialWeight_bernstein_phaseExponent {n : ℕ} (a p : Fin n → ℕ) :
120     monomialWeight (@bernsteinWeight n) (phaseExponent a p) =
121       Stafford38FixedSourceChallenge.phaseDegree a p := by
122   unfold monomialWeight bernsteinWeight Stafford38FixedSourceChallenge.phaseDegree
123   rw [Finsupp.sum_fintype _ _ (fun _ => by simp)]
124   simp [Fintype.sum_sum_type]
125 
126 /-- The challenge filtration is the development's Bernstein filtration. -/
127 theorem bernsteinPiece_eq (n N : ℕ) :
128     Stafford38FixedSourceChallenge.bernsteinPiece k n N =
129       Stafford38.WeylFiltration.bernsteinPiece k n N := by
130   rw [Stafford38FixedSourceChallenge.bernsteinPiece,
131     Stafford38.WeylFiltration.bernsteinPiece, presentedWeightPiece_eq_span]
132   congr 1
133   ext z
134   simp only [presentedWeightBasisSet, Set.mem_ofPred_eq]
135   constructor
136   · rintro ⟨a, p, hdeg, rfl⟩
137     refine ⟨phaseExponent a p, ?_, ?_⟩
138     · rw [monomialWeight_bernstein_phaseExponent]
139       exact hdeg
140     · rw [presentedPBWBasis_apply, orderedMonomial_eq]
141       rfl
142   · rintro ⟨m, hdeg, rfl⟩
143     refine ⟨fun i => m (.inl i), fun i => m (.inr i), ?_, ?_⟩
144     · rw [← monomialWeight_bernstein_phaseExponent, phaseExponent_split]
145       exact hdeg
146     · rw [presentedPBWBasis_apply, orderedMonomial_eq]
147 
148 /-- The challenge's intrinsic degree is the development's checked PBW
149 normal-form degree. -/
150 theorem bernsteinDegree_eq {n : ℕ} (d : PresentedWeyl k n) :
151     Stafford38FixedSourceChallenge.bernsteinDegree k d =
152       Stafford38.FixedSource.bernsteinDegree k d := by
153   have hmem' : d ∈ presentedWeightPiece k (@bernsteinWeight n)
154       (Stafford38.FixedSource.bernsteinDegree k d) :=
155     (mem_presentedWeightPiece k _ _ d).mpr fun m hm =>
156       MvPolynomial.le_weightedTotalDegree _
157         (MvPolynomial.mem_support_iff.mpr hm)
158   have hmem : d ∈ Stafford38FixedSourceChallenge.bernsteinPiece k n
159       (Stafford38.FixedSource.bernsteinDegree k d) := by
160     rw [bernsteinPiece_eq]
161     exact hmem'
162   have hle : ∀ N, d ∈ Stafford38FixedSourceChallenge.bernsteinPiece k n N →
163       Stafford38.FixedSource.bernsteinDegree k d ≤ N := by
164     intro N hN
165     rw [bernsteinPiece_eq] at hN
166     have hN' : d ∈ presentedWeightPiece k (@bernsteinWeight n) N := hN
167     rw [mem_presentedWeightPiece] at hN'
168     apply Finset.sup_le
169     intro m hm
170     exact hN' m (MvPolynomial.mem_support_iff.mp hm)
171   apply le_antisymm
172   · exact Nat.sInf_le hmem
173   · exact le_csInf ⟨_, hmem⟩ hle
174 
175 /-- The two linear symplectic coordinate predicates are definitionally the
176 same. -/
177 theorem isLinearWeylCoordinate_iff (n : ℕ)
178     (ell : Stafford38FixedSourceChallenge.WeylAlg k (n + 1)) :
179     Stafford38FixedSourceChallenge.IsLinearWeylCoordinate k n ell ↔
180       Stafford38.FixedSource.IsLinearWeylCoordinate k n ell :=
181   Iff.rfl
182 
183 /-- The literal fixed-source challenge and the substantive exact-source
184 proposition are equivalent, including the intrinsic degree and source
185 coordinate clauses. -/
186 theorem universalFixedSourceStatement_iff :
187     Stafford38FixedSourceChallenge.UniversalFixedSourceStatement.{u} ↔
188       Stafford38.FixedSource.UniversalFixedSourceStatement.{u} := by
189   constructor
190   · intro h k _ _ n d hd
191     obtain ⟨ell, R, S, hcoord, hcert⟩ := h k n d hd
192     have hdeg := bernsteinDegree_eq (k := k) d
193     refine ⟨ell, R, S,
194       (isLinearWeylCoordinate_iff (k := k) n ell).mp hcoord, ?_⟩
195     rw [hdeg] at hcert
196     exact hcert
197   · intro h k _ _ n d hd
198     obtain ⟨ell, R, S, hcoord, hcert⟩ := h k n d hd
199     have hdeg := bernsteinDegree_eq (k := k) d
200     refine ⟨ell, R, S,
201       (isLinearWeylCoordinate_iff (k := k) n ell).mpr hcoord, ?_⟩
202     change 1 = d * R + ell ^ Stafford38.FixedSource.bernsteinDegree k d * d * S at hcert
203     rw [← hdeg] at hcert
204     exact hcert
205 
206 #print axioms orderedMonomial_eq
207 #print axioms bernsteinPiece_eq
208 #print axioms bernsteinDegree_eq
209 #print axioms isLinearWeylCoordinate_iff
210 #print axioms universalFixedSourceStatement_iff
211 
212 end Stafford38FixedSourceChallengeTransport
213