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.Basic |
| 2 | import PoincareLib.Geometry.Riemannian.Tensor.Regularity |
| 3 | |
| 4 | /-! |
| 5 | # Actual time derivatives of smooth metric families |
| 6 | |
| 7 | Joint metric smoothness supplies the time derivative used when passing the |
| 8 | Ricci-flow equation to a limit. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | open Bundle Filter Set |
| 16 | |
| 17 | namespace PoincareMT.RiemannianMetric |
| 18 | |
| 19 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 21 | {J : Set ℝ} {g : ℝ → RiemannianMetric n M} |
| 22 | |
| 23 | /-- The actual scalar metric evaluations are smooth in time on the time domain. -/ |
| 24 | theorem IsSmoothFamilyOn.contDiffWithinAt_inner_time |
| 25 | (hg : IsSmoothFamilyOn g J) {t : ℝ} (ht : t ∈ J) |
| 26 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 27 | ContDiffWithinAt ℝ ∞ (fun s => (g s).inner x u v) J t := by |
| 28 | let X := FiberBundle.extend (EuclideanSpace ℝ (Fin n)) u |
| 29 | let Y := FiberBundle.extend (EuclideanSpace ℝ (Fin n)) v |
| 30 | have hX := FiberBundle.contMDiffAt_extend (k := ∞) (𝓡 n) (EuclideanSpace ℝ (Fin n)) u |
| 31 | have hY := FiberBundle.contMDiffAt_extend (k := ∞) (𝓡 n) (EuclideanSpace ℝ (Fin n)) v |
| 32 | have hX' : ContMDiffWithinAt (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 33 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 34 | (fun p : ℝ × M => TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) p.2 (X p.2)) |
| 35 | (J ×ˢ univ) (t, x) := (hX.comp (t, x) contMDiffAt_snd).contMDiffWithinAt |
| 36 | have hY' : ContMDiffWithinAt (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 37 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 38 | (fun p : ℝ × M => TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) p.2 (Y p.2)) |
| 39 | (J ×ˢ univ) (t, x) := (hY.comp (t, x) contMDiffAt_snd).contMDiffWithinAt |
| 40 | have h := (contMDiffWithinAt_totalSpace.mp |
| 41 | ((hg (t, x) ⟨ht, mem_univ x⟩).clm_bundle_apply₂ |
| 42 | (F₃ := ℝ) (E₃ := fun _ : M => ℝ) hX' hY')).2 |
| 43 | have h' := h.comp t (contMDiffWithinAt_id.prodMk contMDiffWithinAt_const) |
| 44 | (show MapsTo (fun s : ℝ => (s, x)) J (J ×ˢ univ) from |
| 45 | fun s hs => ⟨hs, mem_univ _⟩) |
| 46 | simpa [X, Y, Function.comp_def] using h'.contDiffWithinAt |
| 47 | |
| 48 | /-- On an open time interval, the ordinary derivative is the metric derivative. -/ |
| 49 | theorem IsSmoothFamilyOn.hasDerivAt_inner |
| 50 | (hg : IsSmoothFamilyOn g J) (hJ : IsOpen J) {t : ℝ} (ht : t ∈ J) |
| 51 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 52 | HasDerivAt (fun s => (g s).inner x u v) |
| 53 | (deriv (fun s => (g s).inner x u v) t) t := |
| 54 | (((hg.contDiffWithinAt_inner_time ht x u v).contDiffAt (hJ.mem_nhds ht)).differentiableAt |
| 55 | (by simp)).hasDerivAt |
| 56 | |
| 57 | end PoincareMT.RiemannianMetric |