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.Ramp.LocalFlow.C2.NormalizationContinuity |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.IntrinsicSpeedEvolution |
| 3 | import Mathlib.Analysis.SpecialFunctions.Log.Deriv |
| 4 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus |
| 5 | |
| 6 | /-! |
| 7 | # Literal time primitive of the actual C2 speed |
| 8 | |
| 9 | Closed coefficient continuity and the genuine interior speed equation |
| 10 | give the exact exponential primitive. Neither a curvature bound nor |
| 11 | an endpoint time derivative is assumed. MT2007 Claim 19.1, p. 437; |
| 12 | MT2015Correction Lemma 0.1, p. 3; |
| 13 | `2026-09-22-fixed-label-c2-speed-primitive.md`, statement 3. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M63 |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {a b : ℝ} |
| 28 | |
| 29 | /-- The actual speed is its arbitrary positive initial speed times the |
| 30 | exponential of the literal normalization integral on any included |
| 31 | closed interval. Time derivatives are only interior witnesses. |
| 32 | MT2015Correction Lemma 0.1, p. 3; fixed-label C2 speed primitive, |
| 33 | statement 3. -/ |
| 34 | theorem c2ShrinkingCurve_speed_eq_exp_integral |
| 35 | (F : RicciFlow n M (Icc a b)) {c : ℝ → ℝ → M} {J : Set ℝ} |
| 36 | (hc : M63C2ShrinkingCurveOn F c J) |
| 37 | (hH : ContMDiffOn 𝓘(ℝ, ℝ × ℝ) ((𝓡 n).prod (𝓡 n)) 1 |
| 38 | (fun z : ℝ × ℝ => (⟨c z.1 z.2, m62CurvatureVector F c z.2 z.1⟩ : |
| 39 | TangentBundle (𝓡 n) M)) (univ ×ˢ interior J)) |
| 40 | {s t : ℝ} (hst : s ≤ t) (hsub : Icc s t ⊆ J) (x : ℝ) : |
| 41 | curveSpeed F c t x = curveSpeed F c s x * |
| 42 | Real.exp (-(∫ r in s..t, m62TangentRicci F c r x + |
| 43 | m62CurvatureSquared F c r x)) := by |
| 44 | obtain ⟨hv, hA⟩ := c2ShrinkingCurve_speed_normalization_continuousOn F hc |
| 45 | have hmaps : MapsTo (fun r : ℝ => (x, r)) (Icc s t) (univ ×ˢ J) := |
| 46 | fun _ hr => ⟨mem_univ _, hsub hr⟩ |
| 47 | have hvcont : ContinuousOn (fun r => curveSpeed F c r x) (Icc s t) := |
| 48 | hv.comp (s := Icc s t) (f := fun r : ℝ => (x, r)) |
| 49 | (continuous_const.prodMk continuous_id).continuousOn hmaps |
| 50 | have hAcont : ContinuousOn |
| 51 | (fun r => m62TangentRicci F c r x + m62CurvatureSquared F c r x) (Icc s t) := |
| 52 | hA.comp (s := Icc s t) (f := fun r : ℝ => (x, r)) |
| 53 | (continuous_const.prodMk continuous_id).continuousOn hmaps |
| 54 | have hpos (r : ℝ) (hr : r ∈ Icc s t) : 0 < curveSpeed F c r x := |
| 55 | Real.sqrt_pos.mpr ((F.metric r).pos _ _ (hc.immersed r (hsub hr) x)) |
| 56 | have hlog := hvcont.log (fun r hr => (hpos r hr).ne') |
| 57 | have hio : Ioo s t ⊆ interior J := |
| 58 | isOpen_Ioo.subset_interior_iff.mpr (Ioo_subset_Icc_self.trans hsub) |
| 59 | have hderiv (r : ℝ) (hr : r ∈ Ioo s t) : |
| 60 | HasDerivAt (fun u => Real.log (curveSpeed F c u x)) |
| 61 | (-(m62TangentRicci F c r x + m62CurvatureSquared F c r x)) r := by |
| 62 | have hvne := (hpos r (Ioo_subset_Icc_self hr)).ne' |
| 63 | convert! (c2ShrinkingCurve_speed_hasDerivAt_of_curvature_c1 F hc hH |
| 64 | (hio hr) x).log hvne using 1 |
| 65 | field_simp |
| 66 | have hFTC := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hst hlog hderiv |
| 67 | (ContinuousOn.intervalIntegrable_of_Icc hst hAcont).neg |
| 68 | rw [intervalIntegral.integral_neg] at hFTC |
| 69 | have hlogeq : Real.log (curveSpeed F c t x) = Real.log (curveSpeed F c s x) - |
| 70 | ∫ r in s..t, m62TangentRicci F c r x + m62CurvatureSquared F c r x := by |
| 71 | linarith |
| 72 | calc |
| 73 | _ = Real.exp (Real.log (curveSpeed F c t x)) := |
| 74 | (Real.exp_log (hpos t ⟨hst, le_rfl⟩)).symm |
| 75 | _ = _ := by |
| 76 | rw [hlogeq, sub_eq_add_neg, Real.exp_add, Real.exp_log (hpos s ⟨le_rfl, hst⟩)] |
| 77 | |
| 78 | end PoincareMT.M63 |