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.Spacetime.Product.SpatialConnection |
| 2 | import PoincareLib.Geometry.RicciFlow.CurveShortening.Connection.Restriction |
| 3 | |
| 4 | /-! |
| 5 | # Actual pullback differentiation on a fixed-time slice |
| 6 | |
| 7 | Metric compatibility and local chart test fields identify both components |
| 8 | of the frozen along-curve derivative. The vertical part is the actual Ricci |
| 9 | pairing, as in MT2015Correction (0.1), p. 2, and Lemma 0.2, pp. 4-6. |
| 10 | See `references/ricci-flow/mapher/curve-evolution/derivations/2026-09-20-spacetime-pullback-normal.md` for the local argument. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Bundle Manifold Set Topology Filter |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | namespace PoincareMT.M62.SpacetimeData |
| 22 | |
| 23 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {a b : ℝ} |
| 26 | |
| 27 | /-- The actual fixed-time pullback derivative has the spatial pullback and |
| 28 | Ricci vertical parts; MT2015Correction (0.1), p. 2, and Lemma 0.2, pp. 4-6. -/ |
| 29 | theorem covariantAlong_space_slice {F : RicciFlow n M (Set.Icc a b)} |
| 30 | (G : SpacetimeData F) (t : OpenTime a b) {gamma : ℝ → M} |
| 31 | {Y : (s : ℝ) → TangentSpace (𝓡 n) (gamma s)} {x : ℝ} |
| 32 | (hgamma : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 n) gamma x) |
| 33 | (hY : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 n).tangent |
| 34 | (fun s => (⟨gamma s, Y s⟩ : TangentBundle (𝓡 n) M)) x) : |
| 35 | G.charts.split (gamma x, t) |
| 36 | (G.covariantAlong (fun s => (gamma s, t)) |
| 37 | (fun s => G.charts.horizontal (gamma s, t) (Y s)) x) = |
| 38 | (rampHorizontalCovariantDerivative (F.connection t) gamma Y x, |
| 39 | (F.connection t).ricci (gamma x) (curveVelocity gamma x) (Y x)) := by |
| 40 | let := G.charts.chartedSpace |
| 41 | let C := G.charts |
| 42 | let E := EuclideanSpace ℝ (Fin n) |
| 43 | let p := gamma x |
| 44 | let q : C.Point := (p, t) |
| 45 | let g := F.metric t |
| 46 | let D := F.connection t |
| 47 | let gammahat : ℝ → C.Point := fun s => (gamma s, t) |
| 48 | let Yhat : (s : ℝ) → TangentSpace (𝓡 (n + 1)) (gammahat s) := |
| 49 | fun s => C.horizontal (gammahat s) (Y s) |
| 50 | let A := rampHorizontalCovariantDerivative G.connection gammahat Yhat x |
| 51 | let U := (C.split q A).1 |
| 52 | let Z0 := rampHorizontalCovariantDerivative D gamma Y x |
| 53 | let V := curveVelocity (n := n) gamma x |
| 54 | have hgammahat : MDifferentiableAt (M' := C.Point) 𝓘(ℝ, ℝ) (𝓡 (n + 1)) gammahat x := |
| 55 | ((C.contMDiff_space_slice t).mdifferentiableAt (by simp)).comp x hgamma |
| 56 | have hvelocity : curveVelocity gammahat x = C.horizontal q V := by |
| 57 | have h := mfderiv_comp_apply |
| 58 | (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) (I'' := 𝓡 (n + 1)) |
| 59 | (f := gamma) (g := fun y : M => ((y, t) : C.Point)) x |
| 60 | ((C.contMDiff_space_slice t).mdifferentiableAt (by simp)) hgamma (1 : ℝ) |
| 61 | rw [C.mfderiv_space_slice] at h |
| 62 | exact h |
| 63 | have hYhat : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 (n + 1)).tangent |
| 64 | (fun s => (⟨gammahat s, Yhat s⟩ : TangentBundle (𝓡 (n + 1)) C.Point)) x := by |
| 65 | have h := (((C.contMDiff_space_slice t).contMDiff_tangentMap (m := ∞) |
| 66 | (by simp)).mdifferentiableAt (by simp)).comp x hY |
| 67 | apply h.congr_of_eventuallyEq |
| 68 | filter_upwards [] with s |
| 69 | simp only [Function.comp_def, tangentMap, C.mfderiv_space_slice, gammahat, Yhat] |
| 70 | have hp : p ∈ (chartAt E p).source := mem_chart_source E p |
| 71 | let L := (mdifferentiable_chart (I := 𝓡 n) p).mfderiv hp |
| 72 | have hvalue (W : TangentSpace (𝓡 n) p) : |
| 73 | PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (L W) p = W := by |
| 74 | have hi : (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) p).IsInvertible := ⟨L, rfl⟩ |
| 75 | exact hi.inverse_apply_self W |
| 76 | have htest (W : TangentSpace (𝓡 n) p) : g.inner p U W = g.inner p Z0 W := by |
| 77 | let Z := PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (L W) |
| 78 | let B := C.productChartField p (L W) 0 |
| 79 | have hZ : ContMDiffAt (𝓡 n) (𝓡 n).tangent ∞ (T% Z) p := |
| 80 | (PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField_smooth p (L W)).contMDiffAt |
| 81 | ((chartAt E p).open_source.mem_nhds hp) |
| 82 | have hO : IsOpen {r : C.Point | r.1 ∈ (chartAt E p).source} := |
| 83 | (chartAt E p).open_source.preimage C.contMDiff_space.continuous |
| 84 | have hB : ContMDiffAt (𝓡 (n + 1)) (𝓡 (n + 1)).tangent ∞ (T% B) q := |
| 85 | (C.productChartField_contMDiffOn p (L W) 0).contMDiffAt (hO.mem_nhds hp) |
| 86 | have hZq : Z p = W := hvalue W |
| 87 | have hBq : B q = C.horizontal q W := by |
| 88 | change C.horizontal q (Z p) + (0 : ℝ) • C.timeVector q = _ |
| 89 | rw [hZq, zero_smul, add_zero] |
| 90 | have hfield : C.liftSpatialField (fun _ : ℝ => Z) = B := by |
| 91 | funext r |
| 92 | simp [B, Z, SpacetimeCharts.liftSpatialField, SpacetimeCharts.productChartField] |
| 93 | have hreg : ContMDiffAt (𝓡 (n + 1)) (𝓡 (n + 1)).tangent ∞ |
| 94 | (T% (C.liftSpatialField (fun _ : ℝ => Z))) q := by |
| 95 | rw [hfield] |
| 96 | exact hB |
| 97 | have hconn : G.charts.split q |
| 98 | (G.connection.connection B q (C.horizontal q V)) = |
| 99 | (D.connection Z p V, D.ricci p V (Z p)) := by |
| 100 | have h := G.spatial_connection_at (fun _ : ℝ => Z) q hreg V |
| 101 | rw [hfield] at h |
| 102 | exact h |
| 103 | have hpair : (fun s => G.metric.inner (gammahat s) (Yhat s) (B (gammahat s))) = |
| 104 | (fun s => g.inner (gamma s) (Y s) (Z (gamma s))) := by |
| 105 | funext s |
| 106 | simp only [B, SpacetimeCharts.productChartField, zero_smul, add_zero, Yhat] |
| 107 | exact G.inner_horizontal (gammahat s) (Y s) (Z (gamma s)) |
| 108 | have hbig := hasDerivAt_metric_pairing G.connection hgammahat hYhat |
| 109 | ((hB.mdifferentiableAt (by simp)).comp x hgammahat) |
| 110 | have hsmall := hasDerivAt_metric_pairing D hgamma hY |
| 111 | ((hZ.mdifferentiableAt (by simp)).comp x hgamma) |
| 112 | rw [hpair] at hbig |
| 113 | have he := hbig.unique hsmall |
| 114 | rw [pullback_ambient_field G.connection hgammahat B (hB.mdifferentiableAt (by simp)), |
| 115 | pullback_ambient_field D hgamma Z (hZ.mdifferentiableAt (by simp)), hvelocity] at he |
| 116 | have hsecond : G.metric.inner q (Yhat x) |
| 117 | (G.connection.connection B q (C.horizontal q V)) = |
| 118 | g.inner p (Y x) (D.connection Z p V) := by |
| 119 | rw [G.metric_eq, hconn] |
| 120 | simp [Yhat, C, SpacetimeCharts.horizontal, gammahat, q, p, g] |
| 121 | change G.metric.inner q A (B q) + |
| 122 | G.metric.inner q (Yhat x) (G.connection.connection B q (C.horizontal q V)) = |
| 123 | g.inner p Z0 (Z p) + g.inner p (Y x) (D.connection Z p V) at he |
| 124 | rw [hsecond, hBq, hZq, G.metric_eq] at he |
| 125 | simp only [C, SpacetimeCharts.horizontal, ContinuousLinearEquiv.apply_symm_apply, |
| 126 | mul_zero, add_zero] at he |
| 127 | change g.inner p U W + g.inner p (Y x) (D.connection Z p V) = |
| 128 | g.inner p Z0 W + g.inner p (Y x) (D.connection Z p V) at he |
| 129 | exact add_right_cancel he |
| 130 | have hhorizontal : U = Z0 := by |
| 131 | by_contra hne |
| 132 | have he := htest (U - Z0) |
| 133 | have hz : g.inner p (U - Z0) (U - Z0) = 0 := by |
| 134 | rw [(g.inner p).map_sub U Z0] |
| 135 | change g.inner p U (U - Z0) - g.inner p Z0 (U - Z0) = 0 |
| 136 | exact sub_eq_zero.mpr he |
| 137 | exact (ne_of_gt (g.pos p (U - Z0) (sub_ne_zero.mpr hne))) hz |
| 138 | have hT := (C.timeVector_smooth q).mdifferentiableAt (by simp) |
| 139 | have hzero (s : ℝ) : |
| 140 | G.metric.inner (gammahat s) (Yhat s) (C.timeVector (gammahat s)) = 0 := by |
| 141 | change G.metric.inner (gammahat s) (Yhat s) (G.charts.timeVector (gammahat s)) = 0 |
| 142 | rw [G.inner_time] |
| 143 | simp [Yhat, C, SpacetimeCharts.horizontal] |
| 144 | have hbig := hasDerivAt_metric_pairing G.connection hgammahat hYhat |
| 145 | (hT.comp x hgammahat) |
| 146 | have hconstant : HasDerivAt |
| 147 | (fun s => G.metric.inner (gammahat s) (Yhat s) (C.timeVector (gammahat s))) 0 x := by |
| 148 | simpa only [hzero] using hasDerivAt_const x (0 : ℝ) |
| 149 | have he := hbig.unique hconstant |
| 150 | rw [pullback_ambient_field G.connection hgammahat C.timeVector hT, hvelocity] at he |
| 151 | have hneg : G.metric.inner q (Yhat x) |
| 152 | (G.connection.connection C.timeVector q (C.horizontal q V)) = -D.ricci p V (Y x) := by |
| 153 | rw [G.metric.symm] |
| 154 | exact G.spatial_time_pairing q V (Y x) |
| 155 | change G.metric.inner q A (G.charts.timeVector q) + |
| 156 | G.metric.inner q (Yhat x) (G.connection.connection C.timeVector q (C.horizontal q V)) = 0 at he |
| 157 | rw [G.inner_time, hneg] at he |
| 158 | apply Prod.ext |
| 159 | · exact hhorizontal |
| 160 | · change (C.split q A).2 = D.ricci p V (Y x) |
| 161 | linarith only [he] |
| 162 | |
| 163 | end PoincareMT.M62.SpacetimeData |