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.SquareComparison |
| 2 | |
| 3 | /-! |
| 4 | # The actual action in square-root time |
| 5 | |
| 6 | Coordinate velocities compare the two parametrizations without transporting |
| 7 | tangent vectors between unequal basepoints. The square-time kinetic term |
| 8 | has its actual terminal limit, and the curvature term is retained. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set Filter |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.ReducedVolume |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 23 | |
| 24 | /-- The actual square-time kinetic energy evaluated in the fixed preferred frame. -/ |
| 25 | noncomputable def squareKineticEnergy (G : LExponentialGeometry F T τmax p) |
| 26 | (Z : TangentSpace (𝓡 n) p) (s : ℝ) : ℝ := |
| 27 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 28 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 29 | let V := fderiv ℝ (squareCoordinates G) (Z, s) (0, 1) |
| 30 | backwardMetricCoordinates F T p (G.squareFamily Z s, s ^ 2) V V |
| 31 | |
| 32 | set_option backward.isDefEq.respectTransparency false in |
| 33 | /-- The coordinate square-time velocity is two s times the ordinary-time coordinate velocity. -/ |
| 34 | theorem squareCoordinates_time_eq_endpoint |
| 35 | (G : LExponentialGeometry F T τmax p) (hmax : 0 < τmax) |
| 36 | (Z : TangentSpace (𝓡 n) p) {s : ℝ} (hs : s ∈ Ioo 0 (Real.sqrt τmax)) |
| 37 | (hq : G.gamma Z (s ^ 2) ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source) : |
| 38 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 39 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 40 | fderiv ℝ (squareCoordinates G) (Z, s) (0, 1) = |
| 41 | (2 * s) • fderiv ℝ (endpointCoordinates G p) (Z, s ^ 2) (0, 1) := by |
| 42 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 43 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 44 | have hsmax : s ^ 2 < τmax := by nlinarith [Real.sq_sqrt hmax.le, hs.1, hs.2] |
| 45 | have hqs : G.squareFamily Z s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source := by |
| 46 | rwa [G.square_agrees Z s ⟨hs.1.le, hs.2⟩] |
| 47 | have hP := squareCoordinates_contDiffAt G (Z, s) |
| 48 | (G.square_contains ⟨mem_univ _, hs.1.le, hs.2⟩) hqs |
| 49 | have hE := endpointCoordinates_contDiffAt G p (Z, s ^ 2) |
| 50 | ⟨mem_univ _, sq_pos_of_pos hs.1, hsmax⟩ hq |
| 51 | have hsq : HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by |
| 52 | simpa using hasDerivAt_pow 2 s |
| 53 | have hd := (hasDerivAt_time_slice (hE.differentiableAt (by simp))).scomp |
| 54 | (h := fun r : ℝ ↦ r ^ 2) s hsq |
| 55 | have heq : (fun r : ℝ ↦ squareCoordinates G (Z, r)) =ᶠ[𝓝 s] |
| 56 | (fun r : ℝ ↦ endpointCoordinates G p (Z, r ^ 2)) := by |
| 57 | filter_upwards [isOpen_Ioo.mem_nhds hs] with r hr |
| 58 | exact congrArg (extChartAt (𝓡 n) p) (G.square_agrees Z r ⟨hr.1.le, hr.2⟩) |
| 59 | exact (hasDerivAt_time_slice (hP.differentiableAt (by simp))).unique |
| 60 | (hd.congr_of_eventuallyEq heq) |
| 61 | |
| 62 | set_option backward.isDefEq.respectTransparency false in |
| 63 | /-- The square-coordinate kinetic term is the actual ordinary-time speed with its time factor. -/ |
| 64 | theorem squareKineticEnergy_eq_speed |
| 65 | (G : LExponentialGeometry F T τmax p) (hmax : 0 < τmax) |
| 66 | (Z : TangentSpace (𝓡 n) p) {s : ℝ} (hs : s ∈ Ioo 0 (Real.sqrt τmax)) |
| 67 | (hq : G.gamma Z (s ^ 2) ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source) : |
| 68 | squareKineticEnergy G Z s = (2 * s) ^ 2 * |
| 69 | (F.metric (T - s ^ 2)).inner (G.gamma Z (s ^ 2)) |
| 70 | (curveVelocity (G.gamma Z) (s ^ 2)) (curveVelocity (G.gamma Z) (s ^ 2)) := by |
| 71 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 72 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 73 | have hsmax : s ^ 2 < τmax := by nlinarith [Real.sq_sqrt hmax.le, hs.1, hs.2] |
| 74 | unfold squareKineticEnergy |
| 75 | rw [squareCoordinates_time_eq_endpoint G hmax Z hs hq, |
| 76 | endpointCoordinates_time G p (Z, s ^ 2) ⟨mem_univ _, sq_pos_of_pos hs.1, hsmax⟩ hq, |
| 77 | G.square_agrees Z s ⟨hs.1.le, hs.2⟩] |
| 78 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 79 | rw [backwardMetricCoordinates_apply p (G.gamma Z (s ^ 2), s ^ 2) hq] |
| 80 | ring |
| 81 | |
| 82 | /-- The actual square-time action derivative retains both scalar curvature and kinetic energy. -/ |
| 83 | theorem squareAction_hasDerivAt |
| 84 | (G : LExponentialGeometry F T τmax p) (hmax : 0 < τmax) |
| 85 | (Z : TangentSpace (𝓡 n) p) {s : ℝ} (hs : s ∈ Ioo 0 (Real.sqrt τmax)) |
| 86 | (hq : G.gamma Z (s ^ 2) ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source) : |
| 87 | HasDerivAt (fun r : ℝ ↦ G.toLExponentialFamily.action Z (r ^ 2)) |
| 88 | (2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (G.gamma Z (s ^ 2)) + |
| 89 | squareKineticEnergy G Z s / 2) s := by |
| 90 | have hsmax : s ^ 2 < τmax := by nlinarith [Real.sq_sqrt hmax.le, hs.1, hs.2] |
| 91 | have hsq : HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by |
| 92 | simpa using hasDerivAt_pow 2 s |
| 93 | apply ((G.action_time_derivative Z (s ^ 2) (sq_pos_of_pos hs.1) hsmax).comp |
| 94 | (h := fun r : ℝ ↦ r ^ 2) s hsq).congr_deriv |
| 95 | rw [squareKineticEnergy_eq_speed G hmax Z hs hq] |
| 96 | simp only [backwardLIntegrand, Real.sqrt_sq hs.1.le] |
| 97 | ring |
| 98 | |
| 99 | set_option backward.isDefEq.respectTransparency false in |
| 100 | /-- The actual square-time kinetic energy tends to four times the terminal speed squared. -/ |
| 101 | theorem squareKineticEnergy_tendsto_zero |
| 102 | (G : LExponentialGeometry F T τmax p) (hmax : 0 < τmax) |
| 103 | (hT : T ∈ J) (hwindow : Icc (T - τmax) T ⊆ J) (Z : TangentSpace (𝓡 n) p) : |
| 104 | Tendsto (squareKineticEnergy G Z) (𝓝[>] (0 : ℝ)) |
| 105 | (𝓝 (4 * (F.metric T).inner p Z Z)) := by |
| 106 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 107 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 108 | let V := fun s : ℝ ↦ fderiv ℝ (squareCoordinates G) (Z, s) (0, 1) |
| 109 | let L := (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 110 | (TangentSpace (𝓡 n)) p).continuousLinearMapAt ℝ p |
| 111 | have hP := squareCoordinates_contDiffAt G (Z, 0) (squareDomain_at_zero G hmax Z) |
| 112 | (by simpa only [G.square_at_zero] using mem_chart_source (EuclideanSpace ℝ (Fin n)) p) |
| 113 | have hP2 : ContDiffAt ℝ 2 (squareCoordinates G) (Z, 0) := hP.of_le (by decide) |
| 114 | have hV : ContinuousAt V 0 := |
| 115 | (((hP2.fderiv_right (m := 1) (by norm_num)).continuousAt.comp |
| 116 | (continuousAt_const.prodMk continuousAt_id)).clm_apply continuousAt_const) |
| 117 | have hVlim : Tendsto V (𝓝[>] (0 : ℝ)) (𝓝 ((2 : ℝ) • L Z)) := by |
| 118 | have hv0 : V 0 = (2 : ℝ) • L Z := squareCoordinates_time_at_zero G hmax Z |
| 119 | simpa only [hv0] using hV.tendsto.mono_left nhdsWithin_le_nhds |
| 120 | have hB := squareMetric_tendsto_zero G hmax hT hwindow Z |
| 121 | have heval : Continuous (fun z : |
| 122 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) × |
| 123 | EuclideanSpace ℝ (Fin n) ↦ z.1 z.2 z.2) := |
| 124 | (continuous_fst.clm_apply continuous_snd).clm_apply continuous_snd |
| 125 | have hlim := heval.continuousAt.tendsto.comp (hB.prodMk_nhds hVlim) |
| 126 | have hvalue : backwardMetricCoordinates F T p (p, 0) ((2 : ℝ) • L Z) |
| 127 | ((2 : ℝ) • L Z) = 4 * (F.metric T).inner p Z Z := by |
| 128 | have heq := backwardMetricCoordinates_apply (F := F) (T := T) p (p, 0) |
| 129 | (mem_chart_source _ _) Z Z |
| 130 | simp only [sub_zero] at heq |
| 131 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 132 | change 2 * (2 * backwardMetricCoordinates F T p (p, 0) (L Z) (L Z)) = _ |
| 133 | rw [heq] |
| 134 | ring |
| 135 | change Tendsto (fun s : ℝ ↦ |
| 136 | backwardMetricCoordinates F T p (G.squareFamily Z s, s ^ 2) (V s) (V s)) |
| 137 | (𝓝[>] (0 : ℝ)) (𝓝 (4 * (F.metric T).inner p Z Z)) |
| 138 | simpa only [Function.comp_def, hvalue] using hlim |
| 139 | |
| 140 | end PoincareMT.ReducedVolume |