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.Second.SecondVariationCoordinates |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Second.SecondVariationGeometry |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiClosedCoordinates |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiRepresentative |
| 5 | |
| 6 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/VariationAcceleration.lean` at |
| 7 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 8 | |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set Filter Topology |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.LGeometry |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | theorem pullbackCovariantDerivative_chart_formula_local {J C U : Set ℝ} |
| 26 | (F : RicciFlow n M J) (time : ℝ → ℝ) (hU : IsOpen U) |
| 27 | (x : M) (α : ℝ → M) (c : ℝ → EuclideanSpace ℝ (Fin n)) |
| 28 | (hc : ContDiffOn ℝ ∞ c U) |
| 29 | (hsrc : MapsTo α (C ∩ U) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 30 | (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 31 | (hY : ∀ s ∈ C ∩ U, chartFrame x (c s) (α s) = Y s) |
| 32 | (E : ParametricAlongCurveExtensionOn C α Y) {s : ℝ} (hs : s ∈ C) (hsU : s ∈ U) |
| 33 | (hC : UniqueDiffWithinAt ℝ C s) |
| 34 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 35 | pullbackCovariantDerivative F time α Y C E s = |
| 36 | chartFrame x (deriv c s) (α s) + |
| 37 | (F.connection (time s)).connection (chartFrame x (c s)) (α s) |
| 38 | (chartFrame x (deriv ((extChartAt (𝓡 n) x) ∘ α) s) (α s)) := by |
| 39 | have hD := hC.inter (hU.mem_nhds hsU) |
| 40 | rw [pullbackCovariantDerivative_restrict F time inter_subset_left E hC hD hα] |
| 41 | exact pullbackCovariantDerivative_chart_formula F time hU inter_subset_right x α c hc |
| 42 | hsrc Y hY (restrictParametricSectionExtension inter_subset_left E) ⟨hs, hsU⟩ hD hα |
| 43 | |
| 44 | def variationChartDomain {J : Set ℝ} {F : RicciFlow n M J} |
| 45 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 46 | (V : LVariation F T τ₁ τ₂ p) (x : M) : Set (ℝ × ℝ) := |
| 47 | V.squareDomain ∩ (fun z : ℝ × ℝ ↦ V.squareFamily z.1 z.2) ⁻¹' |
| 48 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source |
| 49 | |
| 50 | def variationChart {J : Set ℝ} {F : RicciFlow n M J} |
| 51 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 52 | (V : LVariation F T τ₁ τ₂ p) (x : M) (z : ℝ × ℝ) : EuclideanSpace ℝ (Fin n) := |
| 53 | extChartAt (𝓡 n) x (V.squareFamily z.1 z.2) |
| 54 | |
| 55 | theorem variationChartDomain_open {J : Set ℝ} {F : RicciFlow n M J} |
| 56 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 57 | (V : LVariation F T τ₁ τ₂ p) (x : M) : IsOpen (variationChartDomain V x) := |
| 58 | V.square_smooth.continuousOn.isOpen_inter_preimage V.square_open |
| 59 | (chartAt (EuclideanSpace ℝ (Fin n)) x).open_source |
| 60 | |
| 61 | theorem variationChart_contDiffOn {J : Set ℝ} {F : RicciFlow n M J} |
| 62 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 63 | (V : LVariation F T τ₁ τ₂ p) (x : M) : |
| 64 | ContDiffOn ℝ ∞ (variationChart V x) (variationChartDomain V x) := by |
| 65 | have h := (contMDiffOn_extChartAt (I := 𝓡 n) (x := x)).comp |
| 66 | (V.square_smooth.mono inter_subset_left) (fun z hz ↦ by |
| 67 | simpa only [extChartAt_source] using hz.2) |
| 68 | apply ContMDiffOn.contDiffOn |
| 69 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] |
| 70 | exact h |
| 71 | |
| 72 | set_option maxHeartbeats 1800000 in |
| 73 | theorem variationEndpointAcceleration_chart {J : Set ℝ} {F : RicciFlow n M J} |
| 74 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 75 | (V : LVariation F T τ₁ τ₂ p) (D : LVariationDerivativeData V) |
| 76 | {x : M} {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) |
| 77 | (hx : V.baseSquareCurve s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 78 | variationEndpointAcceleration V D s hs = |
| 79 | chartFrame x |
| 80 | (coordinatePartialU (coordinatePartialU (variationChart V x)) (s, 0) + |
| 81 | closedChartChristoffel F T x (sqrtParameterInterval τ₁ τ₂) |
| 82 | (s, variationChart V x (s, 0)) |
| 83 | (coordinatePartialU (variationChart V x) (s, 0)) |
| 84 | (coordinatePartialU (variationChart V x) (s, 0))) (V.baseSquareCurve s) := by |
| 85 | let C := sqrtParameterInterval τ₁ τ₂ |
| 86 | let Ω := variationChartDomain V x |
| 87 | let q := variationChart V x |
| 88 | let α := V.squareFamily s |
| 89 | let U := (fun u : ℝ ↦ (s, u)) ⁻¹' Ω |
| 90 | let c := fun u : ℝ ↦ coordinatePartialU q (s, u) |
| 91 | have hΩ : IsOpen Ω := variationChartDomain_open V x |
| 92 | have hq : ContDiffOn ℝ ∞ q Ω := variationChart_contDiffOn V x |
| 93 | have hU : IsOpen U := hΩ.preimage (continuous_const.prodMk continuous_id) |
| 94 | have hzero : (0 : ℝ) ∈ V.parameterDomain := ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 95 | have hzeroU : (0 : ℝ) ∈ U := ⟨V.square_contains ⟨hs, hzero⟩, hx⟩ |
| 96 | have hc : ContDiffOn ℝ ∞ c U := |
| 97 | (coordinatePartialU_contDiffOn hΩ q hq).comp |
| 98 | (contDiffOn_const.prodMk contDiffOn_id) (fun u hu ↦ hu) |
| 99 | have hα (u : ℝ) (hu : u ∈ U) : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α u := |
| 100 | (((V.square_smooth (s, u) hu.1).contMDiffAt |
| 101 | (V.square_open.mem_nhds hu.1)).mdifferentiableAt (by simp)).comp u |
| 102 | (mdifferentiableAt_const.prodMk mdifferentiableAt_id) |
| 103 | have hsrc : MapsTo α (V.parameterDomain ∩ U) |
| 104 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source := fun u hu ↦ hu.2.2 |
| 105 | have hfield (u : ℝ) (hu : u ∈ V.parameterDomain ∩ U) : |
| 106 | chartFrame x (c u) (α u) = curveVelocityWithin (n := n) α V.parameterDomain u := by |
| 107 | have hd := (coordinateSlice_snd_hasDerivAt q |
| 108 | (((hq (s, u) hu.2).contDiffAt (hΩ.mem_nhds hu.2)).differentiableAt (by simp))).deriv |
| 109 | change deriv ((extChartAt (𝓡 n) x) ∘ α) u = c u at hd |
| 110 | rw [← hd, chartFrame_curveVelocity (hsrc hu) (hα u hu.2)] |
| 111 | unfold curveVelocityWithin curveVelocity |
| 112 | change (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) α u) 1 = |
| 113 | (mfderivWithin (𝓘(ℝ, ℝ)) (𝓡 n) α (Ioo (-V.radius) V.radius) u) 1 |
| 114 | rw [mfderivWithin_of_mem_nhds (isOpen_Ioo.mem_nhds hu.1)] |
| 115 | have hpb := pullbackCovariantDerivative_chart_formula_local F (fun _ ↦ T - s ^ 2) |
| 116 | hU x α c hc hsrc _ hfield (D.endpoint_extension s hs) hzero hzeroU |
| 117 | (isOpen_Ioo.uniqueDiffWithinAt hzero) (hα 0 hzeroU) |
| 118 | have hdc := (coordinateSlice_snd_hasDerivAt (coordinatePartialU q) |
| 119 | ((((coordinatePartialU_contDiffOn hΩ q hq) (s, 0) hzeroU).contDiffAt |
| 120 | (hΩ.mem_nhds hzeroU)).differentiableAt (by simp))).deriv |
| 121 | have hdq := (coordinateSlice_snd_hasDerivAt q |
| 122 | (((hq (s, 0) hzeroU).contDiffAt (hΩ.mem_nhds hzeroU)).differentiableAt (by simp))).deriv |
| 123 | change deriv c 0 = coordinatePartialU (coordinatePartialU q) (s, 0) at hdc |
| 124 | change deriv ((extChartAt (𝓡 n) x) ∘ α) 0 = coordinatePartialU q (s, 0) at hdq |
| 125 | have htime (r : ℝ) (hr : r ∈ C) : T - r ^ 2 ∈ J := by |
| 126 | apply p.time_mem |
| 127 | have hr0 : 0 ≤ r := (Real.sqrt_nonneg τ₁).trans hr.1 |
| 128 | constructor |
| 129 | · nlinarith [Real.sq_sqrt p.nonnegative, Real.sqrt_nonneg τ₁, hr.1] |
| 130 | · nlinarith [Real.sq_sqrt (p.nonnegative.trans p.ordered.le), Real.sqrt_nonneg τ₂, hr.2] |
| 131 | change variationEndpointAcceleration V D s hs = _ at hpb |
| 132 | rw [hpb, hdc, hdq] |
| 133 | change chartFrame x (coordinatePartialU (coordinatePartialU q) (s, 0)) |
| 134 | (V.baseSquareCurve s) + |
| 135 | (F.connection (T - s ^ 2)).connection |
| 136 | (chartFrame x (coordinatePartialU q (s, 0))) (V.baseSquareCurve s) |
| 137 | (chartFrame x (coordinatePartialU q (s, 0)) (V.baseSquareCurve s)) = _ |
| 138 | rw [closedChartChristoffel_connection F T htime hx hs] |
| 139 | exact ((trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 140 | (TangentSpace (𝓡 n)) x).symmL ℝ (V.baseSquareCurve s)).map_add _ _ |>.symm |
| 141 | |
| 142 | end PoincareMT.LGeometry |