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.LocalH.Haar |
| 2 | import YM.Next.STATIONARY.Joint.Symmetry |
| 3 | import YM.Work.B16 |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | /-! # Simultaneous color of the centered coordinate germ. Invariant |
| 10 | field gradients of any such scalar vanish at origin jointly, including the |
| 11 | frame variables. Lie action on THE physical coordinates actually used. |
| 12 | -/ |
| 13 | noncomputable section |
| 14 | namespace YM.Stationary |
| 15 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Tree Matrix Module |
| 16 | open scoped Matrix Topology ContDiff BigOperators InnerProductSpace Matrix.Norms.Frobenius |
| 17 | variable {G : Gauge} {c f n : Side} {S : StepData c f} |
| 18 | |
| 19 | variable (u : G.El) |
| 20 | |
| 21 | def solid : Coats G n := fun _ => u |
| 22 | def sigil (x : G.El) := u*x*u⁻¹ |
| 23 | lemma ever_focus : ∀ᶠ v : G.Mat in 𝓝 1, G.focus (G.conjugate u v) = sigil u (G.focus v) := by |
| 24 | have he : Tendsto (G.conjugate u) (𝓝 1) (𝓝 1) := by |
| 25 | have hv := (G.conjugateL u).continuous.tendsto 1 |
| 26 | rw [show G.conjugateL u 1=1 by simp [Gauge.conjugate]] at hv; exact hv |
| 27 | filter_upwards [G.nearest_is_focus,he.eventually G.nearest_is_focus] with x hx hy |
| 28 | obtain ⟨v,h⟩ := G.nearest_exists x; rw [← hx v h] |
| 29 | exact (hy _ <| (G.nearest_right u⁻¹ (u*v) _).2 <| (G.nearest_left u v _).2 h).symm |
| 30 | |
| 31 | lemma solid_arm (u : G.El) : wages S (solid u) (solid u) (1 : Joint G c f) = 1 := by ext i <;> simp [wages,solid,Lattice.gauge] |
| 32 | lemma flare_color (b : Vault G c f) : |
| 33 | Stationary.extend (armUp (solid u) (solid u) b)=wages S (solid u) (solid u) (Stationary.extend b) := by |
| 34 | have hi := arm_root (S:=S) (solid u) (solid u) b (1:Joint G c f) |
| 35 | rwa [solid_arm,mul_one,mul_one] at hi |
| 36 | lemma tincture : stain (m:=n) u = armor (solid u) := by |
| 37 | ext1 x; apply edgeColor.injective; funext i |
| 38 | rw [armor_at] |
| 39 | change arm G n 1 (stain u x) _= _; simp only [stain,ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe,(arm _ _ _).apply_symm_apply]; rfl |
| 40 | |
| 41 | variable (t : S.Choices) (h : S.patch.Branches S.kernel G) |
| 42 | include h |
| 43 | lemma frame_sig (i : Site c) (U : Config G f) : |
| 44 | prospect S t (Lattice.gauge (solid u) U) i=G.conjugate u (prospect S t U i) := by |
| 45 | have hp j : S.frames (Lattice.gauge (solid u) U) t.1 i j=u*S.frames U t.1 i j*u⁻¹ := by |
| 46 | rw [StepData.frames,expandAt_gauge,(S.patch.frame_gauged h ..).2]; rfl |
| 47 | unfold prospect Gauge.conjugate |
| 48 | simp only [hp,G.mat_mul,G.mat_inv,Finset.mul_sum,Finset.sum_mul,smul_mul_assoc,mul_smul_comm] |
| 49 | lemma fedora_u {X : Type} [NormedAddCommGroup X] [NormedSpace ℝ X] {U : X → Joint G c f} (H : Thaw U 0) (he : (U 0).1=1) : |
| 50 | ∀ᶠ z in 𝓝 0, enroll S t (wages S (solid u) (solid u) (U z))=wages S (solid u) (solid u) (enroll S t (U z)) := by |
| 51 | have hv (i) : ∀ᶠ z in 𝓝 0,bears S t (Lattice.gauge (solid u) (U z).1) i=u*bears S t (U z).1 i*u⁻¹ := by |
| 52 | simp_rw [bears,frame_sig u t h]; apply Filter.Tendsto.eventually _ (ever_focus u) |
| 53 | let L z := prospect S t (U z).1 i |
| 54 | have hp : ContDiffAt ℝ ω L 0 := ContDiffAt.sum fun j _ => (H.1.frame h t he i j).const_smul _ |
| 55 | have ht : L 0=1 := by simp [L,he,prospect_zero S t h] |
| 56 | exact ht ▸ hp.continuousAt.tendsto |
| 57 | filter_upwards [eventually_all.mpr hv] with z hz |
| 58 | refine Prod.ext rfl ?_; funext i |
| 59 | simp only [wages,enroll,solid,Pi.mul_apply,Pi.inv_apply]; rw [hz]; group |
| 60 | end YM.Stationary |
| 61 | end |
| 62 | |
| 63 | /-! # Invariance under color forces field-gradients to vanish on scalar full or compare |
| 64 | matrices (off shell at flat, in joint coordinates). `Simple` REAL. -/ |
| 65 | noncomputable section |
| 66 | namespace YM.Stationary |
| 67 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Tree Matrix Module |
| 68 | open scoped Matrix Topology ContDiff BigOperators InnerProductSpace Matrix.Norms.Frobenius |
| 69 | variable {G : Gauge} {c f n : Side} {S : StepData c f} |
| 70 | |
| 71 | lemma color_pitch (x y : G.Color) : HasDerivAt (fun t : ℝ => G.adjoint (G.lieExp (t • x)) y) (G.ad x y) 0 := by |
| 72 | have hh := G.projectColor.toContinuousLinearMap.hasFDerivAt.comp_hasDerivAt (0:ℝ) |
| 73 | (((exp_ray x).mul_const (G.colorMat y)).mul (exp_ray x).star) |
| 74 | change HasDerivAt _ (G.projectColor (G.colorMat x*G.colorMat y-G.colorMat y*G.colorMat x)) _ |
| 75 | convert! hh using 1; simp [G.colorMat_skew]; rfl |
| 76 | |
| 77 | lemma color_fixed_at (h : G.Simple) (x : G.Color) (he : ∀ u, G.adjoint u x=x) : x=0 := by |
| 78 | have hi a : G.ad a x=0 := HasDerivAt.unique (color_pitch a x) (by simp only [he]; exact hasDerivAt_const 0 x) |
| 79 | let P := Submodule.span ℝ ({x} : Set G.Color) |
| 80 | have ht (a : G.Color) (y : G.Color) (p : y∈P) : G.ad a y=0 := by |
| 81 | obtain ⟨b,rfl⟩ := Submodule.mem_span_singleton.mp p |
| 82 | rw [map_smul,hi,smul_zero] |
| 83 | have hf : P≠⊤ := fun hv => by |
| 84 | obtain ⟨a,y,ha⟩ := h.nonabelian; exact ha (ht a y (by simp only [hv,Submodule.mem_top])) |
| 85 | have hs : P=⊥ := (h.ideals P (fun i j hj => by rw [ht _ _ hj]; exact P.zero_mem)).resolve_right hf |
| 86 | exact Submodule.mem_bot ℝ |>.mp (hs ▸ (Submodule.subset_span (show x∈ ({x}:Set G.Color) from Set.mem_singleton _) : x∈P)) |
| 87 | |
| 88 | lemma color_fixed (h : G.Simple) {X : Type} [NormedAddCommGroup X] [NormedSpace ℝ X] (F : G.Color →L[ℝ] X) |
| 89 | (he : ∀ u x, F (G.adjoint u x)=F x) : F=0 := by |
| 90 | let P := F.toLinearMap.ker |
| 91 | have hp (x y : G.Color) : F (G.ad x y)=0 := by |
| 92 | have hx := F.hasFDerivAt.comp_hasDerivAt 0 (color_pitch x y) |
| 93 | change HasDerivAt (fun v : ℝ => F (G.adjoint (G.lieExp (v • x)) y)) _ _ at hx |
| 94 | simp_rw [he] at hx; exact hx.unique (hasDerivAt_const ..) |
| 95 | have hh : P≠⊥ := by |
| 96 | obtain ⟨x,y,he⟩ := h.nonabelian |
| 97 | intro h |
| 98 | refine he (Submodule.mem_bot ℝ |>.mp (h ▸ (show G.ad x y ∈ P from hp x y))) |
| 99 | have hv := (h.ideals P (fun i j _ => (show G.ad i j∈P from hp i j))).resolve_left hh |
| 100 | ext m; exact (show m∈P from hv.symm ▸ Submodule.mem_top) |
| 101 | |
| 102 | section slots |
| 103 | variable {X Y : Type} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] |
| 104 | lemma chain_fixed {F : X→Y} (A : X→L[ℝ] X) (h : F∘A=ᶠ[𝓝 0] F) (hp : DifferentiableAt ℝ F 0) (x : X) : |
| 105 | fderiv ℝ F 0 (A x)=fderiv ℝ F 0 x := by |
| 106 | have hv := h.fderiv_eq (𝕜:=ℝ) |
| 107 | rw [fderiv_comp 0 (by rw [map_zero]; exact hp) A.differentiableAt,map_zero,A.fderiv] at hv |
| 108 | exact DFunLike.congr_fun hv x |
| 109 | |
| 110 | variable (h : G.Simple) |
| 111 | include h |
| 112 | lemma slot_fixed {ι : Type} [Fintype ι] [DecidableEq ι] (f : (ι → G.Color) →L[ℝ] X) (he : ∀ u : G.El, ∀ v : ι→ G.Color, f (fun z => G.adjoint u (v z))=f v) : |
| 113 | ∀ y,f y=0 := by |
| 114 | have hp i (x : G.Color) : f (Pi.single i x)=0 := by |
| 115 | let F : G.Color→L[ℝ] X := f ∘L ContinuousLinearMap.single ℝ (φ:=fun _ => G.Color) i |
| 116 | apply DFunLike.congr_fun (color_fixed h F ?_) x |
| 117 | intro u y; change f (Pi.single i _)=f (Pi.single i y) |
| 118 | rw [← he u (Pi.single i y)]; congr; funext k; by_cases hv : k=i <;> simp [hv] |
| 119 | intro y; rw [← show ∑ i,Pi.single i (y i)=y by ext1 i; simp [Finset.sum_apply,Pi.single_apply], map_sum]; simp only [hp, Finset.sum_const_zero] |
| 120 | lemma oneFlag (f : Link G n →L[ℝ] X) (he : ∀ u : G.El, ∀ v,f (armor (solid u) v)=f v) : ∀ x, f x=0 := by |
| 121 | have ht (x : Edge (Site n) → G.Color) : f (edgeColor.symm x)=0 := by |
| 122 | apply slot_fixed h (f ∘L edgeColor.symm.toContinuousLinearMap) ?_ x |
| 123 | intro u y; change f (edgeColor.symm _)=f (edgeColor.symm y); rw [← he u (edgeColor.symm y)] |
| 124 | apply congr_arg f; apply edgeColor.injective; funext i; rw [armor_at]; simp [solid] |
| 125 | intro x; simpa only [edgeColor.symm_apply_apply] using ht (edgeColor x) |
| 126 | lemma flagSite (f : BaseSites G n →L[ℝ] X) (he : ∀ u : G.El, ∀ v,f (armorG (solid u) v)=f v) : ∀ x,f x=0 := by |
| 127 | have ht (x : Site n → G.Color) : f (gaugeColor.symm x)=0 := by |
| 128 | apply slot_fixed h (f ∘L gaugeColor.symm.toContinuousLinearMap) ?_ x |
| 129 | intro u y; change f (gaugeColor.symm _)=f (gaugeColor.symm y); rw [← he u (gaugeColor.symm y)] |
| 130 | apply congr_arg f; apply gaugeColor.injective; funext i; rw [armorG_at]; simp [solid] |
| 131 | intro x; simpa only [gaugeColor.symm_apply_apply] using ht (gaugeColor x) |
| 132 | end slots |
| 133 | |
| 134 | def starsky (u : G.El) : Point G c f →L[ℝ] Point G c f := |
| 135 | (armor (solid u)).prodMap (armUp (solid u) (solid u)) |
| 136 | lemma triple_star (h : G.Simple) {F : Point G c f → ℝ} (p : ∀ u : G.El, F∘starsky u =ᶠ[𝓝 0] F) (he : DifferentiableAt ℝ F 0) : fderiv ℝ F 0=0 := by |
| 137 | let A := fderiv ℝ F 0 |
| 138 | have hp (u : G.El) (x : Point G c f) : A (starsky u x)= A x := chain_fixed _ (p u) he x |
| 139 | let L := ContinuousLinearMap.inl ℝ (Link G c) (Vault G c f) |
| 140 | let P := ContinuousLinearMap.inr ℝ (Link G c) (Vault G c f) |
| 141 | let M := P ∘L ContinuousLinearMap.inl ℝ (Link G f) (BaseSites G c) |
| 142 | let N := P ∘L ContinuousLinearMap.inr ℝ (Link G f) (BaseSites G c) |
| 143 | have hl (u : G.El) x : starsky u (L x)=L (armor (solid u) x) := Prod.ext rfl (map_zero (armUp (solid (n:=f) u) (solid (n:=c) u))) |
| 144 | have hm (u : G.El) x : starsky u (M x)=M (armor (solid u) x) := Prod.ext (map_zero (armor (solid (n:=c) u))) (Prod.ext rfl (map_zero (armorG (solid (n:=c) u)))) |
| 145 | have hn (u : G.El) x : starsky u (N x)=N (armorG (solid u) x) := Prod.ext (map_zero (armor (solid (n:=c) u))) (Prod.ext (map_zero (armor (solid (n:=f) u))) rfl) |
| 146 | apply ContinuousLinearMap.ext; intro v |
| 147 | rw [show v=L v.1 + M v.2.1 + N v.2.2 by |
| 148 | apply Prod.ext |
| 149 | · change v.1=v.1+0+0; simp |
| 150 | exact Prod.ext (by change v.2.1=0+v.2.1+0; simp) (by change v.2.2=0+0+v.2.2; simp),map_add,map_add] |
| 151 | change A _ + A _ + A _= 0 |
| 152 | have ha (x) : A (L x) = 0 := oneFlag h (A ∘L L) (fun u x => (congr_arg A (hl u x).symm).trans (hp u (L x))) x |
| 153 | have hw (x) : A (M x) = 0 := oneFlag h (A ∘L M) (fun u x => (congr_arg A (hm u x).symm).trans (hp u (M x))) x |
| 154 | have he (x) : A (N x) = 0 := flagSite h (A ∘L N) (fun u x => (congr_arg A (hn u x).symm).trans (hp u (N x))) x |
| 155 | rw [ha,hw,he]; simp |
| 156 | end YM.Stationary |
| 157 | end |
| 158 | |
| 159 | /-! |
| 160 | # Simultaneous constant-color covariance in centered patch. Used before |
| 161 | linearizing on the graph, so NOT assuming stationarity during this transport. |
| 162 | Group logarithm in rocket/shield still means the real germ. |
| 163 | -/ |
| 164 | noncomputable section |
| 165 | namespace YM.Stationary |
| 166 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Tree Matrix Module |
| 167 | open scoped Matrix Topology ContDiff BigOperators InnerProductSpace Matrix.Norms.Frobenius |
| 168 | variable {G : Gauge} {c f n : Side} {S : StepData c f} |
| 169 | |
| 170 | lemma point_shifts (u : G.El) (x : Point G c f) : |
| 171 | Stationary.extend (starsky u x).2 = wages S (solid u) (solid u) (Stationary.extend x.2) := flare_color .. |
| 172 | lemma solid_color (u : G.El) (x : Point G c f) : input G c (starsky u x).1 = Lattice.gauge (solid u) (input G c x.1) := by |
| 173 | change input G c (armor (solid u) _)=_; rw [← tincture, ← stain_cons]; rfl |
| 174 | |
| 175 | section ramp |
| 176 | variable {p : Clip} {R : PathData G} {μ σ C Λ : ℝ} |
| 177 | (h : S.patch.Branches S.kernel G) (t : S.Choices) (u : G.El) |
| 178 | |
| 179 | include h |
| 180 | def ColorX (z : Point G c f) := Stationary.extend (starsky u z).2 |
| 181 | def ColorV (z : Point G c f) := input G c (starsky u z).1 |
| 182 | local notation "χ" => solid (n:=c) u |
| 183 | local notation "Χ" => solid (n:=f) u |
| 184 | |
| 185 | omit h in |
| 186 | lemma tilt_f (U : Joint G c f) (L : Vault G c f) : |
| 187 | Stationary.extend (armUp Χ χ L)*wages S Χ χ U=wages S Χ χ (Stationary.extend L*U) := arm_root .. |
| 188 | lemma enhance : ∀ᶠ z : Point G c f × Vault G c f in 𝓝 0, |
| 189 | atire (fedora S t) (ColorX u z.1) (armUp Χ χ z.2) = |
| 190 | wages S Χ χ (atire (fedora S t) (Stationary.extend z.1.2) z.2) := by |
| 191 | let Y := Point G c f |
| 192 | let Q := fun z : Y × Vault G c f => Stationary.extend z.2 * Stationary.extend z.1.2 |
| 193 | have he : Thaw Q 0 := (Thaw.through contDiffAt_snd).mul (Thaw.through (v:=fun y : Y × Vault G c f => y.1.2) contDiffAt_fst.snd) |
| 194 | filter_upwards [fedora_u u t h he (by simp [Q])] with z hz; simp only [ColorX,atire,point_shifts (S:=S),arm_root]; exact hz |
| 195 | |
| 196 | lemma drag : |
| 197 | ∀ᶠ z : Point G c f × Vault G c f in 𝓝 0, |
| 198 | rocket S t (fedora S t) (ColorX u z.1) (armUp Χ χ z.2)=armorG Χ (rocket S t (fedora S t) (Stationary.extend z.1.2) z.2) := by |
| 199 | let Y := Point G c f × Vault G c f |
| 200 | let F : Y → Joint G c f := fun z => Stationary.extend z.1.2 |
| 201 | let K := fedora S t (G:=G) |
| 202 | let A (z : Y) : Coats G f := (shield S t (dress K (F z)))⁻¹ * shield S t (atire K (F z) z.2) |
| 203 | have ht : A 0=1 := by simp [A] |
| 204 | have hf : Thaw F 0 := Thaw.through contDiffAt_fst.snd |
| 205 | have h0 : (F 0).1=1 := by simp [F] |
| 206 | have hp : Thaw (fun z : Y => atire K (F z) z.2) 0 := sport_thaw (fedora_style h t) ((Thaw.through contDiffAt_snd).mul hf) (by simp [h0]) |
| 207 | have hb : Army A 0 := ((sport_thaw (fedora_style h t) hf h0).shields h t h0).inv.mul (hp.shields h t (he:=by simp [atire_zero]; exact h0)) |
| 208 | filter_upwards [enhance h t u,fedora_u u t h hf h0,(show Tendsto A (𝓝 0) (𝓝 1) from ht ▸ hb.cont.tendsto).eventually (frame_log_shift Χ)] with z hz hx hy |
| 209 | rw [rocket,rocket, hz,map_neg]; apply congr_arg Neg.neg; change _=armorG Χ (frameLog (A z)); rw [← hy] |
| 210 | rw [ColorX,point_shifts (S:=S),enroll_dress] |
| 211 | simp only [show enroll S t (wages S Χ χ (Stationary.extend z.1.2))=_ from hx, shields S t h,A]; apply congr_arg frameLog; funext i |
| 212 | simp only [← enroll_dress,Pi.mul_apply,Pi.inv_apply,F,K] |
| 213 | group |
| 214 | |
| 215 | variable (hp : R.Bounds p σ C Λ) (hy : 0<μ) |
| 216 | include hp hy |
| 217 | |
| 218 | theorem veneration : ∀ᶠ z : Point G c f in 𝓝 0, |
| 219 | bounty S p R μ t (fedora S t) (ColorV u z) (ColorX u z)= bounty S p R μ t (fedora S t) (input G c z.1) (Stationary.extend z.2) := by |
| 220 | let U := fun z : Point G c f => Stationary.extend z.2 |
| 221 | let V := fun z : Point G c f => input G c z.1 |
| 222 | have hV (z : Point G c f) : ColorV u z=Lattice.gauge χ (V z) := solid_color u z |
| 223 | have hU (z : Point G c f) : (ColorX u z).1=Lattice.gauge Χ (U z).1 := congrArg Prod.fst (point_shifts (S:=S) u z) |
| 224 | let K := fedora S t (G:=G) |
| 225 | let F := fun x : Point G c f × Vault G c f => atire K (ColorX u x.1) x.2 |
| 226 | have H := Thaw.through (v:=fun x : Point G c f => x.2) (x:=0) contDiffAt_snd |
| 227 | have hX : Thaw (ColorX u (f:=f) (c:=c)) 0 := Thaw.through (v:=fun x : Point G c f => (starsky u x).2) (starsky u).contDiff.contDiffAt.snd |
| 228 | have hx : ColorX u (0:Point G c f)=1 := by simp [ColorX] |
| 229 | have he : Thaw F 0 := sport_thaw (fedora_style h t) |
| 230 | ((Thaw.through contDiffAt_snd).mul (Thaw.comp (w:=Prod.fst) (g:=ColorX u (f:=f) (c:=c)) hX (x:=0) contDiffAt_fst)) (by simp [hx]) |
| 231 | have hl : ContDiffAt ℝ ω (fun z : Point G c f × Vault G c f => burnJoint S t p R K (ColorV u z.1) (ColorX u z.1) z.2) 0 := he.earn h t |
| 232 | (by change (atire K (ColorX u (0:Point G c f)) 0).1=_; rw [atire_zero,hx]; rfl) (Army.powL (v:=fun z : Point G c f × Vault G c f => (starsky u z.1).1) (((starsky u).contDiff.contDiffAt.comp (f:=Prod.fst) (x:=0) contDiffAt_fst).fst)) hp |
| 233 | have hu := explosive S t h (fedora_style h t) H (by simp) |
| 234 | have hw : Tendsto (fun z : Point G c f => (z,(0 : Vault G c f))) (𝓝 0) (𝓝 0) := tendsto_id.prodMk_nhds tendsto_const_nhds |
| 235 | filter_upwards [hw.eventually (hl.eventually (by simp)),hu, |
| 236 | explosive S t h (fedora_style h t) hX (by rw [hx]; rfl),hw.eventually (eventually_eventually_nhds.mpr (drag h t u)), hw.eventually (eventually_eventually_nhds.mpr (enhance h t u))] with z hz hH hi hd he |
| 237 | let L : Vault G c f →L[ℝ] Vault G c f := armUp Χ χ |
| 238 | let D := tactics Χ χ |
| 239 | have hf : ContDiffAt ℝ ω (burnJoint S t p R K (ColorV u z) (ColorX u z)) 0 := Work.F05.hold_jet (V:=fun z => burnJoint S t p R K (ColorV u z) (ColorX u z)) hz |
| 240 | have hp' : burnJoint S t p R K (ColorV u z) (ColorX u z) ∘ L =ᶠ[𝓝 0] burnJoint S t p R K (V z) (U z) := by |
| 241 | filter_upwards [Work.F05.hold_near (x:=z) (y:=(0:Vault G c f)) (V:=fun z => atire K (ColorX u z.1) (L z.2)=wages S Χ χ (atire K (U z.1) z.2)) he] with x hx'; simp only [hV,Function.comp_apply,burnJoint]; exact (congr_arg (muster S t p R _) hx').trans (root_wages S t h _ _ _ p R hp _) |
| 242 | have hx' : indexX S t K (ColorX u z)*D= troop Χ *indexX S t K (U z) := by |
| 243 | have he : rocket S t K (ColorX u z) ∘ L =ᶠ[𝓝 0] armorG Χ ∘ rocket S t K (U z) := Work.F05.hold_near (x:=z) (y:=0) hd |
| 244 | exact rate_transfer (helmets _ _ _) (pocket (Lines G f 0)) _ _ he (market S t K _ hi) (market S t K _ hH) |
| 245 | have hP := battery (U z).1 hy Χ |
| 246 | have ht : cannonade S t μ K (ColorX u z)*D=troop Χ*cannonade S t μ K (U z) := by |
| 247 | rw [cannonade,Matrix.add_mul, Matrix.mul_assoc, show rearM G c f*D=_ from rear_tactics Χ χ, ← Matrix.mul_assoc,hU,(troop_orthogonal Χ).transpose_cross (trench_orthogonal Χ) (mail_carry Χ _), Matrix.mul_assoc,cannonade,Matrix.mul_add, Matrix.mul_assoc (cannon μ _),hx', ← Matrix.mul_assoc (cannon μ _),hP.1,Matrix.mul_assoc] |
| 248 | have hh : Dᵀ * medals S t p R μ K (ColorV u z) (ColorX u z) * D=medals S t p R μ K (V z) (U z) := by |
| 249 | rw [medals,Matrix.mul_add, Matrix.add_mul,medals]; exact congr_arg₂ _ ((damage_rate _ (helmets G c f) _ _ hf).symm.trans (damage_congr _ hp')) (gram_bend _ _ _ (troop_orthogonal _) ht) |
| 250 | have HG : (grenade μ (ColorX u z).1).det=(grenade μ (U z).1).det := by |
| 251 | rw [hU]; exact (troop_orthogonal Χ).turn_det ((troop_orthogonal Χ).back hP.2) |
| 252 | exact congr_arg₂ (fun x y => _ * Real.log x-Real.log y) ((tactics_orthogonal Χ χ).turn_det hh) HG |
| 253 | end ramp |
| 254 | end YM.Stationary |
| 255 | end |
| 256 | |
| 257 | /-! |
| 258 | # Linear soldier sufficient for the quadratic bounty. Inherited loop |
| 259 | read here inherits the SAME stationarity choice/period; costs not given |
| 260 | by these fixed-mesh identities. |
| 261 | -/ |
| 262 | noncomputable section |
| 263 | namespace YM.Stationary |
| 264 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Tree Matrix Module |
| 265 | open scoped Matrix Topology ContDiff BigOperators InnerProductSpace Matrix.Norms.Frobenius |
| 266 | variable {G : Gauge} {c f n : Side} {S : StepData c f} {F : Forest S.ratio} |
| 267 | |
| 268 | variable (p : Clip) (R : PathData G) (μ : ℝ) (S) (t : S.Choices) |
| 269 | |
| 270 | def elevation (x : Point G c f) := bounty S p R μ t (fedora S t) (input G c x.1) (Stationary.extend x.2) |
| 271 | def saluteLe (W : Matrix (Body 1 f) (Body 1 c) ℝ) : Link G c →L[ℝ] Point G c f := (ContinuousLinearMap.id _ _).prod (endorse W) |
| 272 | |
| 273 | lemma bonanza (V : Config G c) (U : Joint G c f) (K : Robe G c f) (he : Apparel K U) (hp : Explosives S t 1 (dress K U)) (hh : Shell S t p R V (dress K U)) : |
| 274 | bounty S p R μ t K V U=bounty S p R μ t 1 V (dress K U) := by |
| 275 | simp only [bounty,abides S t p R μ K V U he hp hh, Matrix.det_mul,det_transpose, shear_det K U he,mul_one,one_mul]; rfl |
| 276 | |
| 277 | variable {S t p R μ} {σ A Λ η : ℝ} {P : ChartRatio G} {W : Matrix (Body 1 f) (Body 1 c) ℝ} |
| 278 | {ρ : fieldDir G c 1 → AxisChart G F} |
| 279 | |
| 280 | section step |
| 281 | variable (hc : Critical F p R ρ) (h : S.patch.Branches S.kernel G) (hp : R.Bounds p σ A Λ) (t : S.Choices) (hμ : 0<μ) |
| 282 | include hc h hp hμ |
| 283 | lemma moment_track (hz : PriceGap F p R η) (he : 0<η) : |
| 284 | 0<(medals S t p R μ (fedora S t) 1 1).det ∧ ContDiffAt ℝ ω (elevation S p R μ t) 0 := by |
| 285 | obtain ⟨P,hP⟩ := LocalH.actual G |
| 286 | have ht : 0 < (medals S t p R μ 1 (1:Config G c) 1).det := by simpa only [input_zero,encamp_zero hc] using (tribute hc h hp hz he hμ t hP).self_of_nhds.1 |
| 287 | let U := (1:Joint G c f) |
| 288 | have hu : Thaw (fun _ : ℝ => U) 0 := Thaw.fixed _ _ |
| 289 | let K := fedora S t (G:=G) |
| 290 | have hK := fedora_style h t |
| 291 | have hf : dress K U=U := dressed_one hK |
| 292 | have hi := (explosive S t h root_customs hu rfl).self_of_nhds |
| 293 | have hh := (atire_out hK hu rfl).self_of_nhds |
| 294 | have H : Shell S t p R 1 U := by simpa only [input_zero, encamp_zero hc] using (camp_station hc h hp t).self_of_nhds |
| 295 | have h1 : 0 < (medals S t p R μ K 1 U).det := by |
| 296 | have hb := abides S t p R μ K 1 U hh (by rw [hf]; exact hi) (by rw [hf]; exact H) |
| 297 | rwa [hb,Matrix.det_mul,Matrix.det_mul,det_transpose,shear_det K U hh,one_mul,mul_one,hf] |
| 298 | refine ⟨h1,?_⟩ |
| 299 | let Q := fun x : Point G c f => Stationary.extend x.2 |
| 300 | let V := fun x : Point G c f => input G c x.1 |
| 301 | have hQ : Q 0=1 := by simp [Q] |
| 302 | have hV : V 0=1 := by simp [V] |
| 303 | have hp' : Thaw Q 0 := Thaw.through (x:=0) contDiffAt_snd |
| 304 | have hM := Memo.det_val (ammo_pay Q V hp' (by rw [hQ]; rfl) (by apply Army.powL (v:=Prod.fst); exact contDiffAt_fst) K hK h t hp hμ).2.1 |
| 305 | exact ContDiffAt.sub (ContDiffAt.mul contDiffAt_const (hM.log (by rw [hV,hQ]; exact h1.ne'))) |
| 306 | ((Memo.det_val (memo_flash hμ hp'.1).2.2).log (grenade_safe (Q 0).1 hμ).det_pos.ne') |
| 307 | |
| 308 | lemma elect (hG : G.Simple) (W : Matrix (Body 1 f) (Body 1 c) ℝ) (hw : Guessed F W ρ) (hv : PriceGap F p R η) (hz : 0<η) : |
| 309 | iteratedFDeriv ℝ 2 (honorarium F t μ p R ρ) 0 = iteratedFDeriv ℝ 2 (elevation S p R μ t ∘ saluteLe (G:=G) W) 0 := by |
| 310 | let E := elevation S p R μ t |
| 311 | have he : ∀ u : G.El, E ∘ starsky u =ᶠ[𝓝 0] E := fun u => veneration h t u hp hμ |
| 312 | have hE : ContDiffAt ℝ ω E 0 := (moment_track hc h hp t hμ hv hz).2 |
| 313 | have hd : fderiv ℝ E 0=0 := triple_star hG he (hE.differentiableAt (by simp)) |
| 314 | let D := soldier F W t ρ |
| 315 | let L := fun x : Link G c => (x,D x) |
| 316 | let X := fun x => Stationary.extend (D x) |
| 317 | let K := fedora S t (G:=G) |
| 318 | have hm : Thaw X 0 := Thaw.through (soldier_diff hc h t) |
| 319 | have hD : D 0=0 := soldier_zero hc h t |
| 320 | have hX : (X 0).1=1 := by unfold X; rw [hD,extend_zero]; rfl |
| 321 | have hh : Thaw (liftedUp F W ρ) 0 := liftedThaw hc |
| 322 | have hl : E ∘ L=ᶠ[𝓝 0] honorarium F t μ p R ρ := by |
| 323 | filter_upwards [atire_out (fedora_style h t) hm hX, explosive S t h root_customs (camp_thaw hc) (by rw [encamp_zero hc]; rfl),explosive S t h root_customs hh (by rw [lift_origin hc]; rfl), veteran_status hc h t (W:=W) hp,wage_live hc h (W:=W) t] |
| 324 | with z hz hn hH hr ht |
| 325 | have H : dress K (X z)=liftedUp F W ρ z := ht |
| 326 | change bounty S p R μ t K (input G c z) (X z)=_ |
| 327 | rw [bonanza S p R μ t _ _ _ hz (by rw [H]; exact hH) (by rw [H]; exact hr), H] |
| 328 | have he := bounty_carry h t (salute F W z) 1 (encamp F ρ z) (input G c z) hp hn hH hμ (by rw [gauge_one]; exact hr.1) |
| 329 | rw [gauge_one] at he; exact he |
| 330 | let T := saluteLe (G:=G) W |
| 331 | have hT : HasFDerivAt L T 0 := by |
| 332 | have hd := (soldier_diff hc h t (W:=W)).differentiableAt (by simp) |>.hasFDerivAt |
| 333 | rw [soldier_known hc h t hw] at hd |
| 334 | exact (hasFDerivAt_id _).prodMk hd |
| 335 | have H : L 0=0 := Prod.ext rfl hD |
| 336 | rw [← (hl.iteratedFDeriv ℝ 2).eq_of_nhds] |
| 337 | ext1 v |
| 338 | rw [show v=![v 0,v 1] by funext i; fin_cases i <;> rfl] |
| 339 | rw [(Work.F03.hessian_comp H (hE.of_le le_top) (contDiffAt_id.prodMk (soldier_diff hc h t |>.of_le le_top)) hd).2, hT.fderiv, |
| 340 | (Work.F03.hessian_comp (g:=T) T.map_zero (hE.of_le le_top) (T.contDiff.contDiffAt) hd).2,T.fderiv] |
| 341 | |
| 342 | omit hμ |
| 343 | include t |
| 344 | lemma inherited_le (W : Matrix (Body 1 f) (Body 1 c) ℝ) (hw : Guessed F W ρ) : |
| 345 | iteratedFDeriv ℝ 2 (burnished F R ρ) 0=iteratedFDeriv ℝ 2 ((turnSeries (m:=f) R.loop) ∘ uniformM (G:=G) W) 0 := by |
| 346 | let D := soldier F W t ρ |
| 347 | have hf : burnished F R ρ =ᶠ[𝓝 0] (turnSeries (m:=f) R.loop) ∘ (fun z => (D z).1) := by |
| 348 | filter_upwards [wage_live (W:=W) hc h t] with z hz |
| 349 | have hp : (Precision.loop R ((liftedUp F W ρ z).1))=Precision.loop R (encamp F ρ z).1 := Work.F05.loop_gauge hp .. |
| 350 | rw [← hz] at hp; exact hp.symm |
| 351 | have he := turns_analytic R.loop hp.width hp.two (m:=f) |
| 352 | have hd : fderiv ℝ (turnSeries R.loop (m:=f)) 0=0 := by |
| 353 | have hv := turns_low R.loop hp.width hp.two (m:=f) |
| 354 | have ht := (rays_jet he _).1 hv 1 (by decide) |
| 355 | apply ContinuousLinearMap.ext; intro x |
| 356 | simpa [iteratedFDeriv_one_apply] using DFunLike.congr_fun ht ![x] |
| 357 | have hD : D 0=0 := soldier_zero hc h t |
| 358 | have ht : fderiv ℝ (fun z => (D z).1) 0=uniformM W := by |
| 359 | let L := ContinuousLinearMap.fst ℝ (Link G f) (BaseSites G c) |
| 360 | have hp := fderiv_comp (0:Link G c) (g:=L) (f:=D) L.differentiableAt ((soldier_diff hc h t).differentiableAt (by simp)) |
| 361 | rw [L.fderiv, show fderiv ℝ D 0=_ from soldier_known hc h t hw] at hp; exact hp |
| 362 | let T := uniformM (G:=G) W |
| 363 | rw [(hf.iteratedFDeriv ℝ 2).eq_of_nhds]; ext1 v |
| 364 | rw [show v=![v 0,v 1] by funext i; fin_cases i <;> rfl] |
| 365 | rw [(Work.F03.hessian_comp (show (D 0).1=0 from congrArg Prod.fst hD) he.contDiffAt ((soldier_diff hc h t |>.of_le le_top).fst) hd).2, ht, |
| 366 | (Work.F03.hessian_comp (g:=T) T.map_zero he.contDiffAt (T.contDiff.contDiffAt) hd).2,T.fderiv] |
| 367 | end step |
| 368 | end YM.Stationary |
| 369 | end |
| 370 | |
| 371 | /-! # Matrix trace-log derivatives, real and in finite counting conventions. -/ |
| 372 | noncomputable section |
| 373 | namespace YM.Stationary |
| 374 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Tree Matrix Module Finset |
| 375 | open scoped Matrix Topology ContDiff BigOperators InnerProductSpace Matrix.Norms.Frobenius |
| 376 | variable {G : Gauge} {c f n : Side} {S : StepData c f} |
| 377 | variable {j m k : Type} {X Y : Type} |
| 378 | section vectors |
| 379 | variable [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] |
| 380 | |
| 381 | def directionM (M : X → Matrix j k ℝ) (x u : X) := Matrix.of fun i b => fderiv ℝ (fun a => M a i b) x u |
| 382 | def bendM (M : X → Matrix j k ℝ) (x u v : X) := Matrix.of fun i b => iteratedFDeriv ℝ 2 (fun a => M a i b) x ![u,v] |
| 383 | lemma directions_congr {M N : X→ Matrix j k ℝ} {x u : X} (he : M =ᶠ[𝓝 x] N) : directionM M x u=directionM N x u := by |
| 384 | ext i j; simp only [directionM,Matrix.of_apply,show fderiv ℝ (fun a => M a i j) x=fderiv ℝ (fun a => N a i j) x from Filter.EventuallyEq.fderiv_eq (he.mono fun a ha => congr_arg (fun f => (f : Matrix _ _ ℝ) i j) ha)] |
| 385 | lemma direction_zero (L : Matrix j k ℝ) (x y : X) : directionM (fun _ => L) x y=0 := by ext; simp [directionM] |
| 386 | lemma divided {M : X→ Y} {x} (u v : X) (h : ContDiffAt ℝ ω M x) : fderiv ℝ (fun a => fderiv ℝ M a v) x u=iteratedFDeriv ℝ 2 M x ![u,v] := by |
| 387 | have hv := (ContinuousLinearMap.apply ℝ Y v).hasFDerivAt.comp x ((h.fderiv_right (m:=ω) (by simp)).differentiableAt (by simp)).hasFDerivAt |
| 388 | change HasFDerivAt (fun a => fderiv ℝ M a v) _ _ at hv |
| 389 | rw [iteratedFDeriv_two_apply,hv.fderiv]; rfl |
| 390 | lemma memo_corner {M : X → Matrix j k ℝ} {x} (h : Memo M x) (u) : Memo (fun a => directionM M a u) x := fun i j => ((h i j).fderiv_right (m:=ω) (by simp)).clm_apply contDiffAt_const |
| 391 | lemma coins_M {M : X → Matrix j k ℝ} {x} (h : Memo M x) (u v : X) : directionM (fun a => directionM M a v) x u=bendM M x u v := by |
| 392 | ext i j; exact divided _ _ (h i j) |
| 393 | lemma direction_prod [Fintype k] {U : X→Matrix j k ℝ} {V : X→Matrix k m ℝ} {x} (hu : Memo U x) (hv : Memo V x) (y) : |
| 394 | directionM (fun u => U u * V u) x y = directionM U x y * V x + U x * directionM V x y := by |
| 395 | ext i j; simp only [directionM,Matrix.of_apply,Matrix.mul_apply, Matrix.add_apply, ← Finset.sum_add_distrib]; rw [fderiv_fun_sum, _root_.sum_apply] |
| 396 | · refine Finset.sum_congr rfl fun k _ => ?_; rw [fderiv_fun_mul ((hu i k).differentiableAt (by simp)) ((hv k j).differentiableAt (by simp))]; simp; ring |
| 397 | intro k _; exact ((hu i k).mul (hv k j)).differentiableAt (by simp) |
| 398 | |
| 399 | variable [Fintype k] [DecidableEq k] |
| 400 | omit [DecidableEq k] in |
| 401 | lemma eventually_memo {U : X→Funds k} {x} (h : Memo U x) : ∀ᶠ y in 𝓝 x, Memo U y := |
| 402 | eventually_all.mpr fun i => eventually_all.mpr fun j => (h i j).eventually (by simp) |
| 403 | lemma direction_inverse {U : X→Funds k} {x} (h : Memo U x) (he : (U x).det ≠ 0) (y) : |
| 404 | directionM (fun a => (U a)⁻¹) x y= -((U x)⁻¹ * directionM U x y * (U x)⁻¹) := by |
| 405 | let F := fun a => (U a)⁻¹ |
| 406 | have heq : (fun a => F a * U a) =ᶠ[𝓝 x] fun _ => (1:Funds k) := by |
| 407 | filter_upwards [h.det_val.continuousAt.eventually_ne he] with i hi |
| 408 | exact nonsing_inv_mul _ hi.isUnit |
| 409 | have hu : directionM (fun z => (U z)⁻¹ * U z) x y=0 := (directions_congr heq).trans (direction_zero ..) |
| 410 | rw [direction_prod (Memo.flip h he) h] at hu |
| 411 | have hp := eq_neg_of_add_eq_zero_left hu |
| 412 | have hv := congr_arg (fun b => b * (U x)⁻¹) hp |
| 413 | simpa only [Matrix.mul_nonsing_inv_cancel_right _ _ he.isUnit, neg_mul] using hv |
| 414 | |
| 415 | omit [DecidableEq k] in |
| 416 | lemma direction_trace {U : X→Funds k} {x} (h : Memo U x) (u : X) : fderiv ℝ (fun z => (U z).trace) x u=(directionM U x u).trace := by |
| 417 | simp only [trace,diag_apply,directionM,Matrix.of_apply]; rw [fderiv_fun_sum,_root_.sum_apply] |
| 418 | exact fun i _ => (h i i).differentiableAt (by simp) |
| 419 | |
| 420 | open Polynomial |
| 421 | -- jacobi formula checked at unit; route to any det-ne-zero real matrix |
| 422 | private lemma identity_line (M : Funds k) : HasDerivAt (fun x : ℝ => ((1:Funds k)+x • M).det) M.trace 0 := by |
| 423 | let P := (1:Matrix k k (Polynomial ℝ)) + (Polynomial.X:Polynomial ℝ) • M.map Polynomial.C |
| 424 | have h := (Polynomial.hasDerivAt P.det 0) |
| 425 | rw [show eval 0 (Polynomial.derivative P.det)=_ from derivative_det_one_add_X_smul M] at h |
| 426 | refine h.congr_of_eventuallyEq (Eventually.of_forall fun x => ?_) |
| 427 | change _=eval x P.det; rw [eval_det] |
| 428 | change (1+x • M).det=_ |
| 429 | apply congr_arg Matrix.det; ext i j; rw [matPolyEquiv_eval] |
| 430 | unfold P; by_cases h : i=j <;> simp [h] <;> ring |
| 431 | |
| 432 | lemma det_line (M A : Funds k) (h : A.det≠0) : |
| 433 | HasDerivAt (fun x : ℝ => (A+x • M).det) (A.det*(A⁻¹*M).trace) 0 := by |
| 434 | refine ((identity_line (A⁻¹*M)).const_mul _).congr_of_eventuallyEq (Eventually.of_forall fun x => ?_) |
| 435 | dsimp only |
| 436 | rw [← det_mul, Matrix.mul_add, Matrix.mul_one,Matrix.mul_smul,← mul_assoc A (A⁻¹), Matrix.mul_nonsing_inv A h.isUnit,Matrix.one_mul] |
| 437 | |
| 438 | end vectors |
| 439 | end YM.Stationary |
| 440 | end |
| 441 | |
| 442 | /-! # Real log trace derivatives. Uses determinant NE ZERO; sign in clients. -/ |
| 443 | noncomputable section |
| 444 | namespace YM.Stationary |
| 445 | open Function Filter Lattice RG Wilson Exterior Precision Bloch Laurent Tree Matrix Module Finset |
| 446 | open scoped Matrix Topology ContDiff BigOperators InnerProductSpace |
| 447 | variable {G : Gauge} {c f n : Side} {S : StepData c f} |
| 448 | |
| 449 | -- choose Pi instances explicitly for calculus here only |
| 450 | section matrix |
| 451 | open scoped Matrix.Norms.Elementwise |
| 452 | variable {ι : Type} [Fintype ι] [DecidableEq ι] |
| 453 | private lemma funds_smooth (U : Funds ι) : ContDiffAt ℝ ω (fun x : Funds ι => x.det) U := by |
| 454 | apply Memo.det_val (P:=fun x => x) |
| 455 | intro i j |
| 456 | exact (contDiffAt_apply ℝ ℝ j _).comp _ (contDiffAt_apply ℝ (ι→ℝ) i _) |
| 457 | lemma det_one_way {M : ℝ→Funds ι} (x : ℝ) (L : Funds ι) (hp : ∀ i j, HasDerivAt (fun z => M z i j) (L i j) x) (hv : (M x).det≠0) : |
| 458 | HasDerivAt (fun z => (M z).det) ((M x).det * ((M x)⁻¹ *L).trace) x := by |
| 459 | let A := M x |
| 460 | have hm : HasDerivAt M L x := hasDerivAt_pi.mpr fun i => hasDerivAt_pi.mpr (hp i) |
| 461 | have hf := (funds_smooth A).differentiableAt (by simp) |>.hasFDerivAt |
| 462 | have he : HasDerivAt (fun v : ℝ => A+v • L) L 0 := (ray_id L).const_add A |
| 463 | have hh := (det_line L A hv).unique ((show HasFDerivAt (fun x : Funds ι => x.det) (fderiv ℝ (fun x : Funds ι => x.det) A) (A+(0:ℝ) • L) by rw [zero_smul, add_zero]; exact hf).comp_hasDerivAt 0 he) |
| 464 | change HasDerivAt _ (A.det * (A⁻¹*L).trace) x |
| 465 | rw [hh]; exact hf.comp_hasDerivAt x hm |
| 466 | end matrix |
| 467 | section trace |
| 468 | variable {ι : Type} [Fintype ι] [DecidableEq ι] {X : Type} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 469 | {P Q : X → Funds ι} {x u v : X} |
| 470 | lemma trace_log_first (h : Memo P x) (hp : (P x).det≠0) (u) : |
| 471 | fderiv ℝ (fun z => Real.log (P z).det) x u=((P x)⁻¹*directionM P x u).trace := by |
| 472 | let F := fun z => Real.log (P z).det |
| 473 | let U := P x |
| 474 | have he : ContDiffAt ℝ ω F x := h.det_val.log hp |
| 475 | let g := fun a : ℝ => x+a • u |
| 476 | have hh : g 0=x := by simp [g] |
| 477 | have hx : HasDerivAt g u 0 := by unfold g; simpa using! (ray_id u).const_add x |
| 478 | have hh' := (show HasFDerivAt F (fderiv ℝ F x) (g 0) by rw [hh]; exact (he.differentiableAt (by simp)).hasFDerivAt).comp_hasDerivAt 0 hx |
| 479 | let L := directionM P x u |
| 480 | apply hh'.unique |
| 481 | have hm := det_one_way (M:=fun a => P (g a)) 0 L (fun i j => HasFDerivAt.comp_hasDerivAt 0 |
| 482 | (show HasFDerivAt (fun v => P v i j) (fderiv ℝ (fun v => P v i j) x) (g 0) by rw [hh]; exact ((h i j).differentiableAt (by simp)).hasFDerivAt) hx) (show (P (g 0)).det≠0 by rw [hh]; exact hp) |
| 483 | have hu : HasDerivAt (F ∘ g) ((P (g 0)).det * ((P (g 0))⁻¹*L).trace / (P (g 0)).det) 0 := hm.log (by rw [hh]; exact hp) |
| 484 | rw [hh,mul_div_cancel_left₀ _ hp] at hu; exact hu |
| 485 | |
| 486 | lemma trace_log (h : Memo P x) (u v : X) (he : (P x).det≠0) : iteratedFDeriv ℝ 2 (fun y => Real.log (P y).det) x ![u,v] = |
| 487 | ((P x)⁻¹*bendM P x u v).trace - ((P x)⁻¹ * directionM P x u * (P x)⁻¹ * directionM P x v).trace := by |
| 488 | have hp : (fun i => fderiv ℝ (fun y => Real.log (P y).det) i v)=ᶠ[𝓝 x] |
| 489 | fun i => ((P i)⁻¹ * directionM P i v).trace := by |
| 490 | filter_upwards [h.det_val.continuousAt.eventually_ne he,eventually_memo h] with i hi hv; exact trace_log_first hv hi v |
| 491 | let F := fun z => (P z)⁻¹ |
| 492 | let L := fun i => directionM P i v |
| 493 | have hF : Memo F x := h.flip he |
| 494 | have hL : Memo L x := memo_corner h v |
| 495 | rw [← divided u v (h.det_val.log he),hp.fderiv_eq, direction_trace (Memo.cross hF hL) u,direction_prod hF hL u] |
| 496 | unfold F L; rw [direction_inverse h he,coins_M h,neg_mul,Matrix.trace_add, Matrix.trace_neg]; abel |
| 497 | omit [Fintype ι] [DecidableEq ι] in |
| 498 | lemma direction_add (h : Memo P x) (he : Memo Q x) (u) : directionM (P+Q) x u=directionM P x u+directionM Q x u := by |
| 499 | ext i j; simp only [directionM,Matrix.of_apply,Pi.add_apply, Matrix.add_apply,fderiv_fun_add ((h i j).differentiableAt (by simp)) ((he i j).differentiableAt (by simp)), _root_.add_apply] |
| 500 | omit [Fintype ι] [DecidableEq ι] in |
| 501 | lemma bend_add (h : Memo P x) (he : Memo Q x) (u v) : bendM (P+Q) x u v=bendM P x u v+bendM Q x u v := by |
| 502 | ext i j |
| 503 | have hr := iteratedFDeriv_add_apply (i:=2) (f:=fun z => P z i j) (g:=fun z => Q z i j) (h i j |>.of_le le_top) (he i j |>.of_le le_top) |
| 504 | exact congr($(hr) (![u,v])) |
| 505 | lemma after_contact (h : Memo P 0) (he : Memo Q 0) (hp : (P 0).det≠0) (hy : Q 0=0) (u v) : |
| 506 | iteratedFDeriv ℝ 2 (fun y => Real.log ((P+Q) y).det) 0 ![u,v] = |
| 507 | iteratedFDeriv ℝ 2 (fun y => Real.log (P y).det) 0 ![u,v] + iteratedFDeriv ℝ 2 (fun y => ((P y)⁻¹ * Q y).trace) 0 ![u,v] - |
| 508 | ((P 0)⁻¹ * directionM Q 0 u * (P 0)⁻¹ * directionM Q 0 v).trace := by |
| 509 | have hx := h.flip hp |
| 510 | let F := fun y => (P y)⁻¹ |
| 511 | let M := P 0 |
| 512 | let G := Q |
| 513 | have hh : Memo (fun y => F y*Q y) 0 := Memo.cross hx he |
| 514 | have hs : ContDiffAt ℝ ω (fun y => (F y*Q y).trace) 0 := ContDiffAt.sum fun i _ => hh i i |
| 515 | have hk : (fun a => fderiv ℝ (fun y => (F y * Q y).trace) a v)=ᶠ[𝓝 0] |
| 516 | fun a => (directionM F a v *Q a + F a *directionM Q a v).trace := by |
| 517 | filter_upwards [eventually_memo (U:=F) hx,eventually_memo he] with x h h'; rw [direction_trace (U:=fun y => F y * Q y) (Memo.cross h h'),direction_prod h h'] |
| 518 | rw [trace_log (Memo.twice h he) _ _ (by simp [hp,hy]),trace_log h _ _ hp, ← divided u v hs,hk.fderiv_eq] |
| 519 | have hm := direction_trace (U:= (fun y => directionM F y v *Q y) + fun y => F y *directionM Q y v) |
| 520 | (Memo.twice (Memo.cross (memo_corner (M:=F) hx v) he) (Memo.cross hx (memo_corner he v))) u |
| 521 | rw [direction_add (Memo.cross (memo_corner (M:=F) hx v) he) (Memo.cross hx (memo_corner he v)) _] at hm |
| 522 | rw [direction_prod (U:=fun a => directionM F a v) (memo_corner hx v) he u,direction_prod hx (memo_corner he v) u] at hm |
| 523 | unfold F at hm; simp only [hy, Matrix.mul_zero,zero_add] at hm |
| 524 | simp only [Pi.add_apply] at hm |
| 525 | unfold F |
| 526 | rw [hm,Pi.add_apply,hy,add_zero,bend_add h he,direction_add h he,direction_add h he] |
| 527 | simp only [Matrix.mul_add, Matrix.add_mul,Matrix.trace_add,direction_inverse h hp,coins_M he,neg_mul,Matrix.trace_neg] |
| 528 | have ht (A B C : Funds ι) : (A * B * A * C).trace=(A * C * A * B).trace := by rw [mul_assoc (A*B),trace_mul_comm, ← mul_assoc] |
| 529 | rw [ht _ (directionM P 0 v) (directionM Q 0 u)]; abel |
| 530 | end trace |
| 531 | end YM.Stationary |
| 532 | end |