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.Coordinates.EndpointCoordinates |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Coordinates.MetricCoordinates |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Rigidity.Exponential.RescaledSource |
| 4 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 5 | import Mathlib.Analysis.Calculus.MeanValue |
| 6 | |
| 7 | /-! |
| 8 | # A stationary rescaled exponential map |
| 9 | |
| 10 | Morgan-Tian Proposition 7.27. Radial velocity cancels the derivative of |
| 11 | the source rescaling. One fixed global smooth inverse turns the resulting |
| 12 | stationary manifold curve into a Euclidean curve, where the mean value |
| 13 | theorem proves constancy throughout the open time interval. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.ReducedVolume |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 28 | |
| 29 | /-- The actual exponential family with the Euclidean spatial scale removed. -/ |
| 30 | noncomputable def rescaledExponential (G : LExponentialGeometry F T τmax p) |
| 31 | (τ : ℝ) (y : EuclideanSpace ℝ (Fin n)) : M := |
| 32 | G.gamma ((2 * Real.sqrt τ)⁻¹ • metricCoordinates (F.metric T) p y) τ |
| 33 | |
| 34 | set_option backward.isDefEq.respectTransparency false in |
| 35 | /-- Each actual rescaled ray is differentiable at every interior positive time. -/ |
| 36 | theorem rescaledExponential_mdifferentiableAt (G : LExponentialGeometry F T τmax p) |
| 37 | {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) (y : EuclideanSpace ℝ (Fin n)) : |
| 38 | MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) (fun s ↦ rescaledExponential G s y) τ := by |
| 39 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 40 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 41 | let Z := fun s : ℝ ↦ (2 * Real.sqrt s)⁻¹ • metricCoordinates (F.metric T) p y |
| 42 | have hp := (inverse_double_sqrt_smul_hasDerivAt (metricCoordinates (F.metric T) p y) hτ).prodMk |
| 43 | (hasDerivAt_id τ) |
| 44 | have hp' : MDifferentiableAt (𝓘(ℝ, ℝ)) |
| 45 | ((𝓘(ℝ, TangentSpace (𝓡 n) p)).prod (𝓘(ℝ, ℝ))) (fun s ↦ (Z s, s)) τ := by |
| 46 | rw [← modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 47 | exact hp.differentiableAt.mdifferentiableAt |
| 48 | have hγ := G.gamma_smooth.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds |
| 49 | (show (Z τ, τ) ∈ univ ×ˢ Ioo 0 τmax from ⟨mem_univ _, hτ, hmax⟩)) |
| 50 | have hc := (hγ.mdifferentiableAt (by simp)).comp (f := fun s ↦ (Z s, s)) τ hp' |
| 51 | exact hc |
| 52 | |
| 53 | set_option backward.isDefEq.respectTransparency false in |
| 54 | /-- Actual radial ray velocity makes the rescaled exponential curve stationary. -/ |
| 55 | theorem rescaledExponential_velocity_eq_zero (G : LExponentialGeometry F T τmax p) |
| 56 | {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 57 | (hvelocity : ∀ Z : TangentSpace (𝓡 n) p, |
| 58 | curveVelocity (G.gamma Z) τ = G.toLExponentialFamily.sliceDifferential Z τ |
| 59 | ((2 * τ)⁻¹ • Z)) (y : EuclideanSpace ℝ (Fin n)) : |
| 60 | curveVelocity (n := n) (fun s ↦ rescaledExponential G s y) τ = 0 := by |
| 61 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 62 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 63 | let Z := fun s : ℝ ↦ (2 * Real.sqrt s)⁻¹ • metricCoordinates (F.metric T) p y |
| 64 | let z := (Z τ, τ) |
| 65 | let q := G.gamma z.1 z.2 |
| 66 | have hz : z ∈ univ ×ˢ Ioo 0 τmax := ⟨mem_univ _, hτ, hmax⟩ |
| 67 | have hq : G.gamma z.1 z.2 ∈ (chartAt (EuclideanSpace ℝ (Fin n)) q).source := |
| 68 | mem_chart_source _ _ |
| 69 | have hp := (inverse_double_sqrt_smul_hasDerivAt (metricCoordinates (F.metric T) p y) hτ).prodMk |
| 70 | (hasDerivAt_id τ) |
| 71 | have hd := ((endpointCoordinates_contDiffAt G q z hz hq).differentiableAt (by simp)).hasFDerivAt |
| 72 | |>.comp_hasDerivAt (f := fun s ↦ (Z s, s)) τ hp |
| 73 | have heval : fderiv ℝ (endpointCoordinates G q) z (-(2 * τ)⁻¹ • Z τ, 1) = 0 := by |
| 74 | rw [show (-(2 * τ)⁻¹ • Z τ, (1 : ℝ)) = |
| 75 | (-(2 * τ)⁻¹ • Z τ, 0) + (0, 1) by simp, map_add, |
| 76 | endpointCoordinates_horizontal G q z hz hq, |
| 77 | endpointCoordinates_time G q z hz hq, hvelocity] |
| 78 | let L := (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 79 | (TangentSpace (𝓡 n)) q).continuousLinearMapAt ℝ q |
| 80 | let D := G.toLExponentialFamily.sliceDifferential (Z τ) τ |
| 81 | change (L.comp D) (-(2 * τ)⁻¹ • Z τ) + (L.comp D) ((2 * τ)⁻¹ • Z τ) = 0 |
| 82 | simp only [neg_smul, map_neg, neg_add_cancel] |
| 83 | have hzero := (hd.congr_deriv heval).deriv |
| 84 | have hγ := rescaledExponential_mdifferentiableAt G hτ hmax y |
| 85 | change fderiv ℝ ((extChartAt (𝓡 n) q) ∘ (fun s ↦ rescaledExponential G s y)) τ 1 = 0 at hzero |
| 86 | rw [← mfderiv_eq_fderiv, |
| 87 | mfderiv_comp (f := fun s ↦ rescaledExponential G s y) τ |
| 88 | (mdifferentiableAt_extChartAt (I := 𝓡 n) hq) hγ] at hzero |
| 89 | change (mfderiv (𝓡 n) (𝓡 n) (extChartAt (𝓡 n) q) q) |
| 90 | (curveVelocity (fun s ↦ rescaledExponential G s y) τ) = 0 at hzero |
| 91 | rw [mfderiv_extChartAt_self] at hzero |
| 92 | exact hzero |
| 93 | |
| 94 | set_option backward.isDefEq.respectTransparency false in |
| 95 | /-- One fixed smooth identification makes the stationary rescaled rays constant in time. -/ |
| 96 | theorem rescaledExponential_eq_of_radial_velocity |
| 97 | (G : LExponentialGeometry F T τmax p) {b : ℝ} (hbmax : b ≤ τmax) |
| 98 | (e : Diffeomorph (𝓡 n) (𝓡 n) M (EuclideanSpace ℝ (Fin n)) ∞) |
| 99 | (hvelocity : ∀ s ∈ Ioo 0 b, ∀ Z : TangentSpace (𝓡 n) p, |
| 100 | curveVelocity (G.gamma Z) s = G.toLExponentialFamily.sliceDifferential Z s |
| 101 | ((2 * s)⁻¹ • Z)) |
| 102 | (y : EuclideanSpace ℝ (Fin n)) {t c : ℝ} (ht : t ∈ Ioo 0 b) (hc : c ∈ Ioo 0 b) : |
| 103 | rescaledExponential G t y = rescaledExponential G c y := by |
| 104 | have hd (s : ℝ) (hs : s ∈ Ioo 0 b) : |
| 105 | HasDerivAt (fun r ↦ e (rescaledExponential G r y)) 0 s := by |
| 106 | have hγ := rescaledExponential_mdifferentiableAt G hs.1 (hs.2.trans_le hbmax) y |
| 107 | have he := (e.contMDiffAt (x := rescaledExponential G s y)).mdifferentiableAt (by simp) |
| 108 | have hcomp := he.comp (f := fun r ↦ rescaledExponential G r y) s hγ |
| 109 | apply hcomp.differentiableAt.hasDerivAt.congr_deriv |
| 110 | change fderiv ℝ (e ∘ (fun r ↦ rescaledExponential G r y)) s 1 = 0 |
| 111 | rw [← mfderiv_eq_fderiv, |
| 112 | mfderiv_comp (f := fun r ↦ rescaledExponential G r y) s he hγ] |
| 113 | change mfderiv (𝓡 n) (𝓡 n) e (rescaledExponential G s y) |
| 114 | (curveVelocity (fun r ↦ rescaledExponential G r y) s) = 0 |
| 115 | rw [rescaledExponential_velocity_eq_zero G hs.1 (hs.2.trans_le hbmax) (hvelocity s hs) y, |
| 116 | map_zero] |
| 117 | apply e.injective |
| 118 | exact isOpen_Ioo.is_const_of_deriv_eq_zero (convex_Ioo 0 b).isPreconnected |
| 119 | (fun s hs ↦ (hd s hs).differentiableAt.differentiableWithinAt) |
| 120 | (fun s hs ↦ (hd s hs).deriv) ht hc |
| 121 | |
| 122 | end PoincareMT.ReducedVolume |