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.CurveShortening.Connection.CurvaturePairing |
| 2 | import PoincareLib.Geometry.RicciFlow.Spacetime.Product.SpatialConnection |
| 3 | |
| 4 | /-! |
| 5 | # Gauss identity for the actual spacetime metric |
| 6 | |
| 7 | Scalar connection pairings on the actual fixed-time slice identify the |
| 8 | spatial curvature terms. The two vertical Ricci products give the Gauss |
| 9 | correction with the frozen last-slot convention. This follows |
| 10 | MT2015Correction (0.1)-(0.2), p. 2, and Lemma 0.2, pp. 4-6. |
| 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 spacetime Gauss formula with the frozen curvature convention; |
| 28 | MT2015Correction (0.1)-(0.2), p. 2, and Lemma 0.2, pp. 4-6. -/ |
| 29 | theorem gauss {F : RicciFlow n M (Set.Icc a b)} |
| 30 | (G : SpacetimeData F) (q : G.charts.Point) |
| 31 | (A B C D : TangentSpace (𝓡 n) q.1) : |
| 32 | G.connection.curvatureTensor q |
| 33 | (G.charts.horizontal q A) (G.charts.horizontal q B) |
| 34 | (G.charts.horizontal q C) (G.charts.horizontal q D) = |
| 35 | (F.connection q.2).curvatureTensor q.1 A B C D - |
| 36 | (F.connection q.2).ricci q.1 B D * (F.connection q.2).ricci q.1 A C + |
| 37 | (F.connection q.2).ricci q.1 A D * (F.connection q.2).ricci q.1 B C := by |
| 38 | let := G.charts.chartedSpace |
| 39 | let S := G.charts |
| 40 | let E := EuclideanSpace ℝ (Fin n) |
| 41 | let p := q.1 |
| 42 | let g := F.metric q.2 |
| 43 | let Dt := F.connection q.2 |
| 44 | let X := fun v : E => PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p v |
| 45 | let H := fun v : E => S.productChartField p v 0 |
| 46 | have hp : p ∈ (chartAt E p).source := mem_chart_source E p |
| 47 | have hO : IsOpen {r : S.Point | r.1 ∈ (chartAt E p).source} := |
| 48 | (chartAt E p).open_source.preimage S.contMDiff_space.continuous |
| 49 | have hX (v : E) : ContMDiffOn (𝓡 n) (𝓡 n).tangent ∞ (T% (X v)) |
| 50 | (chartAt E p).source := PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField_smooth p v |
| 51 | have hH (v : E) : ContMDiffOn (𝓡 (n + 1)) (𝓡 (n + 1)).tangent ∞ (T% (H v)) |
| 52 | {r : S.Point | r.1 ∈ (chartAt E p).source} := S.productChartField_contMDiffOn p v 0 |
| 53 | have hfield (v : E) : S.liftSpatialField (fun _ : ℝ => X v) = H v := by |
| 54 | funext r |
| 55 | simp [H, X, SpacetimeCharts.liftSpatialField, SpacetimeCharts.productChartField] |
| 56 | have hconn (u v : E) : |
| 57 | G.charts.split q (G.connection.connection (H v) q (H u q)) = |
| 58 | (Dt.connection (X v) p (X u p), Dt.ricci p (X u p) (X v p)) := by |
| 59 | have hreg : ContMDiffAt (𝓡 (n + 1)) (𝓡 (n + 1)).tangent ∞ |
| 60 | (T% (S.liftSpatialField (fun _ : ℝ => X v))) q := by |
| 61 | rw [hfield] |
| 62 | exact (hH v).contMDiffAt (hO.mem_nhds hp) |
| 63 | have h := G.spatial_connection_at (fun _ : ℝ => X v) q hreg (X u p) |
| 64 | rw [hfield] at h |
| 65 | simpa only [H, SpacetimeCharts.productChartField, zero_smul, add_zero] using h |
| 66 | have hcross (u v w z : E) : |
| 67 | G.metric.inner q (G.connection.connection (H v) q (H u q)) |
| 68 | (G.connection.connection (H z) q (H w q)) = |
| 69 | g.inner p (Dt.connection (X v) p (X u p)) (Dt.connection (X z) p (X w p)) + |
| 70 | Dt.ricci p (X u p) (X v p) * Dt.ricci p (X w p) (X z p) := by |
| 71 | rw [G.metric_eq, hconn, hconn] |
| 72 | have hd (u v w z : E) : |
| 73 | mvfderiv (𝓡 (n + 1)) |
| 74 | (fun r => G.metric.inner r (G.connection.connection (H w) r (H v r)) (H z r)) |
| 75 | q (H u q) = |
| 76 | mvfderiv (𝓡 n) (fun x => g.inner x (Dt.connection (X w) x (X v x)) (X z x)) |
| 77 | p (X u p) := by |
| 78 | have hf := (RicciFlowAnalysis.contMDiffOn_connection_pairing G.connection hO (hH v) (hH w) (hH z)).contMDiffAt |
| 79 | (hO.mem_nhds hp) |
| 80 | have hs := S.mvfderiv_space_slice |
| 81 | (fun r => G.metric.inner r (G.connection.connection (H w) r (H v r)) (H z r)) q |
| 82 | (hf.mdifferentiableAt (by simp)) (X u p) |
| 83 | have heq : (fun x : M => G.metric.inner (x, q.2) |
| 84 | (G.connection.connection (H w) (x, q.2) (H v (x, q.2))) (H z (x, q.2))) =ᶠ[𝓝 p] |
| 85 | (fun x => g.inner x (Dt.connection (X w) x (X v x)) (X z x)) := by |
| 86 | filter_upwards [(chartAt E p).open_source.mem_nhds hp] with x hx |
| 87 | exact G.spatial_chart_connection_pairing p v w z (x, q.2) hx |
| 88 | have heq' := congrArg (fun L => L (X u p)) |
| 89 | (heq.mfderiv_eq (I := 𝓡 n) (I' := 𝓘(ℝ, ℝ))) |
| 90 | have hdir : H u q = S.horizontal q (X u p) := by |
| 91 | simp [H, X, SpacetimeCharts.productChartField, p] |
| 92 | rw [hdir] |
| 93 | exact hs.trans heq' |
| 94 | have hformula (u v w z : E) : |
| 95 | G.connection.curvatureTensor q (H u q) (H v q) (H w q) (H z q) = |
| 96 | Dt.curvatureTensor p (X u p) (X v p) (X w p) (X z p) - |
| 97 | Dt.ricci p (X v p) (X z p) * Dt.ricci p (X u p) (X w p) + |
| 98 | Dt.ricci p (X u p) (X z p) * Dt.ricci p (X v p) (X w p) := by |
| 99 | have hh := curvatureTensor_pairing_of_commuting G.connection hO |
| 100 | (hH u) (hH v) (hH w) (hH z) hp |
| 101 | (S.productChartField_bracket p u v 0 0 q hp) |
| 102 | have hs := curvatureTensor_pairing_of_commuting Dt (chartAt E p).open_source |
| 103 | (hX u) (hX v) (hX w) (hX z) hp |
| 104 | (PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField_bracket p u v p hp) |
| 105 | rw [hd, hcross, hd, hcross] at hh |
| 106 | linarith only [hh, hs] |
| 107 | let L := (mdifferentiable_chart (I := 𝓡 n) p).mfderiv hp |
| 108 | have hvalue (V : TangentSpace (𝓡 n) p) : X (L V) p = V := by |
| 109 | have hi : (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) p).IsInvertible := ⟨L, rfl⟩ |
| 110 | exact hi.inverse_apply_self V |
| 111 | have hpoint (V : TangentSpace (𝓡 n) p) : H (L V) q = S.horizontal q V := by |
| 112 | change S.horizontal q (X (L V) p) + (0 : ℝ) • S.timeVector q = _ |
| 113 | rw [hvalue, zero_smul, add_zero] |
| 114 | simpa only [hpoint, hvalue] using hformula (L A) (L B) (L C) (L D) |
| 115 | |
| 116 | end PoincareMT.M62.SpacetimeData |