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.Jacobi.JacobiLocalExistence |
| 2 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/JacobiLocalUniqueness.lean` at |
| 4 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 5 | |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | noncomputable section |
| 11 | |
| 12 | open Set Filter Topology |
| 13 | open scoped Manifold ContDiff Bundle |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.LGeometry |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 21 | |
| 22 | local instance jacobiUniqueDualGroup : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 23 | ContinuousLinearMap.toNormedAddCommGroup |
| 24 | local instance jacobiUniqueDualSpace : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 25 | ContinuousLinearMap.toNormedSpace |
| 26 | local instance jacobiUniqueBilinGroup : |
| 27 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 28 | ContinuousLinearMap.toNormedAddCommGroup |
| 29 | local instance jacobiUniqueBilinSpace : |
| 30 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 31 | ContinuousLinearMap.toNormedSpace |
| 32 | |
| 33 | def chartPairCoordinates (x : M) (α : ℝ → M) |
| 34 | (z : ℝ → EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)) (s : ℝ) : |
| 35 | EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n) := |
| 36 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 37 | ((e (Bundle.TotalSpace.mk' (E := TangentSpace (𝓡 n)) |
| 38 | (EuclideanSpace ℝ (Fin n)) (α s) (z s).1)).2, |
| 39 | (e (Bundle.TotalSpace.mk' (E := TangentSpace (𝓡 n)) |
| 40 | (EuclideanSpace ℝ (Fin n)) (α s) (z s).2)).2) |
| 41 | |
| 42 | theorem chartFrame_coordinates_at {x y : M} |
| 43 | (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 44 | (v : TangentSpace (𝓡 n) y) : |
| 45 | chartFrame x |
| 46 | ((trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 47 | (Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) y v)).2) y = v := by |
| 48 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 49 | change e.symmL ℝ y ((e (Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) y v)).2) = v |
| 50 | rw [e.symmL_apply (R := ℝ) hy] |
| 51 | exact e.symm_apply_apply_mk hy v |
| 52 | |
| 53 | theorem chartFrame_injective_of_mem {x y : M} |
| 54 | (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 55 | Function.Injective (fun v : EuclideanSpace ℝ (Fin n) ↦ chartFrame x v y) := by |
| 56 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 57 | intro v w hvw |
| 58 | have h := congrArg (e.continuousLinearMapAt ℝ y) hvw |
| 59 | change e.continuousLinearMapAt ℝ y (e.symmL ℝ y v) = |
| 60 | e.continuousLinearMapAt ℝ y (e.symmL ℝ y w) at h |
| 61 | simpa only [e.continuousLinearMapAt_symmL hy] using h |
| 62 | |
| 63 | theorem IsJacobiPairOn.chart_coordinates_smooth {J S : Set ℝ} {F : RicciFlow n M J} |
| 64 | {T a b : ℝ} {α : ℝ → M} |
| 65 | {z : ℝ → EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)} |
| 66 | (h : IsJacobiPairOn F T α S a b z) (x : M) |
| 67 | (hsrc : MapsTo α (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 68 | ContDiffOn ℝ ∞ (chartPairCoordinates x α z) (Icc a b) := by |
| 69 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 70 | have hfirst := e.contMDiffOn.comp h.first_smooth (fun s hs ↦ e.mem_source.mpr (hsrc hs)) |
| 71 | have hsecond := e.contMDiffOn.comp h.second_smooth (fun s hs ↦ e.mem_source.mpr (hsrc hs)) |
| 72 | exact (ContMDiffOn.contDiffOn (fun s hs ↦ (hfirst s hs).snd)).prodMk |
| 73 | (ContMDiffOn.contDiffOn (fun s hs ↦ (hsecond s hs).snd)) |
| 74 | |
| 75 | set_option maxHeartbeats 2500000 in |
| 76 | theorem IsJacobiPairOn.chart_phase {J U : Set ℝ} {F : RicciFlow n M J} |
| 77 | (hM04 : RicciFlowCurvatureTheory.{u}) {T A B a b : ℝ} {α : ℝ → M} |
| 78 | {z : ℝ → EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)} |
| 79 | (h : IsJacobiPairOn F T α (Icc A B) a b z) (hAB : A < B) |
| 80 | (htime : ∀ s ∈ Icc A B, T - s ^ 2 ∈ J) |
| 81 | (x : M) (hU : IsOpen U) (hCU : Icc a b ⊆ U) |
| 82 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 83 | (hsrc : MapsTo α (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 84 | ∀ s ∈ Icc a b, HasDerivWithinAt (chartPairCoordinates x α z) |
| 85 | (jacobiAlongPhase F T x (Icc A B) α s (chartPairCoordinates x α z s)) (Icc a b) s := by |
| 86 | let v := chartPairCoordinates x α z |
| 87 | have hv : ContDiffOn ℝ ∞ v (Icc a b) := h.chart_coordinates_smooth x hsrc |
| 88 | have hframe₁ : ∀ s ∈ Icc a b, chartFrame x (v s).1 (α s) = (z s).1 := |
| 89 | fun s hs ↦ chartFrame_coordinates_at (hsrc hs) (z s).1 |
| 90 | have hframe₂ : ∀ s ∈ Icc a b, chartFrame x (v s).2 (α s) = (z s).2 := |
| 91 | fun s hs ↦ chartFrame_coordinates_at (hsrc hs) (z s).2 |
| 92 | obtain ⟨EY, EP, hY, hP⟩ := h.equations |
| 93 | intro s hs |
| 94 | have hαs := ((hα s (hCU hs)).contMDiffAt (hU.mem_nhds (hCU hs))).mdifferentiableAt (by simp) |
| 95 | let dy := derivWithin (fun r ↦ (v r).1) (Icc a b) s |
| 96 | let dp := derivWithin (fun r ↦ (v r).2) (Icc a b) s |
| 97 | have hdy : HasDerivWithinAt (fun r ↦ (v r).1) dy (Icc a b) s := |
| 98 | ((hv.fst.differentiableOn (by simp)) s hs).hasDerivWithinAt |
| 99 | have hdp : HasDerivWithinAt (fun r ↦ (v r).2) dp (Icc a b) s := |
| 100 | ((hv.snd.differentiableOn (by simp)) s hs).hasDerivWithinAt |
| 101 | have hDY := pullbackCovariantDerivative_closedChart_formula F T h.ordered h.interval_subset |
| 102 | htime x α (fun r ↦ (v r).1) hv.fst hsrc (fun r ↦ (z r).1) hframe₁ EY hs dy hdy hαs |
| 103 | have hDP := pullbackCovariantDerivative_closedChart_formula F T h.ordered h.interval_subset |
| 104 | htime x α (fun r ↦ (v r).2) hv.snd hsrc (fun r ↦ (z r).2) hframe₂ EP hs dp hdp hαs |
| 105 | have hq : extChartAt (𝓡 n) x (α s) ∈ (extChartAt (𝓡 n) x).target := |
| 106 | (extChartAt (𝓡 n) x).map_source (by simpa only [extChartAt_source] using hsrc hs) |
| 107 | have hfirst : dy = (v s).2 - jacobiAlongConnection F T x (Icc A B) α s (v s).1 := by |
| 108 | apply eq_sub_iff_add_eq.mpr |
| 109 | apply chartFrame_injective_of_mem (hsrc hs) |
| 110 | exact hDY.symm.trans ((hY s hs).trans (hframe₂ s hs).symm) |
| 111 | have hsecond (w : EuclideanSpace ℝ (Fin n)) : |
| 112 | chartActionMetric F T x (s, extChartAt (𝓡 n) x (α s)) |
| 113 | (dp + jacobiAlongConnection F T x (Icc A B) α s (v s).2) w = |
| 114 | jacobiAlongPotential F T x (Icc A B) α s (v s).1 w - |
| 115 | jacobiAlongMetricTime F T x (Icc A B) α s (v s).2 w := by |
| 116 | have hr := hP s hs (chartFrame x w (α s)) |
| 117 | rw [hDP, ← hframe₁ s hs, ← hframe₂ s hs] at hr |
| 118 | rw [jacobiPairResidual_chart F hM04 T hAB htime x α (h.interval_subset hs) |
| 119 | (hsrc hs) hαs] at hr |
| 120 | change chartActionMetric F T x (s, extChartAt (𝓡 n) x (α s)) |
| 121 | (dp + jacobiAlongConnection F T x (Icc A B) α s (v s).2) w - |
| 122 | jacobiAlongPotential F T x (Icc A B) α s (v s).1 w + |
| 123 | jacobiAlongMetricTime F T x (Icc A B) α s (v s).2 w = 0 at hr |
| 124 | linarith |
| 125 | have heq := covariantLinearPhaseOperator_eq_of_pair (jacobiAlongSharp F T x α s) |
| 126 | (chartActionMetric F T x (s, extChartAt (𝓡 n) x (α s))) |
| 127 | (chartMetricDualInverse_left F T x hq) |
| 128 | (jacobiAlongConnection F T x (Icc A B) α s) |
| 129 | (jacobiAlongPotential F T x (Icc A B) α s) |
| 130 | (jacobiAlongMetricTime F T x (Icc A B) α s) |
| 131 | (v s).1 (v s).2 dy dp hfirst hsecond |
| 132 | change HasDerivWithinAt v (covariantLinearPhaseOperator (jacobiAlongSharp F T x α s) |
| 133 | (jacobiAlongConnection F T x (Icc A B) α s) |
| 134 | (jacobiAlongPotential F T x (Icc A B) α s) |
| 135 | (jacobiAlongMetricTime F T x (Icc A B) α s) ((v s).1, (v s).2)) (Icc a b) s |
| 136 | rw [← heq] |
| 137 | simpa only [Prod.eta] using hdy.prodMk hdp |
| 138 | |
| 139 | theorem chartJacobiPairOn_unique {J U : Set ℝ} {F : RicciFlow n M J} |
| 140 | (hM04 : RicciFlowCurvatureTheory.{u}) {T A B a b t₀ : ℝ} {α : ℝ → M} |
| 141 | {f g : ℝ → EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)} |
| 142 | (hf : IsJacobiPairOn F T α (Icc A B) a b f) |
| 143 | (hg : IsJacobiPairOn F T α (Icc A B) a b g) (hAB : A < B) |
| 144 | (htime : ∀ s ∈ Icc A B, T - s ^ 2 ∈ J) |
| 145 | (x : M) (hU : IsOpen U) (hCU : Icc a b ⊆ U) |
| 146 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 147 | (hsrc : MapsTo α (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 148 | (ht₀ : t₀ ∈ Icc a b) (hinit : f t₀ = g t₀) : EqOn f g (Icc a b) := by |
| 149 | obtain ⟨hB, hC, hV, hH⟩ := jacobiAlongCoefficients_contDiffOn F hM04 T x α |
| 150 | (uniqueDiffOn_Icc hAB) htime hf.interval_subset hU hCU hα hsrc |
| 151 | have hcoordinit : chartPairCoordinates x α f t₀ = chartPairCoordinates x α g t₀ := by |
| 152 | unfold chartPairCoordinates |
| 153 | rw [hinit] |
| 154 | have heq := covariant_linear_phase_unique (jacobiAlongSharp F T x α) |
| 155 | (jacobiAlongConnection F T x (Icc A B) α) (jacobiAlongPotential F T x (Icc A B) α) |
| 156 | (jacobiAlongMetricTime F T x (Icc A B) α) hB hC hV hH ht₀ |
| 157 | (hf.chart_phase hM04 hAB htime x hU hCU hα hsrc) |
| 158 | (hg.chart_phase hM04 hAB htime x hU hCU hα hsrc) hcoordinit |
| 159 | intro s hs |
| 160 | apply Prod.ext |
| 161 | · have h₁ := congrArg (fun v : EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n) ↦ |
| 162 | chartFrame x v.1 (α s)) (heq hs) |
| 163 | exact (chartFrame_coordinates_at (hsrc hs) (f s).1).symm.trans |
| 164 | (h₁.trans (chartFrame_coordinates_at (hsrc hs) (g s).1)) |
| 165 | · have h₂ := congrArg (fun v : EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n) ↦ |
| 166 | chartFrame x v.2 (α s)) (heq hs) |
| 167 | exact (chartFrame_coordinates_at (hsrc hs) (f s).2).symm.trans |
| 168 | (h₂.trans (chartFrame_coordinates_at (hsrc hs) (g s).2)) |
| 169 | |
| 170 | end PoincareMT.LGeometry |