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.Next.PHASE.Passage |
| 2 | import YM.OS.Halves |
| 3 | |
| 4 | |
| 5 | /-! |
| 6 | # Pricing the train Gram from the mixed cell estimate |
| 7 | |
| 8 | Full reflected copies. There are just two main point patterns per slot (along |
| 9 | time, integral slab width at the chosen cell scale). The two exterior copies |
| 10 | need not fit the main-field margin; charge them to the exterior scale. No |
| 11 | positive arity condition in this part. Constants are paid independently of |
| 12 | how many replicas are being passed to the continuum. |
| 13 | -/ |
| 14 | set_option autoImplicit false |
| 15 | noncomputable section |
| 16 | namespace YM.Next.Phase |
| 17 | open Function Set Filter Extraction OS Word |
| 18 | open scoped NNReal Topology BigOperators Matrix.Norms.Frobenius |
| 19 | |
| 20 | variable {G : Gauge} {L : Register G} {r t : ℝ} {d e : ℝ≥0} {u v : L.Word} |
| 21 | |
| 22 | -- Membership-based spacing bookkeeping (use separately from Word.distinct). |
| 23 | private def apart (r : ℝ) (w : L.Word) := |
| 24 | ∀ x ∈ w, ∀ y ∈ w, x≠y → r ≤ cubedist x.1 y.1 |
| 25 | |
| 26 | private lemma from_buffer (h : buffer timeAxis r d u) : apart r u := by |
| 27 | intro x hx y hy he |
| 28 | obtain ⟨i,rfl⟩ := List.mem_iff_get.mp hx |
| 29 | obtain ⟨j,rfl⟩ := List.mem_iff_get.mp hy |
| 30 | exact h.1 i j fun p => he (congrArg _ p) |
| 31 | |
| 32 | private lemma apart_raise (h : apart r u) (d : ℝ≥0) : apart r (raised timeAxis d u) := by |
| 33 | intro x hx y hy he |
| 34 | obtain ⟨p,hp,rfl⟩ := List.mem_map.mp hx |
| 35 | obtain ⟨q,hq,rfl⟩ := List.mem_map.mp hy |
| 36 | dsimp only |
| 37 | unfold cubedist; rw [WithLp.ofLp_add,WithLp.ofLp_add,dist_add_right] |
| 38 | exact h _ hp _ hq (fun h => he (h ▸ rfl)) |
| 39 | |
| 40 | private lemma reflect_dist (x y : E4) : cubedist (Ortho.move (Signed.reflect timeAxis) x) |
| 41 | (Ortho.move (Signed.reflect timeAxis) y)=cubedist x y := by |
| 42 | unfold cubedist |
| 43 | have he i : dist (Ortho.move (Signed.reflect timeAxis) x i) (Ortho.move (Signed.reflect timeAxis) y i) = |
| 44 | dist (x i) (y i) := by by_cases h : i=timeAxis <;> simp [h] |
| 45 | apply le_antisymm <;> apply (dist_pi_le_iff dist_nonneg).mpr <;> intro i |
| 46 | · rw [he]; exact dist_le_pi_dist .. |
| 47 | rw [← he]; exact dist_le_pi_dist .. |
| 48 | |
| 49 | private lemma apart_reflect (h : apart r u) : apart r (reflect u timeAxis) := by |
| 50 | intro x hx y hy he |
| 51 | rw [reflectedPoint] at hx hy |
| 52 | obtain ⟨p,hp,rfl⟩ := List.mem_map.mp hx |
| 53 | obtain ⟨q,hq,rfl⟩ := List.mem_map.mp hy |
| 54 | dsimp only; rw [reflect_dist] |
| 55 | exact h _ (List.mem_reverse.mp hp) _ (List.mem_reverse.mp hq) (fun h => he (h ▸ rfl)) |
| 56 | |
| 57 | private lemma apart_join (hu : apart r u) (hv : apart r v) |
| 58 | (h : ∀ x ∈ u, ∀ y ∈ v, r ≤ cubedist x.1 y.1) : apart r (u++v) := by |
| 59 | intro x hx y hy he |
| 60 | rcases List.mem_append.mp hx with p|p <;> rcases List.mem_append.mp hy with q|q |
| 61 | · exact hu _ p _ q he |
| 62 | · exact h _ p _ q |
| 63 | · rw [show cubedist x.1 y.1=cubedist y.1 x.1 from dist_comm ..]; exact h _ q _ p |
| 64 | exact hv _ p _ q he |
| 65 | |
| 66 | private lemma gap_time (x y : E4) (h : r ≤ y timeAxis-x timeAxis) : r ≤ cubedist x y := by |
| 67 | have hr : dist (x timeAxis) (y timeAxis) ≤ cubedist x y := dist_le_pi_dist .. |
| 68 | rw [dist_comm,Real.dist_eq] at hr; exact h.trans ((le_abs_self _).trans hr) |
| 69 | |
| 70 | private def limits (r : ℝ) (d : ℝ≥0) (u : L.Word) := |
| 71 | apart r u ∧ ∀ p∈u, r ≤ p.1 timeAxis ∧ p.1 timeAxis ≤ (d:ℝ)-r |
| 72 | |
| 73 | private lemma across_link (hr : 0 ≤ r) (x : limits r d u) (y : limits r e v) : |
| 74 | limits r (d+e) (linked timeAxis d u v) := by |
| 75 | constructor |
| 76 | · apply apart_join x.1 (apart_raise y.1 d) |
| 77 | intro p hp q hq |
| 78 | obtain ⟨s,hs,rfl⟩ := List.mem_map.mp hq |
| 79 | have hw := (x.2 p hp).2; have he := (y.2 s hs).1 |
| 80 | apply gap_time |
| 81 | change r ≤ (s.1 + (d:ℝ) • basis _) timeAxis - _; simp; linarith |
| 82 | intro p hp |
| 83 | rcases List.mem_append.mp hp with h|h |
| 84 | · obtain ⟨H,j⟩ := x.2 p h; refine ⟨H,j.trans ?_⟩; simp |
| 85 | obtain ⟨s,hs,rfl⟩ := List.mem_map.mp h |
| 86 | obtain ⟨he,hh⟩ := y.2 s hs; simp; constructor <;> linarith [show (0:ℝ) ≤ (d:ℝ) from d.property] |
| 87 | |
| 88 | private lemma across_mirror (x : limits r d u) : limits r d (opposite timeAxis d u) := by |
| 89 | refine ⟨apart_raise (apart_reflect x.1) _,?_⟩ |
| 90 | intro p hp; obtain ⟨s,hs,rfl⟩ := List.mem_map.mp hp |
| 91 | rw [reflectedPoint] at hs; obtain ⟨t,ht,rfl⟩ := List.mem_map.mp hs |
| 92 | obtain ⟨h,w⟩ := x.2 t (List.mem_reverse.mp ht) |
| 93 | simp; constructor <;> linarith |
| 94 | |
| 95 | private def train (d : ℝ≥0) (w : L.Word) : ℕ → L.Word := |
| 96 | Nat.rec ([] : L.Word) (fun _ => linked timeAxis (d+d) (linked timeAxis d (opposite timeAxis d w) w)) |
| 97 | private lemma train_zero (w : L.Word) : train d w 0 = [] := rfl |
| 98 | private lemma train_next (w : L.Word) (q : ℕ) : |
| 99 | train d w (q+1)=linked timeAxis (d+d) (linked timeAxis d (opposite timeAxis d w) w) (train d w q) := rfl |
| 100 | |
| 101 | private def ends (d : ℝ≥0) (q : ℕ) := (d+d)*q |
| 102 | private lemma ends_next (q : ℕ) : ends d (q+1)=d+d+ends d q := by unfold ends; push_cast; ring |
| 103 | |
| 104 | private lemma train_buffer (q) (hr : 0 ≤ r) (hb : buffer timeAxis r d u) : limits r (ends d q) (train d u q) := by |
| 105 | induction q with |
| 106 | | zero => simp [train_zero,limits,apart] |
| 107 | | succ q ih => |
| 108 | have he : limits r d u := ⟨from_buffer hb,hb.2⟩ |
| 109 | rw [train_next,ends_next]; exact across_link hr (across_link hr (across_mirror he) he) ih |
| 110 | |
| 111 | private lemma train_length (w : L.Word) (q : ℕ) : (train d w q).length = 2*q*w.length := by |
| 112 | induction q with |
| 113 | | zero => simp [train_zero] |
| 114 | | succ q ih => |
| 115 | rw [train_next] |
| 116 | simp only [linked,List.length_append,opposite,raised,carry,List.length_map,reflectedPoint, |
| 117 | List.length_reverse,ih]; ring |
| 118 | |
| 119 | private lemma ride_train (H : Slab timeAxis d u) (v : Future L timeAxis) (q) : |
| 120 | (ride H v q).val = train d u q ++ raised timeAxis (ends d q) v.val := by |
| 121 | induction q with |
| 122 | | zero => simp [ride,train_zero,raised,ends] |
| 123 | | succ q ih => |
| 124 | rw [ride,iterate_succ_apply'] |
| 125 | change (entering (mirrorsSlab H) (entering H (ride H v q))).val=_ |
| 126 | change linked timeAxis _ _ (linked timeAxis _ _ (ride H v q).val)=_ |
| 127 | rw [ih,train_next,ends_next] |
| 128 | simp only [linked, raised, distribute, paths, NNReal.coe_add,add_smul,List.append_assoc] |
| 129 | abel_nf |
| 130 | |
| 131 | private def twins (w : L.Word) := reflect w timeAxis ++ w |
| 132 | |
| 133 | private lemma pair_length (w : L.Word) : (twins w).length = 2*w.length := by simp [twins,two_mul] |
| 134 | |
| 135 | private lemma pair_gap (hr : 0 ≤ r) (h : apart r u) (ht : ∀ p∈u, r ≤ p.1 timeAxis) : apart r (twins u) := by |
| 136 | apply apart_join (apart_reflect h) h |
| 137 | intro p hp q hq; rw [reflectedPoint] at hp |
| 138 | obtain ⟨s,hs,rfl⟩ := List.mem_map.mp hp |
| 139 | have he := ht s (List.mem_reverse.mp hs); have hh := ht q hq |
| 140 | apply gap_time; simp; linarith |
| 141 | |
| 142 | private lemma exterior_gap (v : L.Word) (b : buffer timeAxis t e v) (ht : 0 ≤ t) (d) : |
| 143 | apart t (twins (raised timeAxis d v)) := by |
| 144 | apply pair_gap ht (apart_raise (from_buffer b) d); intro x hx |
| 145 | obtain ⟨p,hp,rfl⟩ := List.mem_map.mp hx |
| 146 | have hh := (b.2 p hp).1; simp; linarith [show (0:ℝ) ≤ (d:ℝ) from d.property] |
| 147 | |
| 148 | private lemma cross_gap (v : Future L timeAxis) (hr : 0 ≤ r) (hx : limits r d u) (x) (h : x ∈ twins u) (y) |
| 149 | (he : y ∈ twins (raised timeAxis d v.val)) : r ≤ cubedist x.1 y.1 := by |
| 150 | have hm : -(d:ℝ) + r ≤ x.1 timeAxis ∧ x.1 timeAxis ≤ (d:ℝ)-r := by |
| 151 | rcases List.mem_append.mp h with h|h |
| 152 | · rw [reflectedPoint] at h; obtain ⟨s,hs,rfl⟩ := List.mem_map.mp h |
| 153 | obtain ⟨ha,hb⟩ := hx.2 _ (List.mem_reverse.mp hs) |
| 154 | simp; constructor <;> linarith |
| 155 | obtain ⟨ha,hb⟩ := hx.2 x h; constructor <;> linarith [d.property] |
| 156 | have hl (p) (hp : p∈raised timeAxis d v.val) : (d:ℝ) ≤ p.1 timeAxis := by |
| 157 | obtain ⟨q,hq,rfl⟩ := List.mem_map.mp hp |
| 158 | have hv := v.property.2 _ hq; simp; linarith |
| 159 | rcases List.mem_append.mp he with h|h |
| 160 | · rw [reflectedPoint] at h; obtain ⟨s,hs,rfl⟩ := List.mem_map.mp h |
| 161 | have hv := hl _ (List.mem_reverse.mp hs) |
| 162 | have hx : r ≤ x.1 timeAxis - Ortho.move (Signed.reflect timeAxis) s.1 timeAxis := by simp; linarith [hm.1] |
| 163 | exact (gap_time _ _ hx).trans_eq (dist_comm ..) |
| 164 | have hv := hl _ h; exact gap_time _ _ (by linarith [hm.2]) |
| 165 | |
| 166 | private lemma train_twins (h : Slab timeAxis d u) (v : Future L timeAxis) (q : ℕ) : |
| 167 | List.Perm (twins (ride h v q).val) (twins (train d u q) ++ twins (raised timeAxis (ends d q) v.val)) := by |
| 168 | rw [ride_train]; let s := train d u q; let w := raised timeAxis (ends d q) v.val |
| 169 | change List.Perm (reflect (s++w) _ ++ (s++w)) (twins s ++ twins w) |
| 170 | have hp : List.Perm (reflect w timeAxis ++ twins s) (twins s ++ reflect w timeAxis) := List.perm_append_comm |
| 171 | simpa [twins,List.append_assoc] using hp.append_right w |
| 172 | |
| 173 | private def suit (s : ℝ) (w u : L.Word) := ∀ p∈u, ∃ y∈twins w, Pattern s p.1 y.1 ∧ p.2=y.2 |
| 174 | |
| 175 | private lemma suit_init (w : L.Word) (s : ℝ) : suit s w w ∧ suit s w (reflect w timeAxis) := by |
| 176 | have he x (h : x∈twins w) : ∃ y∈twins w, Pattern s x.1 y.1 ∧ x.2=y.2 := ⟨_,h,fun a => ⟨0,by simp⟩,rfl⟩ |
| 177 | exact ⟨fun x h => he _ (List.mem_append_right _ h),fun x h => he _ (List.mem_append_left _ h)⟩ |
| 178 | |
| 179 | private lemma suit_raise (s : ℝ) (h : suit s u v) (l : ℕ) (hh : (d:ℝ) = l*s) : suit s u (raised timeAxis d v) := by |
| 180 | intro x hx; obtain ⟨p,hp,rfl⟩ := List.mem_map.mp hx |
| 181 | obtain ⟨y,hy,H,K⟩ := h p hp |
| 182 | refine ⟨y,hy,fun a => ?_,K⟩ |
| 183 | obtain ⟨z,hz⟩ := H a |
| 184 | by_cases ha : a=timeAxis |
| 185 | · refine ⟨z+l,?_⟩; subst a; simp [hz,hh]; ring |
| 186 | exact ⟨z,by simp [ha,hz]⟩ |
| 187 | |
| 188 | private lemma train_suit {m : ℕ} (S : Schedule) (w : L.Word) (h : Covered S d m) (q : ℕ) : |
| 189 | suit (S.a m) w (train d w q) := by |
| 190 | obtain ⟨l,hl⟩ := h |
| 191 | induction q with |
| 192 | | zero => simp [suit,train_zero] |
| 193 | | succ q ih => |
| 194 | have ht := suit_init w (S.a m) |
| 195 | intro p hp |
| 196 | rw [train_next] at hp |
| 197 | rcases List.mem_append.mp hp with hx|hx |
| 198 | · rcases List.mem_append.mp hx with hx|hx |
| 199 | · exact suit_raise _ ht.2 _ hl p hx |
| 200 | exact suit_raise _ ht.1 _ hl p hx |
| 201 | exact suit_raise (d:=d+d) _ ih (l+l) (by push_cast; rw [hl]; ring) p hx |
| 202 | |
| 203 | private lemma suit_pairs (s : ℝ) (h : suit s u v) : suit s u (twins v) := by |
| 204 | intro p hp; rcases List.mem_append.mp hp with hv|hv |
| 205 | · rw [reflectedPoint] at hv; obtain ⟨x,hx,rfl⟩ := List.mem_map.mp hv |
| 206 | obtain ⟨y,hy,H,K⟩ := h _ (List.mem_reverse.mp hx) |
| 207 | refine ⟨(Ortho.move (Signed.reflect timeAxis) y.1,L.reflectedToken timeAxis y.2),?_,fun a => ?_, |
| 208 | congrArg (L.reflectedToken timeAxis) K⟩ |
| 209 | · rcases List.mem_append.mp hy with h₁|h₂ |
| 210 | · apply List.mem_append_right |
| 211 | have hh : (Ortho.move (Signed.reflect timeAxis) y.1,L.reflectedToken timeAxis y.2) ∈ reflect (reflect u timeAxis) timeAxis := by |
| 212 | rw [reflectedPoint]; exact List.mem_map.mpr ⟨_,List.mem_reverse.mpr h₁,rfl⟩ |
| 213 | rw [reflect_twice] at hh; exact hh |
| 214 | apply List.mem_append_left; rw [reflectedPoint]; exact List.mem_map.mpr ⟨_,List.mem_reverse.mpr h₂,rfl⟩ |
| 215 | obtain ⟨b,hb⟩ := H a; by_cases ha : a=timeAxis |
| 216 | · refine ⟨-b,?_⟩; subst a; simp [hb]; ring |
| 217 | exact ⟨b,by simp [ha,hb]⟩ |
| 218 | exact h p hv |
| 219 | |
| 220 | private lemma pair_rep {C : Family G} (F : Extraction.Order) (w : C.book.Word) (A : ℝ) (b : ℕ) |
| 221 | (H : ∀ p∈w, F.late (Single C p.2 A b)) : ∀ p∈twins w, F.late (Single C p.2 A b) := by |
| 222 | intro p hp; rcases List.mem_append.mp hp with he|he |
| 223 | · rw [reflectedPoint] at he; obtain ⟨y,hy,rfl⟩ := List.mem_map.mp he |
| 224 | apply (H _ (List.mem_reverse.mp hy)).mono |
| 225 | intro i h; apply h.mono; intro j hi |
| 226 | have ht : C.book.reflectedToken timeAxis y.2 = Spin.token C.book y.2 (Signed.mirror timeAxis,true) := by |
| 227 | simp only [← Register.token_adjoint, Spin.token,↓reduceIte, Extraction.Spin.swapC] |
| 228 | change Single C (C.book.reflectedToken timeAxis y.2) _ _ _ _ |
| 229 | rw [ht]; exact hi.moves _ |
| 230 | exact H p he |
| 231 | |
| 232 | private lemma words_bound {G : Gauge} {C : Family G} (H : C.Makes) (F : Order) (S : Table C.book) (ht : S.Smooth) |
| 233 | (he : F.PointLimits C S) (m k l b : ℕ) (hm : m≤k) (hk : k≤l) (hl : l≤b) |
| 234 | (u v : C.book.Word) (hc : distinct (u++v)) |
| 235 | (r t : ℝ) (hp : C.S.a m < r) (hh : C.S.a l < t) |
| 236 | (hx : apart r u) (hy : apart t v) (hz : ∀ x∈u, ∀ y∈v, r ≤ cubedist x.1 y.1) |
| 237 | (w : C.book.Word) (h : suit (C.S.a m) w u) |
| 238 | (headroom : (↑(2*w.length : ℕ):ℝ)*(2*(5*C.S.a k)) < C.S.a m) |
| 239 | (side : (v.length : ℝ)*(2*(3*C.S.a b)) < C.S.a l) |
| 240 | (A B : ℝ) (hB : 0 ≤ B) |
| 241 | (ha : ∀ i∈w, F.late (Single C i.2 A k)) |
| 242 | (hf : ∀ j∈v, F.late (Single C j.2 B b)) : |
| 243 | ‖S.expect (u++v)‖ ≤ A ^ u.length * B ^ v.length := by |
| 244 | let e : Fin u.length ⊕ Fin v.length ≃ Fin (u.length+v.length) := finSumFinEquiv |
| 245 | let x := composite u v 0 |
| 246 | let i := Fin.append (tokens u) (tokens v) |
| 247 | have ht₀ : u++v=realize i x := by simpa only [rest] using placements u v 0 |
| 248 | have hb₀ : x∈conf _ := (realized ..).mp (ht₀ ▸ hc) |
| 249 | have hu p : x (e (Sum.inl p))=(u.get p).1 := by simp [x,composite,e,positions,List.get_eq_getElem] |
| 250 | have hv p : x (e (Sum.inr p))=(v.get p).1 := by simp [x,composite,e,positions,List.get_eq_getElem] |
| 251 | have huu p : i (e (Sum.inl p))=(u.get p).2 := by simp [i,tokens,e,List.get_eq_getElem] |
| 252 | have hvv p : i (e (Sum.inr p))=(v.get p).2 := by simp [i,tokens,e,List.get_eq_getElem] |
| 253 | rw [ht₀,S.readAt] |
| 254 | apply le_trans (point_bound e C H F S ht he m k l b hm hk hl x hb₀ i ?_ (twins w).length |
| 255 | (positions (twins w)) ?_ (by rw [pair_length]; exact headroom) (by simpa using side) A B hB ?_ ?_) (le_of_eq (by simp)) |
| 256 | · refine ⟨fun p q hg => ?_, fun p q => ?_, fun p q hg => ?_⟩ |
| 257 | · rw [hu,hu]; refine hp.trans_le (hx _ (List.get_mem ..) _ (List.get_mem ..) fun h => hg ?_) |
| 258 | have hhx : x (e (Sum.inl p)) = x (e (Sum.inl q)) := by rw [hu,hu,h] |
| 259 | exact Sum.inl.inj (e.injective ((show Function.Injective _ from hb₀) hhx)) |
| 260 | · rw [hu,hv]; exact hp.trans_le (hz _ (List.get_mem ..) _ (List.get_mem ..)) |
| 261 | rw [hv,hv]; refine hh.trans_le (hy _ (List.get_mem ..) _ (List.get_mem ..) fun h => hg ?_) |
| 262 | have hhx : x (e (Sum.inr p)) = x (e (Sum.inr q)) := by rw [hv,hv,h] |
| 263 | exact Sum.inr.inj (e.injective ((show Function.Injective _ from hb₀) hhx)) |
| 264 | · intro p; obtain ⟨z,H,hz,-⟩ := h (u.get p) (List.get_mem ..) |
| 265 | obtain ⟨j,rfl⟩ := List.mem_iff_get.mp H; rw [hu]; exact ⟨j,hz⟩ |
| 266 | · intro p; rw [huu]; obtain ⟨y,hy,-,hQ⟩ := h (u.get p) (List.get_mem ..) |
| 267 | rw [hQ]; exact pair_rep F w A k ha y hy |
| 268 | intro p; rw [hvv]; exact hf _ (List.get_mem ..) |
| 269 | |
| 270 | /-- `A`,`B` pay, respectively, for each main and each exterior insertion. Uses |
| 271 | *all* `4*q` copies of the main word in this train and gives the required |
| 272 | exterior cost independent of `q`. -/ |
| 273 | theorem travel_price {C : Family G} (H : C.Makes) (F : Order) (S : Table C.book) (hs : S.Hierarchy) |
| 274 | (he : F.PointLimits C S) {m k l b : ℕ} (hm : m≤k) (hk : k≤l) (hl : l≤b) |
| 275 | {w : C.book.Word} (h : Slab timeAxis d w) (hd : buffer timeAxis r d w) (hc : Covered C.S d m) |
| 276 | (v : Future C.book timeAxis) (hv : buffer timeAxis t e v.val) (q : ℕ) |
| 277 | (hp : C.S.a m < r) (hh : C.S.a l < t) |
| 278 | (headroom : (↑(2*w.length : ℕ):ℝ)*(2*(5*C.S.a k)) < C.S.a m) |
| 279 | (side : (↑(2*v.val.length : ℕ):ℝ)*(2*(3*C.S.a b)) < C.S.a l) |
| 280 | (A B : ℝ) (hB : 0 ≤ B) |
| 281 | (ha : ∀ i∈w, F.late (Single C i.2 A k)) |
| 282 | (hf : ∀ j∈v.val, F.late (Single C j.2 B b)) : |
| 283 | ‖S.gram timeAxis (ride h v q).val (ride h v q).val‖ ≤ B ^ (2*v.val.length) * A ^ (w.length*(4*q)) := by |
| 284 | let a := train d w q |
| 285 | let x := twins a |
| 286 | let p := raised timeAxis (ends d q) v.val |
| 287 | let y := twins p |
| 288 | have hperm : List.Perm (twins (ride h v q).val) (x++y) := train_twins .. |
| 289 | have ht₀ : distinct (twins (ride h v q).val) := twoSides (ride h v q).property (ride h v q).property |
| 290 | have ht : distinct (x++y) := locations.mpr ((hperm.map Prod.fst).nodup (locations.mp ht₀)) |
| 291 | have hr := ((C.S.a_pos m).trans hp).le |
| 292 | have hxy : limits r (ends d q) a := train_buffer q hr hd |
| 293 | change ‖S.expect (twins (ride h v q).val)‖ ≤ _ |
| 294 | rw [← S.order hs.laws.toSymmetric ht₀ hperm] |
| 295 | have hil : y.length=2*v.val.length := by unfold y; rw [pair_length]; simp [p,raised,carry] |
| 296 | calc |
| 297 | _ ≤ A ^ x.length * B ^ y.length := |
| 298 | words_bound H F S hs.smooth he m k l b hm hk hl x y ht r t hp hh |
| 299 | (pair_gap hr hxy.1 (fun p hp => (hxy.2 p hp).1)) |
| 300 | (exterior_gap _ hv ((C.S.a_pos l).trans hh).le _) |
| 301 | (cross_gap v hr hxy) w (suit_pairs _ (train_suit _ w hc q)) headroom (by rw [hil]; exact side) A B hB ha |
| 302 | (pair_rep F p B b (by |
| 303 | intro i hi; obtain ⟨t,ht,rfl⟩ := List.mem_map.mp hi; exact hf t ht)) |
| 304 | _ = _ := by unfold x a; rw [pair_length,train_length,hil, mul_comm]; ring |
| 305 | end YM.Next.Phase |