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.ReducedGeometry.ReducedVolume.Metric.Comparison.SmoothMetric |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Coordinates.ProductDerivatives |
| 3 | import Mathlib.Geometry.Manifold.MFDeriv.Atlas |
| 4 | import Mathlib.Analysis.Calculus.Deriv.Mul |
| 5 | |
| 6 | /-! |
| 7 | # Backward metric evolution in the preferred endpoint coordinates |
| 8 | |
| 9 | Strict interior times turn the flow's within derivative into a genuine |
| 10 | derivative. Backward time changes its sign, giving the +2 Ric contribution |
| 11 | to the reduced-volume Gram evolution. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedVolume |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} |
| 26 | |
| 27 | set_option backward.isDefEq.respectTransparency false in |
| 28 | /-- At its preferred center the coordinate bilinear form is the literal selected metric. -/ |
| 29 | theorem coordinateBackwardMetric_at_center (q : M) (τ : ℝ) |
| 30 | (v w : TangentSpace (𝓡 n) q) : |
| 31 | coordinateBackwardMetric F T q (extChartAt (𝓡 n) q q, τ) v w = |
| 32 | (F.metric (T - τ)).inner q v w := by |
| 33 | have hc := backwardMetricCoordinates_apply (F := F) (T := T) q (q, τ) |
| 34 | (FiberBundle.mem_baseSet_trivializationAt' q) v w |
| 35 | rw [TangentBundle.continuousLinearMapAt_trivializationAt (mem_chart_source _ _), |
| 36 | mfderiv_extChartAt_self] at hc |
| 37 | simpa only [coordinateBackwardMetric, extChartAt_to_inv, |
| 38 | ContinuousLinearMap.id_apply] using! hc |
| 39 | |
| 40 | /-- The actual backward metric has derivative +2 Ric at every strict interior time. -/ |
| 41 | theorem backward_metric_inner_hasDerivAt |
| 42 | (hwindow : Icc (T - τmax) T ⊆ J) {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 43 | (q : M) (v w : TangentSpace (𝓡 n) q) : |
| 44 | HasDerivAt (fun s ↦ (F.metric (T - s)).inner q v w) |
| 45 | (2 * (F.connection (T - τ)).ricci q v w) τ := by |
| 46 | have hi : T - τ ∈ Ioo (T - τmax) T := by constructor <;> linarith |
| 47 | have hJ : J ∈ 𝓝 (T - τ) := |
| 48 | Filter.mem_of_superset (isOpen_Ioo.mem_nhds hi) |
| 49 | (fun _ hs ↦ hwindow ⟨hs.1.le, hs.2.le⟩) |
| 50 | have hd := (F.equation (T - τ) (hwindow ⟨hi.1.le, hi.2.le⟩) q v w).hasDerivAt hJ |
| 51 | have ht := hd.comp τ ((hasDerivAt_id τ).const_sub T) |
| 52 | simpa only [Function.comp_def, neg_mul, mul_neg, mul_one, neg_neg] using ht |
| 53 | |
| 54 | set_option backward.isDefEq.respectTransparency false in |
| 55 | /-- The pure time derivative of the actual coordinate metric is +2 Ric. -/ |
| 56 | theorem coordinateBackwardMetric_time_derivative |
| 57 | (hwindow : Icc (T - τmax) T ⊆ J) {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 58 | (q : M) (v w : TangentSpace (𝓡 n) q) : |
| 59 | fderiv ℝ (coordinateBackwardMetric F T q) (extChartAt (𝓡 n) q q, τ) (0, 1) v w = |
| 60 | 2 * (F.connection (T - τ)).ricci q v w := by |
| 61 | let v' : EuclideanSpace ℝ (Fin n) := v |
| 62 | let w' : EuclideanSpace ℝ (Fin n) := w |
| 63 | have hB : DifferentiableAt ℝ (coordinateBackwardMetric F T q) |
| 64 | (extChartAt (𝓡 n) q q, τ) := |
| 65 | (coordinateBackwardMetric_contDiffAt (F := F) hwindow q hτ hmax).differentiableAt (by simp) |
| 66 | have ht := hasDerivAt_time_slice (X := EuclideanSpace ℝ (Fin n)) |
| 67 | (Y := EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) hB |
| 68 | have hv := ht.clm_apply (hasDerivAt_const τ v') |
| 69 | have hcoord := hv.clm_apply (hasDerivAt_const τ w') |
| 70 | simp only [map_zero, add_zero] at hcoord |
| 71 | have hmetric := (backward_metric_inner_hasDerivAt hwindow hτ hmax q v w).congr_of_eventuallyEq |
| 72 | (Filter.Eventually.of_forall (fun s ↦ |
| 73 | coordinateBackwardMetric_at_center (F := F) (T := T) q s v w)) |
| 74 | exact hcoord.unique hmetric |
| 75 | |
| 76 | end PoincareMT.ReducedVolume |