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.LGeometry.Variation.Coordinates.ChartConnection |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.SmoothEndpointExtension |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiPhase |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/JacobiClosedCoordinates.lean` at |
| 6 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 7 | |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | open Set Filter Topology |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.LGeometry |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | theorem exists_closedChartSectionExtension {a b : ℝ} (hab : a < b) |
| 25 | (x : M) (α : ℝ → M) (c : ℝ → EuclideanSpace ℝ (Fin n)) |
| 26 | (hc : ContDiffOn ℝ ∞ c (Icc a b)) |
| 27 | (hsrc : MapsTo α (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 28 | (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 29 | (hY : ∀ s ∈ Icc a b, chartFrame x (c s) (α s) = Y s) : |
| 30 | Nonempty (ParametricAlongCurveExtensionOn (Icc a b) α Y) := by |
| 31 | obtain ⟨g, hg, hgc⟩ := exists_smooth_extension_Icc hab c hc |
| 32 | exact ⟨chartSectionExtension isOpen_univ (subset_univ _) x α g hg.contDiffOn hsrc Y |
| 33 | (fun s hs ↦ by rw [hgc hs]; exact hY s hs)⟩ |
| 34 | |
| 35 | theorem closedChartField_contMDiffOn {C : Set ℝ} |
| 36 | (x : M) (α : ℝ → M) (c : ℝ → EuclideanSpace ℝ (Fin n)) |
| 37 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α C) |
| 38 | (hc : ContDiffOn ℝ ∞ c C) |
| 39 | (hsrc : MapsTo α C (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 40 | ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 41 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) |
| 42 | (chartFrame x (c s) (α s))) C := by |
| 43 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 44 | apply (e.contMDiffOn_symm.comp (hα.prodMk hc.contMDiffOn) |
| 45 | (fun s hs ↦ e.mem_target.mpr (hsrc hs))).congr |
| 46 | intro s hs |
| 47 | rw [show chartFrame x (c s) (α s) = e.symm (α s) (c s) from |
| 48 | Bundle.Trivialization.symmL_apply e (hsrc hs) (c s)] |
| 49 | exact e.mk_symm (hsrc hs) (c s) |
| 50 | |
| 51 | set_option maxHeartbeats 1000000 in |
| 52 | theorem pullbackCovariantDerivative_closedChart_formula {J S : Set ℝ} |
| 53 | (F : RicciFlow n M J) (T : ℝ) {a b : ℝ} (hab : a < b) |
| 54 | (hCS : Icc a b ⊆ S) (htime : ∀ s ∈ S, T - s ^ 2 ∈ J) |
| 55 | (x : M) (α : ℝ → M) (c : ℝ → EuclideanSpace ℝ (Fin n)) |
| 56 | (hc : ContDiffOn ℝ ∞ c (Icc a b)) |
| 57 | (hsrc : MapsTo α (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 58 | (Y : ∀ r, TangentSpace (𝓡 n) (α r)) |
| 59 | (hY : ∀ r ∈ Icc a b, chartFrame x (c r) (α r) = Y r) |
| 60 | (E : ParametricAlongCurveExtensionOn (Icc a b) α Y) |
| 61 | {s : ℝ} (hs : s ∈ Icc a b) (dc : EuclideanSpace ℝ (Fin n)) |
| 62 | (hdc : HasDerivWithinAt c dc (Icc a b) s) |
| 63 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 64 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α Y (Icc a b) E s = |
| 65 | chartFrame x (dc + closedChartChristoffel F T x S (s, extChartAt (𝓡 n) x (α s)) |
| 66 | (deriv ((extChartAt (𝓡 n) x) ∘ α) s) (c s)) (α s) := by |
| 67 | obtain ⟨g, hg, hgc⟩ := exists_smooth_extension_Icc hab c hc |
| 68 | have hgd : deriv g s = dc := by |
| 69 | have hd : HasDerivWithinAt g (deriv g s) (Icc a b) s := |
| 70 | ((hg.differentiable (by simp)) s).hasDerivAt.hasDerivWithinAt |
| 71 | exact UniqueDiffWithinAt.eq_deriv _ (uniqueDiffOn_Icc hab s hs) |
| 72 | (hd.congr_of_mem (fun r hr ↦ (hgc hr).symm) hs) hdc |
| 73 | have hfield : ∀ r ∈ Icc a b, chartFrame x (g r) (α r) = Y r := by |
| 74 | intro r hr |
| 75 | rw [hgc hr] |
| 76 | exact hY r hr |
| 77 | rw [pullbackCovariantDerivative_chart_formula F (fun r ↦ T - r ^ 2) |
| 78 | isOpen_univ (subset_univ _) x α g hg.contDiffOn hsrc Y hfield E hs |
| 79 | (uniqueDiffOn_Icc hab s hs) hα, |
| 80 | hgd, hgc hs, closedChartChristoffel_connection F T htime (hsrc hs) (hCS hs)] |
| 81 | exact ((trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 82 | (TangentSpace (𝓡 n)) x).symmL ℝ (α s)).map_add _ _ |>.symm |
| 83 | |
| 84 | local instance closedJacobiDualGroup : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 85 | ContinuousLinearMap.toNormedAddCommGroup |
| 86 | local instance closedJacobiDualSpace : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 87 | ContinuousLinearMap.toNormedSpace |
| 88 | local instance closedJacobiBilinGroup : |
| 89 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 90 | ContinuousLinearMap.toNormedAddCommGroup |
| 91 | local instance closedJacobiBilinSpace : |
| 92 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 93 | ContinuousLinearMap.toNormedSpace |
| 94 | |
| 95 | set_option maxHeartbeats 1000000 in |
| 96 | theorem covariantPhase_pullback_pair {J S : Set ℝ} |
| 97 | (F : RicciFlow n M J) (T : ℝ) {a b : ℝ} (hab : a < b) |
| 98 | (hCS : Icc a b ⊆ S) (htime : ∀ s ∈ S, T - s ^ 2 ∈ J) |
| 99 | (x : M) (α : ℝ → M) |
| 100 | (hsrc : MapsTo α (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 101 | (B : ℝ → (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 102 | (C : ℝ → EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 103 | (V H : ℝ → EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 104 | (z : ℝ → EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)) |
| 105 | (hz : ContDiffOn ℝ ∞ z (Icc a b)) |
| 106 | (EY : ParametricAlongCurveExtensionOn (Icc a b) α |
| 107 | (fun r ↦ chartFrame x (z r).1 (α r))) |
| 108 | (EP : ParametricAlongCurveExtensionOn (Icc a b) α |
| 109 | (fun r ↦ chartFrame x (z r).2 (α r))) |
| 110 | {s : ℝ} (hs : s ∈ Icc a b) |
| 111 | (hΓ : ∀ v, C s v = closedChartChristoffel F T x S |
| 112 | (s, extChartAt (𝓡 n) x (α s)) (deriv ((extChartAt (𝓡 n) x) ∘ α) s) v) |
| 113 | (hd : HasDerivWithinAt z (covariantLinearPhaseOperator (B s) (C s) (V s) (H s) (z s)) |
| 114 | (Icc a b) s) |
| 115 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 116 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α |
| 117 | (fun r ↦ chartFrame x (z r).1 (α r)) (Icc a b) EY s = |
| 118 | chartFrame x (z s).2 (α s) ∧ |
| 119 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α |
| 120 | (fun r ↦ chartFrame x (z r).2 (α r)) (Icc a b) EP s = |
| 121 | chartFrame x (B s (V s (z s).1 - H s (z s).2)) (α s) := by |
| 122 | have hdy : HasDerivWithinAt (fun r ↦ (z r).1) ((z s).2 - C s (z s).1) |
| 123 | (Icc a b) s := hd.fst |
| 124 | have hdp : HasDerivWithinAt (fun r ↦ (z r).2) |
| 125 | (B s (V s (z s).1 - H s (z s).2) - C s (z s).2) (Icc a b) s := hd.snd |
| 126 | constructor |
| 127 | · rw [pullbackCovariantDerivative_closedChart_formula F T hab hCS htime x α |
| 128 | (fun r ↦ (z r).1) hz.fst hsrc _ (fun _ _ ↦ rfl) EY hs _ hdy hα, |
| 129 | ← hΓ (z s).1, sub_add_cancel] |
| 130 | · rw [pullbackCovariantDerivative_closedChart_formula F T hab hCS htime x α |
| 131 | (fun r ↦ (z r).2) hz.snd hsrc _ (fun _ _ ↦ rfl) EP hs _ hdp hα, |
| 132 | ← hΓ (z s).2, sub_add_cancel] |
| 133 | |
| 134 | end PoincareMT.LGeometry |