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.Surgery.Continuation.Construction.Terminal.Event.LimitLocal |
| 2 | |
| 3 | /-! |
| 4 | # Metric convergence through the inverse terminal source |
| 5 | -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Filter |
| 12 | open scoped Manifold ContDiff Topology |
| 13 | |
| 14 | universe u |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | open Poincare.Analysis.Calculus |
| 19 | |
| 20 | theorem RiemannianMetric.pullbackCoefficients_congr_of_eventuallyEq |
| 21 | {n : ℕ} {Y : Type*} [TopologicalSpace Y] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) Y] [IsManifold (𝓡 n) ∞ Y] |
| 23 | (g : RiemannianMetric n Y) {p q : EuclideanSpace ℝ (Fin n) → Y} |
| 24 | {x : EuclideanSpace ℝ (Fin n)} (h : p =ᶠ[𝓝 x] q) : |
| 25 | g.pullbackCoefficients p x = g.pullbackCoefficients q x := by |
| 26 | ext v w |
| 27 | change g.inner (p x) (mfderiv (𝓡 n) (𝓡 n) p x v) (mfderiv (𝓡 n) (𝓡 n) p x w) = |
| 28 | g.inner (q x) (mfderiv (𝓡 n) (𝓡 n) q x v) (mfderiv (𝓡 n) (𝓡 n) q x w) |
| 29 | rw [h.mfderiv_eq, h.self_of_nhds] |
| 30 | |
| 31 | theorem RiemannianMetric.pullbackCoefficients_eventuallyEq |
| 32 | {n : ℕ} {Y : Type*} [TopologicalSpace Y] |
| 33 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) Y] [IsManifold (𝓡 n) ∞ Y] |
| 34 | (g : RiemannianMetric n Y) {p q : EuclideanSpace ℝ (Fin n) → Y} |
| 35 | {x : EuclideanSpace ℝ (Fin n)} (h : p =ᶠ[𝓝 x] q) : |
| 36 | g.pullbackCoefficients p =ᶠ[𝓝 x] g.pullbackCoefficients q := by |
| 37 | filter_upwards [h.eventually_nhds] with y hy |
| 38 | exact g.pullbackCoefficients_congr_of_eventuallyEq hy |
| 39 | |
| 40 | namespace SingularLimitConclusion |
| 41 | |
| 42 | variable {M : Type u} [TopologicalSpace M] |
| 43 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 44 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 45 | {G : GeneralizedRicciFlowData.{u}} {T : ℝ} {H : SingularTimeAssumptions G T M} |
| 46 | (Q : SingularLimitConclusion H) [Nonempty (Q.extension.extended.slice T).carrier] |
| 47 | |
| 48 | theorem sourceInverseCoordinate_tendstoUniformlyOn |
| 49 | {V : Set (EuclideanSpace ℝ (Fin 3))} (hV : IsOpen V) |
| 50 | {p : EuclideanSpace ℝ (Fin 3) → M} |
| 51 | (hp : ContMDiffOn (𝓡 3) (𝓡 3) ∞ p V) |
| 52 | (hmap : MapsTo p V H.reference.regularLimitSet) |
| 53 | (k : ℕ) (K : Set (EuclideanSpace ℝ (Fin 3))) (hK : IsCompact K) (hKV : K ⊆ V) : |
| 54 | TendstoUniformlyOn |
| 55 | (fun t => iteratedFDeriv ℝ k ((H.reference.flow.metric t).pullbackCoefficients p)) |
| 56 | (iteratedFDeriv ℝ k |
| 57 | (Q.terminal_metric.pullbackCoefficients (Q.sourceInverse ∘ p))) (𝓝[<] T) K := by |
| 58 | have hf := Q.sourceInverse_contMDiffOn.comp hp hmap |
| 59 | have hc := Q.metric_limit_on_compacts.coordinatePullback_tendstoUniformlyOn |
| 60 | Q.terminal_source_smooth hV hf k K hK hKV |
| 61 | apply hc.congr |
| 62 | refine Eventually.of_forall fun t x hx => ?_ |
| 63 | have heq : Q.terminal_source ∘ (Q.sourceInverse ∘ p) =ᶠ[𝓝 x] p := by |
| 64 | filter_upwards [hV.mem_nhds (hKV hx)] with y hy |
| 65 | exact Q.source_sourceInverse (hmap hy) |
| 66 | exact (((H.reference.flow.metric t).pullbackCoefficients_eventuallyEq heq).iteratedFDeriv |
| 67 | ℝ k).self_of_nhds |
| 68 | |
| 69 | theorem sourceInverseCoordinate_scalar_tendstoUniformlyOn |
| 70 | {V : Set (EuclideanSpace ℝ (Fin 3))} (hV : IsOpen V) |
| 71 | {p : EuclideanSpace ℝ (Fin 3) → M} |
| 72 | (hp : ContMDiffOn (𝓡 3) (𝓡 3) ∞ p V) |
| 73 | (hmap : MapsTo p V H.reference.regularLimitSet) |
| 74 | (k : ℕ) (a b : Fin 3) (K : Set (EuclideanSpace ℝ (Fin 3))) |
| 75 | (hK : IsCompact K) (hKV : K ⊆ V) : |
| 76 | TendstoUniformlyOn |
| 77 | (fun t => iteratedFDeriv ℝ k (surgeryMetricCoefficient (H.reference.flow.metric t) p a b)) |
| 78 | (iteratedFDeriv ℝ k |
| 79 | (surgeryMetricCoefficient Q.terminal_metric (Q.sourceInverse ∘ p) a b)) (𝓝[<] T) K := by |
| 80 | let E := EuclideanSpace ℝ (Fin 3) |
| 81 | let B := E →L[ℝ] E →L[ℝ] ℝ |
| 82 | let ev := linearJetEvaluation (E := E) (B := B) (F := ℝ) k (bilinearBasisEvaluation a b) |
| 83 | have hc := ev.uniformContinuous.comp_tendstoUniformlyOn |
| 84 | (Q.sourceInverseCoordinate_tendstoUniformlyOn hV hp hmap k K hK hKV) |
| 85 | have hf := Q.sourceInverse_contMDiffOn.comp hp hmap |
| 86 | apply (hc.congr (Eventually.of_forall fun t x hx => ?_)).congr_right |
| 87 | · intro x hx |
| 88 | exact ((bilinearBasisEvaluation a b).iteratedFDeriv_comp_left |
| 89 | (Q.terminal_metric.contDiffAt_pullbackCoefficients |
| 90 | ((hf x (hKV hx)).contMDiffAt (hV.mem_nhds (hKV hx)))) |
| 91 | (by exact_mod_cast le_top)).symm |
| 92 | · exact ((bilinearBasisEvaluation a b).iteratedFDeriv_comp_left |
| 93 | ((H.reference.flow.metric t).contDiffAt_pullbackCoefficients |
| 94 | ((hp x (hKV hx)).contMDiffAt (hV.mem_nhds (hKV hx)))) |
| 95 | (by exact_mod_cast le_top)).symm |
| 96 | |
| 97 | theorem sourceInverse_surgeryMetricLimitOn : |
| 98 | SurgeryMetricLimitOn Q.referenceCarrier (Q.extension.extended.slice T) |
| 99 | H.reference.flow.metric Q.terminal_metric Q.sourceInverse H.reference.regularLimitSet T := by |
| 100 | intro q _ K hK hKt hKU k a b ε hε |
| 101 | let c := extChartAt (𝓡 3) q |
| 102 | let V := c.target ∩ c.symm ⁻¹' H.reference.regularLimitSet |
| 103 | have hV : IsOpen V := (contMDiffOn_extChartAt_symm (n := ∞) q).continuousOn.isOpen_inter_preimage |
| 104 | (isOpen_extChartAt_target q) Q.regular_open |
| 105 | have hKV : K ⊆ V := fun x hx => ⟨hKt hx, hKU ⟨x, hx, rfl⟩⟩ |
| 106 | have hp : ContMDiffOn (𝓡 3) (𝓡 3) ∞ c.symm V := |
| 107 | (contMDiffOn_extChartAt_symm (n := ∞) q).mono inter_subset_left |
| 108 | have hconv := Q.sourceInverseCoordinate_scalar_tendstoUniformlyOn hV hp |
| 109 | (fun _ hx => hx.2) k a b K hK hKV |
| 110 | have he := Metric.tendstoUniformlyOn_iff.mp hconv ε hε |
| 111 | obtain ⟨t₀, ht₀, hbound⟩ := mem_nhdsLT_iff_exists_Ioo_subset.mp he |
| 112 | refine ⟨T - t₀, sub_pos.mpr ht₀, fun t ht htT x hx => ?_⟩ |
| 113 | have h := hbound ⟨by linarith, htT⟩ x hx |
| 114 | have hcoeff : surgeryMetricCoefficient (H.reference.flow.metric t) c.symm a b = |
| 115 | singularMetricCoefficient (H.reference.flow.metric t) q a b := by |
| 116 | rfl |
| 117 | rw [hcoeff] at h |
| 118 | simpa only [dist_eq_norm, norm_sub_rev, c, Function.comp_def] using h |
| 119 | |
| 120 | end SingularLimitConclusion |
| 121 | end PoincareMT |