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.STATIONARY.FrameEst.PatchGeometry |
| 2 | import YM.Next.STATIONARY.FrameEst.Stencils |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | /-! |
| 9 | # Canonical packing and actual static mean/range. Integer offsets |
| 10 | honored. Independent of pre/post. -/ |
| 11 | noncomputable section |
| 12 | namespace YM.Stationary |
| 13 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Matrix Finset Complex Tree |
| 14 | open scoped Matrix Topology ContDiff BigOperators ComplexConjugate |
| 15 | variable {G : Gauge} {P : Patch} {c f : Side} {S : StepData c f} |
| 16 | variable (S) |
| 17 | |
| 18 | abbrev unitSplit (G : Gauge) (S : StepData c f) (i : ℕ) := splitCo S.ratio (Loc G i) |
| 19 | abbrev ParcelG (G : Gauge) (L : Side) := Co L (Loc G 1) ⊕ (Loc G 0) |
| 20 | |
| 21 | def drawerC (α β : Type) (c : Side) : Co c α ⊕ (Co c β) ≃ Co c (α⊕β) := (Equiv.prodSumDistrib ..).symm |
| 22 | |
| 23 | def clothe (G : Gauge) (S : StepData c f) : Bodies G c f ≃ Co c (ParcelG G S.patch.L) := |
| 24 | (Equiv.sumCongr (unitSplit G S 1) (Equiv.refl (Lines G c 0))).trans (drawerC ..) |
| 25 | lemma inflowL (x : Lines G f 1) : clothe G S (.inl x) = ((unitSplit G S 1 x).1,Sum.inl (unitSplit G S 1 x).2) := rfl |
| 26 | |
| 27 | |
| 28 | -- derivatives |
| 29 | |
| 30 | def curryG (G : Gauge) (S : StepData c f) : Matrix (Lines G c 0) (Lines G f 0) ℝ := LinearMap.toMatrix' (LinearMap.pi fun a : Lines G c 0 => |
| 31 | ∑ i : S.patch.Points, S.patch.weight i • (LinearMap.proj (Precision.atPoint S a.1 i,a.2) : BaseSites G f→ₗ[ℝ] ℝ)) |
| 32 | def bondsM (G : Gauge) (S : StepData c f) := patron G (Precision.mean S) |
| 33 | lemma curry_at (x : BaseSites G f) (a) : (curryG G S*ᵥ x) a=∑ i : S.patch.Points,S.patch.weight i*x (Precision.atPoint S a.1 i,a.2) := by |
| 34 | rw [curryG, LinearMap.toMatrix'_mulVec]; simp |
| 35 | lemma bonds_spot (x : Link G f) (a : Lines G c 1) : (bondsM G S*ᵥ x) a= ∑ i:S.patch.Points,S.patch.weight i* ∑ j : Fin S.patch.L.val, x (Precision.atPoint S a.1 i + j.val • step (axisEquiv.symm a.2.1),a.2) := by |
| 36 | let k := parts G 1 (arm G f 1 x) a.2.2 |
| 37 | let m := axisEquiv.symm a.2.1 |
| 38 | have hh n (y : Site _) : integralLink y (List.replicate n (posDir m)) k=∑ i : Fin n, x (y+i.val • step m,a.2) := by |
| 39 | change linkSum _ _ _= _ |
| 40 | induction n generalizing y with |
| 41 | | zero => simp [linkSum] |
| 42 | | succ i IH => |
| 43 | rw [List.replicate_succ, Fin.sum_univ_succ,linkSum,IH]; |
| 44 | simp only [Step.vec,Step.used,Bool.false_eq_true,↓reduceIte,posDir] |
| 45 | rw [Fin.val_zero,zero_smul,add_zero] |
| 46 | congr 1 |
| 47 | · rw [show coord m=_ from axisEquiv.apply_symm_apply a.2.1]; rfl |
| 48 | apply sum_congr rfl; intro j _; rw [Fin.val_succ, add_smul,one_smul, ← add_assoc, add_right_comm] |
| 49 | rw [bondsM,patron_fee] |
| 50 | change (Precision.mean S*ᵥ k) (a.1,a.2.1)=_ |
| 51 | rw [Precision.mean,LinearMap.toMatrix'_mulVec]; simp only [LinearMap.pi_apply,LinearMap.sum_apply, LinearMap.smul_apply] |
| 52 | simp_rw [show S.repath (axisEquiv.symm a.2.1)=List.replicate _ _ from rfl]; exact sum_congr rfl fun i _ => by rw [show integralLink _ _ k = _ from hh _ _]; rfl |
| 53 | |
| 54 | lemma jar_boat (v : Phase (Lines G f 0)) (a) : (approached (curryG G S)*ᵥ v) a=∑ i : S.patch.Points,(S.patch.weight i:ℂ)*v (Precision.atPoint S a.1 i,a.2) := by |
| 55 | refine Leads.buys (p:=fun x => (approached (curryG G S) *ᵥ x) a) (q:=fun x : Phase (Lines G f 0) => ∑ i : S.patch.Points,(S.patch.weight i:ℂ)*x (Precision.atPoint S a.1 i,a.2)) (fun u v => ?_) (fun u v => ?_) ?_ v |
| 56 | · exact congr_fun ((Leads.byVec (curryG G S)) u v) _ |
| 57 | · simp only [Pi.add_apply,Pi.smul_apply, smul_eq_mul,Finset.mul_sum,mul_add,Finset.sum_add_distrib]; simp only [mul_left_comm _ I] |
| 58 | intro i; rw [prom_vec]; simp [axes,curry_at] |
| 59 | lemma bonds_boat (v : Phase (Lines G f 1)) (a) : (approached (bondsM G S)*ᵥ v) a=∑ i : S.patch.Points,(S.patch.weight i:ℂ)* ∑ j : Fin S.patch.L.val, v (Precision.atPoint S a.1 i + j.val • step (axisEquiv.symm a.2.1),a.2) := by |
| 60 | refine Leads.buys (p:=fun x => (approached (bondsM G S) *ᵥ x) a) (q:=fun v => ∑ i : S.patch.Points,(S.patch.weight i:ℂ)*∑ j : Fin S.patch.L.val,v (Precision.atPoint S a.1 i + j.val • step (axisEquiv.symm a.2.1),a.2)) (fun u v => ?_) (fun u v => ?_) ?_ v |
| 61 | · exact congr_fun ((Leads.byVec (bondsM G S)) u v) _ |
| 62 | · simp only [Pi.add_apply,Pi.smul_apply,smul_eq_mul, Finset.sum_add_distrib,Finset.mul_sum, mul_add]; |
| 63 | simp only [Finset.sum_add_distrib,mul_left_comm _ I] |
| 64 | intro i; rw [prom_vec]; simp [axes,bonds_spot] |
| 65 | |
| 66 | section importers |
| 67 | variable {F B : Type} [Fintype F] [Fintype B] [DecidableEq F] [DecidableEq B] |
| 68 | |
| 69 | lemma import_in (U : Matrix (Co c F) (Co f B) ℂ) (p : Site c) (v : Phase (Co S.patch.L B)) : |
| 70 | U*ᵥ poured S.ratio p v = repackM (Equiv.refl _) (splitCo S.ratio B) U *ᵥ tune p v := by |
| 71 | have hx := repack_act (Equiv.refl _) (splitCo S.ratio B) U (poured S.ratio p v) |
| 72 | rw [show poured S.ratio p v ∘ (splitCo S.ratio B).symm=tune p v by ext1 i; simp [poured]; rfl] at hx; exact hx.symm |
| 73 | end importers |
| 74 | |
| 75 | lemma bond_travel : Jaunt (repackM (Equiv.refl (Lines G c 1)) (unitSplit G S 1) (approached (bondsM G S))) (meanRay G S.patch) 0 := by |
| 76 | intro p q h v; rw [← import_in S,add_zero]; ext1 a; rw [bonds_boat] |
| 77 | let d := axisEquiv.symm a.2.1 |
| 78 | have he i (j : Fin S.patch.L.val) : Precision.atPoint S a.1 i+j.val • step d=wrap f (i.val+j.val • step d)+S.ratio.embed a.1 := by rw [Precision.atPoint, map_add,map_nsmul,wrap_step, add_right_comm] |
| 79 | change ∑ i:S.patch.Points,(S.patch.weight i:ℂ)*∑ j : Fin S.patch.L.val, poured S.ratio p v (Precision.atPoint S a.1 i+j.val • step d,a.2) = cell p a.1 *((∑ j : Fin S.patch.L.val, _)*ᵥ v) a.2 |
| 80 | simp_rw [he]; simp only [scrap_pour S.ratio p a.1 q h, Matrix.sum_mulVec, Finset.sum_apply,coast_earn, Finset.mul_sum] |
| 81 | rw [sum_comm]; apply sum_congr rfl; intro j _; refine Eq.trans ?_ (congr_arg (cell p a.1 * ·) (coast_earn S.patch (fun a : Loc G 1 => axisEquiv.symm a.1) j.val q (v:Phase (Co S.patch.L (Loc G 1))) a.2).symm); rw [ Finset.mul_sum]; apply sum_congr rfl; intro i _; rw [mul_left_comm]; rfl |
| 82 | lemma jar_travel : Jaunt (repackM (Equiv.refl (Lines G c 0)) (unitSplit G S 0) (approached (curryG G S))) (jar G S.patch) 0 := by |
| 83 | intro p q h v; rw [← import_in S,add_zero]; ext1 a; rw [jar_boat]; change _=cell p a.1*(jar _ _ q*ᵥ v) a.2 |
| 84 | simp only [Precision.atPoint, scrap_pour S.ratio p a.1 q h, jar,coast_earn, zero_smul, add_zero, Finset.mul_sum]; apply sum_congr rfl; intro i _; rw [mul_left_comm]; rfl |
| 85 | end YM.Stationary |
| 86 | end |
| 87 | |
| 88 | /-! |
| 89 | # Two physical roles at c. Counting arms from ANY Ratio. Canonical real basis |
| 90 | mapping. Payload formula for vertical precision. |
| 91 | -/ |
| 92 | set_option linter.unusedSectionVars false |
| 93 | noncomputable section |
| 94 | namespace YM.Stationary |
| 95 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Matrix Finset Complex Tree |
| 96 | open scoped Matrix Topology ContDiff BigOperators ComplexConjugate |
| 97 | variable {G : Gauge} {P : Patch} {c f k L : Side} {S : StepData c f} {α β γ : Type} [Fintype α] [DecidableEq α] [Fintype β] [DecidableEq β] |
| 98 | {p : Site c} {q : Momentum} |
| 99 | |
| 100 | |
| 101 | |
| 102 | section joins |
| 103 | variable (R : Type) [CommRing R] (α β c) |
| 104 | |
| 105 | def shardX : Matrix α (α ⊕ β) R := LinearMap.toMatrix' (LinearMap.pi fun i : α => LinearMap.proj (.inl i : α ⊕ β)) |
| 106 | def shardY : Matrix β (α ⊕ β) R := LinearMap.toMatrix' (LinearMap.pi fun i : β => LinearMap.proj (.inr i : α ⊕ β)) |
| 107 | variable (x : α ⊕ β→R) |
| 108 | lemma sliceX : shardX α β R *ᵥ x=x ∘ Sum.inl := by rw [shardX,LinearMap.toMatrix'_mulVec]; rfl |
| 109 | lemma sliceY : shardY α β R *ᵥ x=x ∘ Sum.inr := by rw [shardY,LinearMap.toMatrix'_mulVec]; rfl |
| 110 | lemma shardPromX : approached (shardX α β ℝ)=shardX α β ℂ := by ext i (j|j) <;> simp [shardX,LinearMap.toMatrix'_apply,approached,Pi.single_apply] <;> split <;> simp_all |
| 111 | lemma shardPromY : approached (shardY α β ℝ)=shardY α β ℂ := by ext i (j|j) <;> simp [shardY,LinearMap.toMatrix'_apply,approached,Pi.single_apply] <;> split <;> simp_all |
| 112 | end joins |
| 113 | |
| 114 | variable (G c f) |
| 115 | |
| 116 | def butt := rearM G c f |
| 117 | def brim := billsM (helmets G c f) (pocket _) (ContinuousLinearMap.snd ℝ (Link G f) (BaseSites G c)) |
| 118 | |
| 119 | lemma helmet_ear (u : Vault G c f) : cash (helmets G c f) u=Sum.elim u.1 u.2 := by funext i; rcases i with i|i; exact (cash_prod_left ..).trans (congr_fun (cash_pocket _) _); exact (cash_prod_right ..).trans (congr_fun (cash_pocket _) _) |
| 120 | lemma helmet_butt : butt G c f= shardX (Lines G f 1) (Lines G c 0) ℝ := by |
| 121 | apply bill_eq (helmets G c f); intro x; rw [butt,rear_cost, sliceX,helmet_ear]; rfl |
| 122 | lemma helmet_brim : brim G c f= shardY (Lines G f 1) (Lines G c 0) ℝ := by apply bill_eq (helmets G c f); intro x; rw [brim,bill_at,cash_pocket,sliceY,helmet_ear]; rfl |
| 123 | variable {G c f} |
| 124 | lemma butt_travel : Jaunt (repackM (unitSplit G S 1) (clothe G S) (approached (butt G c f))) (fun _ => shardX (Co S.patch.L (Loc G 1)) (Loc G 0) ℂ) 0 := by |
| 125 | classical |
| 126 | intro i p _ v; let B := unitSplit G S 1; let T := clothe G S |
| 127 | let w := tune i v ∘ T |
| 128 | rw [add_zero,show tune i v=w ∘ T.symm by ext1 a; simp [w,T]] |
| 129 | rw [helmet_butt,shardPromX,repack_act _ (clothe G S) _ w, sliceX] |
| 130 | refine Eq.trans ?_ (congr_arg (tune i) (sliceX (Co S.patch.L (Loc G 1)) (Loc G 0) ℂ v).symm) |
| 131 | funext a; obtain ⟨b,rfl⟩ := B.surjective a; simp only [Function.comp_apply,w]; rw [show (unitSplit G S 1).symm (B b)=b from B.symm_apply_apply b,inflowL]; rfl |
| 132 | lemma brim_travel : Jaunt (repackM (Equiv.refl _) (clothe G S) (approached (brim G c f))) (fun _ => shardY (Co S.patch.L (Loc G 1)) (Loc G 0) ℂ) 0 := by |
| 133 | classical |
| 134 | intro i p _ v; let T := clothe G S; let w := tune i v ∘ T |
| 135 | rw [add_zero,show tune i v=w ∘ T.symm by funext j; simp [w]] |
| 136 | rw [helmet_brim,shardPromY, repack_act _ (clothe G S) _ w, sliceY,sliceY]; funext a; rfl |
| 137 | |
| 138 | lemma serial_butt (X : Slab α) (Y : Slab β) : serial X (X.spade Y) q q (shardX α β ℂ) 1 := by |
| 139 | refine Slab.serial_of zero_le_one fun i => ?_ |
| 140 | rw [sliceX,one_mul]; |
| 141 | have he := Slab.spade_rate (p:=q) (u:=i∘Sum.inl) (v:=i∘Sum.inr) X Y; rw [← spade_assemble] at he |
| 142 | have hp (j : Phase (α⊕β)) : 0 ≤ (X.spade Y).rate q j := slug_nonneg _ |
| 143 | nlinarith [hp i,sq_nonneg (Y.rate q (i∘Sum.inr))] |
| 144 | lemma serial_brim (X : Slab α) (Y : Slab β) : serial Y (X.spade Y) q q (shardY α β ℂ) 1 := by |
| 145 | refine Slab.serial_of zero_le_one fun i => ?_ |
| 146 | rw [sliceY,one_mul] |
| 147 | have he := Slab.spade_rate (p:=q) (u:=i∘Sum.inl) (v:=i∘Sum.inr) X Y; rw [← spade_assemble] at he |
| 148 | have hp (j : Phase (α⊕β)) : 0 ≤ (X.spade Y).rate q j := slug_nonneg _ |
| 149 | nlinarith [hp i,sq_nonneg (X.rate q (i∘Sum.inl))] |
| 150 | |
| 151 | -- actual gauge column in centered basis as z=u at f; sign convention u brings A down |
| 152 | |
| 153 | variable (S) |
| 154 | def spreadM := (butt G c f)ᵀ * mail (1:Config G f) - (brim G c f)ᵀ * curryG G S |
| 155 | lemma parliament (V : BaseSites G f) : spreadM (G:=G) S *ᵥ V = cash (helmets G c f) (-gradientA G f V, -(curryG G S*ᵥ V)) := by |
| 156 | rw [spreadM,sub_mulVec,← Matrix.mulVec_mulVec V (butt G c f)ᵀ, ← Matrix.mulVec_mulVec V (brim G c f)ᵀ,mailed,cant_one,helmet_ear] |
| 157 | funext i |
| 158 | cases i <;> simp [-Matrix.mulVec_mulVec, helmet_brim,helmet_butt,shardX,shardY,Matrix.mulVec,dotProduct, Pi.single_apply,ite_mul] |
| 159 | end YM.Stationary |
| 160 | end |
| 161 | |
| 162 | /-! |
| 163 | # Bang linear choreography, packed on one coarse cell. Register for |
| 164 | independent apertures/tilts on ANY given patch. Derivatives use bill seats |
| 165 | in this packing. -/ |
| 166 | noncomputable section |
| 167 | namespace YM.Stationary |
| 168 | open Function Filter Lattice RG Audience Exterior Precision Bloch Wilson Laurent Matrix Finset |
| 169 | open scoped Topology ContDiff BigOperators |
| 170 | variable {c f : Side} {G : Gauge} {P : Patch} {K : KernelChoices} |
| 171 | |
| 172 | abbrev Acts (G : Gauge) (P : Patch) := (Loc G 1)⊕ ((ParcelG G P.L)⊕((ParcelG G P.L)⊕(Loc G 1))) |
| 173 | |
| 174 | section pack |
| 175 | variable (G) (S : StepData c f) |
| 176 | |
| 177 | abbrev WarpV := Corn (Co c (ParcelG G S.patch.L)) |
| 178 | def directX (S : StepData c f) : Vault G c f ≃L[ℝ] WarpV G S := LinearEquiv.toContinuousLinearEquiv <| |
| 179 | (cash (helmets G c f)).trans (LinearEquiv.funCongrLeft ℝ ℝ ((clothe G S).symm)) |
| 180 | lemma direct_pay (x : Vault G c f) : directX G S x=cash (helmets _ _ _) x ∘ (clothe G S).symm := rfl |
| 181 | -- folded global in Acts. Build arg pair with nested sum |
| 182 | |
| 183 | def wiredFrame {A B : Type} [Fintype A] [DecidableEq A] [Fintype B] [DecidableEq B] (c : Side) : (Corn (Co c A) × Corn (Co c B))≃L[ℝ] Corn (Co c (A⊕B)) := LinearEquiv.toContinuousLinearEquiv { |
| 184 | toFun a i := Sum.elim (fun j => a.1 (i.1,j)) (fun j => a.2 (i.1,j)) i.2 |
| 185 | invFun v := (fun i => v (i.1, .inl i.2), fun i => v (i.1, .inr i.2)) |
| 186 | map_add' a b := funext fun i => by cases i with | mk i j => cases j <;> rfl |
| 187 | map_smul' a b := funext fun i => by cases i with | mk i j => cases j <;> rfl |
| 188 | left_inv v := rfl |
| 189 | right_inv v := funext fun i => by rcases i with ⟨i,j|j⟩ <;> rfl } |
| 190 | |
| 191 | def pavilionB : Bang G c f ≃L[ℝ] Corn (Co c (Acts G S.patch)) := by |
| 192 | classical |
| 193 | exact (ContinuousLinearEquiv.prodAssoc ℝ (Link G c) (Vault G c f) (Vault G c f × Link G c)).trans |
| 194 | (((ContinuousLinearEquiv.refl ℝ (Link G c)).prodCongr (((directX G S).prodCongr (((directX G S).prodCongr (ContinuousLinearEquiv.refl ℝ (Link G c))).trans (wiredFrame c))).trans (wiredFrame c))).trans (wiredFrame c)) |
| 195 | -- index assignments |
| 196 | |
| 197 | def footVoice (P : Patch) (v : Bool) (i : ParcelG G P.L) : Acts G P := if v then .inr (.inr (.inl i)) else .inr (.inl i) |
| 198 | def highVoice (P : Patch) (v : Bool) (i : Loc G 1) : Acts G P := if v then .inr (.inr (.inr i)) else .inl i |
| 199 | -- scalar support |
| 200 | def hymn (P : Patch) (i : Piano G P) : Acts G P := match i with |
| 201 | | .inl (v,a,j) => footVoice G P v (.inl (wrap P.L a.val,j)) |
| 202 | | .inr (.inl (v,_,b)) => footVoice G P v (.inr (vac,b)) |
| 203 | | .inr (.inr (v,i)) => highVoice G P v i |
| 204 | |
| 205 | def carol (P : Patch) (i : Piano G P) : Cover := match i with |
| 206 | | .inl (_,a,_) => rent P.L a.val |
| 207 | | .inr (.inl (_,some a,_)) => step a |
| 208 | | _ => 0 |
| 209 | |
| 210 | variable {G} |
| 211 | lemma pavilionB_high (x : Bang G c f) (v : Bool) (i : Lines G c 1) : |
| 212 | pavilionB G S x (i.1,highVoice G S.patch v i.2) = if v then x.2.2 i else x.1.1 i := by cases v <;> rfl |
| 213 | lemma pavilionB_low (x : Bang G c f) (v : Bool) (i : Site c) (j) : |
| 214 | pavilionB G S x (i,footVoice G S.patch v j) = directX G S (if v then x.2.1 else x.1.2) (i,j) := by cases v <;> rfl |
| 215 | lemma direct_in (x : Vault G c f) (i : Bodies G c f) : directX G S x (clothe G S i)=Sum.elim x.1 x.2 i := by rw [direct_pay,Function.comp_apply,Equiv.symm_apply_apply,helmet_ear] |
| 216 | lemma sewn (z : Cover) (i : Site c) : wrap f z+S.ratio.embed i=S.ratio.assemble (wrap c (rent S.patch.L z)+i,wrap S.patch.L z) := by |
| 217 | have hx : S.ratio.embed (wrap c (rent S.patch.L z)+i)=S.ratio.embed (wrap c (rent S.patch.L z))+S.ratio.embed i := map_add S.ratio.root .. |
| 218 | rw [Ratio.assemble,hx,S.ratio.embed_wrap] |
| 219 | conv_lhs => rw [rent_balance S.patch.L z, map_add]; |
| 220 | unfold StepData.ratio; abel |
| 221 | lemma direct_low (x : Vault G c f) (z : Cover) (i) (j) : directX G S x (wrap c (rent S.patch.L z)+i,.inl (wrap S.patch.L z,j))=x.1 (wrap f z+S.ratio.embed i,j) := by |
| 222 | rw [sewn]; let Y := wrap c (rent S.patch.L z)+i; let P := wrap S.patch.L z |
| 223 | rw [show ((Y, .inl (P,j)) : Co c (ParcelG G S.patch.L))=clothe G S (.inl (S.ratio.assemble (Y,P),j)) by |
| 224 | rw [inflowL,unitSplit,split_co, S.ratio.assemble_parent,S.ratio.assemble_res]; rfl,direct_in]; rfl |
| 225 | lemma direct_high (x : Vault G c f) (i) (j) : directX G S x (i,.inr j)=x.2 (i,j) := direct_in S x (.inr (i,j)) |
| 226 | lemma pavilionB_here (x : Bang G c f) (i) (j) : pianist S i x j=pavilionB G S x (wrap c (carol G S.patch j)+i,hymn G S.patch j) := by |
| 227 | rcases j with ⟨v,a,j⟩| (⟨v,a,j⟩| ⟨v,j⟩) |
| 228 | · simp only [carol,hymn,pavilionB_low,direct_low]; cases v <;> rfl |
| 229 | · cases a with |
| 230 | | none => simp only [carol,hymn,map_zero,zero_add,pavilionB_low,direct_high]; cases v <;> rfl |
| 231 | | some b => simp only [carol,hymn,wrap_step,pavilionB_low,direct_high]; rw [add_comm]; cases v <;> rfl |
| 232 | simp only [carol,hymn,map_zero,zero_add] |
| 233 | change pianist S i x _=pavilionB _ _ _ (_, highVoice G S.patch v j); rw [show pavilionB G S x (i,highVoice G S.patch v j)= _ from pavilionB_high S x v (i,j)]; cases v <;> rfl |
| 234 | end pack |
| 235 | end YM.Stationary |
| 236 | end |
| 237 | |
| 238 | /-! |
| 239 | # Evaluation of complex beats of stencil scores from actual patch phase hands. |
| 240 | -/ |
| 241 | noncomputable section |
| 242 | namespace YM.Stationary |
| 243 | open Function Filter Lattice RG Audience Exterior Precision Bloch Wilson Laurent Matrix Finset |
| 244 | open scoped Topology ContDiff BigOperators |
| 245 | variable {c f : Side} {α β : Type} [Fintype α] [Fintype β] {G : Gauge} {P : Patch} {K : KernelChoices} {A : Audience α} {C D κ : ℝ} {n m t : ℕ} |
| 246 | -- install DecidableEq to avoid search brittle |
| 247 | instance (G : Gauge) (P : Patch) : DecidableEq (Piano G P) := Classical.typeDecidableEq _ |
| 248 | instance (G : Gauge) (P : Patch) : DecidableEq (Acts G P) := Classical.typeDecidableEq _ |
| 249 | |
| 250 | section ext |
| 251 | variable [DecidableEq β] {R : Corn β→ℕ→Prop} {u : Fin n → Phase β} {b : Fin n→ℕ} {M : α → Corn β→ℝ} |
| 252 | def Shiny (R : Corn β→ℕ→Prop) (x : Phase β) (k : ℕ) : Prop := R (fun i => (x i).re) k ∧ R (fun i => (x i).im) k |
| 253 | lemma through_charge (h : Tested A R M n C) (hp : ∀ i, Shiny R (u i) (b i)) (hv : (∑ i,b i) ≤ 2) : Hearing A (∑ i,b i) (fun i => beat (M i) 0 n u) ((2:ℝ)^n*C) := by |
| 254 | classical |
| 255 | let f i (p : Bool) : Corn β := if p then fun j => (u i j).im else fun j => (u i j).re |
| 256 | let q (i : Bool) := if i then Complex.I else 1 |
| 257 | have hf i (a : Bool) : R (f i a) (b i) := by cases a; exact (hp i).1; exact (hp i).2 |
| 258 | have hx : (fun i => ∑ a : Bool,q a • axes (f i a))=u := by |
| 259 | funext i j; simp [axes,Finset.sum_apply,q,f]; rw [add_comm,mul_comm Complex.I,Complex.re_add_im] |
| 260 | have he (x : α) : beat (M x) 0 n u = ∑ v : Fin n→Bool,(∏ i,q (v i))*beat (M x) 0 n (axes ∘ fun i => f i (v i)) := by |
| 261 | conv_lhs => rw [← hx] |
| 262 | rw [MultilinearMap.map_sum]; exact Finset.sum_congr rfl fun v _ => MultilinearMap.map_smul_univ (beat (M x) 0 n) (fun i => q (v i)) _ |
| 263 | simp_rw [he]; rw [show (2:ℝ)^n*C=∑ _ : Fin n→ Bool,C by simp] |
| 264 | have hu i : ‖q i‖=1 := by cases i <;> simp [q] |
| 265 | refine Hearing.join _ (fun v _ => ?_) |
| 266 | exact (h (fun i => f i (v i)) b (fun i => hf i (v i)) hv).softer (fun x => by rw [beat_real]; simp [norm_prod,hu]) |
| 267 | end ext |
| 268 | |
| 269 | -- `melody` bulletin filtered. Input scalar points from arbitrary Momentum. |
| 270 | def imprintsC (G : Gauge) (P : Patch) (q : Momentum) : Phase (Acts G P) →ₗ[ℂ] Phase (Piano G P) := |
| 271 | LinearMap.pi fun i => mode q (carol G P i) • (LinearMap.proj (hymn G P i)) |
| 272 | lemma imprints_read (x : Phase (Acts G P)) (p : Momentum) (i) : imprintsC G P p x i=mode p (carol G P i)*x (hymn G P i) := rfl |
| 273 | lemma flips_melody (x : Phase (Acts G P)) {p q} (hp : rolls p q) : imprintsC G P p x=imprintsC G P q x := by ext1 i; rw [imprints_read,imprints_read,hp.exp] |
| 274 | @[fun_prop] lemma melody_diff {X : Type} [NormedAddCommGroup X] [NormedSpace ℂ X] {v : X→ Phase (Acts G P)} {p : X→Momentum} {x} (hx : DifferentiableAt ℂ v x) (hp : DifferentiableAt ℂ p x) : |
| 275 | DifferentiableAt ℂ (fun z => imprintsC G P (p z) (v z)) x := by |
| 276 | apply differentiableAt_pi.mpr; intro i; simp only [imprints_read] |
| 277 | exact (((show Differentiable ℂ (fun p : Momentum => mode p (carol G P i)) by unfold mode; fun_prop).differentiableAt.comp x hp).mul (differentiableAt_pi.mp hx _)) |
| 278 | |
| 279 | section bills |
| 280 | variable (S : StepData c f) |
| 281 | |
| 282 | def rehearsal (i : Site c) : Corn (Co c (Acts G S.patch))→L[ℝ] BassInput G S.patch := pianist S i ∘L ((pavilionB G S).symm : _ →L[ℝ] Bang G c f) |
| 283 | def applause (G : Gauge) (S : StepData c f) (i : Site c) : Phase (Co c (Acts G S.patch)) →ₗ[ℂ] Phase (Piano G S.patch) := LinearMap.pi (fun j : Piano G S.patch => LinearMap.proj (wrap c (carol G S.patch j)+i,hymn G S.patch j)) |
| 284 | lemma applause_fits (x : Corn (Co c (Acts G S.patch))) (i : Site c) : axes (rehearsal S i x) = applause G S i (axes x) := by |
| 285 | ext1 j; unfold rehearsal axes; simp only [ContinuousLinearMap.comp_apply]; change ((pianist S i ((pavilionB G S).symm x) j : ℝ):ℂ)=_; rw [show pianist S i ((pavilionB G S).symm x) j= _ from pavilionB_here S ..,(pavilionB G S).apply_symm_apply]; rfl |
| 286 | lemma audience_act (p : Site c) {q} (h : rolls (mon p) q) (v : Phase (Acts G S.patch)) (i : Site c) : |
| 287 | applause G S i (tune p v)=cell p i • imprintsC G S.patch q v := by |
| 288 | ext1 j; simp [imprints_read,applause,tune,cell_wrap,h.exp]; ring |
| 289 | lemma audition (p : Fin n→ Site c) (q : Fin n→ Momentum) (he : ∀ i,rolls (mon (p i)) (q i)) (v : Fin n→Phase (Acts G S.patch)) (i) (M : BassInput G S.patch→ℝ) (h : AnalyticAt ℝ M 0) : |
| 290 | beat (M ∘ rehearsal S i) 0 n (fun j => tune (p j) (v j))=cell (∑ j,p j) i * beat M 0 n (fun j => imprintsC G S.patch (q j) (v j)) := by |
| 291 | rw [evaluated _ (fun v => applause_fits S v i) h, MultilinearMap.compLinearMap_apply]; simp only [audience_act S _ (he _),MultilinearMap.map_smul_univ,cell_hom]; rfl |
| 292 | end bills |
| 293 | end YM.Stationary |
| 294 | end |
| 295 | |
| 296 | /-! |
| 297 | # Palette test for linear temporal profiles. No singular weight divisions |
| 298 | for Hess legs. Reach: σ≤1. Costs from packing BEFORE L. |
| 299 | -/ |
| 300 | noncomputable section |
| 301 | namespace YM.Stationary |
| 302 | open Function Filter Lattice RG Audience Exterior Precision Bloch Wilson Laurent Matrix Finset |
| 303 | open scoped Topology ContDiff BigOperators Matrix.Norms.Frobenius |
| 304 | variable {α : Type} [Fintype α] {L : Side} {K : KernelChoices} {A : Audience α} {G : Gauge} {P : Patch} {C D σ : ℝ} {m n : ℕ} |
| 305 | |
| 306 | -- venue pockets direction condition |
| 307 | |
| 308 | def pawn (v : Bool) (x : Phase (Acts G P)) : Phase (Co P.L (Loc G 1)) := x ∘ footVoice G P v ∘ Sum.inl |
| 309 | def signet (v : Bool) (x : Phase (Acts G P)) : Phase (Loc G 1) := x ∘ highVoice G P v |
| 310 | def capitals (v : Bool) (x : Phase (Acts G P)) : Phase (Loc G 0) := x ∘ footVoice G P v ∘ Sum.inr |
| 311 | def roster (z : Phase (Co L α)) (b : Site L) : EuclideanSpace ℂ α := WithLp.toLp 2 (stackSlice b z) |
| 312 | |
| 313 | structure Veil (C : ℝ) (x : Phase (Acts G P)) (k : ℕ) : Prop where |
| 314 | grade : k≤1 |
| 315 | fine v : Hearing (balcony (Site P.L)) k (roster (pawn v x)) (inch P.L*C) |
| 316 | skins v : slug (capitals v x)≤C |
| 317 | bonds v : slug (signet v x)≤C |
| 318 | |
| 319 | section tours |
| 320 | |
| 321 | def entryRoom (j : ℕ) := 4+4*(j+5) |
| 322 | def visitor (j : ℕ) : Finset Cover := box (entryRoom j) |
| 323 | def admission (j : ℕ) := (Fintype.card ↥(visitor j):ℝ) |
| 324 | def muralRoom (j : ℕ) := Real.exp (entryRoom j) * admission j |
| 325 | instance (j : ℕ) : Nonempty ↥(visitor j) := ⟨⟨0, center_box _⟩⟩ |
| 326 | lemma admit_pos (j : ℕ) : 1 ≤ admission j := by |
| 327 | unfold admission; exact_mod_cast Fintype.card_pos (α:=↥(visitor j)) |
| 328 | lemma muralRoom_pos (j : ℕ) : Real.exp 1 ≤ muralRoom j := |
| 329 | (Real.exp_monotone (show (1:ℝ) ≤ ↑(entryRoom j) by exact_mod_cast (show 1≤entryRoom j from by unfold entryRoom; omega))).trans (le_mul_of_one_le_right (by positivity) (admit_pos j)) |
| 330 | lemma mural_one (j : ℕ) : 1≤muralRoom j := (Real.one_le_exp (by norm_num)).trans (muralRoom_pos j) |
| 331 | lemma park_scap (a : Plaza P) : Laurent.size (rent P.L a.val)≤entryRoom P.J := by |
| 332 | exact_mod_cast (show (Laurent.size (rent P.L a.val):ℝ) ≤ ↑(entryRoom P.J) by simpa only [entryRoom,Nat.cast_add,Nat.cast_mul,Nat.cast_ofNat] using rent_pay P a.val a.property) |
| 333 | def mural_obey (a : Plaza P) : ↥(visitor P.J) × Site P.L := (⟨rent P.L a.val,by |
| 334 | let k := rent P.L a.val |
| 335 | have he i : (k i).natAbs≤entryRoom P.J := le_trans (single_le_sum (s:=univ) (f:=fun i:Axis => (k i).natAbs) (fun _ _ => Nat.zero_le _) (mem_univ i)) (park_scap a) |
| 336 | apply box_test.mpr; constructor <;> intro i <;> set x:=k i <;> have hv : x.natAbs ≤ entryRoom P.J := he i |
| 337 | · change _ ≤ k i; omega |
| 338 | change k i ≤ _; omega⟩,wrap P.L a.val) |
| 339 | lemma mural_inj (P : Patch) : Injective (mural_obey (P:=P)) := by |
| 340 | intro i j h; have ht : rent P.L i.val=rent P.L j.val := congr_arg (fun v => (v : ↥(visitor P.J) × _).1.val) h |
| 341 | have hv : wrap P.L i.val=wrap P.L j.val := congr_arg Prod.snd h |
| 342 | apply Subtype.ext; rw [rent_balance P.L i.val]; rw [ht,hv, ← rent_balance] |
| 343 | lemma mural_ports (i : Plaza P) : (balcony (Plaza P)).weight i ≤ admission P.J * (balcony _).weight (mural_obey i) := by |
| 344 | have h : Fintype.card P.Points ≤ Fintype.card (Plaza P) := Fintype.card_le_of_injective (fun i => (⟨i.val,alley i⟩ : Plaza P)) (fun a b h => Subtype.ext (congr_arg (fun i : Plaza P => i.val) h)) |
| 345 | have hp : (P.L.val:ℝ)^4 ≤ Fintype.card (Plaza P) := (alley_pin P).trans (by exact_mod_cast h) |
| 346 | have hi : 0 < (P.L.val:ℝ)^4 := by positivity |
| 347 | have ht : 0 < (Fintype.card ↥(visitor P.J):ℝ) := by exact_mod_cast Fintype.card_pos |
| 348 | simp only [balcony,admission,Fintype.card_prod,Lattice.site_card]; push_cast |
| 349 | field_simp |
| 350 | exact hp |
| 351 | lemma mode_voice (a : Plaza P) {p : Momentum} (h : p∈strip (1:ℝ)) : ‖mode p (rent P.L a.val)‖≤Real.exp (entryRoom P.J) := |
| 352 | (reward _ _ 1 (fun i => (h i).le)).trans (Real.exp_monotone (by rw [one_mul]; exact_mod_cast park_scap a)) |
| 353 | lemma venue_step (i : Option Axis) {p : Momentum} (h : p∈strip (1:ℝ)) : ‖mode p ((i.map (fun i => step i)).getD 0)‖≤Real.exp 1 := by |
| 354 | apply (reward _ _ (1:ℝ) (fun i => (h i).le)).trans; rw [one_mul]; apply Real.exp_monotone |
| 355 | cases i with |
| 356 | | none => simp |
| 357 | | some i => simp [Laurent.size,apply_ite Int.natAbs] |
| 358 | lemma carried_shine {p : Momentum} (h : p∈strip (1:ℝ)) (u : Phase (Co P.L α)) (hp : Hearing (balcony (Site P.L)) n (roster u) C) : Hearing (balcony (Plaza P)) n (fun a => WithLp.toLp 2 (fun i => scrap p u a.val i)) (muralRoom P.J*C) := by |
| 359 | let F := fun i : ↥(visitor P.J) × Site P.L => roster u i.2 |
| 360 | have he : Hearing (balcony _) n F C := by rw [← balcony_circus]; exact hp.on_right |
| 361 | have hx : Hearing (balcony (Plaza P)) n (F ∘ mural_obey) (admission P.J*C) := Hearing.crops (g:=_) univ (mural_obey (P:=P)) (mural_inj P|>.injOn) (admit_pos _) (fun i _ => ⟨le_rfl,mural_ports i⟩) (by simp) he |
| 362 | rw [muralRoom,mul_assoc]; apply hx.grows (Real.exp _) (by positivity) |
| 363 | intro i; rw [show (WithLp.toLp 2 (fun j => scrap p u i.val j) : EuclideanSpace ℂ α)=mode p (rent P.L i.val) • F (mural_obey i) from rfl,norm_smul]; exact mul_le_mul_of_nonneg_right (mode_voice i h) (norm_nonneg _) |
| 364 | end tours |
| 365 | |
| 366 | lemma thrones (a : G.Color) {ι : Type} [Fintype ι] (f : G.ColorIndex → ι) (h : Injective f) (u : EuclideanSpace ℂ ι) (he : ∀ i, |a i| ≤ ‖u (f i)‖) : ‖a‖≤ ‖u‖ := by |
| 367 | classical |
| 368 | refine le_of_pow_le_pow_left₀ two_ne_zero (norm_nonneg _) ?_ |
| 369 | rw [EuclideanSpace.norm_sq_eq, EuclideanSpace.norm_sq_eq]; simp_rw [Real.norm_eq_abs] |
| 370 | apply (Finset.sum_le_sum (fun i _ => pow_le_pow_left₀ (abs_nonneg _) (he i) 2)).trans |
| 371 | rw [← Finset.sum_image (f:=fun i => ‖u i‖^2) (by exact h.injOn)] |
| 372 | exact Finset.sum_le_sum_of_subset_of_nonneg (subset_univ _) (by intros; positivity) |
| 373 | |
| 374 | lemma shiny_steps (x : Phase (Acts G P)) (hc : Veil C x n) {p : Momentum} (h : p∈strip (1:ℝ)) : Shiny (StaffP G P (muralRoom P.J*C)) (imprintsC G P p x) n := by |
| 375 | let y := imprintsC G P p x |
| 376 | have hv (u : ℂ → ℝ) (he : ∀ i, |u i| ≤ ‖i‖) : StaffP G P (muralRoom P.J*C) (u ∘ y) n := by |
| 377 | refine ⟨hc.grade.trans (by decide),fun b v => ?_,fun b v => ?_,fun b v => ?_⟩ |
| 378 | · rw [mul_left_comm]; refine (carried_shine h (pawn b x) (hc.fine b)).softer (fun i => thrones _ (fun j => (coord v,j)) (fun j k h => congr_arg Prod.snd h) _ (fun j => ?_)) |
| 379 | exact he (mode p (rent P.L i.val)* x (hymn G P (Sum.inl (b,i,(coord v,j))))) |
| 380 | · let Z := WithLp.toLp 2 (capitals b x) |
| 381 | let l := mode p ((v.map (fun a => step a)).getD 0) |
| 382 | have hp : ‖whipC b v (u∘y)‖≤‖l • (Z : EuclideanSpace ℂ (Loc G 0))‖ := thrones _ (fun j => (vac,j)) (fun j k h => congr_arg Prod.snd h) _ (fun j => by |
| 383 | cases v <;> exact he (y (Sum.inr (Sum.inl (b,_,j))))) |
| 384 | rw [norm_smul] at hp; exact hp.trans (mul_le_mul ((venue_step v h).trans (muralRoom_pos P.J)) (hc.skins b) (norm_nonneg _) (zero_le_one.trans (mural_one P.J))) |
| 385 | · have hh : 0≤C := (slug_nonneg _).trans (hc.bonds b) |
| 386 | apply le_trans (thrones _ (fun j => (coord v,j)) (fun j k h => congr_arg Prod.snd h) (WithLp.toLp 2 (signet b x)) (fun j => ?_)) ((hc.bonds b).trans (le_mul_of_one_le_left hh (mural_one P.J))) |
| 387 | let i := Sum.inr (α:=Bool × Plaza P × Loc G 1) (Sum.inr (α:=Bool×Option Axis× G.ColorIndex) (b,coord v,j)) |
| 388 | change |u (y i)| ≤ ‖signet b x (coord v,j)‖ |
| 389 | have hx : y i=signet b x (coord v,j) := by unfold y; rw [imprints_read]; simp [i,hymn,signet,carol] |
| 390 | rw [hx]; exact he _ |
| 391 | exact ⟨hv Complex.re Complex.abs_re_le_norm,hv Complex.im Complex.abs_im_le_norm⟩ |
| 392 | end YM.Stationary |
| 393 | end |