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.StandardCap.Existence.InitialEstimates.RadialForm |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.RiemannianProper |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Imports.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.RiemannianProper |
| 4 | import PoincareLib.Geometry.Riemannian.MetricComparison |
| 5 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus |
| 6 | |
| 7 | /-! |
| 8 | # Radial length for an arbitrary standard initial metric |
| 9 | |
| 10 | Morgan-Tian Lemma 12.3, pp. 294-295. The signed-axis radial coefficient |
| 11 | defines a positive smooth speed. Integrating it bounds the actual metric |
| 12 | distance along that axis. Completeness and M09 properness then force the |
| 13 | radial length to be unbounded: otherwise an unbounded Euclidean ray would |
| 14 | lie in a compact metric ball. See the weighted-radial-positivity derivation. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set MeasureTheory Manifold |
| 20 | open scoped Manifold ContDiff Bundle ENNReal |
| 21 | |
| 22 | namespace PoincareMT.M34 |
| 23 | |
| 24 | /-- The metric speed along the signed first axis (Lemma 12.3, p. 295). -/ |
| 25 | noncomputable def initialRadialSpeed (g₀ : StandardInitialMetric) (r : ℝ) : ℝ := |
| 26 | Real.sqrt (initialRadialCoefficient g₀ r) |
| 27 | |
| 28 | /-- The angular warping radius in the original radial coordinate |
| 29 | (Lemma 12.3, pp. 294-295). -/ |
| 30 | noncomputable def initialWarping (g₀ : StandardInitialMetric) (r : ℝ) : ℝ := |
| 31 | r * Real.sqrt (initialAngularCoefficient g₀ r) |
| 32 | |
| 33 | /-- The radial speed is everywhere strictly positive (Lemma 12.3, p. 295). -/ |
| 34 | theorem initialRadialSpeed_pos (g₀ : StandardInitialMetric) (r : ℝ) : |
| 35 | 0 < initialRadialSpeed g₀ r := Real.sqrt_pos.mpr (initialCoefficients_pos g₀ r).1 |
| 36 | |
| 37 | /-- Smoothness of the radial speed on the signed axis (Lemma 12.3, p. 295). -/ |
| 38 | theorem initialRadialSpeed_contDiff (g₀ : StandardInitialMetric) : |
| 39 | ContDiff ℝ ∞ (initialRadialSpeed g₀) := |
| 40 | (initialRadialCoefficient_contDiff g₀).sqrt (fun r => (initialCoefficients_pos g₀ r).1.ne') |
| 41 | |
| 42 | /-- The angular warping function is smooth even at the origin |
| 43 | (Lemma 12.3, pp. 294-295). -/ |
| 44 | theorem initialWarping_contDiff (g₀ : StandardInitialMetric) : |
| 45 | ContDiff ℝ ∞ (initialWarping g₀) := |
| 46 | contDiff_id.mul ((initialAngularCoefficient_contDiff g₀).sqrt |
| 47 | (fun r => (initialCoefficients_pos g₀ r).2.ne')) |
| 48 | |
| 49 | /-- The warping radius is positive on the positive half-line |
| 50 | (Lemma 12.3, pp. 294-295). -/ |
| 51 | theorem initialWarping_pos (g₀ : StandardInitialMetric) {r : ℝ} (hr : 0 < r) : |
| 52 | 0 < initialWarping g₀ r := |
| 53 | mul_pos hr (Real.sqrt_pos.mpr (initialCoefficients_pos g₀ r).2) |
| 54 | |
| 55 | /-- Radial length measured from the tip (Lemma 12.3, p. 295). -/ |
| 56 | noncomputable def initialRadialLength (g₀ : StandardInitialMetric) (r : ℝ) : ℝ := |
| 57 | ∫ t in 0..r, initialRadialSpeed g₀ t |
| 58 | |
| 59 | /-- The radial speed is the derivative of radial length |
| 60 | (Lemma 12.3, p. 295). -/ |
| 61 | theorem initialRadialLength_hasDerivAt (g₀ : StandardInitialMetric) (r : ℝ) : |
| 62 | HasDerivAt (initialRadialLength g₀) (initialRadialSpeed g₀ r) r := by |
| 63 | have hc := (initialRadialSpeed_contDiff g₀).continuous |
| 64 | exact intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable _ _) |
| 65 | hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt |
| 66 | |
| 67 | set_option backward.isDefEq.respectTransparency false in |
| 68 | /-- Actual metric distance along the positive axis is bounded by its |
| 69 | integrated metric speed (Lemma 12.3, p. 295). -/ |
| 70 | theorem initialAxis_edist_le_radialLength (g₀ : StandardInitialMetric) |
| 71 | {r : ℝ} (hr : 0 ≤ r) : |
| 72 | g₀.metric.edist 0 (EuclideanSpace.single (0 : Fin 3) r) ≤ |
| 73 | ENNReal.ofReal (initialRadialLength g₀ r) := by |
| 74 | let v : StandardCapSpace := EuclideanSpace.single 0 1 |
| 75 | let γ : ℝ → StandardCapSpace := fun t => t • v |
| 76 | have hγ : ContMDiff (𝓘(ℝ, ℝ)) (𝓡 3) 1 γ := |
| 77 | contMDiff_iff_contDiff.mpr (contDiff_id.smul contDiff_const) |
| 78 | have hd (t : ℝ) : mfderiv (𝓘(ℝ, ℝ)) (𝓡 3) γ t 1 = v := by |
| 79 | rw [mfderiv_eq_fderiv] |
| 80 | have h : HasDerivAt γ v t := by |
| 81 | simpa [γ] using (hasDerivAt_id t).smul_const v |
| 82 | rw [h.hasFDerivAt.fderiv] |
| 83 | exact one_smul ℝ v |
| 84 | have haxis (t : ℝ) : γ t = EuclideanSpace.single (0 : Fin 3) t := by |
| 85 | ext i |
| 86 | simp [γ, v] |
| 87 | have hlength : g₀.metric.pathELength γ 0 r = |
| 88 | ENNReal.ofReal (initialRadialLength g₀ r) := by |
| 89 | rw [RiemannianMetric.pathELength_eq_lintegral_tangentNorm] |
| 90 | have heq (t : ℝ) : g₀.metric.tangentNorm (γ t) |
| 91 | (mfderiv (𝓘(ℝ, ℝ)) (𝓡 3) γ t 1) = initialRadialSpeed g₀ t := by |
| 92 | rw [hd] |
| 93 | unfold RiemannianMetric.tangentNorm initialRadialSpeed initialRadialCoefficient |
| 94 | erw [haxis] |
| 95 | simp_rw [heq] |
| 96 | unfold initialRadialLength |
| 97 | rw [intervalIntegral.integral_of_le hr, ← integral_Icc_eq_integral_Ioc] |
| 98 | exact (ofReal_integral_eq_lintegral_ofReal |
| 99 | ((initialRadialSpeed_contDiff g₀).continuous.integrableOn_Icc) |
| 100 | (Filter.Eventually.of_forall (fun t => (initialRadialSpeed_pos g₀ t).le))).symm |
| 101 | rw [← hlength] |
| 102 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : StandardCapSpace → Type) := |
| 103 | ⟨g₀.metric.toRiemannianMetric⟩ |
| 104 | exact riemannianEDist_le_pathELength hγ.contMDiffOn |
| 105 | (by simp [γ]) (haxis r) hr |
| 106 | |
| 107 | /-- Completeness prevents finite total radial length: for every real |
| 108 | bound some positive-axis length exceeds it (Lemma 12.3, p. 295). -/ |
| 109 | theorem initialRadialLength_unbounded (g₀ : StandardInitialMetric) (B : ℝ) : |
| 110 | ∃ r : ℝ, 0 ≤ r ∧ B < initialRadialLength g₀ r := by |
| 111 | by_contra h |
| 112 | have hbound : ∀ r : ℝ, 0 ≤ r → initialRadialLength g₀ r ≤ B := by |
| 113 | intro r hr |
| 114 | exact le_of_not_gt (fun hb => h ⟨r, hr, hb⟩) |
| 115 | let K := closure (g₀.metric.ball 0 (max B 0 + 1)) |
| 116 | have hK : IsCompact K := Proofs.M09.isCompact_closure_metric_ball |
| 117 | g₀.metric g₀.complete 0 (max B 0 + 1) |
| 118 | obtain ⟨C, hC⟩ := (hK.image continuous_norm).bddAbove |
| 119 | let r := max C 0 + 1 |
| 120 | have hr : 0 ≤ r := by dsimp [r]; positivity |
| 121 | have hmem : EuclideanSpace.single (0 : Fin 3) r ∈ K := by |
| 122 | apply subset_closure |
| 123 | change g₀.metric.edist 0 (EuclideanSpace.single (0 : Fin 3) r) < |
| 124 | ENNReal.ofReal (max B 0 + 1) |
| 125 | apply (initialAxis_edist_le_radialLength g₀ hr).trans_lt |
| 126 | apply (ENNReal.ofReal_le_ofReal (hbound r hr)).trans_lt |
| 127 | exact (ENNReal.ofReal_lt_ofReal_iff (by positivity)).mpr (by linarith [le_max_left B 0]) |
| 128 | have hb := hC (mem_image_of_mem (fun x : StandardCapSpace => ‖x‖) hmem) |
| 129 | have hn : ‖EuclideanSpace.single (0 : Fin 3) r‖ = r := by |
| 130 | simp [abs_of_nonneg hr] |
| 131 | rw [hn] at hb |
| 132 | dsimp [r] at hb |
| 133 | linarith [le_max_left C 0] |
| 134 | |
| 135 | end PoincareMT.M34 |