Stafford38/ChallengeDefinitions.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Mathlib.Algebra.RingQuot
3 public import Mathlib.Algebra.FreeAlgebra
4 public import Mathlib.LinearAlgebra.SymplecticGroup
5 public import Mathlib.Order.Lattice.Nat
6 
7 @[expose] public section
8 
9 /-!
10 # Shared Mathlib-only Stafford challenge definitions
11 
12 The challenge statements and the proof development use the same presented
13 Weyl algebra and certificate predicate. This file is the single owner of that
14 presentation, the generic single-element conclusion, the right-torsion
15 predicate, and the literal fixed-source challenge definitions. It imports no
16 proof module and no challenge theorem with a placeholder, so both solution files can
17 use it directly.
18 -/
19 
20 namespace Stafford
21 
22 variable {k A ι : Type*} [Field k] [Ring A] [Algebra k A]
23   [Fintype ι] [DecidableEq ι]
24 
25 /-- Linear combination of an indexed family by the rows of a matrix. -/
26 def linearCombination (M : Matrix ι ι k) (z : ι → A) (i : ι) : A :=
27   ∑ j, algebraMap k A (M i j) * z j
28 
29 variable {k ι : Type*} [Field k]
30 
31 /-- The commutator relations presenting a Weyl-type algebra. -/
32 def freeWeylRelation (omega : Matrix ι ι k)
33     (a b : FreeAlgebra k ι) : Prop :=
34   ∃ i j,
35     a = FreeAlgebra.ι k i * FreeAlgebra.ι k j -
36       FreeAlgebra.ι k j * FreeAlgebra.ι k i ∧
37     b = algebraMap k (FreeAlgebra k ι) (omega i j)
38 
39 /-- The free algebra modulo the commutator relations encoded by `omega`. -/
40 abbrev FreeWeyl (k : Type*) [Field k] (ι : Type*)
41     (omega : Matrix ι ι k) := RingQuot (freeWeylRelation omega)
42 
43 /-- The canonical generators of the presented Weyl-type algebra. -/
44 def freeWeylGenerator (omega : Matrix ι ι k) (i : ι) : FreeWeyl k ι omega :=
45   RingQuot.mkAlgHom k (freeWeylRelation omega) (FreeAlgebra.ι k i)
46 
47 end Stafford
48 
49 namespace Stafford
50 namespace Reduction
51 
52 variable {k A : Type*} [Field k] [Ring A] [Algebra k A]
53 
54 /-- Stafford 3.8 for one element, in written operator order. -/
55 def Stafford38 (e : A) : Prop := ∃ F R S : A, (1 : A) = e * R + F * e * S
56 
57 end Reduction
58 end Stafford
59 
60 namespace Stafford38Challenge
61 
62 universe u
63 
64 /-- Index type of the coordinate and momentum generators. -/
65 abbrev PhaseVar (n : ℕ) := Fin n ⊕ Fin n
66 
67 /-- The Weyl commutator relation for the standard symplectic matrix. -/
68 abbrev relation {k : Type*} [Field k] {n : ℕ}
69     (omega : Matrix (PhaseVar n) (PhaseVar n) k)
70     (a b : FreeAlgebra k (PhaseVar n)) : Prop :=
71   Stafford.freeWeylRelation omega a b
72 
73 /-- The standard presented Weyl algebra, shared with the substantive proof. -/
74 abbrev WeylAlg (k : Type*) [Field k] (n : ℕ) :=
75   Stafford.FreeWeyl k (PhaseVar n) (Matrix.J (Fin n) k)
76 
77 /-- Stafford's Conjecture 3.8 in its intended nonzero form. -/
78 def UniversalStatement : Prop :=
79   ∀ (k : Type u) [Field k] [CharZero k] (n : ℕ) (d : WeylAlg k n),
80     d ≠ 0 → Stafford.Reduction.Stafford38 d
81 
82 /-- A named generator in the canonical presentation. -/
83 abbrev generator (k : Type*) [Field k] (n : ℕ) (i : PhaseVar n) : WeylAlg k n :=
84   Stafford.freeWeylGenerator (Matrix.J (Fin n) k) i
85 
86 /-- The standard symplectic form used for the fixed-source coordinate. -/
87 abbrev standardForm (k : Type*) [Field k] (n : ℕ) :
88     Matrix (PhaseVar n) (PhaseVar n) k := Matrix.J (Fin n) k
89 
90 end Stafford38Challenge
91 
92 namespace Stafford38FixedSourceChallenge
93 
94 universe u
95 
96 /-- The fixed-source challenge uses the same phase variables and Weyl
97 presentation as the ordinary challenge. -/
98 abbrev PhaseVar (n : ℕ) := Stafford38Challenge.PhaseVar n
99 
100 abbrev relation {k : Type u} [Field k] {n : ℕ}
101     (omega : Matrix (PhaseVar n) (PhaseVar n) k)
102     (a b : FreeAlgebra k (PhaseVar n)) : Prop :=
103   Stafford38Challenge.relation omega a b
104 
105 abbrev WeylAlg (k : Type u) [Field k] (n : ℕ) :=
106   Stafford38Challenge.WeylAlg k n
107 
108 abbrev generator (k : Type u) [Field k] (n : ℕ) (i : PhaseVar n) : WeylAlg k n :=
109   Stafford38Challenge.generator k n i
110 
111 /-- Insert an old phase variable after the newest coordinate or momentum. -/
112 def oldIndex {n : ℕ} : PhaseVar n → PhaseVar (n + 1)
113   | .inl i => .inl i.succ
114   | .inr i => .inr i.succ
115 
116 @[simp] theorem oldIndex_inl {n : ℕ} (i : Fin n) :
117     oldIndex (.inl i) = .inl i.succ := rfl
118 
119 @[simp] theorem oldIndex_inr {n : ℕ} (i : Fin n) :
120     oldIndex (.inr i) = .inr i.succ := rfl
121 
122 /-- Insert an old free-algebra word into the next-rank free algebra. -/
123 def freeOldMap (k : Type u) [Field k] (n : ℕ) :
124     FreeAlgebra k (PhaseVar n) →ₐ[k] FreeAlgebra k (PhaseVar (n + 1)) :=
125   FreeAlgebra.lift k (fun i => FreeAlgebra.ι k (oldIndex i))
126 
127 /-- Ordered PBW words, with old pairs followed by the newest pair. -/
128 def freeOrderedMonomial (k : Type u) [Field k] :
129     (n : ℕ) → (Fin n → ℕ) → (Fin n → ℕ) → FreeAlgebra k (PhaseVar n)
130   | 0, _, _ => 1
131   | n + 1, a, p =>
132       freeOldMap k n
133           (freeOrderedMonomial k n (fun i => a i.succ) (fun i => p i.succ)) *
134         FreeAlgebra.ι k (.inl (0 : Fin (n + 1))) ^ a 0 *
135         FreeAlgebra.ι k (.inr (0 : Fin (n + 1))) ^ p 0
136 
137 /-- The image of an ordered PBW word in the shared Weyl quotient. -/
138 def orderedMonomial (k : Type u) [Field k] (n : ℕ)
139     (a p : Fin n → ℕ) : WeylAlg k n :=
140   RingQuot.mkAlgHom k (relation (k := k) (n := n) (Matrix.J (Fin n) k))
141     (freeOrderedMonomial k n a p)
142 
143 /-- Total degree of a split coordinate/momentum exponent. -/
144 def phaseDegree {n : ℕ} (a p : Fin n → ℕ) : ℕ :=
145   (∑ i, a i) + ∑ i, p i
146 
147 /-- Span of the ordered Weyl words of total degree at most `N`. -/
148 def bernsteinPiece (k : Type u) [Field k] (n N : ℕ) :
149     Submodule k (WeylAlg k n) :=
150   Submodule.span k
151     {z | ∃ a p : Fin n → ℕ,
152       phaseDegree a p ≤ N ∧ z = orderedMonomial k n a p}
153 
154 /-- The intrinsic Bernstein degree of a presented element: its least piece. -/
155 noncomputable def bernsteinDegree (k : Type u) [Field k] {n : ℕ}
156     (d : WeylAlg k n) : ℕ :=
157   sInf {N : ℕ | d ∈ bernsteinPiece k n N}
158 
159 /-- The shared matrix-row combination used to name a linear source. -/
160 abbrev linearCombination (k : Type u) [Field k] {n : ℕ}
161     (M : Matrix (PhaseVar n) (PhaseVar n) k)
162     (z : PhaseVar n → WeylAlg k n) (i : PhaseVar n) : WeylAlg k n :=
163   Stafford.linearCombination M z i
164 
165 abbrev standardForm (k : Type u) [Field k] (n : ℕ) :
166     Matrix (PhaseVar n) (PhaseVar n) k := Stafford38Challenge.standardForm k n
167 
168 /-- A source coordinate obtained from an invertible symplectic linear change
169 of the canonical Weyl generators. -/
170 def IsLinearWeylCoordinate (k : Type u) [Field k] (n : ℕ)
171     (ell : WeylAlg k (n + 1)) : Prop :=
172   ∃ (M N : Matrix (PhaseVar (n + 1)) (PhaseVar (n + 1)) k)
173       (_hM : M * standardForm k (n + 1) * Matrix.transpose M =
174         standardForm k (n + 1))
175       (_hN : N * standardForm k (n + 1) * Matrix.transpose N =
176         standardForm k (n + 1))
177       (_hMN : M * N = 1) (_hNM : N * M = 1),
178       ell = linearCombination k N (generator k (n + 1))
179         (.inl (0 : Fin (n + 1)))
180 
181 /-- Shared template for the fixed-source proposition, parameterized only by
182 the chosen degree function. -/
183 def UniversalFixedSourceStatementWithDegree
184     (degree : ∀ (k : Type u) [Field k] {n : ℕ}, WeylAlg k n → ℕ) : Prop :=
185   ∀ (k : Type u) [Field k] [CharZero k] (n : ℕ)
186     (d : WeylAlg k (n + 1)), d ≠ 0 →
187       ∃ ell R S : WeylAlg k (n + 1),
188         IsLinearWeylCoordinate k n ell ∧
189           (1 : WeylAlg k (n + 1)) =
190             d * R + ell ^ degree k d * d * S
191 
192 /-- The exact fixed-source challenge, using the intrinsic degree. -/
193 abbrev UniversalFixedSourceStatement : Prop :=
194   UniversalFixedSourceStatementWithDegree.{u} bernsteinDegree
195 
196 end Stafford38FixedSourceChallenge
197 
198 namespace Stafford38.TorsionCyclicity
199 
200 universe u v
201 
202 /-- Every element of a right module is killed by some nonzero right scalar. -/
203 def IsRightTorsion {A : Type u} {M : Type v} [Ring A]
204     [AddCommGroup M] [Module Aᵐᵒᵖ M] : Prop :=
205   ∀ m : M, ∃ d : A, d ≠ 0 ∧ (MulOpposite.op d : Aᵐᵒᵖ) • m = 0
206 
207 end Stafford38.TorsionCyclicity
208 
209 namespace Stafford38Challenge
210 
211 universe u v
212 
213 /-- The generator `x₁` of `A_n(k)`, `n ≥ 1`. -/
214 abbrev x₁ (k : Type*) [Field k] {n : ℕ} (hn : 0 < n) : WeylAlg k n :=
215   generator k n (.inl ⟨0, hn⟩)
216 
217 /-- The linear map `g` on the generator space `V = span(x_1, …, ∂_n)`, given by
218 the rows of its matrix: `g(u_i) = ∑_j g_ij u_j`. -/
219 abbrev linearImage (k : Type*) [Field k] {n : ℕ}
220     (g : Matrix (PhaseVar n) (PhaseVar n) k) (i : PhaseVar n) : WeylAlg k n :=
221   Stafford.linearCombination g (generator k n) i
222 
223 /-- An `ω`-preserving `g` (`g J gᵀ = J`) preserves the Weyl relations
224 `[u_i, u_j] = J_ij`. -/
225 theorem linearImage_rel (k : Type*) [Field k] {n : ℕ}
226     (g : Matrix.symplecticGroup (Fin n) k) ⦃a b : FreeAlgebra k (PhaseVar n)⦄
227     (h : relation (Matrix.J (Fin n) k) a b) :
228     FreeAlgebra.lift k (linearImage k (g : Matrix (PhaseVar n) (PhaseVar n) k)) a =
229       FreeAlgebra.lift k (linearImage k (g : Matrix (PhaseVar n) (PhaseVar n) k)) b := by
230   obtain ⟨i, j, rfl, rfl⟩ := h
231   have hcomm : ∀ p q : PhaseVar n,
232       generator k n p * generator k n q - generator k n q * generator k n p =
233         algebraMap k (WeylAlg k n) (Matrix.J (Fin n) k p q) := by
234     intro p q
235     have := RingQuot.mkAlgHom_rel k
236       (show relation (Matrix.J (Fin n) k) _ _ from ⟨p, q, rfl, rfl⟩)
237     simpa [generator, Stafford.freeWeylGenerator, map_sub, map_mul] using this
238   have hg := (SymplecticGroup.mem_iff).mp g.2
239   -- Reversed simp lemmas (`← l`) would become helpers named after the compiling
240   -- module, so challenge and solution copies of this proof would differ.
241   have smul_def' : ∀ (c : k) (x : WeylAlg k n), algebraMap k (WeylAlg k n) c * x = c • x :=
242     fun c x => (Algebra.smul_def c x).symm
243   have sum_sub' : ∀ (s : Finset (PhaseVar n)) (f f' : PhaseVar n → WeylAlg k n),
244       ∑ p ∈ s, f p - ∑ p ∈ s, f' p = ∑ p ∈ s, (f p - f' p) :=
245     fun s f f' => (Finset.sum_sub_distrib f f').symm
246   have sum_algebraMap : ∀ (s : Finset (PhaseVar n)) (f : PhaseVar n → k),
247       ∑ p ∈ s, algebraMap k (WeylAlg k n) (f p) = algebraMap k (WeylAlg k n) (∑ p ∈ s, f p) :=
248     fun s f => (map_sum (algebraMap k (WeylAlg k n)) f s).symm
249   simp only [map_sub, map_mul, FreeAlgebra.lift_ι_apply, AlgHom.commutes, linearImage,
250     Stafford.linearCombination, smul_def', Finset.sum_mul, Finset.mul_sum,
251     smul_mul_smul_comm]
252   rw [Finset.sum_comm, ← Finset.sum_sub_distrib]
253   simp_rw [sum_sub']
254   have hterm : ∀ p q : PhaseVar n,
255       ((g : Matrix _ _ k) i p * (g : Matrix _ _ k) j q) • (generator k n p * generator k n q) -
256         ((g : Matrix _ _ k) j q * (g : Matrix _ _ k) i p) • (generator k n q * generator k n p) =
257       algebraMap k (WeylAlg k n)
258         ((g : Matrix _ _ k) i p * Matrix.J (Fin n) k p q * (g : Matrix _ _ k) j q) := by
259     intro p q
260     rw [mul_comm ((g : Matrix _ _ k) j q)]
261     rw [show ∀ (c : k) (x y : WeylAlg k n), c • x - c • y = c • (x - y) from
262       fun c x y => (smul_sub c x y).symm, hcomm, Algebra.smul_def, ← map_mul]
263     congr 1
264     ring
265   simp_rw [hterm, sum_algebraMap]
266   congr 1
267   conv_rhs => rw [← hg]
268   simp only [Matrix.mul_apply, Matrix.transpose_apply, Finset.sum_mul]
269   rw [Finset.sum_comm]
270 
271 /-- **`Φ_g`**: for a linear `ω`-preserving automorphism `g` of the generator
272 space (`g J gᵀ = J`, i.e. `g ∈ Sp(2n, k)`), the algebra automorphism of
273 `A_n(k)` extending `u_i ↦ g(u_i) = ∑_j g_ij u_j`.  Its inverse is
274 `Φ_g⁻¹ = Φ_{g⁻¹}`. -/
275 noncomputable def phiG (k : Type*) [Field k] (n : ℕ) (g : Matrix.symplecticGroup (Fin n) k) :
276     WeylAlg k n →ₐ[k] WeylAlg k n :=
277   RingQuot.liftAlgHom k
278     ⟨FreeAlgebra.lift k (linearImage k (g : Matrix (PhaseVar n) (PhaseVar n) k)),
279       fun _ _ h => linearImage_rel k g h⟩
280 
281 /-- A right module `M` is cyclic: `M = mA` for some `m ∈ M`. -/
282 def IsCyclicModule (A : Type u) (M : Type v) [Ring A] [AddCommGroup M] [Module Aᵐᵒᵖ M] :
283     Prop :=
284   ∃ m : M, ∀ x : M, ∃ a : A, x = MulOpposite.op a • m
285 
286 /-- **Theorem 1.1.**  For every field of characteristic zero `k`, every `n ≥ 0`
287 and every nonzero `d ∈ A_n(k)`, there exists an `F ∈ A_n(k)` such that
288 `A_n(k) = dA_n(k) + FdA_n(k)`, or equivalently, there exist `F, S, R ∈ A_n(k)`
289 such that `1 = dR + FdS`.  Moreover, if `n ≥ 1`, one may choose
290 `F = Φ_g^{-1}(x₁)^{deg_B d}` for a linear `ω`-preserving automorphism `g`. -/
291 def PaperTheorem_1_1 : Prop :=
292   ∀ (k : Type u) [Field k] [CharZero k] (n : ℕ) (d : WeylAlg k n), d ≠ 0 →
293     (∃ F : WeylAlg k n, (⊤ : Submodule (WeylAlg k n)ᵐᵒᵖ (WeylAlg k n)) =
294         Submodule.span (WeylAlg k n)ᵐᵒᵖ {d} ⊔ Submodule.span (WeylAlg k n)ᵐᵒᵖ {F * d}) ∧
295       (∃ F S R : WeylAlg k n, (1 : WeylAlg k n) = d * R + F * d * S) ∧
296       (∀ hn : 1 ≤ n, ∃ g : Matrix.symplecticGroup (Fin n) k, ∃ R S : WeylAlg k n,
297         (1 : WeylAlg k n) = d * R +
298           phiG k n g⁻¹ (x₁ k hn) ^ Stafford38FixedSourceChallenge.bernsteinDegree k d * d * S)
299 
300 /-- **Corollary 6.3** (Stafford 1978).  Every finitely generated torsion right
301 `A_n(k)`-module is cyclic. -/
302 def PaperCorollary_6_3 : Prop :=
303   ∀ (k : Type u) [Field k] [CharZero k] (n : ℕ) (M : Type v) [AddCommGroup M]
304     [Module (WeylAlg k n)ᵐᵒᵖ M] [Module.Finite (WeylAlg k n)ᵐᵒᵖ M],
305     Stafford38.TorsionCyclicity.IsRightTorsion (A := WeylAlg k n) (M := M) →
306       IsCyclicModule (WeylAlg k n) M
307 
308 end Stafford38Challenge
309