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.Endpoint.Lift |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Boundary.Parameters |
| 3 | import Mathlib.MeasureTheory.Function.JacobianOneDim |
| 4 | import Mathlib.Analysis.SpecialFunctions.Complex.Circle |
| 5 | |
| 6 | /-! |
| 7 | # Endpoint projection on measurable lifted boundary sets |
| 8 | |
| 9 | The inverse lift need only be smooth locally; the retained endpoint set |
| 10 | may be an arbitrary measurable subset. The one-dimensional Jacobian |
| 11 | formula controls its projected arc length, including at tangencies where |
| 12 | the derivative of the base projection vanishes. |
| 13 | |
| 14 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. The project derivations |
| 15 | implement its intrinsic normal-geodesic, focusing and retained-length comparison |
| 16 | arguments. |
| 17 | -/ |
| 18 | |
| 19 | noncomputable section |
| 20 | set_option autoImplicit false |
| 21 | set_option backward.isDefEq.respectTransparency false |
| 22 | |
| 23 | open Set Filter MeasureTheory |
| 24 | open scoped Topology Manifold ContDiff Bundle Matrix ENNReal |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 29 | normedSpaceTangentSpaceVectorSpace |
| 30 | |
| 31 | /-- Each nonzero-radius boundary has an injective half-open parameter period. No endpoint |
| 32 | identification is admitted into this domain. Source: MT Proposition 19.35, pp. 480-481; |
| 33 | `reports/2026-09-25-global-endpoint-projection.md`. -/ |
| 34 | theorem m64Intrinsic_boundary_injOn_period {radius : ℝ} (hradius : radius ≠ 0) : |
| 35 | InjOn (intrinsicAnnulusBoundary radius) (Ico (0 : ℝ) rampPeriod) := by |
| 36 | intro x hx y hy hxy |
| 37 | apply Circle.exp_injOn_Ico (by simp only [sub_zero]; exact le_rfl) hx hy |
| 38 | apply Subtype.ext |
| 39 | apply Complex.ext |
| 40 | · have h := congrArg (fun z : AnnulusCoordinates => z 0) hxy |
| 41 | change radius * Real.cos x = radius * Real.cos y at h |
| 42 | have hc := mul_left_cancel₀ hradius h |
| 43 | simpa only [Circle.coe_exp, Complex.exp_ofReal_mul_I_re] using hc |
| 44 | · have h := congrArg (fun z : AnnulusCoordinates => z 1) hxy |
| 45 | change radius * Real.sin x = radius * Real.sin y at h |
| 46 | have hs := mul_left_cancel₀ hradius h |
| 47 | simpa only [Circle.coe_exp, Complex.exp_ofReal_mul_I_im] using hs |
| 48 | |
| 49 | /-- A smooth lifted boundary obeys the length-expansion estimate on every measurable subset |
| 50 | on which its base projection is injective. Source: MT Proposition 19.35, pp. 480-481; |
| 51 | `reports/2026-09-25-global-endpoint-projection.md`. -/ |
| 52 | theorem m64Intrinsic_lifted_boundary_measure_le |
| 53 | (N : IntrinsicAnnulus) |
| 54 | {e : AnnulusCoordinates → AnnulusCoordinates} {gamma : ℝ → AnnulusCoordinates} |
| 55 | {J B : Set ℝ} (hJ : IsOpen J) (hg : ContDiffOn ℝ ∞ gamma J) |
| 56 | (he : ∀ s ∈ J, DifferentiableAt ℝ e (gamma s)) |
| 57 | (hlift : ∀ s ∈ J, e (gamma s) = intrinsicAnnulusBoundary 2 s) |
| 58 | (hB : MeasurableSet B) (hBJ : B ⊆ J) |
| 59 | (hinj : InjOn (fun s => gamma s 0) B) {c : ℝ} (hc : 0 ≤ c) |
| 60 | (hbound : ∀ s ∈ B, ∀ v : AnnulusCoordinates, |
| 61 | c ^ 2 * ((intrinsicBoundarySpeed N.metric 1 (gamma s 0)) ^ 2 * (v 0) ^ 2 + (v 1) ^ 2) ≤ |
| 62 | N.metric.inner (e (gamma s)) (fderiv ℝ e (gamma s) v) (fderiv ℝ e (gamma s) v)) : |
| 63 | ENNReal.ofReal c * |
| 64 | (∫⁻ a in (fun s => gamma s 0) '' B, ENNReal.ofReal (intrinsicBoundarySpeed N.metric 1 a)) ≤ |
| 65 | ∫⁻ s in B, ENNReal.ofReal (intrinsicBoundarySpeed N.metric 2 s) := by |
| 66 | let f : ℝ → ℝ := fun s => gamma s 0 |
| 67 | let f' : ℝ → ℝ := fun s => deriv gamma s 0 |
| 68 | have hga (s : ℝ) (hs : s ∈ B) : ContDiffAt ℝ ∞ gamma s := |
| 69 | hg.contDiffAt (hJ.mem_nhds (hBJ hs)) |
| 70 | have hdf (s : ℝ) (hs : s ∈ B) : HasDerivAt f (f' s) s := |
| 71 | (PiLp.hasFDerivAt_apply (𝕜 := ℝ) 2 (gamma s) 0).comp_hasDerivAt s |
| 72 | ((hga s hs).differentiableAt (by simp)).hasDerivAt |
| 73 | have hchange := lintegral_image_eq_lintegral_abs_deriv_mul hB |
| 74 | (fun s hs => (hdf s hs).hasDerivWithinAt) hinj |
| 75 | (fun a => ENNReal.ofReal (intrinsicBoundarySpeed N.metric 1 a)) |
| 76 | rw [hchange, ← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] |
| 77 | apply setLIntegral_mono' hB |
| 78 | intro s hs |
| 79 | have hspeed := m64Intrinsic_boundary_lift_speed_le N (he s (hBJ hs)) |
| 80 | ((hga s hs).differentiableAt (by simp)) (c := c) (hbound := hbound s hs) ?_ |
| 81 | · rw [← ENNReal.ofReal_mul (abs_nonneg _), ← ENNReal.ofReal_mul hc] |
| 82 | apply ENNReal.ofReal_le_ofReal |
| 83 | convert hspeed using 1 |
| 84 | dsimp only [f, f'] |
| 85 | ring |
| 86 | · filter_upwards [hJ.mem_nhds (hBJ hs)] with x hx |
| 87 | exact hlift x hx |
| 88 | |
| 89 | /-- On a graph of first-contact heights the lifted base projection is injective, including |
| 90 | tangencies. Thus the measurable endpoint estimate does not require a smooth height function |
| 91 | or a nonzero base derivative. Source: MT Proposition 19.35, pp. 480-481; |
| 92 | `reports/2026-09-25-global-endpoint-projection.md`. -/ |
| 93 | theorem m64Intrinsic_lifted_endpoint_graph_measure_le |
| 94 | (N : IntrinsicAnnulus) |
| 95 | {e : AnnulusCoordinates → AnnulusCoordinates} {gamma : ℝ → AnnulusCoordinates} |
| 96 | {J B : Set ℝ} (hJ : IsOpen J) (hg : ContDiffOn ℝ ∞ gamma J) |
| 97 | (he : ∀ s ∈ J, DifferentiableAt ℝ e (gamma s)) |
| 98 | (hlift : ∀ s ∈ J, e (gamma s) = intrinsicAnnulusBoundary 2 s) |
| 99 | (hB : MeasurableSet B) (hBJ : B ⊆ J) (hBP : B ⊆ Ico (0 : ℝ) rampPeriod) |
| 100 | {height : ℝ → ℝ} (hgraph : ∀ s ∈ B, gamma s 1 = height (gamma s 0)) |
| 101 | {c : ℝ} (hc : 0 ≤ c) |
| 102 | (hbound : ∀ s ∈ B, ∀ v : AnnulusCoordinates, |
| 103 | c ^ 2 * ((intrinsicBoundarySpeed N.metric 1 (gamma s 0)) ^ 2 * (v 0) ^ 2 + (v 1) ^ 2) ≤ |
| 104 | N.metric.inner (e (gamma s)) (fderiv ℝ e (gamma s) v) (fderiv ℝ e (gamma s) v)) : |
| 105 | ENNReal.ofReal c * |
| 106 | (∫⁻ a in (fun s => gamma s 0) '' B, ENNReal.ofReal (intrinsicBoundarySpeed N.metric 1 a)) ≤ |
| 107 | ∫⁻ s in B, ENNReal.ofReal (intrinsicBoundarySpeed N.metric 2 s) := by |
| 108 | apply m64Intrinsic_lifted_boundary_measure_le N hJ hg he hlift hB hBJ ?_ hc hbound |
| 109 | intro x hx y hy hxy |
| 110 | change gamma x 0 = gamma y 0 at hxy |
| 111 | have hgamma : gamma x = gamma y := by |
| 112 | ext i |
| 113 | fin_cases i |
| 114 | · exact hxy |
| 115 | · change gamma x 1 = gamma y 1 |
| 116 | rw [hgraph x hx, hgraph y hy, hxy] |
| 117 | apply m64Intrinsic_boundary_injOn_period (by norm_num : (2 : ℝ) ≠ 0) (hBP hx) (hBP hy) |
| 118 | rw [← hlift x (hBJ hx), ← hlift y (hBJ hy), hgamma] |
| 119 | |
| 120 | end PoincareMT |