Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Variable.ModulusEnergy |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Weak.ReplacementEnergy |
| 3 | |
| 4 | /-! |
| 5 | # Exact local replacement for weighted annular energy |
| 6 | |
| 7 | The literal piecewise competitor changes only the disk contribution to |
| 8 | the weighted energy. Cancellation gives local comparison, and positive |
| 9 | modulus converts this into unweighted comparison with its ellipticity |
| 10 | ratio. No global energy error is introduced. |
| 11 | |
| 12 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 13 | 447-449. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | open Set Filter MeasureTheory Topology |
| 21 | open scoped Topology Manifold ContDiff |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- Integrable nonnegative columns have equivalent weighted and unweighted energies at each |
| 26 | positive modulus. Source: Morgan-Tian Lemma 19.15, pp. 447-449; M64 derivation |
| 27 | `2026-09-26-raw-harmonic-stress.md`. -/ |
| 28 | theorem m64VariableModulus_integral_comparison |
| 29 | {X : Type*} [MeasurableSpace X] {mu : Measure X} {f0 f1 : X → ℝ} |
| 30 | (hf0 : Integrable f0 mu) (hf1 : Integrable f1 mu) |
| 31 | (h0 : ∀ᵐ p ∂mu, 0 ≤ f0 p) (h1 : ∀ᵐ p ∂mu, 0 ≤ f1 p) |
| 32 | {r : ℝ} (hr : 0 < r) : |
| 33 | (∫ p, (f0 p + f1 p) / 2 ∂mu) ≤ |
| 34 | max r r⁻¹ * (∫ p, (r * f0 p + r⁻¹ * f1 p) / 2 ∂mu) ∧ |
| 35 | (∫ p, (r * f0 p + r⁻¹ * f1 p) / 2 ∂mu) ≤ |
| 36 | max r r⁻¹ * (∫ p, (f0 p + f1 p) / 2 ∂mu) := by |
| 37 | have hu := (hf0.add hf1).div_const 2 |
| 38 | have hw := ((hf0.const_mul r).add (hf1.const_mul r⁻¹)).div_const 2 |
| 39 | have hDr : 1 ≤ max r r⁻¹ * r := by |
| 40 | simpa only [inv_mul_cancel₀ hr.ne'] using |
| 41 | mul_le_mul_of_nonneg_right (le_max_right r r⁻¹) hr.le |
| 42 | have hDinv : 1 ≤ max r r⁻¹ * r⁻¹ := by |
| 43 | simpa only [mul_inv_cancel₀ hr.ne'] using |
| 44 | mul_le_mul_of_nonneg_right (le_max_left r r⁻¹) (inv_nonneg.mpr hr.le) |
| 45 | constructor |
| 46 | · rw [← integral_const_mul] |
| 47 | apply integral_mono_ae hu (hw.const_mul _) |
| 48 | filter_upwards [h0, h1] with p hp0 hp1 |
| 49 | change (f0 p + f1 p) / 2 ≤ max r r⁻¹ * ((r * f0 p + r⁻¹ * f1 p) / 2) |
| 50 | have ha := mul_le_mul_of_nonneg_right hDr hp0 |
| 51 | have hb := mul_le_mul_of_nonneg_right hDinv hp1 |
| 52 | nlinarith |
| 53 | · rw [← integral_const_mul] |
| 54 | apply integral_mono_ae hw (hu.const_mul _) |
| 55 | filter_upwards [h0, h1] with p hp0 hp1 |
| 56 | change (r * f0 p + r⁻¹ * f1 p) / 2 ≤ max r r⁻¹ * ((f0 p + f1 p) / 2) |
| 57 | have ha := mul_le_mul_of_nonneg_right (le_max_left r r⁻¹) hp0 |
| 58 | have hb := mul_le_mul_of_nonneg_right (le_max_right r r⁻¹) hp1 |
| 59 | nlinarith |
| 60 | |
| 61 | variable {n m : ℕ} {M : Type*} [TopologicalSpace M] |
| 62 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 63 | {e : M → EuclideanSpace ℝ (Fin m)} {c0 c1 : ℝ → M} |
| 64 | |
| 65 | local notation "E" => EuclideanSpace ℝ (Fin m) |
| 66 | local notation "S" => interior m64AnnulusDomain |
| 67 | local notation "mu" => volume.restrict S |
| 68 | |
| 69 | /-- Every genuine L2 replacement column has integrable observed quadratic energy. Source: |
| 70 | Morgan-Tian Lemma 19.15, pp. 447-449; M64 derivation `2026-09-26-raw-harmonic-stress.md`. -/ |
| 71 | theorem m64VariableModulus_column_integrable |
| 72 | (Q : M → E →L[ℝ] E →L[ℝ] ℝ) (hQ : Continuous Q) |
| 73 | {C : ℝ} (hb : ∀ q, ‖Q q‖ ≤ C) {K : Set LoopPlane} |
| 74 | (f : LoopPlane → M) (hf : AEStronglyMeasurable f (volume.restrict K)) |
| 75 | (V : LoopPlane → E) (hV : MemLp V 2 (volume.restrict K)) : |
| 76 | IntegrableOn (fun p => Q (f p) (V p) (V p)) K volume := by |
| 77 | simpa only [add_self_div_two] using |
| 78 | m64Observed_energyDensity_integrable Q hQ hb f hf (fun _ => V) (fun _ => hV) |
| 79 | |
| 80 | /-- The constructed piecewise weak annulus has exactly the old weighted energy plus the new |
| 81 | disk energy minus the old disk energy. Source: Morgan-Tian Lemma 19.15, pp. 447-449; M64 |
| 82 | derivation `2026-09-26-raw-harmonic-stress.md`. -/ |
| 83 | theorem m64VariableModulus_replacement_energy |
| 84 | (Q : M → E →L[ℝ] E →L[ℝ] ℝ) (hQ : Continuous Q) (hei : IsEmbedding e) |
| 85 | {C : ℝ} (hb : ∀ q, ‖Q q‖ ≤ C) (r : ℝ) |
| 86 | (A W : M64ObservedWeakAnnulus (n := n) e c0 c1) |
| 87 | {K : Set LoopPlane} [DecidablePred (· ∈ K)] (hK : MeasurableSet K) (hKS : K ⊆ S) |
| 88 | (f : LoopPlane → M) (hf : AEStronglyMeasurable f (volume.restrict K)) |
| 89 | (V : Fin 2 → LoopPlane → E) (hV : ∀ i, MemLp (V i) 2 (volume.restrict K)) |
| 90 | (hmap : W.map = K.piecewise f A.map) |
| 91 | (hcol : ∀ i, (W.column i : LoopPlane → E) =ᵐ[mu] K.piecewise (V i) (A.column i)) : |
| 92 | W.weightedEnergy Q r = A.weightedEnergy Q r + |
| 93 | (∫ p in K, (r * Q (f p) (V 0 p) (V 0 p) + r⁻¹ * Q (f p) (V 1 p) (V 1 p)) / 2) - |
| 94 | ∫ p in K, (r * Q (A.map p) (A.column 0 p) (A.column 0 p) + |
| 95 | r⁻¹ * Q (A.map p) (A.column 1 p) (A.column 1 p)) / 2 := by |
| 96 | classical |
| 97 | let old := fun p => (r * Q (A.map p) (A.column 0 p) (A.column 0 p) + |
| 98 | r⁻¹ * Q (A.map p) (A.column 1 p) (A.column 1 p)) / 2 |
| 99 | let new := fun p => (r * Q (f p) (V 0 p) (V 0 p) + r⁻¹ * Q (f p) (V 1 p) (V 1 p)) / 2 |
| 100 | have heq : (fun p => (r * Q (W.map p) (W.column 0 p) (W.column 0 p) + |
| 101 | r⁻¹ * Q (W.map p) (W.column 1 p) (W.column 1 p)) / 2) =ᵐ[mu] K.piecewise new old := by |
| 102 | filter_upwards [hcol 0, hcol 1] with p h0 h1 |
| 103 | rw [h0, h1, hmap] |
| 104 | by_cases hp : p ∈ K <;> simp only [piecewise, hp, if_true, if_false, new, old] |
| 105 | have hi (i : Fin 2) := m64VariableModulus_column_integrable Q hQ hb f hf (V i) (hV i) |
| 106 | unfold M64ObservedWeakAnnulus.weightedEnergy |
| 107 | rw [integral_congr_ae heq] |
| 108 | exact m64Integral_piecewise_of_subset hK hKS |
| 109 | (((hi 0).const_mul r).add ((hi 1).const_mul r⁻¹) |>.div_const 2) |
| 110 | (A.weightedEnergy_integrable Q hQ hei hb r) |
| 111 | |
| 112 | /-- Weighted minimality gives a genuine local unweighted replacement comparison with the |
| 113 | fixed ellipticity ratio. Source: Morgan-Tian Lemma 19.15, pp. 447-449; M64 derivation |
| 114 | `2026-09-26-raw-harmonic-stress.md`. -/ |
| 115 | theorem M64ObservedWeakAnnulus.weighted_local_energy_le_of_matching_flux |
| 116 | (A : M64ObservedWeakAnnulus (n := n) e c0 c1) |
| 117 | (Q : M → E →L[ℝ] E →L[ℝ] ℝ) (hQ : Continuous Q) (hei : IsEmbedding e) |
| 118 | {C : ℝ} (hb : ∀ q, ‖Q q‖ ≤ C) (hpos : ∀ q v, 0 ≤ Q q v v) |
| 119 | {r : ℝ} (hr : 0 < r) |
| 120 | (hmin : ∀ W : M64ObservedWeakAnnulus (n := n) e c0 c1, |
| 121 | A.weightedEnergy Q r ≤ W.weightedEnergy Q r) |
| 122 | {K : Set LoopPlane} (hK : MeasurableSet K) (hKS : K ⊆ S) |
| 123 | (f : LoopPlane → M) (hf : AEStronglyMeasurable f (volume.restrict K)) |
| 124 | (V : Fin 2 → LoopPlane → E) (hV : ∀ i, MemLp (V i) 2 (volume.restrict K)) |
| 125 | (hfl : MemLp (e ∘ f) 2 (volume.restrict K)) |
| 126 | (ht : ∀ i, ∀ᵐ p ∂volume.restrict K, |
| 127 | V i p ∈ range (mfderiv (𝓡 n) (𝓡 m) e (f p))) |
| 128 | (hgreen : ∀ (phi : LoopPlane → ℝ), ContDiff ℝ 1 phi → ∀ i : Fin 2, |
| 129 | (∫ p in K, phi p • V i p) + |
| 130 | (∫ p in K, fderiv ℝ phi p (EuclideanSpace.single i 1) • e (f p)) = |
| 131 | (∫ p in K, phi p • A.column i p) + |
| 132 | (∫ p in K, fderiv ℝ phi p (EuclideanSpace.single i 1) • e (A.map p))) : |
| 133 | (∫ p in K, (Q (A.map p) (A.column 0 p) (A.column 0 p) + |
| 134 | Q (A.map p) (A.column 1 p) (A.column 1 p)) / 2) ≤ |
| 135 | (max r r⁻¹) ^ 2 * |
| 136 | ∫ p in K, (Q (f p) (V 0 p) (V 0 p) + Q (f p) (V 1 p) (V 1 p)) / 2 := by |
| 137 | classical |
| 138 | obtain ⟨W, hmap, hcol⟩ := A.replace hK hKS f V hfl hV ht hgreen |
| 139 | have hE := m64VariableModulus_replacement_energy Q hQ hei hb r A W hK hKS |
| 140 | f hf V hV hmap hcol |
| 141 | have hm := hmin W |
| 142 | have hlocal : (∫ p in K, (r * Q (A.map p) (A.column 0 p) (A.column 0 p) + |
| 143 | r⁻¹ * Q (A.map p) (A.column 1 p) (A.column 1 p)) / 2) ≤ |
| 144 | ∫ p in K, (r * Q (f p) (V 0 p) (V 0 p) + r⁻¹ * Q (f p) (V 1 p) (V 1 p)) / 2 := by |
| 145 | linarith |
| 146 | have hD : 0 ≤ max r r⁻¹ := hr.le.trans (le_max_left _ _) |
| 147 | have hold := (m64VariableModulus_integral_comparison |
| 148 | ((A.column_energy_integrable Q hQ hei hb 0).mono_set hKS) |
| 149 | ((A.column_energy_integrable Q hQ hei hb 1).mono_set hKS) |
| 150 | (Eventually.of_forall fun p => hpos (A.map p) (A.column 0 p)) |
| 151 | (Eventually.of_forall fun p => hpos (A.map p) (A.column 1 p)) hr).1 |
| 152 | have hnew := (m64VariableModulus_integral_comparison |
| 153 | (m64VariableModulus_column_integrable Q hQ hb f hf (V 0) (hV 0)) |
| 154 | (m64VariableModulus_column_integrable Q hQ hb f hf (V 1) (hV 1)) |
| 155 | (Eventually.of_forall fun p => hpos (f p) (V 0 p)) |
| 156 | (Eventually.of_forall fun p => hpos (f p) (V 1 p)) hr).2 |
| 157 | exact (hold.trans (mul_le_mul_of_nonneg_left hlocal hD)).trans |
| 158 | ((mul_le_mul_of_nonneg_left hnew hD).trans_eq (by ring)) |
| 159 | |
| 160 | end PoincareMT |