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.AnalyticBridge.GAUSSIAN_FIELD_ALIGNMENT.Windows |
| 2 | import YM.Next.FREE_KERNELS.Lifts |
| 3 | import YM.SectorNext.GAUSSIAN_SECTOR_CHANGE.ResidualPrice |
| 4 | |
| 5 | |
| 6 | set_option warningAsError false |
| 7 | |
| 8 | /-! |
| 9 | # Quantitative price for changing a Gaussian window law |
| 10 | |
| 11 | Supply same-Gram and/or two known Grams at possibly different windows. Pay |
| 12 | for both nonsymmetric ordered inverses (also the ones which supply the mean |
| 13 | shift), then the ACTUAL symmetric covariances. Keep determinant ratio and |
| 14 | force difference; there is no Jacobian outside the finite counting metric in |
| 15 | this comparison. For different precisions the cost includes their weighted |
| 16 | difference (need not be small). No derivative assertion. Applies even on |
| 17 | empty lists. Use on positive branches only, after delay for symmetrized |
| 18 | matrices, not as a formal density quotient if a window failed its checks. |
| 19 | -/ |
| 20 | set_option autoImplicit false |
| 21 | noncomputable section |
| 22 | namespace YM.AnalyticBridge.GaussianFieldAlignment.Relative |
| 23 | open Function Filter Set Matrix MeasureTheory Lattice |
| 24 | open Next.SectorChange Next.SectorChange.Gaussian Next.SectorChange.Schur |
| 25 | open FreeResolvent (native normSum_nn resolve safeRate) |
| 26 | open scoped Topology BigOperators Classical ENNReal |
| 27 | |
| 28 | variable {α : Type} [Fintype α] [DecidableEq α] {c : Side} {p : α → Site c} {σ M η δ : ℝ} |
| 29 | |
| 30 | local notation "Mat" α => Gaussian.Table α |
| 31 | variable {A D : Mat α} |
| 32 | |
| 33 | omit [DecidableEq α] in |
| 34 | lemma of_pours (h : Pours A p p σ M) : (native c).Schur p p σ M A := by |
| 35 | refine ⟨⟨h.row⟩,⟨fun j => ?_⟩⟩ |
| 36 | simpa only [native, FreeResolvent.Cost.weight, transpose_apply,separation_comm (p j)] using! h.col j |
| 37 | |
| 38 | omit [DecidableEq α] in |
| 39 | lemma to_pours (h : (native c).Schur p p σ M A) (hm : 0 ≤ M) : Pours A p p σ M := by |
| 40 | refine ⟨hm,h.rows.bound,fun j => ?_⟩ |
| 41 | simpa only [native,FreeResolvent.Cost.weight,transpose_apply,separation_comm (p j)] using! h.cols.bound j |
| 42 | |
| 43 | omit [DecidableEq α] in |
| 44 | lemma gap_iff : Gapped A η ↔ FreeResolvent.Gap A η := by simp only [Gapped,sumSq_dot]; exact ⟨(⟨·⟩), (·.lower)⟩ |
| 45 | |
| 46 | lemma view_near {W : α → Set α} {r : ℕ} (h : Bars W p r) : (view W (per_self h)).Near (native c) p r := by |
| 47 | intro i j he |
| 48 | have hx : ¬ separation (p i) (p j) ≤ r := fun ht => he ⟨⟨j,h i j ht⟩,rfl⟩ |
| 49 | change _ ≤ ((separation (p i) (p j)):ℝ) |
| 50 | exact_mod_cast (Nat.le_of_lt (lt_of_not_ge hx)) |
| 51 | |
| 52 | def symPart (A : Mat α) : Mat α := (1/2:ℝ) • (A + A.transpose) |
| 53 | |
| 54 | omit [Fintype α] [DecidableEq α] in |
| 55 | lemma sym_of_sub : symPart (A-D) = symPart A-symPart D := by unfold symPart; rw [transpose_sub]; module |
| 56 | |
| 57 | omit [DecidableEq α] in |
| 58 | lemma sym_pours (h : Pours A p p σ M) : Pours (symPart A) p p σ M := |
| 59 | ((h.bind h.turn).scale _).weaker le_rfl (le_of_eq (by rw [abs_of_pos (by norm_num)]; ring)) |
| 60 | |
| 61 | structure Supported (A : Mat α) (W : α → Set α) (p : α → Site c) (r s M : ℝ) : Prop where |
| 62 | source_pos : A.PosDef |
| 63 | pos : (symPart (per W A)).PosDef |
| 64 | prec : Pours A p p s M |
| 65 | exactInv : Pours A⁻¹ p p s M |
| 66 | order : Pours (per W A) p p s M |
| 67 | tail : Pours (per W A-A⁻¹) p p s (M*Real.exp (-s*r)) |
| 68 | charges : Pours ((symPart (per W A))⁻¹) p p s M |
| 69 | |
| 70 | /-- Consequence of the two accepted window estimates, now uniform also on |
| 71 | *differences at positive rate* and including costs of symmetric inverses. -/ |
| 72 | theorem same_purchase (hσ : 0 < σ) (hM : 0 ≤ M) (he : 0 < η) (B : ℝ → ℝ) (hB : ∀ s, 0 ≤ B s) : |
| 73 | ∃ s K : ℝ, 0 < s ∧ s ≤ σ ∧ 0 < K ∧ ∀ᶠ r : ℕ in atTop, |
| 74 | ∀ {α : Type} [Fintype α] [DecidableEq α] {c : Side} (A : Mat α) (p : α → Site c) (W : α → Set α), |
| 75 | Revenue p B → Pours A p p σ M → A.IsSymm → Gapped A η → Bars W p r → Supported A W p r s K := by |
| 76 | obtain ⟨_,_,g,_,_,hg,hw⟩ := windows hσ he hM B hB |
| 77 | let t := safeRate σ M η |
| 78 | have ht : 0 < t := FreeResolvent.rate_pos hσ hM he |
| 79 | have hv : t < σ := FreeResolvent.rate_lt hσ |
| 80 | let v := t/2 |
| 81 | let D := B (t-v) * (η/2)⁻¹ |
| 82 | have hy : 0<v := half_pos ht |
| 83 | have hd : 0≤D := mul_nonneg (hB _) (by positivity) |
| 84 | let s := min (v/2) (safeRate v D g/2) |
| 85 | have hh := FreeResolvent.rate_pos hy hd hg |
| 86 | have hs : 0 < s := lt_min (half_pos hy) (half_pos hh) |
| 87 | have hu : s ≤ v/2 := min_le_left .. |
| 88 | have hz : s ≤ v := hu.trans (half_le_self hy.le) |
| 89 | let k := B (safeRate v D g-s)*(g/2)⁻¹ |
| 90 | have hk : 0 ≤ k := mul_nonneg (hB _) (by positivity) |
| 91 | let K := 1+M+D+(D*M*D)+k |
| 92 | refine ⟨s,K,hs,by linarith [show v=t/2 from rfl],by unfold K; positivity,?_⟩ |
| 93 | filter_upwards [hw] with r hr |
| 94 | intro α _ _ c A p W hp hA hx hq hW |
| 95 | let P := per W A |
| 96 | have h := of_pours hA; have hG := gap_iff.mp hq |
| 97 | have HB (a : ℝ) (ha : 0 < a) : (native c).Volume p a (B a) := ⟨hp _ ha⟩ |
| 98 | have HB' := HB (safeRate σ M η-v) (by change 0<t-v; unfold v; linarith) |
| 99 | have hP : Pours P p p v D := to_pours (by |
| 100 | have hL := (view W (per_self hW)).prices (show 0 ≤ (0:ℝ) by rfl) he hσ hM h hG HB' |
| 101 | rw [per_view,add_zero] at hL; exact hL) hd |
| 102 | have hI : Pours A⁻¹ p p v D := to_pours (by simpa only [add_zero,resolve,zero_smul] using! |
| 103 | (FreeResolvent.resolve_schur hM hσ h hG he (show 0 ≤ (0:ℝ) by rfl) HB')) hd |
| 104 | have hE := to_pours (FreeResolvent.Window.Survey.difference (view_near hW) (show 0 ≤ (0:ℝ) by rfl) he hσ hM hs.le hz (show v ≤ σ by linarith [show v=t/2 from rfl]) (hB _) h hG HB') (by have := hB (t-v); change 0 ≤ (B (t-v)*_)*(Real.exp _*(M*(B (t-v)*_))); positivity) |
| 105 | rw [per_view,resolve,zero_smul,add_zero,add_zero] at hE |
| 106 | have h₀ := (hr p A W hp hA hx hq hW).2 |
| 107 | have hn : 0 < safeRate v D g - s := by have hi : s ≤ safeRate v D g/2 := min_le_right ..; linarith |
| 108 | have ha := to_pours (FreeResolvent.resolve_schur hd hy (of_pours (sym_pours hP)) (gap_iff.mp h₀.1) hg (show 0 ≤ (0:ℝ) by rfl) (HB _ hn)) |
| 109 | rw [resolve,zero_smul,add_zero,add_zero] at ha |
| 110 | have h1 : D ≤ K := by unfold K; nlinarith [mul_nonneg (mul_nonneg hd hM) hd] |
| 111 | have h2 : k ≤ K := by unfold K; nlinarith [mul_nonneg (mul_nonneg hd hM) hd] |
| 112 | have h3 : M ≤ K := by unfold K; nlinarith [mul_nonneg (mul_nonneg hd hM) hd] |
| 113 | refine ⟨dissolves hq hx he,h₀.2,hA.weaker (hz.trans (show v ≤ σ by unfold v; linarith)) h3,hI.weaker hz h1,hP.weaker hz h1,hE.weaker le_rfl ?_,(ha hk).weaker le_rfl h2⟩ |
| 114 | change D*(Real.exp _ *(M*D)) ≤ _ |
| 115 | rw [show D*(Real.exp (-(v-s)*r)*(M*D))=D*M*D*Real.exp (-(v-s)*r) by ring] |
| 116 | have hi : D*M*D ≤ K := by unfold K; linarith |
| 117 | gcongr |
| 118 | linarith only [hu] |
| 119 | |
| 120 | section Log |
| 121 | |
| 122 | lemma log_upper (A : Mat α) (h : 0 < det A) (hδ : 0 ≤ δ) (he : ResidualPrice.flared (1+δ) A) : |
| 123 | Real.log (det A) ≤ Fintype.card α * δ := calc |
| 124 | _ ≤ Real.log ((1+δ)^Fintype.card α) := Real.log_le_log h ((le_abs_self _).trans (ResidualPrice.det_pay he)) |
| 125 | _ ≤ _ := by rw [Real.log_pow]; gcongr; linarith [Real.log_le_sub_one_of_pos (by positivity : 0<1+δ)] |
| 126 | |
| 127 | lemma log_one (h : 0 < det A) (he : Pours (A-1) p p σ δ) (hσ : 0 ≤ σ) : Real.log (det A) ≤ Fintype.card α * δ := by |
| 128 | apply log_upper _ h he.pos |
| 129 | intro j |
| 130 | have hx := of_pours (he.weaker hσ le_rfl) |
| 131 | have hp := hx.cols.bound j |
| 132 | calc |
| 133 | _ = ∑ i, |(1:Mat α) i j + (A-1) i j| := by simp |
| 134 | _ ≤ (∑ i, |(1:Mat α) i j|) + ∑ i, |(A-1) i j| := by rw [← Finset.sum_add_distrib]; exact Finset.sum_le_sum fun i _ => abs_add_le .. |
| 135 | _ ≤ _ := by simpa [Matrix.one_apply, apply_ite abs] using hp |
| 136 | |
| 137 | lemma det_ratio (hA : A.PosDef) (hD : D.PosDef) (ha : Pours A⁻¹ p p σ M) (hd : Pours D⁻¹ p p σ M) |
| 138 | (he : Pours (A-D) p p σ δ) (hs : 0 ≤ σ) : |Real.log (det A) - Real.log (det D)| ≤ Fintype.card α * (δ*M) := by |
| 139 | have H {A D : Mat α} (h : A.PosDef) (h' : D.PosDef) (he : Pours (A-D) p p σ δ) (hd : Pours D⁻¹ p p σ M) : |
| 140 | Real.log (det A)-Real.log (det D) ≤ Fintype.card α*(δ*M) := by |
| 141 | have hu := he.fuse hd hs |
| 142 | rw [Matrix.sub_mul, Matrix.mul_nonsing_inv _ (IsUnit.mk0 _ h'.det_pos.ne')] at hu |
| 143 | have hl := log_one (show 0 < det (A*D⁻¹) by rw [det_mul,det_nonsing_inv,Ring.inverse_eq_inv]; have := h.det_pos; have := h'.det_pos; positivity) hu hs |
| 144 | rw [det_mul,det_nonsing_inv,Ring.inverse_eq_inv,Real.log_mul h.det_pos.ne' (inv_ne_zero h'.det_pos.ne'),Real.log_inv] at hl |
| 145 | exact hl |
| 146 | have hh : Pours (D-A) p p σ δ := to_pours (by rw [← neg_sub]; exact (of_pours he).neg) he.pos |
| 147 | exact abs_le.mpr ⟨by linarith only [H hD hA hh ha],H hA hD he hd⟩ |
| 148 | end Log |
| 149 | |
| 150 | /-- Data at fixed centers. Keep the ordered and symmetric errors separate; |
| 151 | log term doesn't include its factor 1/2 yet. -/ |
| 152 | structure Difference (U V : Mat α) (p : α → Site c) (s δ : ℝ) : Prop where |
| 153 | left_pos : (symPart U).PosDef |
| 154 | right_pos : (symPart V).PosDef |
| 155 | ordered : Pours (U-V) p p s δ |
| 156 | force : Pours ((symPart U)⁻¹ - (symPart V)⁻¹) p p s δ |
| 157 | logs : |Real.log (det (symPart U)) - Real.log (det (symPart V))| ≤ Fintype.card α * δ |
| 158 | |
| 159 | def error (M s r δ : ℝ) := ((M+1)^2) * (2*M*Real.exp (-s*r)+M*δ*M) |
| 160 | |
| 161 | theorem compare {W W' : α → Set α} {r : ℝ} (hA : Supported A W p r σ M) (hD : Supported D W' p r σ M) |
| 162 | (he : Pours (A-D) p p σ δ) (hs : 0 ≤ σ) : Difference (per W A) (per W' D) p σ (error M σ r δ) := by |
| 163 | let U := per W A; let V := per W' D |
| 164 | let E := 2*M*Real.exp (-σ*r)+M*δ*M |
| 165 | have hM := hA.prec.pos; have hδ := he.pos |
| 166 | have hE : 0 ≤ E := by unfold E; positivity |
| 167 | have h₁ : ∀ {A B : Mat α} {e : ℝ}, A.PosDef → B.PosDef → Pours A⁻¹ p p σ M → Pours B⁻¹ p p σ M → |
| 168 | Pours (A-B) p p σ e → Pours (A⁻¹-B⁻¹) p p σ (M*e*M) := by |
| 169 | intro A B e ha hb hp hq he |
| 170 | have hf := FreeResolvent.resolve_diff (A:=A) (B:=B) (u:=0) (by simp [ha.det_pos.ne']) (by simp [hb.det_pos.ne']) |
| 171 | simp only [resolve,zero_smul,add_zero] at hf |
| 172 | rw [← neg_sub,hf]; simpa using (((hq.fuse he hs).fuse hp hs).scale (-1)) |
| 173 | have hu : Pours (U-V) p p σ E := by |
| 174 | rw [show U-V=U-A⁻¹+(A⁻¹-D⁻¹) + -(V-D⁻¹) by abel] |
| 175 | have hx := (hA.tail.bind (h₁ hA.source_pos hD.source_pos hA.exactInv hD.exactInv he)).bind (hD.tail.scale (-1:ℝ)) |
| 176 | simp only [neg_one_smul] at hx; exact hx.weaker le_rfl (le_of_eq (by unfold E; rw [abs_neg,abs_one]; ring)) |
| 177 | have hw : Pours (symPart U-symPart V) p p σ E := sym_of_sub (A:=U) (D:=V) ▸ sym_pours hu |
| 178 | have hv := h₁ hA.pos hD.pos hA.charges hD.charges hw |
| 179 | have hl := det_ratio hA.pos hD.pos hA.charges hD.charges hw hs |
| 180 | have hp : E ≤ error M σ r δ := le_mul_of_one_le_left hE (by nlinarith) |
| 181 | refine ⟨hA.pos,hD.pos,hu.weaker le_rfl hp,hv.weaker le_rfl ?_,hl.trans (mul_le_mul_of_nonneg_left ?_ (by positivity))⟩ |
| 182 | · calc |
| 183 | _ = M^2*E := by ring |
| 184 | _ ≤ (M+1)^2*E := by gcongr; linarith |
| 185 | calc |
| 186 | E*M = M*E := mul_comm .. |
| 187 | _ ≤ (M+1)^2*E := mul_le_mul_of_nonneg_right (by nlinarith) hE |
| 188 | |
| 189 | |
| 190 | |
| 191 | /-- Density of the centered covariance A with respect to D, in the latter |
| 192 | coordinates z, with an optional translation h (e.g. `(μ_D - μ_A)/g`). -/ |
| 193 | def trade (A D : Mat α) (h z : Vec α) : ℝ := |
| 194 | Real.sqrt D.det / Real.sqrt A.det * Real.exp ((Gaussian.force D z-Gaussian.force A (h+z))/2) |
| 195 | |
| 196 | variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 197 | |
| 198 | lemma change (hA : A.PosDef) (hD : D.PosDef) (h : Vec α) (f : Vec α → X) : |
| 199 | (Integrable f (cloud A) ↔ Integrable (fun z => trade A D h z • f (h+z)) (cloud D)) ∧ |
| 200 | (∫ z, f z ∂cloud A) = ∫ z, trade A D h z • f (h+z) ∂cloud D := by |
| 201 | let u (A : Mat α) (f : Vec α → X) (z : Vec α) := ratio A z • f z |
| 202 | have H {A : Mat α} (ha : A.PosDef) (f : Vec α → X) : (Integrable f (cloud A) ↔ Integrable (u A f)) ∧ |
| 203 | (∫ z,f z ∂cloud A) = ∫ z, u A f z := by |
| 204 | rw [cloud_formula ha,integrable_withDensity_iff_integrable_smul' (measurable_ratio A |>.ennreal_ofReal) |
| 205 | (Eventually.of_forall fun _ => ENNReal.ofReal_lt_top), integral_withDensity_eq_integral_toReal_smul |
| 206 | (measurable_ratio A |>.ennreal_ofReal) (Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] |
| 207 | simp_rw [ENNReal.toReal_ofReal (ratio_pos ha _).le]; exact ⟨Iff.rfl,rfl⟩ |
| 208 | rw [(H hA f).1,(H hA f).2,(H hD _).1,(H hD _).2] |
| 209 | let e := MeasurableEquiv.addLeft h |
| 210 | have he : MeasurePreserving e volume volume := measurePreserving_add_left .. |
| 211 | have ht : u D (fun z => trade A D h z • f (h+z)) = u A f ∘ e := by |
| 212 | funext z |
| 213 | unfold u; rw [smul_smul]; change _ = ratio A (h+z) • f (h+z) |
| 214 | congr 1 |
| 215 | unfold ratio trade coat |
| 216 | have h₁ : 0 < dome α := dome_pos |
| 217 | have h₂ := Real.sqrt_pos.mpr hD.det_pos; have h₃ := Real.sqrt_pos.mpr hA.det_pos |
| 218 | have hi : (-Gaussian.force A (h+z))/2=(-Gaussian.force D z)/2 + (Gaussian.force D z-Gaussian.force A (h+z))/2 := by ring |
| 219 | rw [hi,Real.exp_add]; field_simp |
| 220 | rw [ht]; exact ⟨(he.integrable_comp_emb e.measurableEmbedding).symm,(he.integral_comp' _).symm⟩ |
| 221 | |
| 222 | lemma Difference.change {U V : Mat α} (H : Difference U V p σ δ) (h : Vec α) (f : Vec α → X) : |
| 223 | let A := symPart U; let B := symPart V |
| 224 | (Integrable f (cloud A) ↔ Integrable (fun z => trade A B h z • f (h+z)) (cloud B)) ∧ |
| 225 | (∫ z,f z ∂cloud A) = ∫ z, trade A B h z • f (h+z) ∂cloud B := Relative.change H.left_pos H.right_pos h f |
| 226 | |
| 227 | lemma Difference.price {U V : Mat α} (H : Difference U V p σ δ) (hs : 0 ≤ σ) (z : Vec α) : |
| 228 | |Real.log (trade (symPart U) (symPart V) 0 z)| ≤ (Fintype.card α + sumSq z)*(δ/2) := by |
| 229 | let A := symPart U; let B := symPart V |
| 230 | have ha := H.left_pos.det_pos; have hb := H.right_pos.det_pos |
| 231 | rw [trade,zero_add, Real.log_mul (div_pos (Real.sqrt_pos.mpr hb) (Real.sqrt_pos.mpr ha)).ne' (Real.exp_pos _).ne',Real.log_exp,Real.log_div (Real.sqrt_pos.mpr hb).ne' (Real.sqrt_pos.mpr ha).ne',Real.log_sqrt ha.le,Real.log_sqrt hb.le] |
| 232 | change |Real.log B.det /2 - Real.log A.det/2 + _| ≤ _ |
| 233 | have ht : |Gaussian.force B z - Gaussian.force A z| ≤ δ * sumSq z := by |
| 234 | have hL := estimate (H.force.weaker hs le_rfl) z z |
| 235 | rw [Matrix.sub_mulVec,dotProduct_sub] at hL; rw [abs_sub_comm]; unfold Gaussian.force |
| 236 | linarith |
| 237 | have hi := H.logs |
| 238 | rw [abs_sub_comm] at hi |
| 239 | apply (abs_add_le ..).trans; rw [← sub_div,abs_div,abs_div,abs_of_pos (zero_lt_two (α:=ℝ))] |
| 240 | linarith |
| 241 | |
| 242 | /-- Optional cost of the shift as `d*u` in the *normalized* z variables (so may |
| 243 | include an inverse coupling!). Kept separate because no small shift of actual |
| 244 | origins follows just by identifying linear covariance data. -/ |
| 245 | lemma Difference.priceShift {U V : Mat α} (H : Difference U V p σ δ) (ha : Pours (symPart U)⁻¹ p p σ M) |
| 246 | (hs : 0 ≤ σ) (d : ℝ) (u z : Vec α) : |
| 247 | |Real.log (trade (symPart U) (symPart V) (d • u) z)| ≤ (Fintype.card α + sumSq z)*(δ/2) + |
| 248 | (d^2*M*sumSq u + |d| *M*(sumSq u + sumSq z))/2 := by |
| 249 | let A := symPart U; let B := symPart V |
| 250 | have he := estimate (ha.weaker hs le_rfl) |
| 251 | let suff := d^2*M*sumSq u + |d| *M*(sumSq u + sumSq z) |
| 252 | have hf : |Gaussian.force A (d • u+z) - Gaussian.force A z| ≤ suff := by |
| 253 | let q (v w : Vec α) := v ⬝ᵥ (A⁻¹ *ᵥ w) |
| 254 | have hu : Gaussian.force A (d • u+z) - Gaussian.force A z = d^2*q u u + d*q z u + d*q u z := by |
| 255 | unfold Gaussian.force q; rw [mulVec_add,add_dotProduct,dotProduct_add,dotProduct_add,mulVec_smul,smul_dotProduct,smul_dotProduct,dotProduct_smul,dotProduct_smul]; simp only [smul_eq_mul]; ring |
| 256 | have ht v w : |q v w| ≤ _ := he v w |
| 257 | rw [hu]; apply (abs_add_le ..).trans ((add_le_add_left (abs_add_le ..) _).trans ?_) |
| 258 | rw [abs_mul,abs_mul,abs_mul,abs_of_nonneg (sq_nonneg _)] |
| 259 | unfold suff; linarith only [mul_le_mul_of_nonneg_left (ht u u) (sq_nonneg d),mul_le_mul_of_nonneg_left (ht z u) (abs_nonneg d),mul_le_mul_of_nonneg_left (ht u z) (abs_nonneg d)] |
| 260 | have hi := H.price hs z |
| 261 | simp only [trade,zero_add] at hi ⊢ |
| 262 | have hτ := (div_pos (Real.sqrt_pos.mpr H.right_pos.det_pos) (Real.sqrt_pos.mpr H.left_pos.det_pos)).ne' |
| 263 | rw [Real.log_mul hτ (Real.exp_pos _).ne',Real.log_exp] at hi ⊢ |
| 264 | rw [abs_le] at hi hf ⊢ |
| 265 | change -suff ≤ Gaussian.force (symPart U) _ - _ ∧ _ ≤ suff at hf |
| 266 | constructor <;> unfold suff at hf <;> linarith |
| 267 | |
| 268 | omit [DecidableEq α] in |
| 269 | /-- Sup-cost for nonsymmetric mean operators and changes of ordered mean. Caller |
| 270 | supplies actual source(s); nothing small about wrong-branch linear terms is |
| 271 | assumed. -/ |
| 272 | lemma source (hs : 0 ≤ σ) (ha : Pours A p p σ M) (b : Vec α) : ‖-A.transpose *ᵥ b‖ ≤ M*‖b‖ := by |
| 273 | rw [pi_norm_le_iff_of_nonneg (mul_nonneg ha.pos (norm_nonneg b))]; intro i |
| 274 | have hi := (of_pours ha).mono hs le_rfl |>.cols.bound i |
| 275 | rw [Real.norm_eq_abs] |
| 276 | change |∑ j, -A j i * b j| ≤ _ |
| 277 | calc |
| 278 | _ ≤ ∑ j, |-(A j i) * b j| := Finset.abs_sum_le_sum_abs .. |
| 279 | _ ≤ ∑ j, |A j i| * ‖b‖ := Finset.sum_le_sum fun j _ => by rw [abs_mul,abs_neg]; exact mul_le_mul_of_nonneg_left (norm_le_pi_norm b j) (abs_nonneg _) |
| 280 | _ ≤ M*‖b‖ := by rw [← Finset.sum_mul]; exact mul_le_mul_of_nonneg_right (by simpa using hi) (norm_nonneg _) |
| 281 | |
| 282 | omit [DecidableEq α] in |
| 283 | lemma source_difference {b e : Vec α} (hs : 0 ≤ σ) (hD : Pours D p p σ M) (he : Pours (A-D) p p σ δ) : |
| 284 | ‖(-A.transpose *ᵥ b) - (-D.transpose *ᵥ e)‖ ≤ δ*‖b‖ + M*‖b-e‖ := by |
| 285 | have hi := add_le_add (source hs he b) (source hs hD (b-e)) |
| 286 | apply le_trans _ hi; refine le_trans (le_of_eq (congr_arg Norm.norm ?_)) (norm_add_le ..) |
| 287 | rw [Matrix.transpose_sub,neg_sub,Matrix.sub_mulVec, Matrix.mulVec_sub]; simp_rw [Matrix.neg_mulVec]; abel |
| 288 | |
| 289 | end YM.AnalyticBridge.GaussianFieldAlignment.Relative |