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.RicciFlow.Surgery.Metric.Standard.Radial.RadialArclength |
| 2 | |
| 3 | /-! |
| 4 | # Length of coordinate-axis paths |
| 5 | |
| 6 | The axis path has speed equal to the square root of the radial metric |
| 7 | coefficient. Its exact length bounds the intrinsic distance from above. |
| 8 | The reverse distance bound is not asserted here. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle ENNReal |
| 14 | open MeasureTheory |
| 15 | |
| 16 | namespace PoincareMT.MetricSurgery |
| 17 | |
| 18 | theorem axisPoint_hasDerivAt (r : ℝ) : HasDerivAt axisPoint (axisBasis 0) r := by |
| 19 | rw [show axisPoint = fun t => t • axisBasis 0 from funext axisPoint_eq_smul] |
| 20 | convert! (hasDerivAt_id r).smul_const (axisBasis 0) using 1 |
| 21 | simp |
| 22 | |
| 23 | theorem axisPoint_mfderiv_one (r : ℝ) : |
| 24 | mfderiv 𝓘(ℝ, ℝ) (𝓡 3) axisPoint r 1 = axisBasis 0 := by |
| 25 | rw [mfderiv_eq_fderiv, (axisPoint_hasDerivAt r).hasFDerivAt.fderiv] |
| 26 | change (1 : ℝ) • axisBasis 0 = axisBasis 0 |
| 27 | exact one_smul ℝ (axisBasis 0) |
| 28 | |
| 29 | theorem axis_pathELength (g₀ : StandardInitialMetric) {a b : ℝ} (hab : a ≤ b) : |
| 30 | g₀.metric.pathELength axisPoint a b = |
| 31 | ENNReal.ofReal (radialArclength g₀ b - radialArclength g₀ a) := by |
| 32 | let : Bundle.RiemannianBundle |
| 33 | (TangentSpace (𝓡 3) : StandardCapSpace → Type _) := |
| 34 | ⟨g₀.metric.toRiemannianMetric⟩ |
| 35 | have hc := (radialSpeed_contDiff g₀).continuous |
| 36 | change Manifold.pathELength (𝓡 3) axisPoint a b = _ |
| 37 | rw [Manifold.pathELength_eq_lintegral_mfderiv_Icc] |
| 38 | calc |
| 39 | _ = ∫⁻ t in Set.Icc a b, ENNReal.ofReal (radialSpeed g₀ t) := by |
| 40 | apply setLIntegral_congr_fun measurableSet_Icc |
| 41 | intro t _ |
| 42 | dsimp only |
| 43 | erw [← ofReal_norm, norm_eq_sqrt_real_inner] |
| 44 | change ENNReal.ofReal (Real.sqrt (g₀.metric.inner (axisPoint t) |
| 45 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 3) axisPoint t 1) |
| 46 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 3) axisPoint t 1))) = _ |
| 47 | rw [axisPoint_mfderiv_one] |
| 48 | rfl |
| 49 | _ = ENNReal.ofReal (∫ t in Set.Icc a b, radialSpeed g₀ t) := by |
| 50 | symm |
| 51 | exact ofReal_integral_eq_lintegral_ofReal hc.integrableOn_Icc |
| 52 | (Filter.Eventually.of_forall fun t => (radialSpeed_pos g₀ t).le) |
| 53 | _ = ENNReal.ofReal (∫ t in a..b, radialSpeed g₀ t) := by |
| 54 | rw [intervalIntegral.integral_of_le hab, integral_Icc_eq_integral_Ioc] |
| 55 | _ = _ := by |
| 56 | congr 1 |
| 57 | exact (intervalIntegral.integral_interval_sub_left |
| 58 | (hc.intervalIntegrable 0 b) (hc.intervalIntegrable 0 a)).symm |
| 59 | |
| 60 | theorem axis_edist_le_arclength_sub (g₀ : StandardInitialMetric) |
| 61 | {a b : ℝ} (hab : a ≤ b) : |
| 62 | g₀.metric.edist (axisPoint a) (axisPoint b) ≤ |
| 63 | ENNReal.ofReal (radialArclength g₀ b - radialArclength g₀ a) := by |
| 64 | let : Bundle.RiemannianBundle |
| 65 | (TangentSpace (𝓡 3) : StandardCapSpace → Type _) := |
| 66 | ⟨g₀.metric.toRiemannianMetric⟩ |
| 67 | have hp : g₀.metric.edist (axisPoint a) (axisPoint b) ≤ |
| 68 | g₀.metric.pathELength axisPoint a b := |
| 69 | Manifold.riemannianEDist_le_pathELength |
| 70 | (axisPoint_contDiff.contMDiff.of_le (by norm_num)).contMDiffOn rfl rfl hab |
| 71 | exact hp.trans_eq (axis_pathELength g₀ hab) |
| 72 | |
| 73 | theorem axis_edist_le_arclength_edist (g₀ : StandardInitialMetric) (a b : ℝ) : |
| 74 | g₀.metric.edist (axisPoint a) (axisPoint b) ≤ |
| 75 | edist (radialArclength g₀ a) (radialArclength g₀ b) := by |
| 76 | have hmono := (radialArclength_strictMono g₀).monotone |
| 77 | rcases le_total a b with hab | hba |
| 78 | · rw [edist_dist, Real.dist_eq, abs_of_nonpos (sub_nonpos.mpr (hmono hab)), neg_sub] |
| 79 | exact axis_edist_le_arclength_sub g₀ hab |
| 80 | · let : Bundle.RiemannianBundle |
| 81 | (TangentSpace (𝓡 3) : StandardCapSpace → Type _) := |
| 82 | ⟨g₀.metric.toRiemannianMetric⟩ |
| 83 | have hcomm : g₀.metric.edist (axisPoint a) (axisPoint b) = |
| 84 | g₀.metric.edist (axisPoint b) (axisPoint a) := Manifold.riemannianEDist_comm |
| 85 | rw [hcomm, edist_dist, Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr (hmono hba))] |
| 86 | exact axis_edist_le_arclength_sub g₀ hba |
| 87 | |
| 88 | end PoincareMT.MetricSurgery |