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.ChartConnectionLocal |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.SquareChartCurvature |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.CoordinateBianchi |
| 4 | |
| 5 | /-! |
| 6 | # Curvature throughout one fixed coordinate chart |
| 7 | |
| 8 | The actual iterated connection and M04's regular-extension identity give |
| 9 | the curvature germ needed for covariant differentiation. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | open Filter |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 27 | |
| 28 | set_option maxHeartbeats 800000 in |
| 29 | set_option backward.isDefEq.respectTransparency false in |
| 30 | theorem squareChartConnection_iterated_on_target {J : Set ℝ} (F : RicciFlow n M J) |
| 31 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 32 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 33 | (y : E) (hy : y ∈ (chartAt E p).target) (u v w : E) : |
| 34 | let q := (chartAt E p).symm y |
| 35 | let D := F.connection (T - s ^ 2) |
| 36 | let C : E → E →L[ℝ] E →L[ℝ] E := fun z ↦ |
| 37 | coordinateConnectionBilinear (squareChartMetric F T p) (s, z) |
| 38 | D.connection (fun x ↦ D.connection (chartVectorField p w) x (chartVectorField p v x)) |
| 39 | q (chartVectorField p u q) = |
| 40 | chartVectorField p (C y u (C y v w) + fderiv ℝ C y u v w) q := by |
| 41 | dsimp only |
| 42 | let q := (chartAt E p).symm y |
| 43 | let D := F.connection (T - s ^ 2) |
| 44 | let C : E → E →L[ℝ] E →L[ℝ] E := fun z ↦ |
| 45 | coordinateConnectionBilinear (squareChartMetric F T p) (s, z) |
| 46 | let φ : E → E := fun z ↦ C z v w |
| 47 | let c : M → E := fun x ↦ φ ((chartAt E p) x) |
| 48 | have hq : q ∈ (chartAt E p).source := (chartAt E p).map_target hy |
| 49 | have hC : ContDiffAt ℝ ∞ C y := by |
| 50 | have h := coordinateConnectionBilinear_contDiffOn (squareChartMetric F T p) |
| 51 | (Set.Ioo (-Real.sqrt b) (Real.sqrt b) ×ˢ (chartAt E p).target) |
| 52 | (isOpen_Ioo.prod (chartAt E p).open_target) |
| 53 | (squareChartMetric_smooth F T b hb hwindow p) |
| 54 | (fun z hz a ha ↦ squareChartMetric_pos F T p z hz.2 a ha) |
| 55 | exact (h.contDiffAt ((isOpen_Ioo.prod (chartAt E p).open_target).mem_nhds |
| 56 | ⟨hs, hy⟩)).comp y (contDiffAt_const.prodMk contDiffAt_id) |
| 57 | have hφ : DifferentiableAt ℝ φ y := |
| 58 | ((hC.clm_apply contDiffAt_const).clm_apply contDiffAt_const).differentiableAt (by simp) |
| 59 | have hc : MDifferentiableAt (𝓡 n) (𝓡 n) c q := by |
| 60 | have hφ' : MDifferentiableAt (𝓡 n) (𝓡 n) φ ((chartAt E p) q) := by |
| 61 | simpa only [q, (chartAt E p).right_inv hy] using hφ.mdifferentiableAt |
| 62 | exact hφ'.comp q ((mdifferentiable_chart (I := 𝓡 n) p).mdifferentiableAt hq) |
| 63 | have heq : (fun x ↦ D.connection (chartVectorField p w) x (chartVectorField p v x)) |
| 64 | =ᶠ[𝓝 q] (fun x ↦ chartVectorField p (c x) x) := by |
| 65 | filter_upwards [(chartAt E p).open_source.mem_nhds hq] with x hx |
| 66 | have h := squareChartConnection_eq F T b hb hwindow p s hs ((chartAt E p) x) |
| 67 | ((chartAt E p).map_source hx) v w |
| 68 | rw [(chartAt E p).left_inv hx] at h |
| 69 | exact h.symm |
| 70 | have hA (a : E) : D.connection (chartVectorField p a) q (chartVectorField p u q) = |
| 71 | chartVectorField p (C y u a) q := |
| 72 | (squareChartConnection_eq F T b hb hwindow p s hs y hy u a).symm |
| 73 | have hconn := connection_of_eventuallyEq_chartVectorField_on_source D p q hq c hc |
| 74 | _ heq (chartVectorField p u q) (C y u) hA |
| 75 | have hcφ : (fun z ↦ c ((chartAt E p).symm z)) =ᶠ[𝓝 y] φ := by |
| 76 | filter_upwards [(chartAt E p).open_target.mem_nhds hy] with z hz |
| 77 | exact congrArg φ ((chartAt E p).right_inv hz) |
| 78 | have hder : mvfderiv (𝓡 n) c q (chartVectorField p u q) = fderiv ℝ C y u v w := by |
| 79 | rw [mvfderiv_vector_chartVectorField p c y u hy hc, hcφ.fderiv_eq] |
| 80 | have h := ((hC.differentiableAt (by simp)).hasFDerivAt.clm_apply |
| 81 | (hasFDerivAt_const v y)).clm_apply (hasFDerivAt_const w y) |
| 82 | simpa using congrArg (fun L : E →L[ℝ] E ↦ L u) h.fderiv |
| 83 | have hcy : c q = C y v w := congrArg φ ((chartAt E p).right_inv hy) |
| 84 | rw [hder, hcy] at hconn |
| 85 | exact hconn |
| 86 | |
| 87 | set_option maxHeartbeats 800000 in |
| 88 | set_option backward.isDefEq.respectTransparency false in |
| 89 | theorem squareChartCurvature_on_target {J : Set ℝ} (F : RicciFlow n M J) |
| 90 | (hM04 : RicciFlowCurvatureTheory.{u}) |
| 91 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 92 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 93 | (y : E) (hy : y ∈ (chartAt E p).target) (u v w : E) : |
| 94 | let q := (chartAt E p).symm y |
| 95 | let C : E → E →L[ℝ] E →L[ℝ] E := fun z ↦ |
| 96 | coordinateConnectionBilinear (squareChartMetric F T p) (s, z) |
| 97 | (F.connection (T - s ^ 2)).curvature q (chartVectorField p u q) |
| 98 | (chartVectorField p v q) (chartVectorField p w q) = |
| 99 | chartVectorField p (coefficientCurvature C y u v w) q := by |
| 100 | dsimp only |
| 101 | let q := (chartAt E p).symm y |
| 102 | let D := F.connection (T - s ^ 2) |
| 103 | have hq : q ∈ (chartAt E p).source := (chartAt E p).map_target hy |
| 104 | have h := (hM04.tensor_calculus n M (F.metric (T - s ^ 2)) D).2.2.2.2 |
| 105 | (chartAt E p).source (chartAt E p).open_source (chartVectorField p u) |
| 106 | (chartVectorField p v) (chartVectorField p w) |
| 107 | (chartVectorField_smooth p u) (chartVectorField_smooth p v) (chartVectorField_smooth p w) |
| 108 | q hq |
| 109 | rw [← h, LeviCivitaData.curvatureOnFields, |
| 110 | chartVectorField_bracket p u v q hq, map_zero, sub_zero] |
| 111 | rw [squareChartConnection_iterated_on_target F T b hb hwindow p s hs y hy u v w, |
| 112 | squareChartConnection_iterated_on_target F T b hb hwindow p s hs y hy v u w] |
| 113 | let L : E →L[ℝ] TangentSpace (𝓡 n) q := |
| 114 | (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) q).inverse |
| 115 | change L _ - L _ = L _ |
| 116 | rw [← map_sub] |
| 117 | congr 1 |
| 118 | dsimp only [coefficientCurvature] |
| 119 | abel |
| 120 | |
| 121 | end PoincareMT.ReducedLength |