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.CurveShortening.Integral.RegularizationError |
| 2 | import PoincareLib.Analysis.Integral.ParameterContinuity |
| 3 | |
| 4 | /-! |
| 5 | # Endpoint continuity of length and total curvature |
| 6 | |
| 7 | The 2015 correction, Lemma 0.4, pp. 7-8, uses the actual length and total |
| 8 | curvature through the time endpoints. The primitive M62 curve, velocity, |
| 9 | and curvature continuity gives continuity of their metric pairings and |
| 10 | parameter integrals. No extension of the flow across an endpoint is used. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M62 |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | {a b : ℝ} (F : RicciFlow n M (Set.Icc a b)) (c : ℝ → ℝ → M) |
| 24 | |
| 25 | /-- The time-dependent metric pairs continuous fields continuously through |
| 26 | the closed time interval; correction Lemma 0.4, pp. 7-8. -/ |
| 27 | theorem metric_pairing_continuousOn |
| 28 | (hc : ContinuousOn (fun z : ℝ × ℝ ↦ c z.1 z.2) (Set.univ ×ˢ Set.Icc a b)) |
| 29 | (Y Z : ∀ z : ℝ × ℝ, TangentSpace (𝓡 n) (c z.1 z.2)) |
| 30 | (hY : ContinuousOn (fun z : ℝ × ℝ ↦ |
| 31 | (⟨c z.1 z.2, Y z⟩ : TangentBundle (𝓡 n) M)) (Set.univ ×ˢ Set.Icc a b)) |
| 32 | (hZ : ContinuousOn (fun z : ℝ × ℝ ↦ |
| 33 | (⟨c z.1 z.2, Z z⟩ : TangentBundle (𝓡 n) M)) (Set.univ ×ˢ Set.Icc a b)) : |
| 34 | ContinuousOn (fun z : ℝ × ℝ ↦ (F.metric z.2).inner (c z.1 z.2) (Y z) (Z z)) |
| 35 | (Set.univ ×ˢ Set.Icc a b) := by |
| 36 | have hg := F.smooth.continuousOn.comp |
| 37 | (continuous_snd.continuousOn.prodMk hc) (fun z hz ↦ ⟨hz.2, Set.mem_univ _⟩) |
| 38 | intro z hz |
| 39 | have hp : ContinuousWithinAt |
| 40 | (fun w : ℝ × ℝ ↦ Bundle.TotalSpace.mk' ℝ (E := Bundle.Trivial M ℝ) |
| 41 | (c w.1 w.2) ((F.metric w.2).inner (c w.1 w.2) (Y w) (Z w))) |
| 42 | (Set.univ ×ˢ Set.Icc a b) z := |
| 43 | (hg z hz).clm_bundle_apply₂ (hY z hz) (hZ z hz) |
| 44 | rw [FiberBundle.continuousWithinAt_totalSpace] at hp |
| 45 | exact hp.2 |
| 46 | |
| 47 | /-- The actual speed is jointly continuous through both endpoints; |
| 48 | correction Lemma 0.4, p. 7. -/ |
| 49 | theorem speed_continuousOn (hc : M62ShrinkingCurve F c) : |
| 50 | ContinuousOn (fun z : ℝ × ℝ ↦ curveSpeed F c z.2 z.1) |
| 51 | (Set.univ ×ˢ Set.Icc a b) := by |
| 52 | exact (metric_pairing_continuousOn F c hc.continuous _ _ |
| 53 | hc.velocity_continuous hc.velocity_continuous).sqrt |
| 54 | |
| 55 | /-- The squared curvature is jointly continuous through the endpoints; |
| 56 | correction Lemma 0.4, pp. 7-8. -/ |
| 57 | theorem curvatureSquared_continuousOn (hc : M62ShrinkingCurve F c) : |
| 58 | ContinuousOn (fun z : ℝ × ℝ ↦ m62CurvatureSquared F c z.2 z.1) |
| 59 | (Set.univ ×ˢ Set.Icc a b) := by |
| 60 | exact metric_pairing_continuousOn F c hc.continuous _ _ |
| 61 | hc.curvature_continuous hc.curvature_continuous |
| 62 | |
| 63 | /-- Curvature remains continuous at its zeros; correction pp. 6-8. -/ |
| 64 | theorem curvature_continuousOn (hc : M62ShrinkingCurve F c) : |
| 65 | ContinuousOn (fun z : ℝ × ℝ ↦ m62Curvature F c z.2 z.1) |
| 66 | (Set.univ ×ˢ Set.Icc a b) := |
| 67 | (curvatureSquared_continuousOn F c hc).sqrt |
| 68 | |
| 69 | /-- Every fixed regularization is continuous, including epsilon zero; |
| 70 | correction Lemma 0.4, pp. 7-8. -/ |
| 71 | theorem regularized_continuousOn (hc : M62ShrinkingCurve F c) (ε : ℝ) : |
| 72 | ContinuousOn (fun z : ℝ × ℝ ↦ m62RegularizedCurvature F c ε z.2 z.1) |
| 73 | (Set.univ ×ˢ Set.Icc a b) := |
| 74 | ((curvatureSquared_continuousOn F c hc).add continuousOn_const).sqrt |
| 75 | |
| 76 | /-- Speed is integrable over the actual parameter period at every included |
| 77 | time; correction Lemma 0.4, p. 7. -/ |
| 78 | theorem length_integrable (hc : M62ShrinkingCurve F c) {t : ℝ} |
| 79 | (ht : t ∈ Set.Icc a b) : |
| 80 | IntervalIntegrable (curveSpeed F c t) MeasureTheory.volume 0 curvePeriod := by |
| 81 | have hcont : Continuous (curveSpeed F c t) := |
| 82 | (speed_continuousOn F c hc).comp_continuous |
| 83 | (continuous_id.prodMk continuous_const) (fun _ ↦ ⟨Set.mem_univ _, ht⟩) |
| 84 | exact hcont.intervalIntegrable _ _ |
| 85 | |
| 86 | /-- The curvature density is integrable even when curvature vanishes; |
| 87 | correction Lemma 0.4, p. 7. -/ |
| 88 | theorem total_curvature_integrable (hc : M62ShrinkingCurve F c) {t : ℝ} |
| 89 | (ht : t ∈ Set.Icc a b) : |
| 90 | IntervalIntegrable (fun x ↦ m62Curvature F c t x * curveSpeed F c t x) |
| 91 | MeasureTheory.volume 0 curvePeriod := by |
| 92 | have hcont : Continuous (fun x ↦ m62Curvature F c t x * curveSpeed F c t x) := |
| 93 | ((curvature_continuousOn F c hc).mul (speed_continuousOn F c hc)).comp_continuous |
| 94 | (continuous_id.prodMk continuous_const) (fun _ ↦ ⟨Set.mem_univ _, ht⟩) |
| 95 | exact hcont.intervalIntegrable _ _ |
| 96 | |
| 97 | /-- The regularized density is integrable at all included times; |
| 98 | correction Lemma 0.4, pp. 7-8. -/ |
| 99 | theorem regularized_integrable (hc : M62ShrinkingCurve F c) (ε : ℝ) {t : ℝ} |
| 100 | (ht : t ∈ Set.Icc a b) : |
| 101 | IntervalIntegrable (fun x ↦ m62RegularizedCurvature F c ε t x * curveSpeed F c t x) |
| 102 | MeasureTheory.volume 0 curvePeriod := by |
| 103 | have hcont : Continuous |
| 104 | (fun x ↦ m62RegularizedCurvature F c ε t x * curveSpeed F c t x) := |
| 105 | ((regularized_continuousOn F c hc ε).mul (speed_continuousOn F c hc)).comp_continuous |
| 106 | (continuous_id.prodMk continuous_const) (fun _ ↦ ⟨Set.mem_univ _, ht⟩) |
| 107 | exact hcont.intervalIntegrable _ _ |
| 108 | |
| 109 | /-- The length integral is continuous on the closed time interval; |
| 110 | correction Lemma 0.4, p. 7. -/ |
| 111 | theorem length_continuous (hc : M62ShrinkingCurve F c) : |
| 112 | ContinuousOn (m62Length F c) (Set.Icc a b) := |
| 113 | (speed_continuousOn F c hc).intervalIntegral_prod_left 0 curvePeriod |
| 114 | |
| 115 | /-- Total curvature is continuous through the endpoints and curvature zeros; |
| 116 | correction Lemma 0.4, pp. 7-8. -/ |
| 117 | theorem total_curvature_continuous (hc : M62ShrinkingCurve F c) : |
| 118 | ContinuousOn (m62TotalCurvature F c) (Set.Icc a b) := |
| 119 | ((curvature_continuousOn F c hc).mul (speed_continuousOn F c hc)).intervalIntegral_prod_left |
| 120 | 0 curvePeriod |
| 121 | |
| 122 | /-- Regularized total curvature is continuous on the closed time interval; |
| 123 | correction Lemma 0.4, pp. 7-8. -/ |
| 124 | theorem regularized_total_continuous (hc : M62ShrinkingCurve F c) (ε : ℝ) : |
| 125 | ContinuousOn (m62RegularizedTotalCurvature F c ε) (Set.Icc a b) := |
| 126 | ((regularized_continuousOn F c hc ε).mul (speed_continuousOn F c hc)).intervalIntegral_prod_left |
| 127 | 0 curvePeriod |
| 128 | |
| 129 | /-- The actual shrinking curve supplies all integrability needed for the |
| 130 | regularization error in corrected Lemma 0.4, pp. 7-8. -/ |
| 131 | theorem shrinkingCurve_regularization_error (hc : M62ShrinkingCurve F c) |
| 132 | {ε t : ℝ} (hε : 0 ≤ ε) (ht : t ∈ Set.Icc a b) : |
| 133 | 0 ≤ m62RegularizedTotalCurvature F c ε t - m62TotalCurvature F c t ∧ |
| 134 | m62RegularizedTotalCurvature F c ε t - m62TotalCurvature F c t ≤ |
| 135 | ε * m62Length F c t := |
| 136 | regularization_error F c hε (length_integrable F c hc ht) |
| 137 | (total_curvature_integrable F c hc ht) (regularized_integrable F c hc ε ht) |
| 138 | |
| 139 | end PoincareMT.M62 |