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.Area.Density |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Strip.Area |
| 3 | import PoincareLib.Geometry.Riemannian.Measure.ChangeOfVariables |
| 4 | |
| 5 | /-! |
| 6 | # Area of injective measurable normal strips |
| 7 | |
| 8 | The change-of-variables formula applies on an injective measurable subset |
| 9 | of the coordinate plane. An open inverse chart around the entire closed |
| 10 | strip is not required. This accommodates strips with a measurable cut time |
| 11 | and permits the angular seam to be removed as a null set. |
| 12 | |
| 13 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. The project derivations |
| 14 | implement its intrinsic normal-geodesic, focusing and retained-length comparison |
| 15 | arguments. |
| 16 | -/ |
| 17 | |
| 18 | noncomputable section |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set Filter MeasureTheory |
| 23 | open scoped Topology ENNReal Manifold ContDiff Bundle Matrix |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | /-- Intrinsic image volume of an injective differentiable planar parametrization is its |
| 28 | actual pullback Gram-density integral. Source: MT Proposition 19.35, pp. 480-481; |
| 29 | `reports/2026-09-24-injective-strip-area.md`. -/ |
| 30 | theorem m64Intrinsic_volume_image_of_injective |
| 31 | (G : RiemannianMetric 2 AnnulusCoordinates) |
| 32 | {e : AnnulusCoordinates → AnnulusCoordinates} {S : Set AnnulusCoordinates} |
| 33 | (hS : MeasurableSet S) (he : ∀ x ∈ S, DifferentiableAt ℝ e x) |
| 34 | (hinj : InjOn e S) : |
| 35 | G.volumeMeasure (e '' S) = |
| 36 | ∫⁻ x in S, ENNReal.ofReal (G.pullbackVolumeDensity e x) := by |
| 37 | have himage : MeasurableSet (e '' S) := hS.image_of_continuousOn_injOn |
| 38 | (fun x hx => (he x hx).continuousAt.continuousWithinAt) hinj |
| 39 | have hid := G.volumeMeasure_image_eq_lintegral_pullbackVolumeDensity |
| 40 | (OpenPartialHomeomorph.refl AnnulusCoordinates) contMDiffOn_id contMDiffOn_id |
| 41 | himage (subset_univ _) |
| 42 | have hchange := G.lintegral_pullbackVolumeDensity_image hS |
| 43 | (fun _ _ => mdifferentiableAt_id) he hinj (fun _ => 1) |
| 44 | have hid' : G.volumeMeasure (e '' S) = |
| 45 | ∫⁻ x in e '' S, ENNReal.ofReal (G.pullbackVolumeDensity id x) := by |
| 46 | simpa using hid |
| 47 | exact hid'.trans (by simpa using hchange) |
| 48 | |
| 49 | /-- The product-metric lower bound integrates on any injective measurable strip, including a |
| 50 | cut domain without an open-chart hypothesis. Source: MT Proposition 19.35, pp. 480-481; |
| 51 | `reports/2026-09-24-injective-strip-area.md`. -/ |
| 52 | theorem m64Intrinsic_injective_strip_area_lower |
| 53 | (G : RiemannianMetric 2 AnnulusCoordinates) |
| 54 | {e : AnnulusCoordinates → AnnulusCoordinates} {S : Set AnnulusCoordinates} |
| 55 | (hS : MeasurableSet S) (he : ∀ x ∈ S, DifferentiableAt ℝ e x) |
| 56 | (hinj : InjOn e S) {c : ℝ} (speed : ℝ → ℝ) |
| 57 | (hbound : ∀ x ∈ S, ∀ v : AnnulusCoordinates, |
| 58 | c ^ 2 * (speed (x 0) ^ 2 * (v 0) ^ 2 + (v 1) ^ 2) ≤ |
| 59 | G.inner (e x) (mfderiv (𝓡 2) (𝓡 2) e x v) (mfderiv (𝓡 2) (𝓡 2) e x v)) |
| 60 | (himage : e '' S ⊆ standardAnnulusDomain) : |
| 61 | (∫⁻ x in S, ENNReal.ofReal (c ^ 2 * speed (x 0))) ≤ |
| 62 | ENNReal.ofReal (intrinsicAnnulusArea G) := by |
| 63 | have hvolume := m64Intrinsic_volume_image_of_injective G hS he hinj |
| 64 | have harea := m64Intrinsic_region_volume_le_area G himage |
| 65 | calc |
| 66 | _ ≤ ∫⁻ x in S, ENNReal.ofReal (G.pullbackVolumeDensity e x) := by |
| 67 | apply setLIntegral_mono' hS |
| 68 | intro x hx |
| 69 | exact ENNReal.ofReal_le_ofReal (m64Intrinsic_pullbackDensity_lower G e x (hbound x hx)) |
| 70 | _ = G.volumeMeasure (e '' S) := hvolume.symm |
| 71 | _ ≤ ENNReal.ofReal (intrinsicAnnulusArea G) := by |
| 72 | rw [← ENNReal.ofReal_toReal harea.1.ne] |
| 73 | exact ENNReal.ofReal_le_ofReal harea.2 |
| 74 | |
| 75 | /-- Tonelli gives the area-cutoff estimate on an actual injective variable-height strip. Its |
| 76 | height needs only be measurable. Source: MT Proposition 19.35, pp. 480-481; |
| 77 | `reports/2026-09-24-injective-strip-area.md`. -/ |
| 78 | theorem m64Intrinsic_injective_strip_height_integral_le |
| 79 | (G : RiemannianMetric 2 AnnulusCoordinates) |
| 80 | {e : AnnulusCoordinates → AnnulusCoordinates} |
| 81 | (he : Differentiable ℝ e) |
| 82 | {S : Set ℝ} (hS : MeasurableSet S) {height speed : ℝ → ℝ} |
| 83 | (hh : Measurable height) (hs : Measurable speed) {c : ℝ} |
| 84 | (hinj : InjOn e |
| 85 | {z : AnnulusCoordinates | z 0 ∈ S ∧ z 1 ∈ Icc 0 (height (z 0))}) |
| 86 | (hbound : ∀ x : AnnulusCoordinates, x 0 ∈ S → x 1 ∈ Icc 0 (height (x 0)) → |
| 87 | ∀ v : AnnulusCoordinates, |
| 88 | c ^ 2 * (speed (x 0) ^ 2 * (v 0) ^ 2 + (v 1) ^ 2) ≤ |
| 89 | G.inner (e x) (mfderiv (𝓡 2) (𝓡 2) e x v) (mfderiv (𝓡 2) (𝓡 2) e x v)) |
| 90 | (himage : e '' {z : AnnulusCoordinates | z 0 ∈ S ∧ z 1 ∈ Icc 0 (height (z 0))} ⊆ |
| 91 | standardAnnulusDomain) : |
| 92 | ENNReal.ofReal (c ^ 2) * |
| 93 | (∫⁻ s in S, ENNReal.ofReal (speed s) * ENNReal.ofReal (height s)) ≤ |
| 94 | ENNReal.ofReal (intrinsicAnnulusArea G) := by |
| 95 | have hp0 : Measurable (fun z : AnnulusCoordinates => z 0) := by fun_prop |
| 96 | have hp1 : Measurable (fun z : AnnulusCoordinates => z 1) := by fun_prop |
| 97 | have hD : MeasurableSet |
| 98 | {z : AnnulusCoordinates | z 0 ∈ S ∧ z 1 ∈ Icc 0 (height (z 0))} := |
| 99 | (hS.preimage hp0).inter ((measurableSet_le measurable_const hp1).inter |
| 100 | (measurableSet_le hp1 (hh.comp hp0))) |
| 101 | have harea := m64Intrinsic_injective_strip_area_lower G hD (fun x _ => he x) hinj speed |
| 102 | (fun x hx => hbound x hx.1 hx.2) himage |
| 103 | simp_rw [ENNReal.ofReal_mul (sq_nonneg c)] at harea |
| 104 | rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top, |
| 105 | m64Intrinsic_parameter_strip_integral hS hh hs] at harea |
| 106 | exact harea |
| 107 | |
| 108 | end PoincareMT |