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.Exponential.InitialTime.SquareCoordinates |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Coordinates.ExponentialDifferential |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Comparison.EndpointMetricContinuity |
| 4 | |
| 5 | /-! |
| 6 | # Comparing square-root and ordinary-time exponential differentials |
| 7 | |
| 8 | At positive square time the two families agree as source maps. Horizontal |
| 9 | derivatives therefore agree without a time factor, and the actual pullback |
| 10 | metric is their coordinate Gram form. The metric limit is taken one-sided. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedVolume |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 25 | |
| 26 | set_option backward.isDefEq.respectTransparency false in |
| 27 | /-- The square-root family converges to the actual initial point. -/ |
| 28 | theorem squareFamily_tendsto_zero (G : LExponentialGeometry F T τmax p) |
| 29 | (hmax : 0 < τmax) (Z : TangentSpace (𝓡 n) p) : |
| 30 | Tendsto (G.squareFamily Z) (𝓝 (0 : ℝ)) (𝓝 p) := by |
| 31 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 32 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 33 | have hQ := G.square_smooth.contMDiffAt |
| 34 | (G.square_open.mem_nhds (squareDomain_at_zero G hmax Z)) |
| 35 | have hc := hQ.continuousAt.comp |
| 36 | (continuousAt_const.prodMk (continuousAt_id (X := ℝ) (x := 0))) |
| 37 | simpa only [Function.comp_def, G.square_at_zero] using hc.tendsto |
| 38 | |
| 39 | set_option backward.isDefEq.respectTransparency false in |
| 40 | /-- Positive square-time horizontal derivatives equal the ordinary-time endpoint derivatives. -/ |
| 41 | theorem squareCoordinates_horizontal_eq_endpoint |
| 42 | (G : LExponentialGeometry F T τmax p) (hmax : 0 < τmax) |
| 43 | (Z W : TangentSpace (𝓡 n) p) {s : ℝ} (hs : s ∈ Ioo 0 (Real.sqrt τmax)) |
| 44 | (hq : G.gamma Z (s ^ 2) ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source) : |
| 45 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 46 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 47 | fderiv ℝ (squareCoordinates G) (Z, s) (W, 0) = |
| 48 | fderiv ℝ (endpointCoordinates G p) (Z, s ^ 2) (W, 0) := by |
| 49 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 50 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 51 | have hsmax : s ^ 2 < τmax := by nlinarith [Real.sq_sqrt hmax.le, hs.1, hs.2] |
| 52 | have hdom : (Z, s) ∈ G.squareDomain := G.square_contains ⟨mem_univ _, hs.1.le, hs.2⟩ |
| 53 | have hqs : G.squareFamily Z s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source := by |
| 54 | rwa [G.square_agrees Z s ⟨hs.1.le, hs.2⟩] |
| 55 | rw [fderiv_horizontal_eq |
| 56 | ((squareCoordinates_contDiffAt G (Z, s) hdom hqs).differentiableAt (by simp)) W, |
| 57 | fderiv_horizontal_eq ((endpointCoordinates_contDiffAt G p (Z, s ^ 2) |
| 58 | ⟨mem_univ _, sq_pos_of_pos hs.1, hsmax⟩ hq).differentiableAt (by simp)) W] |
| 59 | have heq : (fun V ↦ squareCoordinates G (V, s)) = |
| 60 | (fun V ↦ endpointCoordinates G p (V, s ^ 2)) := by |
| 61 | funext V |
| 62 | exact congrArg (extChartAt (𝓡 n) p) (G.square_agrees V s ⟨hs.1.le, hs.2⟩) |
| 63 | rw [heq] |
| 64 | |
| 65 | set_option backward.isDefEq.respectTransparency false in |
| 66 | /-- The actual exponential pullback metric is the square-coordinate Gram pairing. -/ |
| 67 | theorem squareCoordinates_pullbackMetric_eq |
| 68 | (G : LExponentialGeometry F T τmax p) (hmax : 0 < τmax) |
| 69 | (x u v : EuclideanSpace ℝ (Fin n)) {s : ℝ} (hs : s ∈ Ioo 0 (Real.sqrt τmax)) |
| 70 | (hq : G.gamma (metricCoordinates (F.metric T) p x) (s ^ 2) ∈ |
| 71 | (chartAt (EuclideanSpace ℝ (Fin n)) p).source) : |
| 72 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 73 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 74 | let Z := metricCoordinates (F.metric T) p x |
| 75 | pullbackMetricForm (F.metric (T - s ^ 2)) (exponentialSliceChart G (s ^ 2)) x u v = |
| 76 | backwardMetricCoordinates F T p (G.squareFamily Z s, s ^ 2) |
| 77 | (fderiv ℝ (squareCoordinates G) (Z, s) (metricCoordinates (F.metric T) p u, 0)) |
| 78 | (fderiv ℝ (squareCoordinates G) (Z, s) (metricCoordinates (F.metric T) p v, 0)) := by |
| 79 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 80 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 81 | dsimp only |
| 82 | have hsmax : s ^ 2 < τmax := by nlinarith [Real.sq_sqrt hmax.le, hs.1, hs.2] |
| 83 | rw [exponentialSlice_pullbackMetric_eq G (sq_pos_of_pos hs.1) hsmax x p hq u v, |
| 84 | squareCoordinates_horizontal_eq_endpoint G hmax _ _ hs hq, |
| 85 | squareCoordinates_horizontal_eq_endpoint G hmax _ _ hs hq] |
| 86 | dsimp only [coordinateBackwardMetric, endpointCoordinates] |
| 87 | rw [(extChartAt (𝓡 n) p).left_inv (by simpa only [extChartAt_source] using hq), |
| 88 | G.square_agrees _ s ⟨hs.1.le, hs.2⟩] |
| 89 | |
| 90 | set_option backward.isDefEq.respectTransparency false in |
| 91 | /-- Along the square-root family, the actual metric converges from within its time window. -/ |
| 92 | theorem squareMetric_tendsto_zero (G : LExponentialGeometry F T τmax p) |
| 93 | (hmax : 0 < τmax) (hT : T ∈ J) (hwindow : Icc (T - τmax) T ⊆ J) |
| 94 | (Z : TangentSpace (𝓡 n) p) : |
| 95 | Tendsto (fun s : ℝ ↦ backwardMetricCoordinates F T p (G.squareFamily Z s, s ^ 2)) |
| 96 | (𝓝[>] (0 : ℝ)) (𝓝 (backwardMetricCoordinates F T p (p, 0))) := by |
| 97 | have hQ : Tendsto (G.squareFamily Z) (𝓝[>] (0 : ℝ)) (𝓝 p) := |
| 98 | (squareFamily_tendsto_zero G hmax Z).mono_left nhdsWithin_le_nhds |
| 99 | have hs : Tendsto (fun s : ℝ ↦ s ^ 2) (𝓝[>] (0 : ℝ)) (𝓝 0) := by |
| 100 | simpa only [id_eq, zero_pow (by decide : (2 : ℕ) ≠ 0)] using! |
| 101 | ((tendsto_id : Tendsto (id : ℝ → ℝ) (𝓝 0) (𝓝 0)).mono_left |
| 102 | nhdsWithin_le_nhds).pow 2 |
| 103 | have hp := hQ.prodMk_nhds hs |
| 104 | have hwithin : Tendsto (fun s : ℝ ↦ (G.squareFamily Z s, s ^ 2)) |
| 105 | (𝓝[>] (0 : ℝ)) (𝓝[univ ×ˢ Icc 0 τmax] (p, 0)) := by |
| 106 | apply tendsto_nhdsWithin_iff.mpr ⟨hp, ?_⟩ |
| 107 | filter_upwards [Ioo_mem_nhdsGT (Real.sqrt_pos.2 hmax)] with s hs |
| 108 | refine ⟨mem_univ _, sq_nonneg _, ?_⟩ |
| 109 | nlinarith [Real.sq_sqrt hmax.le, hs.1, hs.2] |
| 110 | exact (backwardMetricCoordinates_continuousWithinAt_zero hT hwindow p).tendsto.comp hwithin |
| 111 | |
| 112 | end PoincareMT.ReducedVolume |