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.RicciPairing |
| 2 | import PoincareLib.Geometry.RicciFlow.CurveShortening.Connection.MetricVariation |
| 3 | |
| 4 | /-! |
| 5 | # Time differentiation of actual lifted spatial fields |
| 6 | |
| 7 | The actual time slice and evolving-metric product rule give the explicit |
| 8 | fixed-fiber derivative minus the Ricci pairing, as in MT2015Correction |
| 9 | equation (0.2), p. 2. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Bundle Manifold Set Topology |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | namespace PoincareMT.M62 |
| 21 | |
| 22 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {a b : ℝ} |
| 25 | |
| 26 | namespace SpacetimeCharts |
| 27 | |
| 28 | /-- The actual time-slice differential is a multiple of the time vector; |
| 29 | MT2015Correction equation (0.2), p. 2. -/ |
| 30 | theorem mfderiv_time_slice (C : SpacetimeCharts n M a b) |
| 31 | (p : M) (t : OpenTime a b) (r : ℝ) : |
| 32 | mfderiv (M' := C.Point) 𝓘(ℝ, ℝ) (𝓡 (n + 1)) |
| 33 | (fun s : OpenTime a b => (p, s)) t r = |
| 34 | r • C.timeVector (p, t) := by |
| 35 | let := C.chartedSpace |
| 36 | have h := mfderiv_comp_apply |
| 37 | (I := 𝓘(ℝ, ℝ)) (I' := (𝓡 n).prod 𝓘(ℝ, ℝ)) (I'' := 𝓡 (n + 1)) |
| 38 | (f := fun s : OpenTime a b => ((p, s) : SpacetimeCarrier M a b)) |
| 39 | (g := (id : SpacetimeCarrier M a b → C.Point)) t |
| 40 | (C.from_product_smooth.mdifferentiableAt (by simp)) |
| 41 | (mdifferentiableAt_const.prodMk mdifferentiableAt_id) r |
| 42 | erw [mfderiv_prodMk mdifferentiableAt_const mdifferentiableAt_id] at h |
| 43 | apply (C.split (p, t)).injective |
| 44 | change C.split (p, t) |
| 45 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 (n + 1)) (id ∘ fun s : OpenTime a b => ((p, s) : |
| 46 | SpacetimeCarrier M a b)) t r) = _ |
| 47 | rw [h] |
| 48 | erw [C.split_mfderiv_from_product] |
| 49 | simp [timeVector, mfderiv_id, mfderiv_const] |
| 50 | rfl |
| 51 | |
| 52 | /-- Evaluate time differentiation by a genuine derivative witness for the |
| 53 | actual scalar restriction; MT2015Correction equation (0.2), p. 2. -/ |
| 54 | theorem mvfderiv_time_slice (C : SpacetimeCharts n M a b) |
| 55 | (f : C.Point → ℝ) (g : ℝ → ℝ) (q : C.Point) (d : ℝ) |
| 56 | (hf : MDifferentiableAt (𝓡 (n + 1)) 𝓘(ℝ, ℝ) f q) |
| 57 | (hg : HasDerivAt g d (q.2 : ℝ)) |
| 58 | (heq : ∀ s : OpenTime a b, f (q.1, s) = g s) : |
| 59 | mvfderiv (𝓡 (n + 1)) f q (C.timeVector q) = d := by |
| 60 | let := C.chartedSpace |
| 61 | have hj : ContMDiff (M' := C.Point) 𝓘(ℝ, ℝ) (𝓡 (n + 1)) ∞ |
| 62 | (fun s : OpenTime a b => (q.1, s)) := |
| 63 | C.from_product_smooth.comp (contMDiff_const.prodMk contMDiff_id) |
| 64 | have h := mfderiv_comp_apply (f := fun s : OpenTime a b => ((q.1, s) : C.Point)) |
| 65 | (g := f) q.2 hf (hj.mdifferentiableAt (by simp)) (1 : ℝ) |
| 66 | rw [C.mfderiv_time_slice, one_smul] at h |
| 67 | have hg' := mfderiv_comp_apply (f := (Subtype.val : OpenTime a b → ℝ)) |
| 68 | (g := g) q.2 hg.differentiableAt.mdifferentiableAt |
| 69 | (contMDiff_subtype_val.mdifferentiableAt (n := ∞) (by simp)) (1 : ℝ) |
| 70 | rw [Poincare.Spacetime.Realization.mfderiv_openSubtype_val] at hg' |
| 71 | have hval : mfderiv 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) g (q.2 : ℝ) (1 : ℝ) = d := by |
| 72 | rw [mfderiv_eq_fderiv] |
| 73 | change fderiv ℝ g (q.2 : ℝ) (1 : ℝ) = d |
| 74 | rw [hg.hasFDerivAt.fderiv] |
| 75 | simp |
| 76 | change mfderiv 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) (fun s : OpenTime a b => g s) q.2 (1 : ℝ) = |
| 77 | mfderiv 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) g (q.2 : ℝ) (1 : ℝ) at hg' |
| 78 | rw [hval] at hg' |
| 79 | have hfun : (fun s : OpenTime a b => f (q.1, s)) = (fun s : OpenTime a b => g s) := |
| 80 | funext heq |
| 81 | change mfderiv 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) (fun s : OpenTime a b => f (q.1, s)) q.2 (1 : ℝ) = |
| 82 | mvfderiv (𝓡 (n + 1)) f q (C.timeVector q) at h |
| 83 | rw [hfun] at h |
| 84 | exact h.symm.trans hg' |
| 85 | |
| 86 | /-- A smooth actual lift gives a smooth existing real-time section germ at |
| 87 | every interior time; MT2015Correction equation (0.2), p. 2. -/ |
| 88 | theorem liftSpatialField_time_smooth (C : SpacetimeCharts n M a b) |
| 89 | (B : ℝ → (p : M) → TangentSpace (𝓡 n) p) |
| 90 | (hB : C.IsSmoothField (C.liftSpatialField B)) |
| 91 | (p : M) (t : OpenTime a b) : |
| 92 | ContMDiffAt 𝓘(ℝ, ℝ) (𝓡 n).tangent ∞ |
| 93 | (fun r : ℝ => (⟨p, B r p⟩ : TangentBundle (𝓡 n) M)) (t : ℝ) := by |
| 94 | have h := ((C.liftSpatialField_smooth_iff B).mp hB).comp |
| 95 | ((contMDiff_const (c := p)).prodMk contMDiff_id) |
| 96 | exact contMDiffAt_subtype_iff.mp (h t) |
| 97 | |
| 98 | end SpacetimeCharts |
| 99 | |
| 100 | namespace SpacetimeData |
| 101 | |
| 102 | /-- Time differentiation of an actual spatial lift has its fixed-fiber |
| 103 | derivative minus the Ricci term; MT2015Correction equation (0.2), p. 2. -/ |
| 104 | theorem time_spatial_pairing {F : RicciFlow n M (Set.Icc a b)} |
| 105 | (G : SpacetimeData F) |
| 106 | (B : ℝ → (p : M) → TangentSpace (𝓡 n) p) |
| 107 | (hB : G.charts.IsSmoothField (G.charts.liftSpatialField B)) |
| 108 | (q : G.charts.Point) (W : TangentSpace (𝓡 n) q.1) : |
| 109 | G.metric.inner q |
| 110 | (G.connection.connection (G.charts.liftSpatialField B) q |
| 111 | (G.charts.timeVector q)) (G.charts.horizontal q W) = |
| 112 | (F.metric q.2).inner q.1 (fixedPointTimeDerivative B q.1 q.2) W - |
| 113 | (F.connection q.2).ricci q.1 (B q.2 q.1) W := by |
| 114 | let := G.charts.chartedSpace |
| 115 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 (n + 1)) : G.charts.Point → Type _) := |
| 116 | ⟨G.metric.toRiemannianMetric⟩ |
| 117 | let C := G.charts |
| 118 | let E := EuclideanSpace ℝ (Fin n) |
| 119 | let p := q.1 |
| 120 | let T := C.timeVector |
| 121 | have hp : p ∈ (chartAt E p).source := mem_chart_source E p |
| 122 | let L := (mdifferentiable_chart (I := 𝓡 n) p).mfderiv hp |
| 123 | have hvalue : PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (L W) p = W := by |
| 124 | have hi : (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) p).IsInvertible := ⟨L, rfl⟩ |
| 125 | exact hi.inverse_apply_self W |
| 126 | let A := C.productChartField p (L W) 0 |
| 127 | have hAr (s : OpenTime a b) : A (p, s) = C.horizontal (p, s) W := by |
| 128 | dsimp only [A, SpacetimeCharts.productChartField] |
| 129 | rw [zero_smul, add_zero, hvalue] |
| 130 | have hAq : A q = C.horizontal q W := hAr q.2 |
| 131 | have hopen : IsOpen {r : C.Point | r.1 ∈ (chartAt E p).source} := |
| 132 | (chartAt E p).open_source.preimage C.contMDiff_space.continuous |
| 133 | have hA : ContMDiffAt (𝓡 (n + 1)) (𝓡 (n + 1)).tangent ∞ (T% A) q := |
| 134 | (C.productChartField_contMDiffOn p (L W) 0).contMDiffAt (hopen.mem_nhds hp) |
| 135 | have hTfield : C.productChartField p 0 1 = T := by |
| 136 | funext r |
| 137 | simp [SpacetimeCharts.productChartField, PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField, |
| 138 | VectorField.mpullback, SpacetimeCharts.horizontal, T] |
| 139 | have hbr : VectorField.mlieBracket (𝓡 (n + 1)) T A q = 0 := by |
| 140 | rw [← hTfield] |
| 141 | exact C.productChartField_bracket p 0 (L W) 1 0 q hp |
| 142 | have hcomm := RicciFlowAnalysis.connection_commutator G.connection (X := T) (Y := A) |
| 143 | ((C.timeVector_smooth q).mdifferentiableAt (by simp)) (hA.mdifferentiableAt (by simp)) |
| 144 | rw [hbr] at hcomm |
| 145 | have hconn := sub_eq_zero.mp hcomm |
| 146 | have hsecond : G.metric.inner q (C.liftSpatialField B q) |
| 147 | (G.connection.connection A q (T q)) = -(F.connection q.2).ricci p (B q.2 p) W := by |
| 148 | rw [G.metric.symm, hconn, hAq] |
| 149 | change G.metric.inner q |
| 150 | (G.connection.connection C.timeVector q (C.horizontal q W)) |
| 151 | (C.horizontal q (B q.2 p)) = _ |
| 152 | rw [G.spatial_time_pairing, RicciFlowAnalysis.ricci_symm (F.connection q.2) p W (B q.2 p)] |
| 153 | have hBt := C.liftSpatialField_time_smooth B hB p q.2 |
| 154 | have hflow := hasDerivAt_flow_metric_pairing F (γ := fun _ : ℝ => p) |
| 155 | (Y := fun r => B r p) (Z := fun _ => W) q.2.property |
| 156 | mdifferentiableAt_const (hBt.mdifferentiableAt (by simp)) mdifferentiableAt_const |
| 157 | have hpull : rampHorizontalCovariantDerivative (F.connection q.2) |
| 158 | (fun _ : ℝ => p) (fun r => B r p) q.2 = fixedPointTimeDerivative B p q.2 := by |
| 159 | simp only [rampHorizontalCovariantDerivative, fixedPointTimeDerivative, |
| 160 | curveVelocity, mfderiv_const, zero_apply, map_zero, add_zero] |
| 161 | have hconst : rampHorizontalCovariantDerivative (F.connection q.2) |
| 162 | (fun _ : ℝ => p) (fun _ => W) q.2 = 0 := by |
| 163 | simp only [rampHorizontalCovariantDerivative, curveVelocity, mfderiv_const, |
| 164 | zero_apply, deriv_const, map_zero, zero_add] |
| 165 | rw [hpull, hconst] at hflow |
| 166 | simp only [map_zero, add_zero] at hflow |
| 167 | have heq (s : OpenTime a b) : |
| 168 | G.metric.inner (p, s) (C.liftSpatialField B (p, s)) (A (p, s)) = |
| 169 | (F.metric s).inner p (B s p) W := by |
| 170 | rw [hAr] |
| 171 | exact G.inner_horizontal (p, s) (B s p) W |
| 172 | have hd := C.mvfderiv_time_slice |
| 173 | (fun r => G.metric.inner r (C.liftSpatialField B r) (A r)) |
| 174 | (fun r => (F.metric r).inner p (B r p) W) q _ |
| 175 | (((hB q).inner_bundle hA).mdifferentiableAt (by simp)) hflow heq |
| 176 | have h := RicciFlowAnalysis.metric_derivative_pairing G.connection T |
| 177 | ((hB q).mdifferentiableAt (by simp)) (hA.mdifferentiableAt (by simp)) |
| 178 | change mvfderiv (𝓡 (n + 1)) |
| 179 | (fun r => G.metric.inner r (C.liftSpatialField B r) (A r)) q (T q) = |
| 180 | G.metric.inner q (G.connection.connection (C.liftSpatialField B) q (T q)) (A q) + |
| 181 | G.metric.inner q (C.liftSpatialField B q) (G.connection.connection A q (T q)) at h |
| 182 | rw [hd, hAq, hsecond] at h |
| 183 | linarith only [h] |
| 184 | |
| 185 | end SpacetimeData |
| 186 | |
| 187 | end PoincareMT.M62 |