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.Coordinates.CenteredConnection |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.CenteredVectorDerivative |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.SquareChartConnection |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.CoordinateConnectionBilinear |
| 5 | |
| 6 | /-! |
| 7 | # The actual curvature in centered square-time coordinates |
| 8 | |
| 9 | The regular-extension field of the public M04 interface identifies the |
| 10 | frozen curvature with the computed commutator on smooth chart fields. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | open Filter |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.ReducedLength |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 26 | [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 29 | |
| 30 | set_option backward.isDefEq.respectTransparency false in |
| 31 | theorem squareChartConnection_slice_contDiffOn {J : Set ℝ} (F : RicciFlow n M J) |
| 32 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 33 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (v w : E) : |
| 34 | ContDiffOn ℝ ∞ (fun y ↦ coordinateConnection (squareChartMetric F T p) (s, y) v w) |
| 35 | (chartAt E p).target := by |
| 36 | have hC := coordinateConnectionBilinear_contDiffOn (squareChartMetric F T p) |
| 37 | (Set.Ioo (-Real.sqrt b) (Real.sqrt b) ×ˢ (chartAt E p).target) |
| 38 | (isOpen_Ioo.prod (chartAt E p).open_target) |
| 39 | (squareChartMetric_smooth F T b hb hwindow p) |
| 40 | (fun z hz a ha ↦ squareChartMetric_pos F T p z hz.2 a ha) |
| 41 | have hi : ContDiffOn ℝ ∞ (fun y : E ↦ (s, y)) |
| 42 | (chartAt E p).target := |
| 43 | contDiffOn_const.prodMk contDiffOn_id |
| 44 | exact ((hC.comp hi (fun y hy ↦ ⟨hs, hy⟩)).clm_apply contDiffOn_const).clm_apply |
| 45 | contDiffOn_const |
| 46 | |
| 47 | set_option backward.isDefEq.respectTransparency false in |
| 48 | theorem squareChartConnection_at_center {J : Set ℝ} (F : RicciFlow n M J) |
| 49 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 50 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (v w : E) : |
| 51 | coordinateConnection (squareChartMetric F T p) (s, (chartAt E p) p) v w = |
| 52 | ((F.connection (T - s ^ 2)).connection (chartVectorField p w) p v : E) := by |
| 53 | have h := squareChartConnection_eq F T b hb hwindow p s hs ((chartAt E p) p) |
| 54 | ((chartAt E p).map_source (mem_chart_source E p)) v w |
| 55 | have hp : (chartAt E p).symm ((chartAt E p) p) = p := |
| 56 | (chartAt E p).left_inv (mem_chart_source E p) |
| 57 | change (chartVectorField p (coordinateConnection (squareChartMetric F T p) |
| 58 | (s, (chartAt E p) p) v w) ((chartAt E p).symm ((chartAt E p) p)) : E) = |
| 59 | (F.connection (T - s ^ 2)).connection (chartVectorField p w) |
| 60 | ((chartAt E p).symm ((chartAt E p) p)) |
| 61 | (chartVectorField p v ((chartAt E p).symm ((chartAt E p) p))) at h |
| 62 | rw [hp] at h |
| 63 | simpa only [chartVectorField_self] using h |
| 64 | |
| 65 | set_option backward.isDefEq.respectTransparency false in |
| 66 | theorem squareChartConnection_iterated_at_center {J : Set ℝ} (F : RicciFlow n M J) |
| 67 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 68 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (U V W : E) : |
| 69 | let D := F.connection (T - s ^ 2) |
| 70 | let C : E → E → E → E := fun y v w ↦ |
| 71 | coordinateConnection (squareChartMetric F T p) (s, y) v w |
| 72 | (D.connection (fun q ↦ D.connection (chartVectorField p W) q |
| 73 | (chartVectorField p V q)) p U : E) = |
| 74 | C ((chartAt E p) p) U (C ((chartAt E p) p) V W) + |
| 75 | fderiv ℝ (fun y ↦ C y V W) ((chartAt E p) p) U := by |
| 76 | let D := F.connection (T - s ^ 2) |
| 77 | let φ : E → E := fun y ↦ coordinateConnection (squareChartMetric F T p) (s, y) V W |
| 78 | let c : M → E := fun q ↦ φ ((chartAt E p) q) |
| 79 | have hφ : DifferentiableAt ℝ φ ((chartAt E p) p) := |
| 80 | ((squareChartConnection_slice_contDiffOn F T b hb hwindow p s hs V W).contDiffAt |
| 81 | ((chartAt E p).open_target.mem_nhds |
| 82 | ((chartAt E p).map_source (mem_chart_source E p)))).differentiableAt (by simp) |
| 83 | have hc : MDifferentiableAt (𝓡 n) (𝓡 n) c p := hφ.mdifferentiableAt.comp p |
| 84 | ((mdifferentiable_chart (I := 𝓡 n) p).mdifferentiableAt (mem_chart_source E p)) |
| 85 | have heq : (fun q ↦ D.connection (chartVectorField p W) q (chartVectorField p V q)) |
| 86 | =ᶠ[𝓝 p] (fun q ↦ chartVectorField p (c q) q) := by |
| 87 | filter_upwards [(chartAt E p).open_source.mem_nhds (mem_chart_source E p)] with q hq |
| 88 | have h := squareChartConnection_eq F T b hb hwindow p s hs ((chartAt E p) q) |
| 89 | ((chartAt E p).map_source hq) V W |
| 90 | convert! h.symm using 1 <;> rw [(chartAt E p).left_inv hq] |
| 91 | have h := connection_of_eventuallyEq_chartVectorField D p c hc _ heq U |
| 92 | rw [mvfderiv_vector_centeredChart_of_eventuallyEq p c φ hφ |
| 93 | (Filter.Eventually.of_forall (fun _ ↦ rfl)) U, |
| 94 | frozenConnectionEndomorphism_apply, connection_frozenExtend_eq_chartVectorField, |
| 95 | ← squareChartConnection_at_center F T b hb hwindow p s hs] at h |
| 96 | exact h |
| 97 | |
| 98 | set_option backward.isDefEq.respectTransparency false in |
| 99 | theorem squareChartCurvature_at_center {J : Set ℝ} (F : RicciFlow n M J) |
| 100 | (hM04 : RicciFlowCurvatureTheory.{u}) |
| 101 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 102 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (U V W : E) : |
| 103 | let C : E → E → E → E := fun y v w ↦ |
| 104 | coordinateConnection (squareChartMetric F T p) (s, y) v w |
| 105 | ((F.connection (T - s ^ 2)).curvature p U V W : E) = |
| 106 | fderiv ℝ (fun y ↦ C y V W) ((chartAt E p) p) U - |
| 107 | fderiv ℝ (fun y ↦ C y U W) ((chartAt E p) p) V + |
| 108 | C ((chartAt E p) p) U (C ((chartAt E p) p) V W) - |
| 109 | C ((chartAt E p) p) V (C ((chartAt E p) p) U W) := by |
| 110 | let D := F.connection (T - s ^ 2) |
| 111 | have h := (hM04.tensor_calculus n M (F.metric (T - s ^ 2)) D).2.2.2.2 |
| 112 | (chartAt E p).source (chartAt E p).open_source (chartVectorField p U) |
| 113 | (chartVectorField p V) (chartVectorField p W) |
| 114 | (chartVectorField_smooth p U) (chartVectorField_smooth p V) (chartVectorField_smooth p W) |
| 115 | p (mem_chart_source E p) |
| 116 | rw [chartVectorField_self, chartVectorField_self, chartVectorField_self] at h |
| 117 | rw [← h, LeviCivitaData.curvatureOnFields, chartVectorField_self, chartVectorField_self, |
| 118 | chartVectorField_bracket p U V p (mem_chart_source E p), map_zero, sub_zero] |
| 119 | rw [squareChartConnection_iterated_at_center F T b hb hwindow p s hs U V W, |
| 120 | squareChartConnection_iterated_at_center F T b hb hwindow p s hs V U W] |
| 121 | abel |
| 122 | |
| 123 | end PoincareMT.ReducedLength |