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.Infimum |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Domain.Boundary |
| 4 | import PoincareLib.Geometry.Riemannian.LoopSpace.Area.Polar.Integration |
| 5 | import Mathlib.MeasureTheory.Integral.Prod |
| 6 | |
| 7 | /-! |
| 8 | # Iterated integration on the annular rectangle |
| 9 | |
| 10 | The source measure in the M64 definitions is transported to the product |
| 11 | coordinates by M58's volume-preserving equivalence. The null boundary then |
| 12 | identifies the closed-domain energy with the interior energy used by weak |
| 13 | compactness and by the trace estimates. |
| 14 | |
| 15 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 16 | 447-449. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open Set MeasureTheory |
| 22 | open scoped ContDiff Topology |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | open Proofs.M58 |
| 27 | |
| 28 | private theorem m64AnnulusDomain_ae_eq_interior : |
| 29 | m64AnnulusDomain =ᵐ[volume] interior m64AnnulusDomain := by |
| 30 | apply ae_eq_set.mpr |
| 31 | exact ⟨m64AnnulusDomain_boundary_null, by rw [sdiff_eq_empty.mpr interior_subset]; simp⟩ |
| 32 | |
| 33 | /-- Transport the actual continuous scalar integral on the closed annulus to product |
| 34 | coordinates. Proof expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 35 | theorem m64AnnulusIntegral_eq_iterated (F : LoopPlane → ℝ) (hF : Continuous F) : |
| 36 | (∫ p in m64AnnulusDomain, F p) = |
| 37 | ∫ x in Icc (0 : ℝ) curvePeriod, ∫ s in Icc (0 : ℝ) 1, F (annulusPoint x s) := by |
| 38 | let T := Icc (0 : ℝ) curvePeriod ×ˢ Icc (0 : ℝ) 1 |
| 39 | have hT : MeasurableSet T := measurableSet_Icc.prod measurableSet_Icc |
| 40 | have heq (q : ℝ × ℝ) : loopPlaneEquivProd.symm q = annulusPoint q.1 q.2 := by |
| 41 | ext i |
| 42 | fin_cases i <;> rfl |
| 43 | have hmem (q : ℝ × ℝ) : loopPlaneEquivProd.symm q ∈ m64AnnulusDomain ↔ q ∈ T := by |
| 44 | rw [heq] |
| 45 | change (0 ≤ q.1 ∧ q.1 ≤ curvePeriod ∧ 0 ≤ q.2 ∧ q.2 ≤ 1) ↔ |
| 46 | (0 ≤ q.1 ∧ q.1 ≤ curvePeriod) ∧ (0 ≤ q.2 ∧ q.2 ≤ 1) |
| 47 | tauto |
| 48 | have hcont : Continuous (fun q : ℝ × ℝ => F (annulusPoint q.1 q.2)) := by |
| 49 | apply hF.comp |
| 50 | unfold annulusPoint |
| 51 | fun_prop |
| 52 | have hInt : IntegrableOn (fun q : ℝ × ℝ => F (annulusPoint q.1 q.2)) T |
| 53 | (volume.prod volume) := |
| 54 | hcont.continuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc) |
| 55 | calc |
| 56 | _ = ∫ p, m64AnnulusDomain.indicator F p := |
| 57 | (integral_indicator m64AnnulusDomain_measurableSet).symm |
| 58 | _ = ∫ q : ℝ × ℝ, m64AnnulusDomain.indicator F (loopPlaneEquivProd.symm q) := |
| 59 | (measurePreserving_loopPlaneEquivProd.symm.integral_comp' _).symm |
| 60 | _ = ∫ q in T, F (annulusPoint q.1 q.2) := by |
| 61 | rw [← integral_indicator hT] |
| 62 | apply integral_congr_ae |
| 63 | exact Filter.Eventually.of_forall fun q => by |
| 64 | by_cases hq : q ∈ T |
| 65 | · simp only [indicator_of_mem ((hmem q).mpr hq), indicator_of_mem hq] |
| 66 | exact congrArg F (heq q) |
| 67 | · simp only [indicator_of_notMem (mt (hmem q).mp hq), indicator_of_notMem hq] |
| 68 | _ = _ := setIntegral_prod _ hInt |
| 69 | |
| 70 | /-- Remove the null annular boundary and compute the actual continuous scalar integral |
| 71 | iteratively. Proof expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 72 | theorem m64AnnulusInteriorIntegral_eq_iterated (F : LoopPlane → ℝ) (hF : Continuous F) : |
| 73 | (∫ p in interior m64AnnulusDomain, F p) = |
| 74 | ∫ x in Icc (0 : ℝ) curvePeriod, ∫ s in Icc (0 : ℝ) 1, F (annulusPoint x s) := by |
| 75 | rw [← setIntegral_congr_set m64AnnulusDomain_ae_eq_interior] |
| 76 | exact m64AnnulusIntegral_eq_iterated F hF |
| 77 | |
| 78 | end PoincareMT |