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.Curve.EndpointProjection |
| 2 | |
| 3 | /-! Endpoint capacity of two smooth target segments. |
| 4 | Source: MT Lemma 19.46, pp. 475-478; central-regional-descent derivation, |
| 5 | Section 8. A measurable partition assigns shared endpoints only once. -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set MeasureTheory |
| 12 | open scoped Topology Manifold ContDiff Bundle Matrix |
| 13 | |
| 14 | namespace PoincareMT |
| 15 | |
| 16 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 17 | normedSpaceTangentSpaceVectorSpace |
| 18 | |
| 19 | /-- Injective regular endpoints landing on two embedded unit-speed segments cost at most the |
| 20 | sum of their lengths, even when the target segments intersect. Source: MT Lemma 19.46; |
| 21 | derivation Section 8. Source/construction: |
| 22 | proof-work/tasks/M64/derivations/2026-09-27-central-regional-descent.md, Section 8. -/ |
| 23 | theorem m64Intrinsic_two_unit_curves_endpoint_projection_length_le |
| 24 | (N : IntrinsicAnnulus) (e : AnnulusCoordinates → AnnulusCoordinates) |
| 25 | (he : ContDiff ℝ ∞ e) {height : ℝ → ℝ} (hh : Measurable height) |
| 26 | {S : Set ℝ} (hS : MeasurableSet S) {l u : ℝ} (hSsub : S ⊆ Icc l u) |
| 27 | (hinj : InjOn (fun a => e !₂[a, height a]) S) |
| 28 | (hregular : ∀ a ∈ S, Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, height a])) |
| 29 | {target₁ target₂ : ℝ → AnnulusCoordinates} |
| 30 | (htarget₁ : ContDiff ℝ ∞ target₁) (htarget₂ : ContDiff ℝ ∞ target₂) |
| 31 | {a₁ b₁ a₂ b₂ : ℝ} (hab₁ : a₁ ≤ b₁) (hab₂ : a₂ ≤ b₂) |
| 32 | (hinj₁ : InjOn target₁ (Icc a₁ b₁)) (hinj₂ : InjOn target₂ (Icc a₂ b₂)) |
| 33 | (hunit₁ : ∀ t ∈ Icc a₁ b₁, |
| 34 | N.metric.inner (target₁ t) (deriv target₁ t) (deriv target₁ t) = 1) |
| 35 | (hunit₂ : ∀ t ∈ Icc a₂ b₂, |
| 36 | N.metric.inner (target₂ t) (deriv target₂ t) (deriv target₂ t) = 1) |
| 37 | (hend : ∀ s ∈ S, e !₂[s, height s] ∈ target₁ '' Icc a₁ b₁ ∪ target₂ '' Icc a₂ b₂) |
| 38 | {c : ℝ} (hc : 0 ≤ c) |
| 39 | (hbound : ∀ s ∈ S, ∀ v : AnnulusCoordinates, |
| 40 | c ^ 2 * (intrinsicBoundarySpeed N.metric 1 s ^ 2 * (v 0) ^ 2 + (v 1) ^ 2) ≤ |
| 41 | N.metric.inner (e !₂[s, height s]) |
| 42 | (fderiv ℝ e !₂[s, height s] v) (fderiv ℝ e !₂[s, height s] v)) : |
| 43 | c * (∫ s in S, intrinsicBoundarySpeed N.metric 1 s) ≤ (b₁ - a₁) + (b₂ - a₂) := by |
| 44 | let C := (fun s => e !₂[s, height s]) ⁻¹' (target₁ '' Icc a₁ b₁) |
| 45 | have hgraph : Measurable (fun s => (!₂[s, height s] : AnnulusCoordinates)) := by fun_prop |
| 46 | have hC : MeasurableSet C := |
| 47 | (isCompact_Icc.image htarget₁.continuous).isClosed.measurableSet.preimage |
| 48 | (he.continuous.measurable.comp hgraph) |
| 49 | have hfirst := m64Intrinsic_unit_curve_endpoint_projection_length_le N e he hh |
| 50 | (hS.inter hC) (inter_subset_left.trans hSsub) (hinj.mono inter_subset_left) |
| 51 | (fun s hs => hregular s hs.1) htarget₁ hab₁ hinj₁ hunit₁ |
| 52 | (fun _ hs => hs.2) hc (fun s hs => hbound s hs.1) |
| 53 | have hsecond := m64Intrinsic_unit_curve_endpoint_projection_length_le N e he hh |
| 54 | (hS.diff hC) (sdiff_subset.trans hSsub) (hinj.mono sdiff_subset) |
| 55 | (fun s hs => hregular s hs.1) htarget₂ hab₂ hinj₂ hunit₂ |
| 56 | (fun s hs => (hend s hs.1).resolve_left hs.2) hc (fun s hs => hbound s hs.1) |
| 57 | have hs := (m64Intrinsic_contDiff_boundarySpeed N one_ne_zero).continuous |
| 58 | have hadd := integral_inter_add_sdiff (μ := volume) hC (hs.integrableOn_Icc.mono_set hSsub) |
| 59 | calc |
| 60 | _ = c * ((∫ s in S ∩ C, intrinsicBoundarySpeed N.metric 1 s) + |
| 61 | ∫ s in S \ C, intrinsicBoundarySpeed N.metric 1 s) := by rw [hadd] |
| 62 | _ = _ + _ := mul_add _ _ _ |
| 63 | _ ≤ _ := add_le_add hfirst hsecond |
| 64 | |
| 65 | end PoincareMT |