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.Completed |
| 2 | import YM.SectorTools.PHYSICAL_GAUSSIAN_INSERTION.Moment |
| 3 | |
| 4 | |
| 5 | /-! |
| 6 | # Local precision-and-source cuts |
| 7 | |
| 8 | `Confined`: LOCAL in the Gaussian variable at fixed geometry, body, centers |
| 9 | and other parameters. It is the **difference of quadratic potentials** to |
| 10 | which to apply this support hypothesis, not a covariance window, an |
| 11 | observable read set, or a bare displacement of the mean. Indeed the mean |
| 12 | can move outside the patch. Use `Completed.marginal` to integrate out the |
| 13 | complement, retaining the actual non-product law (the marginal precision is |
| 14 | the inverse of the covariance submatrix, not assumed the precision |
| 15 | submatrix). Prove the likelihood is that of this projected experiment. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | noncomputable section |
| 20 | |
| 21 | namespace YM.SectorTools.PhysicalGaussianInsertion |
| 22 | |
| 23 | open Function Filter Set Matrix MeasureTheory |
| 24 | open Next.SectorChange (Gaussian.Table) |
| 25 | open Next.SectorChange.Gaussian |
| 26 | open AnalyticBridge.GaussianFieldAlignment (Completed.marginal) |
| 27 | open FreeResolvent (insertion) |
| 28 | open scoped Topology BigOperators Classical ENNReal |
| 29 | |
| 30 | variable {ι : Type} |
| 31 | |
| 32 | def observe (S : Finset ι) (z : Vec ι) : Vec S := fun i => z i |
| 33 | |
| 34 | def marginalCov (S : Finset ι) (C : Gaussian.Table ι) := C.submatrix ((↑) : S → ι) ((↑) : S → ι) |
| 35 | |
| 36 | lemma observe_sub (S : Finset ι) (x y : Vec ι) : observe S (x-y) = observe S x - observe S y := rfl |
| 37 | |
| 38 | variable [Fintype ι] [DecidableEq ι] |
| 39 | |
| 40 | /-- Counting-space zero extension. Not embedding a Gaussian with zero |
| 41 | covariance outside `S`. -/ |
| 42 | def expandVec (S : Finset ι) (u : Vec S) : Vec ι := insertion ((↑) : S → ι) *ᵥ u |
| 43 | |
| 44 | def maskVec (S : Finset ι) (z : Vec ι) : Vec ι := expandVec S (observe S z) |
| 45 | |
| 46 | def maskForm (S : Finset ι) (A : Gaussian.Table ι) : Gaussian.Table ι := |
| 47 | let I := insertion ((↑) : S → ι) |
| 48 | I * marginalCov S A * I.transpose |
| 49 | |
| 50 | variable {S : Finset ι} |
| 51 | |
| 52 | lemma transpose_mul_vec (S : Finset ι) (x : Vec ι) : |
| 53 | (insertion ((↑) : S → ι)).transpose *ᵥ x = observe S x := by |
| 54 | ext i |
| 55 | simp [observe, insertion, mulVec, dotProduct, ite_mul] |
| 56 | |
| 57 | omit [Fintype ι] in |
| 58 | lemma continuous_expandVec : Continuous (expandVec S) := by |
| 59 | unfold expandVec mulVec dotProduct |
| 60 | fun_prop |
| 61 | |
| 62 | lemma observe_expandVec (S : Finset ι) (z : Vec S) : observe S (expandVec S z) = z := by |
| 63 | rw [← transpose_mul_vec, expandVec, mulVec_mulVec, |
| 64 | FreeResolvent.insertion.orthogonal _ Subtype.val_injective, one_mulVec] |
| 65 | |
| 66 | omit [Fintype ι] in |
| 67 | lemma expandVec_of_not_mem (u : Vec S) (i : ι) (hi : i ∉ S) : expandVec S u i = 0 := by |
| 68 | have hj (j : S) : (j : ι) ≠ i := fun h => hi (h ▸ j.property) |
| 69 | unfold expandVec |
| 70 | simp [mulVec, dotProduct, insertion, hj] |
| 71 | |
| 72 | lemma expandVec_quad (S : Finset ι) (A : Gaussian.Table ι) (z : Vec S) : |
| 73 | quad A (expandVec S z) = quad (marginalCov S A) z := |
| 74 | FreeResolvent.insertion.dot_compress _ A z z |
| 75 | |
| 76 | |
| 77 | |
| 78 | lemma maskVec_apply (z : Vec ι) (i : ι) : maskVec S z i = if i ∈ S then z i else 0 := by |
| 79 | unfold maskVec |
| 80 | split |
| 81 | next h => exact congrFun (observe_expandVec S (observe S z)) ⟨i,h⟩ |
| 82 | next h => exact expandVec_of_not_mem _ i h |
| 83 | |
| 84 | lemma dot_maskVec (z y : Vec ι) : z ⬝ᵥ maskVec S y = maskVec S z ⬝ᵥ y := by |
| 85 | unfold dotProduct |
| 86 | refine Finset.sum_congr rfl fun i _ => ?_ |
| 87 | rw [maskVec_apply y i, maskVec_apply z i]; split <;> simp |
| 88 | |
| 89 | omit [Fintype ι] in |
| 90 | lemma maskForm_symm {Q : Gaussian.Table ι} (hQ : Q.IsSymm) : (maskForm S Q).IsSymm := by |
| 91 | have hh : (marginalCov S Q).IsSymm := hQ.submatrix _ |
| 92 | unfold Matrix.IsSymm maskForm |
| 93 | dsimp only |
| 94 | rw [transpose_mul, transpose_mul, hh.eq, transpose_transpose, ← Matrix.mul_assoc] |
| 95 | |
| 96 | lemma maskForm_quad (Q : Gaussian.Table ι) (z : Vec ι) : |
| 97 | quad (maskForm S Q) z = quad Q (maskVec S z) := by |
| 98 | let I := insertion ((↑) : S → ι) |
| 99 | rw [maskVec, expandVec_quad] |
| 100 | change z ⬝ᵥ ((I * marginalCov S Q * I.transpose) *ᵥ z) = |
| 101 | observe S z ⬝ᵥ _ |
| 102 | rw [← mulVec_mulVec, ← mulVec_mulVec, show I.transpose *ᵥ z = observe S z from |
| 103 | transpose_mul_vec S z, dotProduct_comm z, |
| 104 | FreeResolvent.insertion.dot_push, transpose_mul_vec, dotProduct_comm] |
| 105 | |
| 106 | omit [Fintype ι] in |
| 107 | lemma maskForm_apply_of_not_mem (Q : Gaussian.Table ι) {i j : ι} (h : i ∉ S ∨ j ∉ S) : |
| 108 | maskForm S Q i j = 0 := by |
| 109 | rcases h with h|h |
| 110 | · have hi (k : S) : (k : ι) ≠ i := fun e => h (e ▸ k.property) |
| 111 | simp [maskForm, Matrix.mul_apply, insertion, hi] |
| 112 | have hj (k : S) : (k : ι) ≠ j := fun e => h (e ▸ k.property) |
| 113 | simp [maskForm, Matrix.mul_apply, insertion, hj] |
| 114 | |
| 115 | lemma marginalCov_maskForm (S : Finset ι) (Q : Gaussian.Table ι) : |
| 116 | marginalCov S (maskForm S Q) = marginalCov S Q := by |
| 117 | let e : S → ι := (↑) |
| 118 | let I := insertion e |
| 119 | let A := marginalCov S Q |
| 120 | have he : I.transpose * I = 1 := FreeResolvent.insertion.orthogonal e Subtype.val_injective |
| 121 | calc |
| 122 | _ = I.transpose * (I*A*I.transpose) * I := (FreeResolvent.insertion.compress e _).symm |
| 123 | _ = A := by rw [← Matrix.mul_assoc, ← Matrix.mul_assoc, he, Matrix.one_mul, |
| 124 | Matrix.mul_assoc, he, Matrix.mul_one] |
| 125 | |
| 126 | /-- Difference of PRECISIONS supported in S×S, and relative linear source |
| 127 | supported in S (zero for unchanged centers). `h = d - a`. -/ |
| 128 | structure Confined (S : Finset ι) (A D : Gaussian.Table ι) (h : Vec ι) : Prop where |
| 129 | form_out (i j : ι) : i ∉ S ∨ j ∉ S → (D⁻¹ - A⁻¹) i j = 0 |
| 130 | source_out (i : ι) : i ∉ S → (A⁻¹ *ᵥ h) i = 0 |
| 131 | |
| 132 | variable {A D : Gaussian.Table ι} {a d h : Vec ι} {p q : ℝ} |
| 133 | |
| 134 | lemma Confined.local_variation (hA : A.PosDef) (hl : Confined S A D h) (z : Vec ι) : |
| 135 | variation A D h z = variation A D h (maskVec S z) := by |
| 136 | rw [variation_expand hA, variation_expand hA] |
| 137 | let M := D⁻¹ - A⁻¹ |
| 138 | let b := A⁻¹ *ᵥ h |
| 139 | have he : maskForm S M = M := by |
| 140 | ext i j |
| 141 | by_cases hu : i ∈ S ∧ j ∈ S |
| 142 | · exact congrFun (congrFun (marginalCov_maskForm S M) ⟨i,hu.1⟩) ⟨j,hu.2⟩ |
| 143 | have hs := not_and_or.mp hu |
| 144 | rw [maskForm_apply_of_not_mem M hs, show M i j = 0 from hl.form_out _ _ hs] |
| 145 | have hb : maskVec S b = b := funext fun i => by |
| 146 | rw [maskVec_apply]; split |
| 147 | · rfl |
| 148 | next h => exact (hl.source_out i h).symm |
| 149 | change quad M _ / _ - z ⬝ᵥ b = _ |
| 150 | rw [show quad M z = _ from he ▸ maskForm_quad M z, |
| 151 | show z ⬝ᵥ b = _ from hb ▸ dot_maskVec z b] |
| 152 | |
| 153 | lemma Confined.local_likelihood (hA : A.PosDef) (hl : Confined S A D (d-a)) (z : Vec ι) : |
| 154 | likelihood A D a d z = likelihood A D a d (maskVec S z) := by |
| 155 | rw [likelihood_around z, likelihood_around (maskVec S z), hl.local_variation hA, |
| 156 | hl.local_variation hA (maskVec S z-d)] |
| 157 | congr 3 |
| 158 | unfold maskVec |
| 159 | rw [observe_sub, observe_sub, observe_expandVec] |
| 160 | |
| 161 | omit [Fintype ι] [DecidableEq ι] in |
| 162 | lemma marginalCov_pos (S : Finset ι) (hA : A.PosDef) : (marginalCov S A).PosDef := |
| 163 | hA.submatrix Subtype.val_injective |
| 164 | |
| 165 | /-- Actual correlated Gaussian marginal. -/ |
| 166 | lemma preserve_observe (S : Finset ι) (hA : A.PosSemidef) (z : Vec ι) : |
| 167 | MeasurePreserving (observe S) (law A z) (law (marginalCov S A) (observe S z)) := by |
| 168 | have hm : Measurable (observe S) := measurable_pi_lambda _ fun i => measurable_pi_apply _ |
| 169 | have hf : MeasurePreserving (observe S) (cloud A) (cloud (marginalCov S A)) := |
| 170 | Completed.marginal (Embedding.subtype (· ∈ S)) hA |
| 171 | refine ⟨hm,?_⟩ |
| 172 | rw [law, Measure.map_map hm (law_from_center A z).measurable] |
| 173 | exact ((law_from_center _ _).comp hf).map_eq |
| 174 | |
| 175 | /-- Integrating out the complement identifies the local potential's REAL |
| 176 | likelihood, normalization included. It is the ratio for `marginalCov`, not |
| 177 | that for inverse principal precision blocks. -/ |
| 178 | lemma likelihood_local (hA : A.PosDef) (hD : D.PosDef) (hl : Confined S A D (d-a)) (x : Vec ι) : |
| 179 | likelihood A D a d x = likelihood (marginalCov S A) (marginalCov S D) |
| 180 | (observe S a) (observe S d) (observe S x) := by |
| 181 | let H := likelihood A D a d ∘ expandVec S |
| 182 | have hc : Continuous H := (continuous_likelihood A D a d).comp continuous_expandVec |
| 183 | let L := likelihood (marginalCov S A) (marginalCov S D) (observe S a) (observe S d) |
| 184 | have hk : Continuous L := continuous_likelihood .. |
| 185 | have h x : likelihood A D a d x = H (observe S x) := hl.local_likelihood hA x |
| 186 | let μ := law (marginalCov S D) (observe S d) |
| 187 | have hA' := marginalCov_pos S hA |
| 188 | have hD' := marginalCov_pos S hD |
| 189 | have hf := preserve_observe S hD.posSemidef d |
| 190 | have hg := preserve_observe S hA.posSemidef a |
| 191 | have he : μ.withDensity (fun z => ENNReal.ofReal (H z)) = |
| 192 | μ.withDensity (fun z => ENNReal.ofReal (L z)) := by |
| 193 | rw [with_likelihood hA' hD' _ _, ← hg.map_eq, ← with_likelihood hA hD a d] |
| 194 | ext s hs |
| 195 | change (law _ _).withDensity _ s = _ |
| 196 | rw [Measure.map_apply hf.measurable hs, withDensity_apply _ hs, |
| 197 | withDensity_apply _ (hf.measurable hs), ← hf.map_eq, |
| 198 | setLIntegral_map hs hc.measurable.ennreal_ofReal hf.measurable] |
| 199 | simp_rw [h] |
| 200 | have h' := (withDensity_eq_iff_of_sigmaFinite hc.measurable.ennreal_ofReal.aemeasurable |
| 201 | hk.measurable.ennreal_ofReal.aemeasurable).mp he |
| 202 | have hv : H =ᵐ[μ] L := by |
| 203 | filter_upwards [h'] with x hx |
| 204 | exact (ENNReal.ofReal_eq_ofReal_iff |
| 205 | (likelihood_pos hA hD .. |>.le) (likelihood_pos hA' hD' .. |>.le)).mp hx |
| 206 | haveI : μ.IsOpenPosMeasure := law_isOpenPosMeasure hD' _ |
| 207 | exact (h x).trans (congrFun (Measure.eq_of_ae_eq hv hc hk) _) |
| 208 | |
| 209 | lemma integral_observe (hD : D.PosSemidef) {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 210 | {F : Vec S → X} (he : AEStronglyMeasurable F (law (marginalCov S D) (observe S d))) : |
| 211 | ∫ x, F (observe S x) ∂law D d = ∫ z, F z ∂law (marginalCov S D) (observe S d) := by |
| 212 | have ht := preserve_observe S hD d |
| 213 | rw [← ht.map_eq] at he ⊢ |
| 214 | exact (integral_map ht.aemeasurable he).symm |
| 215 | |
| 216 | /-- Necessary and sufficient condition from the LOCAL data. Includes the |
| 217 | empty support and exact threshold. -/ |
| 218 | lemma power_iff_local (hA : A.PosDef) (hD : D.PosDef) (hl : Confined S A D (d-a)) : |
| 219 | Integrable (fun x => likelihood A D a d x ^ p) (law D d) ↔ |
| 220 | (mixed (marginalCov S A) (marginalCov S D) p).PosDef := by |
| 221 | let F (x : Vec S) := likelihood (marginalCov S A) (marginalCov S D) (observe S a) |
| 222 | (observe S d) x ^ p |
| 223 | simp_rw [likelihood_local hA hD hl] |
| 224 | have hm : Measurable F := (continuous_likelihood ..).measurable.pow_const p |
| 225 | exact ((preserve_observe S hD.posSemidef d).integrable_comp hm.aestronglyMeasurable).trans |
| 226 | (power_iff (marginalCov_pos S hA) (marginalCov_pos S hD)) |
| 227 | |
| 228 | lemma mixed_local (hA : A.PosDef) (hD : D.PosDef) (hl : Confined S A D (d-a)) : |
| 229 | (mixed A D p).PosDef ↔ (mixed (marginalCov S A) (marginalCov S D) p).PosDef := |
| 230 | (power_iff hA hD).symm.trans (power_iff_local hA hD hl) |
| 231 | |
| 232 | lemma power_integral_local (hA : A.PosDef) (hD : D.PosDef) (hl : Confined S A D (d-a)) |
| 233 | (hm : (mixed (marginalCov S A) (marginalCov S D) p).PosDef) : |
| 234 | Integrable (fun x => likelihood A D a d x ^ p) (law D d) ∧ |
| 235 | (∫ x, likelihood A D a d x ^ p ∂law D d) = |
| 236 | moment (marginalCov S A) (marginalCov S D) p (observe S (d-a)) := by |
| 237 | refine ⟨(power_iff_local hA hD hl).mpr hm,?_⟩ |
| 238 | obtain ⟨hh,he⟩ := power_integral (marginalCov_pos S hA) (marginalCov_pos S hD) hm |
| 239 | (observe S a) (observe S d) |
| 240 | simp_rw [likelihood_local hA hD hl] |
| 241 | exact (integral_observe hD.posSemidef hh.1).trans he |
| 242 | |
| 243 | lemma moment_local (hA : A.PosDef) (hD : D.PosDef) (hl : Confined S A D (d-a)) |
| 244 | (hm : (mixed (marginalCov S A) (marginalCov S D) p).PosDef) : |
| 245 | moment A D p (d-a) = moment (marginalCov S A) (marginalCov S D) p (observe S (d-a)) := |
| 246 | (power_integral hA hD ((mixed_local hA hD hl).mpr hm) a d).2.symm.trans |
| 247 | (power_integral_local hA hD hl hm).2 |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] {F : Vec ι → X} |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | end YM.SectorTools.PhysicalGaussianInsertion |