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.Evolution.Curvature |
| 2 | import PoincareLib.Geometry.RicciFlow.CurveShortening.Evolution.Commutator |
| 3 | import PoincareLib.Geometry.RicciFlow.CurveShortening.Evolution.NormalDecomposition |
| 4 | |
| 5 | /-! |
| 6 | # Exact corrected curve laws |
| 7 | |
| 8 | The evolving metric rule and scalar curvature identities give the genuine |
| 9 | time derivative in MT2015Correction Lemma 0.2, pp. 4-6. Together with the |
| 10 | speed and commutator laws of Lemma 0.1, p. 3, they assemble the frozen spatial |
| 11 | and full spacetime laws. See `references/ricci-flow/mapher/curve-evolution/derivations/2026-09-20-curve-laws-assembly.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | namespace PoincareMT.M62 |
| 21 | |
| 22 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {a b : ℝ} |
| 25 | |
| 26 | /-- The actual squared curvature has the corrected spatial evolution |
| 27 | derivative; MT2015Correction Lemma 0.2, pp. 4-6. -/ |
| 28 | theorem hasDerivAt_curvatureSquared [T2Space M] |
| 29 | (F : RicciFlow n M (Set.Icc a b)) (c : ℝ → ℝ → M) |
| 30 | (hc : M62ShrinkingCurve F c) {t : ℝ} (ht : t ∈ Set.Ioo a b) (x : ℝ) : |
| 31 | HasDerivAt (fun s => m62CurvatureSquared F c s x) |
| 32 | (m62SpatialEvolutionRhs F c t x) t := by |
| 33 | have hmem : (x, t) ∈ (Set.univ ×ˢ Set.Ioo a b : Set (ℝ × ℝ)) := |
| 34 | ⟨mem_univ _, ht⟩ |
| 35 | have hopen : IsOpen (Set.univ ×ˢ Set.Ioo a b : Set (ℝ × ℝ)) := |
| 36 | isOpen_univ.prod isOpen_Ioo |
| 37 | have htime : MDifferentiableAt 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ × ℝ) |
| 38 | (fun s : ℝ => (x, s)) t := |
| 39 | ((differentiableAt_const x).prodMk differentiableAt_id).mdifferentiableAt |
| 40 | have hγ : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 n) (fun s => c x s) t := |
| 41 | ((hc.joint_smooth.contMDiffAt (hopen.mem_nhds hmem)).mdifferentiableAt |
| 42 | (by simp)).comp t htime |
| 43 | have hH : MDifferentiableAt 𝓘(ℝ, ℝ) ((𝓡 n).prod (𝓡 n)) |
| 44 | (fun s => (⟨c x s, m62CurvatureVector F c s x⟩ : TangentBundle (𝓡 n) M)) t := |
| 45 | (((curvature_joint_contMDiff F c hc).contMDiffAt |
| 46 | (hopen.mem_nhds hmem)).mdifferentiableAt (by simp)).comp t htime |
| 47 | have h := hasDerivAt_flow_metric_pairing F ht hγ hH hH |
| 48 | apply h.congr_deriv |
| 49 | rw [(F.metric t).symm (c x t) (m62CurvatureVector F c t x) |
| 50 | (rampHorizontalCovariantDerivative (F.connection t) (fun s => c x s) |
| 51 | (fun s => m62CurvatureVector F c s x) t)] |
| 52 | rw [curvature_squared_time_pair F c hc ht x] |
| 53 | dsimp only [m62SpatialEvolutionRhs] |
| 54 | rw [curvature_squared_arcSecond_eq F c hc ht x, |
| 55 | spatialDerivative_norm_split F c hc ht x] |
| 56 | dsimp only [m62TangentRicci] |
| 57 | ring |
| 58 | |
| 59 | /-- All spatial evolution laws hold for the displayed shrinking curve; |
| 60 | MT2015Correction Lemmas 0.1-0.2, pp. 3-6. -/ |
| 61 | theorem spatial_evolution [T2Space M] |
| 62 | (F : RicciFlow n M (Set.Icc a b)) (c : ℝ → ℝ → M) |
| 63 | (hc : M62ShrinkingCurve F c) : M62SpatialEvolution F c where |
| 64 | speed_positive := fun _ ht x => speed_pos F c hc ht x |
| 65 | speed_squared := fun _ ht x => hasDerivAt_speed_sq F c hc ht x |
| 66 | speed_derivative := fun _ ht x => hasDerivAt_speed F c hc ht x |
| 67 | commutator := fun f hf _ ht x => arc_time_commutator F c hc f hf ht x |
| 68 | curvature_squared_smooth := curvatureSquared_contDiffOn F c hc |
| 69 | exact_curvature := fun _ ht x => hasDerivAt_curvatureSquared F c hc ht x |
| 70 | |
| 71 | /-- The spatial evolution and full-normal identities assemble the exact |
| 72 | spacetime curve laws; MT2015Correction Lemma 0.2 and pp. 6-7. -/ |
| 73 | theorem SpacetimeData.curve_laws [T2Space M] |
| 74 | {F : RicciFlow n M (Set.Icc a b)} (G : SpacetimeData F) |
| 75 | (c : ℝ → ℝ → M) (hc : M62ShrinkingCurve F c) : M62CurveLaws G c where |
| 76 | spatial := spatial_evolution F c hc |
| 77 | lifted_time := G.lifted_time c hc |
| 78 | normal_norm := G.normal_norm c hc |
| 79 | exact_curvature := fun t x => by |
| 80 | rw [G.spacetimeEvolutionRhs_eq_spatial c hc t x] |
| 81 | exact hasDerivAt_curvatureSquared F c hc t.property x |
| 82 | regularized_gradient := fun _ hε t x => G.regularized_gradient_le c hc hε t x |
| 83 | |
| 84 | end PoincareMT.M62 |