Yang–Mills: the 2026 Lean construction, rerun and read; the mass gap still open
OpenAI's 2026 Lean construction of 4D Yang–Mills as the expert group keeps it: settle what it proves, rerun it, read it; uniqueness and the mass gap are open, and Clay's problem unsolved

| 1 | import YM.Lattice.Site |
| 2 | import Mathlib.Tactic.Abel |
| 3 | import Mathlib.Tactic.Group |
| 4 | |
| 5 | /-! |
| 6 | # Wilson paths |
| 7 | |
| 8 | Works at arbitrary scale and on the lattice cover, using the actual directed |
| 9 | step conventions. |
| 10 | |
| 11 | Longer kernels keep (path) labels on the cover rather than |
| 12 | measuring just the distance on the torus. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | namespace YM.Lattice |
| 17 | |
| 18 | open Set |
| 19 | |
| 20 | /-- Link arrays with positive orientations only. -/ |
| 21 | abbrev Links (R K : Type*) := Edge (Four R) → K |
| 22 | |
| 23 | structure Step where |
| 24 | dir : Axis |
| 25 | neg : Bool |
| 26 | deriving DecidableEq |
| 27 | abbrev Walk := List Step |
| 28 | |
| 29 | def posDir (i : Axis) : Step := ⟨i,false⟩ |
| 30 | def negDir (i : Axis) : Step := ⟨i,true⟩ |
| 31 | def Step.vec {R : Type*} [AddGroup R] [One R] (d : Step) : Four R := |
| 32 | if d.neg then - step d.dir else step d.dir |
| 33 | |
| 34 | def Step.rev (d : Step) : Step := ⟨d.dir,!d.neg⟩ |
| 35 | def Step.rotate (d : Step) (s : Signed) : Step := |
| 36 | ⟨s.perm d.dir,(d.neg).xor (s.flip d.dir)⟩ |
| 37 | |
| 38 | @[simp] theorem Step.rev_pos (i : Axis) : (posDir i).rev = negDir i := rfl |
| 39 | @[simp] theorem Step.rev_neg (i : Axis) : (negDir i).rev = posDir i := rfl |
| 40 | |
| 41 | @[simp] theorem Step.rotate_one (d : Step) : d.rotate 1 = d := by |
| 42 | rcases d with ⟨i,h|h⟩ <;> rfl |
| 43 | |
| 44 | theorem Step.rev_rotate (d : Step) (s : Signed) : d.rev.rotate s = (d.rotate s).rev := by |
| 45 | rcases d with ⟨i,h|h⟩ <;> simp [rotate, rev] |
| 46 | |
| 47 | theorem Step.rotate_mul (d : Step) (s t : Signed) : |
| 48 | (d.rotate t).rotate s = d.rotate (s*t) := by |
| 49 | unfold rotate |
| 50 | rw [Signed.mul_perm_apply]; simp [Signed.mul_flip, Bool.xor_comm (t.flip _)] |
| 51 | |
| 52 | variable {R K : Type*} [AddCommGroup R] [One R] |
| 53 | |
| 54 | /-- Step's displacement transforms by the same signed permutation. -/ |
| 55 | theorem Step.vec_rotate (d : Step) (s : Signed) : (d.rotate s).vec (R := R) = s.act d.vec := by |
| 56 | rcases d with ⟨i,t⟩ |
| 57 | funext j |
| 58 | obtain ⟨k,rfl⟩ := s.perm.surjective j |
| 59 | rw [Signed.act_at] |
| 60 | by_cases h : k = i |
| 61 | · subst i |
| 62 | cases hh : s.flip k <;> cases t <;> simp [vec, rotate, hh] |
| 63 | · cases hh : s.flip k <;> cases hh' : s.flip i <;> cases t <;> simp [vec, rotate, hh', h] |
| 64 | |
| 65 | def Step.used (d : Step) (x : Four R) : Edge (Four R) := |
| 66 | if d.neg then (x - step d.dir,d.dir) else (x,d.dir) |
| 67 | |
| 68 | /-- Step backwards returns to the same site. -/ |
| 69 | theorem Step.vec_rev (d : Step) : d.rev.vec = -(d.vec : Four R) := by |
| 70 | rcases d with ⟨i,h|h⟩ <;> simp [vec, rev] |
| 71 | |
| 72 | def stop (x : Four R) : Walk → Four R |
| 73 | | [] => x |
| 74 | | d::w => stop (x+d.vec) w |
| 75 | |
| 76 | def visits (x : Four R) : Walk → List (Four R) |
| 77 | | [] => [x] |
| 78 | | d::w => x :: visits (x+d.vec) w |
| 79 | |
| 80 | theorem stop_append (x : Four R) (a b : Walk) : stop x (a++b) = stop (stop x a) b := by |
| 81 | induction a generalizing x <;> simp_all [stop] |
| 82 | |
| 83 | @[simp] theorem Step.vec_pos (i : Axis) : ((posDir i).vec : Four R) = step i := rfl |
| 84 | @[simp] theorem Step.vec_neg (i : Axis) : ((negDir i).vec : Four R) = - step i := rfl |
| 85 | |
| 86 | def square (i j : Axis) : Walk := [posDir i,posDir j,negDir i,negDir j] |
| 87 | |
| 88 | @[simp] theorem square_stop (x : Four R) (i j : Axis) : stop x (square i j) = x := by |
| 89 | simp [stop, square]; abel |
| 90 | |
| 91 | variable [Group K] |
| 92 | |
| 93 | def Step.read (d : Step) (U : Links R K) (x : Four R) : K := |
| 94 | if d.neg then (U (d.used x))⁻¹ else U (d.used x) |
| 95 | |
| 96 | @[simp] theorem Step.pos_read (U : Links R K) (x : Four R) (i : Axis) : |
| 97 | (posDir i).read U x = U (x,i) := rfl |
| 98 | @[simp] theorem Step.neg_read (U : Links R K) (x : Four R) (i : Axis) : |
| 99 | (negDir i).read U x = (U (x-step i,i))⁻¹ := rfl |
| 100 | |
| 101 | @[simp] theorem Step.read_rev (d : Step) (U : Links R K) (x : Four R) : |
| 102 | d.rev.read U (x + d.vec) = (d.read U x)⁻¹ := by |
| 103 | rcases d with ⟨i,n|n⟩ <;> simp [read, vec, used, rev, sub_eq_add_neg] |
| 104 | |
| 105 | def travel (U : Links R K) (x : Four R) : Walk → K |
| 106 | | [] => 1 |
| 107 | | d::w => d.read U x * travel U (x + d.vec) w |
| 108 | |
| 109 | theorem travel_append (U : Links R K) (x : Four R) (a b : Walk) : |
| 110 | travel U x (a++b) = travel U x a * travel U (stop x a) b := by |
| 111 | induction a generalizing x <;> simp_all [travel, stop, mul_assoc] |
| 112 | |
| 113 | def reverse (a : Walk) : Walk := a.reverse.map Step.rev |
| 114 | |
| 115 | theorem reverse_stop (a : Walk) (x : Four R) : stop (stop x a) (reverse a) = x := by |
| 116 | induction a generalizing x with |
| 117 | | nil => simp [stop, reverse] |
| 118 | | cons d p ih => |
| 119 | simp only [reverse, List.reverse_cons, List.map_append, List.map_cons, List.map_nil, stop] |
| 120 | rw [stop_append, show List.map Step.rev _ = reverse p from rfl, ih]; simp [stop, Step.vec_rev] |
| 121 | |
| 122 | theorem travel_reverse (a : Walk) (U : Links R K) (x : Four R) : |
| 123 | travel U (stop x a) (reverse a) = (travel U x a)⁻¹ := by |
| 124 | induction a generalizing x with |
| 125 | | nil => simp [travel, reverse] |
| 126 | | cons d p ih => |
| 127 | simp only [reverse, List.reverse_cons, List.map_append, List.map_cons, List.map_nil, stop] |
| 128 | rw [travel_append, show List.map Step.rev _ = reverse p from rfl, ih, reverse_stop] |
| 129 | simp [travel] |
| 130 | |
| 131 | /-- Pull under a vertex gauge rotation, including the inverse at the *final* site. -/ |
| 132 | def gauge (t : Four R → K) (U : Links R K) : Links R K := fun e => |
| 133 | t e.1 * U e * (t (e.1 + step e.2))⁻¹ |
| 134 | |
| 135 | def GaugeInvariant {X : Type*} (f : Links R K → X) : Prop := ∀ t U, f (gauge t U) = f U |
| 136 | |
| 137 | theorem Step.gauge_read (d : Step) (t : Four R → K) (U : Links R K) (x : Four R) : |
| 138 | d.read (gauge t U) x = t x * d.read U x * (t (x+d.vec))⁻¹ := by |
| 139 | rcases d with ⟨i,h|h⟩ <;> simp [vec, read, used, gauge, mul_assoc, sub_eq_add_neg] |
| 140 | |
| 141 | theorem travel_gauge (t : Four R → K) (U : Links R K) (x : Four R) (w : Walk) : |
| 142 | travel (gauge t U) x w = t x * travel U x w * (t (stop x w))⁻¹ := by |
| 143 | induction w generalizing x <;> simp_all [travel, stop, Step.gauge_read, mul_assoc] |
| 144 | |
| 145 | def affine (s : Signed) (b x : Four R) : Four R := s.act x + b |
| 146 | |
| 147 | def pull (s : Signed) (b : Four R) (U : Links R K) : Links R K := |
| 148 | fun e => ((posDir e.2).rotate s).read U (affine s b e.1) |
| 149 | |
| 150 | theorem Step.pull_read (d : Step) (U : Links R K) (s : Signed) (b x : Four R) : |
| 151 | d.read (pull s b U) x = (d.rotate s).read U (affine s b x) := by |
| 152 | rcases d with ⟨a,h|h⟩ |
| 153 | · rfl |
| 154 | change (negDir a).read _ _ = ((posDir a).rev.rotate s).read _ _ |
| 155 | rw [Step.neg_read, rev_rotate, pull] |
| 156 | rw [show affine s b x = affine s b (x-step a) + ((posDir a).rotate s).vec by |
| 157 | rw [Step.vec_rotate, Step.vec_pos]; simp only [affine, s.act_sub]; abel] |
| 158 | rw [read_rev] |
| 159 | |
| 160 | theorem travel_pull (w : Walk) (U : Links R K) (s : Signed) (x b) : |
| 161 | travel (pull s b U) x w = travel U (affine s b x) (w.map (·.rotate s)) := by |
| 162 | induction w generalizing x with |
| 163 | | nil => simp [travel] |
| 164 | | cons d w ih => |
| 165 | simp only [travel, List.map_cons, ih, Step.pull_read] |
| 166 | rw [Step.vec_rotate, show affine s b (x+d.vec) = affine s b x + s.act d.vec by |
| 167 | rw [affine, affine, Signed.act_add]; abel] |
| 168 | |
| 169 | @[simp] theorem pull_id (U : Links R K) : pull 1 0 U = U := by |
| 170 | ext ⟨x,i⟩ |
| 171 | simp [pull, affine] |
| 172 | |
| 173 | theorem pull_pull (s t : Signed) (a b) (U : Links R K) : |
| 174 | pull t b (pull s a U) = pull (s*t) (affine s a b) U := by |
| 175 | funext e |
| 176 | rcases e with ⟨x,i⟩ |
| 177 | change ((posDir i).rotate t).read (pull s a U) _ = ((posDir i).rotate (s*t)).read U _ |
| 178 | rw [Step.pull_read, Step.rotate_mul, show affine s a (affine t b x) = affine (s*t) (affine s a b) x by |
| 179 | simp [affine, Signed.act_mul, add_assoc]] |
| 180 | |
| 181 | /-- Translations with `translate b U` at `x` equal to `U` at `x+b`. -/ |
| 182 | def translate (b : Four R) (U : Links R K) : Links R K := fun e => U (e.1+b,e.2) |
| 183 | |
| 184 | theorem pull_one (b : Four R) (U : Links R K) : pull 1 b U = translate b U := by |
| 185 | funext e |
| 186 | simp [pull, affine, translate] |
| 187 | |
| 188 | /-! Locality and wrap. -/ |
| 189 | section |
| 190 | omit [Group K] |
| 191 | |
| 192 | def Agrees (X : Set (Four R)) (U V : Links R K) : Prop := ∀ (e : Edge (Four R)), |
| 193 | e.1 ∈ X → e.1 + step e.2 ∈ X → U e = V e |
| 194 | |
| 195 | /-- When the underlying lattice changes, use ALL read endpoints. -/ |
| 196 | def LocalOn {B : Type*} (X : Set (Four R)) (F : Links R K → B) : Prop := |
| 197 | ∀ U V, Agrees X U V → F U = F V |
| 198 | end |
| 199 | |
| 200 | theorem travel_local (x : Four R) (w : Walk) : |
| 201 | LocalOn { y | y ∈ visits x w } fun U : Links R K => travel U x w := by |
| 202 | induction w generalizing x with |
| 203 | | nil => intro U V h; rfl |
| 204 | | cons d l ih => |
| 205 | intro U V h |
| 206 | have htail (y) (hy : y ∈ visits (x+d.vec) l) : y ∈ visits x (d::l) := |
| 207 | List.mem_cons_of_mem x hy |
| 208 | have hx : x ∈ visits x (d::l) := List.mem_cons_self |
| 209 | have hd : x+d.vec ∈ visits x (d::l) := htail _ (by cases l <;> simp [visits]) |
| 210 | change travel U x (d::l) = travel V x (d::l) |
| 211 | have hrest : travel U (x+d.vec) l = travel V (x+d.vec) l := |
| 212 | ih (x+d.vec) U V fun e he hh ↦ h e (htail _ he) (htail _ hh) |
| 213 | simp only [travel, hrest] |
| 214 | suffices d.read U x = d.read V x by rw [this] |
| 215 | rcases d with ⟨i,b|b⟩ |
| 216 | · exact h (x,i) hx hd |
| 217 | change (negDir i).read U x = (negDir i).read V x |
| 218 | rw [Step.neg_read, Step.neg_read, h (x - step i,i) ?_ ?_] |
| 219 | · simpa [sub_eq_add_neg, Step.vec] using hd |
| 220 | · simpa using hx |
| 221 | |
| 222 | variable {n : Side} |
| 223 | |
| 224 | def expandAt (b : Site n) (U : Links (Per n) K) : Links ℤ K := |
| 225 | fun e => U (wrap n e.1 + b,e.2) |
| 226 | |
| 227 | theorem expandAt_pull (b a : Site n) (s : Signed) (U : Links (Per n) K) : |
| 228 | expandAt b (pull s a U) = pull s 0 (expandAt (affine s a b) U) := by |
| 229 | funext e |
| 230 | rcases e with ⟨x,i⟩ |
| 231 | simp only [expandAt, pull, posDir, Step.rotate, Step.read, Step.used, |
| 232 | affine, Signed.act_add, add_zero, Bool.false_xor, wrap_signed] |
| 233 | split <;> simp [*, add_assoc] |
| 234 | congr 2 |
| 235 | abel |
| 236 | |
| 237 | theorem wrap_vec (n : Side) (d : Step) : wrap n (d.vec : Cover) = d.vec := by |
| 238 | rcases d with ⟨i,h|h⟩ <;> simp [Step.vec] |
| 239 | |
| 240 | theorem travel_at (b : Site n) (U : Links (Per n) K) (x : Cover) (w : Walk) : |
| 241 | travel (expandAt b U) x w = travel U (wrap n x + b) w := by |
| 242 | induction w generalizing x with |
| 243 | | nil => simp [travel] |
| 244 | | cons d w ih => |
| 245 | rw [travel, travel, ih, map_add, wrap_vec, show wrap n x + d.vec + b = wrap n x + b + d.vec by abel] |
| 246 | suffices d.read (expandAt b U) x = d.read U (wrap n x+b) by rw [this] |
| 247 | rcases d with ⟨i,h|h⟩ <;> simp [Step.read, Step.used, expandAt, sub_add_eq_add_sub] |
| 248 | |
| 249 | theorem expandAt_gauge (t : Site n → K) (U : Links (Per n) K) (b : Site n) : |
| 250 | expandAt b (gauge t U) = gauge (fun x => t (wrap n x+b)) (expandAt b U) := by |
| 251 | funext e; simp [expandAt, gauge, add_right_comm] |
| 252 | |
| 253 | omit [Group K] in |
| 254 | theorem LocalOn.expandAt {B : Type*} (X : Set Cover) (F : Links ℤ K → B) (h : LocalOn X F) |
| 255 | (b : Site n) : LocalOn ((fun x => wrap n x + b) '' X) |
| 256 | (F ∘ expandAt b) := by |
| 257 | intro U V hh |
| 258 | apply h |
| 259 | rintro ⟨x,i⟩ hx hi |
| 260 | apply hh (wrap n x+b,i) ⟨x,hx,rfl⟩ |
| 261 | exact ⟨x+step i, hi, by simp [add_right_comm]⟩ |
| 262 | |
| 263 | end YM.Lattice |