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.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Rectangle.GreenIdentity |
| 3 | |
| 4 | /-! |
| 5 | # Rectangle integration for measurable derivative columns |
| 6 | |
| 7 | The volume-preserving coordinate map works for arbitrary integrable |
| 8 | columns. No continuity of the derivatives is required. |
| 9 | |
| 10 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 11 | 447-449. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set MeasureTheory |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | open Proofs.M58 |
| 21 | |
| 22 | /-- Closed and open annular rectangles carry the same restricted volume measure. Proof |
| 23 | expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 24 | theorem m64Annulus_restrict_closed_eq_interior : |
| 25 | volume.restrict m64AnnulusDomain = volume.restrict (interior m64AnnulusDomain) := by |
| 26 | apply Measure.restrict_congr_set |
| 27 | apply ae_eq_set.mpr |
| 28 | exact ⟨m64AnnulusDomain_boundary_null, by rw [sdiff_eq_empty.mpr interior_subset]; simp⟩ |
| 29 | |
| 30 | /-- The actual product coordinate map preserves the restricted annular volume measure. Proof |
| 31 | expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 32 | theorem m64AnnulusPoint_measurePreserving : |
| 33 | MeasurePreserving (fun q : ℝ × ℝ => annulusPoint q.1 q.2) |
| 34 | ((volume.restrict (Icc (0 : ℝ) curvePeriod)).prod (volume.restrict (Icc (0 : ℝ) 1))) |
| 35 | (volume.restrict (interior m64AnnulusDomain)) := by |
| 36 | have heq : (fun q : ℝ × ℝ => annulusPoint q.1 q.2) = loopPlaneEquivProd.symm := by |
| 37 | funext q |
| 38 | ext i |
| 39 | fin_cases i <;> rfl |
| 40 | have hpre : loopPlaneEquivProd.symm ⁻¹' m64AnnulusDomain = |
| 41 | Icc (0 : ℝ) curvePeriod ×ˢ Icc (0 : ℝ) 1 := by |
| 42 | ext q |
| 43 | rw [← heq] |
| 44 | change (0 ≤ q.1 ∧ q.1 ≤ curvePeriod ∧ 0 ≤ q.2 ∧ q.2 ≤ 1) ↔ |
| 45 | (0 ≤ q.1 ∧ q.1 ≤ curvePeriod) ∧ (0 ≤ q.2 ∧ q.2 ≤ 1) |
| 46 | tauto |
| 47 | have h := measurePreserving_loopPlaneEquivProd.symm.restrict_preimage_emb |
| 48 | loopPlaneEquivProd.symm.measurableEmbedding m64AnnulusDomain |
| 49 | rw [hpre, m64Annulus_restrict_closed_eq_interior] at h |
| 50 | rw [heq, Measure.prod_restrict] |
| 51 | exact h |
| 52 | |
| 53 | /-- Compute an actual Bochner-integrable annulus integral by the product coordinates. Proof |
| 54 | expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 55 | theorem m64AnnulusInteriorIntegral_eq_iterated_integrable |
| 56 | {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] |
| 57 | (f : LoopPlane → F) (hf : IntegrableOn f (interior m64AnnulusDomain) volume) : |
| 58 | (∫ p in interior m64AnnulusDomain, f p) = |
| 59 | ∫ x in Icc (0 : ℝ) curvePeriod, ∫ s in Icc (0 : ℝ) 1, f (annulusPoint x s) := by |
| 60 | have hi := m64AnnulusPoint_measurePreserving.integrable_comp_of_integrable hf |
| 61 | calc |
| 62 | _ = ∫ q : ℝ × ℝ, f (annulusPoint q.1 q.2) |
| 63 | ∂((volume.restrict (Icc (0 : ℝ) curvePeriod)).prod |
| 64 | (volume.restrict (Icc (0 : ℝ) 1))) := |
| 65 | (m64AnnulusPoint_measurePreserving.integral_comp |
| 66 | (by |
| 67 | have heq : (fun q : ℝ × ℝ => annulusPoint q.1 q.2) = loopPlaneEquivProd.symm := by |
| 68 | funext q |
| 69 | ext i |
| 70 | fin_cases i <;> rfl |
| 71 | rw [heq] |
| 72 | exact loopPlaneEquivProd.symm.measurableEmbedding) f).symm |
| 73 | _ = _ := integral_prod _ hi |
| 74 | |
| 75 | /-- Swap the two coordinate integrals for genuine Bochner-integrable annular data. Proof |
| 76 | expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 77 | theorem m64AnnulusInteriorIntegral_eq_iterated_swap_integrable |
| 78 | {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] |
| 79 | (f : LoopPlane → F) (hf : IntegrableOn f (interior m64AnnulusDomain) volume) : |
| 80 | (∫ p in interior m64AnnulusDomain, f p) = |
| 81 | ∫ s in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) curvePeriod, f (annulusPoint x s) := by |
| 82 | rw [m64AnnulusInteriorIntegral_eq_iterated_integrable f hf] |
| 83 | exact integral_integral_swap (m64AnnulusPoint_measurePreserving.integrable_comp_of_integrable hf) |
| 84 | |
| 85 | end PoincareMT |