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.IntrinsicComparison.Focusing.Loss |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Subarc.LengthDecrease |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Boundary.Periodicity |
| 4 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic |
| 5 | |
| 6 | /-! Local separation from the actual focusing inequalities. |
| 7 | Source: MT Lemma 19.53 and Corollary 19.56, pp. 478-479; |
| 8 | local-inverse-self-return derivation, Section 1. The curvature bound is local. -/ |
| 9 | |
| 10 | noncomputable section |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set MeasureTheory |
| 14 | open scoped intervalIntegral |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- The two complementary oriented arcs sum to the full boundary length. This identity |
| 19 | retains the actual circle parameter and metric speed. Source: MT Corollary 19.55; |
| 20 | local-inverse-self-return, Section 1. Source/construction: |
| 21 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Section 1. -/ |
| 22 | theorem m64Intrinsic_complementary_boundary_length (N : IntrinsicAnnulus) (a b : ℝ) : |
| 23 | intrinsicBoundaryLength N.metric 1 a b + |
| 24 | intrinsicBoundaryLength N.metric 1 b (a + rampPeriod) = |
| 25 | intrinsicBoundaryLength N.metric 1 0 rampPeriod := by |
| 26 | have hs := (m64Intrinsic_contDiff_boundarySpeed N one_ne_zero).continuous |
| 27 | have hadd := intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 28 | (hs.intervalIntegrable a b) (hs.intervalIntegrable b (a + rampPeriod)) |
| 29 | have hperiod := (m64Intrinsic_boundarySpeed_periodic N 1).intervalIntegral_add_eq a 0 |
| 30 | simpa only [intrinsicBoundaryLength, zero_add] using hadd.trans hperiod |
| 31 | |
| 32 | /-- A positive arc with curvature at most M cannot satisfy focusing at radius rho when |
| 33 | 2*rho*M<1. Source: MT Claim 19.43, absolute-turning repair; local-inverse-self-return |
| 34 | derivation, Section 1. Source/construction: |
| 35 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Section 1. -/ |
| 36 | theorem m64Intrinsic_no_focusing_of_curvature_bound |
| 37 | (N : IntrinsicAnnulus) {a b rho kappa M : ℝ} |
| 38 | (hab : a < b) (hrho : 0 < rho) (hkappa : 0 < kappa) |
| 39 | (hangle : kappa * rho ≤ Real.pi / 4) (hsmall : 2 * rho * M < 1) |
| 40 | (hcurv : ∀ p ∈ Icc a b, intrinsicGeodesicCurvature N.metric N.connection 1 p ≤ M) |
| 41 | (hfocus : Real.cos (kappa * rho) * intrinsicBoundaryLength N.metric 1 a b ≤ |
| 42 | (Real.sin (kappa * rho) / kappa) * |
| 43 | intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 a b) : False := by |
| 44 | have hlen := m64Intrinsic_boundaryLength_pos N one_ne_zero hab |
| 45 | have hs := (m64Intrinsic_contDiff_boundarySpeed N one_ne_zero).continuous |
| 46 | have ht := m64Intrinsic_continuous_turning_density N one_ne_zero |
| 47 | have hturn : intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 a b ≤ |
| 48 | M * intrinsicBoundaryLength N.metric 1 a b := by |
| 49 | have h := intervalIntegral.integral_mono_on (μ := volume) hab.le (ht.intervalIntegrable a b) |
| 50 | ((continuous_const.mul hs).intervalIntegrable a b) |
| 51 | (fun p hp => mul_le_mul_of_nonneg_right (hcurv p hp) |
| 52 | (m64Intrinsic_boundarySpeed_nonneg N 1 p)) |
| 53 | simpa only [intrinsicGeodesicCurvatureIntegral, intrinsicBoundaryLength, |
| 54 | Pi.mul_apply, intervalIntegral.integral_const_mul] using h |
| 55 | have hbound := m64Intrinsic_sine_focusing_length_le_twice_radius_turning hrho hkappa |
| 56 | hangle hlen.le (m64Intrinsic_geodesicCurvatureIntegral_nonneg N 1 a b hab.le) hfocus |
| 57 | have hupper := mul_le_mul_of_nonneg_left hturn (by positivity : 0 ≤ 2 * rho) |
| 58 | have hstrict := mul_lt_mul_of_pos_right hsmall hlen |
| 59 | nlinarith only [hbound, hupper, hstrict] |
| 60 | |
| 61 | /-- A short locally regular base and its long complement exclude both alternatives of the |
| 62 | proved cyclic focusing producer. This is the local separation input for Lemma 19.53; |
| 63 | local-inverse-self-return, Section 1. Source/construction: |
| 64 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Section 1. -/ |
| 65 | theorem m64Intrinsic_no_local_cyclic_focusing |
| 66 | (N : IntrinsicAnnulus) {a b q rho kappa M : ℝ} |
| 67 | (hab : a < b) (hrho : 0 < rho) (hkappa : 0 < kappa) |
| 68 | (hangle : kappa * rho ≤ Real.pi / 4) (hsmall : 2 * rho * M < 1) |
| 69 | (hcurv : ∀ p ∈ Icc a b, intrinsicGeodesicCurvature N.metric N.connection 1 p ≤ M) |
| 70 | (hgap : intrinsicBoundaryLength N.metric 1 a b < |
| 71 | intrinsicBoundaryLength N.metric 1 0 rampPeriod - 2 * q) |
| 72 | (hfocus : |
| 73 | (intrinsicBoundaryLength N.metric 1 a b ≤ 2 * q ∧ |
| 74 | Real.cos (kappa * rho) * intrinsicBoundaryLength N.metric 1 a b ≤ |
| 75 | (Real.sin (kappa * rho) / kappa) * |
| 76 | intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 a b) ∨ |
| 77 | (intrinsicBoundaryLength N.metric 1 b (a + rampPeriod) ≤ 2 * q ∧ |
| 78 | Real.cos (kappa * rho) * intrinsicBoundaryLength N.metric 1 b (a + rampPeriod) ≤ |
| 79 | (Real.sin (kappa * rho) / kappa) * |
| 80 | intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 b (a + rampPeriod))) : |
| 81 | False := by |
| 82 | rcases hfocus with hfocus | hfocus |
| 83 | · exact m64Intrinsic_no_focusing_of_curvature_bound N hab hrho hkappa hangle hsmall |
| 84 | hcurv hfocus.2 |
| 85 | · have hsum := m64Intrinsic_complementary_boundary_length N a b |
| 86 | linarith only [hgap, hsum, hfocus.1] |
| 87 | |
| 88 | end PoincareMT |