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.ReducedLength.Variation.Index.FixedChartIndexCoefficients |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.FixedChartCurvature |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Index.AdaptedIndexTrace |
| 4 | |
| 5 | /-! |
| 6 | # The full geometric index density in a fixed chart |
| 7 | |
| 8 | All five terms are identified using the actual chart differential. |
| 9 | The curvature pairing retains the frozen fourth-slot convention. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 26 | |
| 27 | set_option backward.isDefEq.respectTransparency false in |
| 28 | theorem squareChartIndexCurvature_on_target {J : Set ℝ} (F : RicciFlow n M J) |
| 29 | (hM04 : RicciFlowCurvatureTheory.{u}) |
| 30 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 31 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 32 | (y : E) (hy : y ∈ (chartAt E p).target) (u v w : E) : |
| 33 | (F.connection (T - s ^ 2)).curvature ((chartAt E p).symm y) |
| 34 | (chartVectorField p u ((chartAt E p).symm y)) |
| 35 | (chartVectorField p v ((chartAt E p).symm y)) |
| 36 | (chartVectorField p w ((chartAt E p).symm y)) = |
| 37 | chartVectorField p (coordinateIndexCurvature (squareChartMetric F T p) (s, y) u v w) |
| 38 | ((chartAt E p).symm y) := by |
| 39 | let C := coordinateConnectionBilinear (squareChartMetric F T p) |
| 40 | let Ω := Set.Ioo (-Real.sqrt b) (Real.sqrt b) ×ˢ (chartAt E p).target |
| 41 | have hC : DifferentiableAt ℝ C (s, y) := |
| 42 | ((coordinateConnectionBilinear_contDiffOn (squareChartMetric F T p) Ω |
| 43 | (isOpen_Ioo.prod (chartAt E p).open_target) |
| 44 | (squareChartMetric_smooth F T b hb hwindow p) |
| 45 | (fun z hz a ha ↦ squareChartMetric_pos F T p z hz.2 a ha)).contDiffAt |
| 46 | ((isOpen_Ioo.prod (chartAt E p).open_target).mem_nhds ⟨hs, hy⟩)).differentiableAt |
| 47 | (by simp) |
| 48 | have h := squareChartCurvature_on_target F hM04 T b hb hwindow p s hs y hy u v w |
| 49 | dsimp only [coefficientCurvature] at h |
| 50 | rw [fderiv_spatialSlice C s y hC] at h |
| 51 | exact h |
| 52 | |
| 53 | set_option backward.isDefEq.respectTransparency false in |
| 54 | theorem squareChartMetric_on_target {J : Set ℝ} (F : RicciFlow n M J) |
| 55 | (T : ℝ) (p : M) (s : ℝ) (y : E) (hy : y ∈ (chartAt E p).target) (v w : E) : |
| 56 | squareChartMetric F T p (s, y) v w = |
| 57 | (F.metric (T - s ^ 2)).inner ((chartAt E p).symm y) |
| 58 | (chartVectorField p v ((chartAt E p).symm y)) |
| 59 | (chartVectorField p w ((chartAt E p).symm y)) := by |
| 60 | rw [chartVectorField_at_inverse p v y hy, chartVectorField_at_inverse p w y hy] |
| 61 | rfl |
| 62 | |
| 63 | set_option maxHeartbeats 800000 in |
| 64 | -- The geometric and analytic expressions retain the same five index terms. |
| 65 | set_option backward.isDefEq.respectTransparency false in |
| 66 | theorem squareChartIndexDensity_on_target {J : Set ℝ} (F : RicciFlow n M J) |
| 67 | (hM04 : RicciFlowCurvatureTheory.{u}) |
| 68 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 69 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 70 | (y : E) (hy : y ∈ (chartAt E p).target) (a v w : E) : |
| 71 | coordinateIndexDensity (squareChartMetric F T p) (squareChartScalar F T p) (s, y) a v w = |
| 72 | pointwiseSecondVariationDensity F T ((chartAt E p).symm y) s |
| 73 | (chartVectorField p a ((chartAt E p).symm y)) |
| 74 | (chartVectorField p v ((chartAt E p).symm y)) |
| 75 | (chartVectorField p w ((chartAt E p).symm y)) := by |
| 76 | let q := (chartAt E p).symm y |
| 77 | let D := F.connection (T - s ^ 2) |
| 78 | have hcurv : squareChartMetric F T p (s, y) |
| 79 | (coordinateIndexCurvature (squareChartMetric F T p) (s, y) v a v) a = |
| 80 | D.curvatureTensor q (chartVectorField p v q) (chartVectorField p a q) |
| 81 | (chartVectorField p a q) (chartVectorField p v q) := by |
| 82 | rw [squareChartMetric_on_target F T p s y hy, |
| 83 | ← squareChartIndexCurvature_on_target F hM04 T b hb hwindow p s hs y hy v a v] |
| 84 | rfl |
| 85 | unfold coordinateIndexDensity pointwiseSecondVariationDensity |
| 86 | rw [hcurv, squareChartMetric_on_target F T p s y hy, |
| 87 | squareChartIndexHessian_on_target F hM04 T b hb hwindow p s hs y hy, |
| 88 | squareChartTimeCovariant_on_target F hM04 T b hb hwindow p s hs y hy, |
| 89 | squareChartTimeCovariant_on_target F hM04 T b hb hwindow p s hs y hy] |
| 90 | ring |
| 91 | |
| 92 | end PoincareMT.ReducedLength |