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.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Pullback.MetricHessian |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.ChartConnectionVariation |
| 4 | |
| 5 | /-! |
| 6 | # Actual pulled-back Ricci evaluation on the closed flow interval |
| 7 | |
| 8 | The within-time metric equation identifies the actual Ricci field |
| 9 | with the smooth time partial of the pulled-back metric. |
| 10 | MT2007 Claim 19.1, p. 437, and Lemma 19.6, pp. 441-442; |
| 11 | `2026-09-22-fixed-label-geometric-coefficients.md`, statement 1. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u v |
| 20 | |
| 21 | namespace PoincareMT.M63 |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {V : Type v} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 26 | |
| 27 | /-- The actual repeated Ricci evaluation along an arbitrary smooth |
| 28 | spatial map is smooth through both included time endpoints. |
| 29 | MT2007 Claim 19.1, p. 437; geometric coefficient derivation, statement 1. -/ |
| 30 | theorem flow_pullback_ricci_contDiffOn {a b : ℝ} (F : RicciFlow n M (Icc a b)) |
| 31 | {U : Set V} (hU : IsOpen U) {ρ : V → M} |
| 32 | (hρ : ContMDiffOn 𝓘(ℝ, V) (𝓡 n) ∞ ρ U) : |
| 33 | ContDiffOn ℝ ∞ |
| 34 | (fun z : (ℝ × V) × V => (F.connection z.1.1).ricci (ρ z.1.2) |
| 35 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.1.2 z.2) |
| 36 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.1.2 z.2)) ((Icc a b ×ˢ U) ×ˢ univ) := by |
| 37 | have hab : a < b := by |
| 38 | obtain ⟨s, hs, t, ht, hne⟩ := F.nontrivial |
| 39 | by_contra! h |
| 40 | apply hne |
| 41 | linarith [hs.1, hs.2, ht.1, ht.2] |
| 42 | have hC : UniqueDiffOn ℝ (Icc a b) := uniqueDiffOn_Icc hab |
| 43 | let G : ℝ × (V × V) → ℝ := fun z => (F.metric z.1).inner (ρ z.2.1) |
| 44 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.2.1 z.2.2) |
| 45 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.2.1 z.2.2) |
| 46 | let R : ℝ × (V × V) → ℝ := fun z => (F.connection z.1).ricci (ρ z.2.1) |
| 47 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.2.1 z.2.2) |
| 48 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.2.1 z.2.2) |
| 49 | have hzero : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun _ : M => (0 : ℝ)) := |
| 50 | contMDiff_const |
| 51 | have hmetric := (flow_pullback_metric_hessian_contDiffOn F hU hρ hzero).1 |
| 52 | have hpair : ContDiff ℝ ∞ (fun z : ℝ × (V × V) => ((z.1, z.2.1), z.2.2)) := |
| 53 | (contDiff_fst.prodMk contDiff_snd.fst).prodMk contDiff_snd.snd |
| 54 | have hG : ContDiffOn ℝ ∞ G (Icc a b ×ˢ (U ×ˢ univ)) := |
| 55 | hmetric.comp hpair.contDiffOn (fun z hz => ⟨⟨hz.1, hz.2.1⟩, mem_univ _⟩) |
| 56 | have hD := M08.timeWithinFDeriv_contDiffOn hC (hU.prod isOpen_univ) G hG |
| 57 | have hR : ContDiffOn ℝ ∞ R (Icc a b ×ˢ (U ×ˢ univ)) := by |
| 58 | apply ((contDiffOn_const (c := - (1 / 2 : ℝ))).mul hD).congr |
| 59 | intro z hz |
| 60 | have hd := (M08.hasDerivWithinAt_timeWithin G hG hz.1 hz.2).derivWithin (hC z.1 hz.1) |
| 61 | have he := (F.equation z.1 hz.1 (ρ z.2.1) |
| 62 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.2.1 z.2.2) |
| 63 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.2.1 z.2.2)).derivWithin (hC z.1 hz.1) |
| 64 | have hval := hd.symm.trans he |
| 65 | change M08.timeWithinFDeriv (Icc a b) (U ×ˢ univ) G z = -2 * R z at hval |
| 66 | change R z = (- (1 / 2 : ℝ)) * M08.timeWithinFDeriv (Icc a b) (U ×ˢ univ) G z |
| 67 | linarith only [hval] |
| 68 | have hinv : ContDiff ℝ ∞ (fun z : (ℝ × V) × V => (z.1.1, (z.1.2, z.2))) := |
| 69 | contDiff_fst.fst.prodMk (contDiff_fst.snd.prodMk contDiff_snd) |
| 70 | exact hR.comp hinv.contDiffOn (fun z hz => ⟨hz.1.1, hz.1.2, mem_univ _⟩) |
| 71 | |
| 72 | end PoincareMT.M63 |