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.CurvePhase |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.ODE.GeometricODE |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.VelocityRestriction |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.ODE.SquareChartAtFlow |
| 5 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.ODE.OpenODEUniqueness |
| 6 | |
| 7 | /-! |
| 8 | # Uniqueness of regularized geometric curves |
| 9 | |
| 10 | The actual tangent phase determines a local solution. Chart uniqueness |
| 11 | then propagates through an open preconnected parameter domain, as in the |
| 12 | construction of the L-exponential family in Morgan--Tian Chapter 6. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option maxSynthPendingDepth 3 |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.ReducedLength |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 26 | [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 29 | |
| 30 | set_option backward.isDefEq.respectTransparency false in |
| 31 | theorem regularizedCurve_eventuallyEq {J : Set ℝ} (F : RicciFlow n M J) |
| 32 | (hM04 : RicciFlowCurvatureTheory.{u}) (T b : ℝ) (hb : 0 < b) |
| 33 | (hwindow : Set.Icc (T - b) T ⊆ J) (γ δ : ℝ → M) |
| 34 | (I : Set ℝ) (hI : IsOpen I) (htime : I ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 35 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ I) |
| 36 | (hδ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ δ I) |
| 37 | (Eγ : ParametricAlongCurveExtensionOn (n := n) I γ (curveVelocityWithin (n := n) γ I)) |
| 38 | (Eδ : ParametricAlongCurveExtensionOn (n := n) I δ (curveVelocityWithin (n := n) δ I)) |
| 39 | (heγ : ∀ s ∈ I, regularizedLGeodesicEquation F T γ I Eγ s) |
| 40 | (heδ : ∀ s ∈ I, regularizedLGeodesicEquation F T δ I Eδ s) |
| 41 | (s0 : ℝ) (hs0 : s0 ∈ I) |
| 42 | (hphase : curvePhase (n := n) γ s0 = curvePhase (n := n) δ s0) : |
| 43 | γ =ᶠ[𝓝 s0] δ := by |
| 44 | let p := γ s0 |
| 45 | let e := chartAt V p |
| 46 | have hbase : γ s0 = δ s0 := congrArg Bundle.TotalSpace.proj hphase |
| 47 | have hvel : (curveVelocity γ s0 : V) = (curveVelocity δ s0 : V) := |
| 48 | congrArg (fun z : TangentBundle (𝓡 n) M ↦ (z.2 : V)) hphase |
| 49 | let K := (I ∩ γ ⁻¹' e.source) ∩ (I ∩ δ ⁻¹' e.source) |
| 50 | have hK : IsOpen K := (hγ.continuousOn.isOpen_inter_preimage hI e.open_source).inter |
| 51 | (hδ.continuousOn.isOpen_inter_preimage hI e.open_source) |
| 52 | have hsK : s0 ∈ K := by |
| 53 | refine ⟨⟨hs0, mem_chart_source V p⟩, hs0, ?_⟩ |
| 54 | change δ s0 ∈ e.source |
| 55 | rw [← hbase] |
| 56 | exact mem_chart_source V p |
| 57 | have hKI : K ⊆ I := fun _ ht ↦ ht.1.1 |
| 58 | have hγd : ∀ t ∈ I, MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ t := |
| 59 | fun t ht ↦ (hγ.contMDiffAt (hI.mem_nhds ht)).mdifferentiableAt (by simp) |
| 60 | have hδd : ∀ t ∈ I, MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) δ t := |
| 61 | fun t ht ↦ (hδ.contMDiffAt (hI.mem_nhds ht)).mdifferentiableAt (by simp) |
| 62 | let EγK := restrictVelocityExtension γ I K hKI hI.uniqueDiffOn hK.uniqueDiffOn hγd Eγ |
| 63 | let EδK := restrictVelocityExtension δ I K hKI hI.uniqueDiffOn hK.uniqueDiffOn hδd Eδ |
| 64 | let a : ℝ → V := fun t ↦ e (γ t) |
| 65 | let c : ℝ → V := fun t ↦ e (δ t) |
| 66 | let f : ℝ → V × V := fun t ↦ (a t, deriv a t) |
| 67 | let g : ℝ → V × V := fun t ↦ (c t, deriv c t) |
| 68 | let S : Set (ℝ × (V × V)) := |
| 69 | {z | z.1 ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b) ∧ z.2.1 ∈ e.target} |
| 70 | let field := regularizedCoordinatePhase (squareChartMetric F T p) (squareChartScalar F T p) |
| 71 | have hS : IsOpen S := (isOpen_Ioo.prod e.open_target).preimage |
| 72 | (continuous_fst.prodMk (continuous_fst.comp continuous_snd)) |
| 73 | have hfield : ContDiffOn ℝ 1 field S := |
| 74 | (regularizedCoordinatePhase_smooth _ _ |
| 75 | (Set.Ioo (-Real.sqrt b) (Real.sqrt b) ×ˢ e.target) |
| 76 | (isOpen_Ioo.prod e.open_target) |
| 77 | (squareChartMetric_smooth F T b hb hwindow p) |
| 78 | (squareChartScalar_smooth F hM04 T b hb hwindow p) |
| 79 | (fun z hz v hv ↦ squareChartMetric_pos F T p z hz.2 v hv)).of_le (by simp) |
| 80 | have hf : ∀ t ∈ K, (t, f t) ∈ S ∧ HasDerivAt f (field (t, f t)) t := by |
| 81 | intro t ht |
| 82 | refine ⟨⟨htime (hKI ht), e.map_source ht.1.2⟩, ?_⟩ |
| 83 | exact regularizedCurve_chart_hasDerivAt F hM04 T b hb hwindow p γ K hK |
| 84 | (hγ.mono hKI) (fun r hr ↦ hr.1.2) EγK t ht (htime (hKI ht)) |
| 85 | (regularizedEquation_restrict F T γ I K hKI hI.uniqueDiffOn hK.uniqueDiffOn |
| 86 | hγd Eγ t ht (heγ t (hKI ht))) |
| 87 | have hg : ∀ t ∈ K, (t, g t) ∈ S ∧ HasDerivAt g (field (t, g t)) t := by |
| 88 | intro t ht |
| 89 | refine ⟨⟨htime (hKI ht), e.map_source ht.2.2⟩, ?_⟩ |
| 90 | exact regularizedCurve_chart_hasDerivAt F hM04 T b hb hwindow p δ K hK |
| 91 | (hδ.mono hKI) (fun r hr ↦ hr.2.2) EδK t ht (htime (hKI ht)) |
| 92 | (regularizedEquation_restrict F T δ I K hKI hI.uniqueDiffOn hK.uniqueDiffOn |
| 93 | hδd Eδ t ht (heδ t (hKI ht))) |
| 94 | have h0 : f s0 = g s0 := by |
| 95 | apply Prod.ext |
| 96 | · exact congrArg e hbase |
| 97 | · change deriv a s0 = deriv c s0 |
| 98 | rw [(hasDerivAt_chart_curve p γ s0 hsK.1.2 (hγd s0 hs0)).deriv, |
| 99 | (hasDerivAt_chart_curve p δ s0 hsK.2.2 (hδd s0 hs0)).deriv] |
| 100 | exact congrArg₂ (fun (q : M) (v : V) ↦ (mfderiv (𝓡 n) (𝓡 n) e q) v) hbase hvel |
| 101 | have hfg := openODE_eventuallyEq S hS field hfield f g s0 (hf s0 hsK).1 h0 |
| 102 | (Filter.Eventually.mono (hK.mem_nhds hsK) (fun t ht ↦ hf t ht)) |
| 103 | (Filter.Eventually.mono (hK.mem_nhds hsK) (fun t ht ↦ hg t ht)) |
| 104 | filter_upwards [hK.mem_nhds hsK, hfg] with t ht he |
| 105 | exact e.injOn ht.1.2 ht.2.2 (congrArg Prod.fst he) |
| 106 | |
| 107 | theorem regularizedCurve_phase_eqOn {J : Set ℝ} [T2Space M] (F : RicciFlow n M J) |
| 108 | (hM04 : RicciFlowCurvatureTheory.{u}) (T b : ℝ) (hb : 0 < b) |
| 109 | (hwindow : Set.Icc (T - b) T ⊆ J) (γ δ : ℝ → M) |
| 110 | (I : Set ℝ) (hI : IsOpen I) (hconn : IsPreconnected I) |
| 111 | (htime : I ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 112 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ I) |
| 113 | (hδ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ δ I) |
| 114 | (Eγ : ParametricAlongCurveExtensionOn (n := n) I γ (curveVelocityWithin (n := n) γ I)) |
| 115 | (Eδ : ParametricAlongCurveExtensionOn (n := n) I δ (curveVelocityWithin (n := n) δ I)) |
| 116 | (heγ : ∀ s ∈ I, regularizedLGeodesicEquation F T γ I Eγ s) |
| 117 | (heδ : ∀ s ∈ I, regularizedLGeodesicEquation F T δ I Eδ s) |
| 118 | (s0 : ℝ) (hs0 : s0 ∈ I) |
| 119 | (hphase : curvePhase (n := n) γ s0 = curvePhase (n := n) δ s0) : |
| 120 | Set.EqOn (curvePhase (n := n) γ) (curvePhase (n := n) δ) I := by |
| 121 | letI : T2Space (TangentBundle (𝓡 n) M) := tangentBundle_t2Space |
| 122 | letI : PreconnectedSpace I := isPreconnected_iff_preconnectedSpace.mp hconn |
| 123 | let A : Set I := {s | curvePhase (n := n) γ s = curvePhase (n := n) δ s} |
| 124 | have hclosed : IsClosed A := isClosed_eq |
| 125 | (curvePhase_contMDiffOn γ I hI hγ).continuousOn.domRestrict |
| 126 | (curvePhase_contMDiffOn δ I hI hδ).continuousOn.domRestrict |
| 127 | have hopen : IsOpen A := by |
| 128 | apply isOpen_iff_mem_nhds.mpr |
| 129 | intro t ht |
| 130 | have hlocal := regularizedCurve_eventuallyEq F hM04 T b hb hwindow γ δ I hI |
| 131 | htime hγ hδ Eγ Eδ heγ heδ t t.property ht |
| 132 | exact continuousAt_subtype_val.preimage_mem_nhds (curvePhase_eventuallyEq hlocal) |
| 133 | have hAll : A = Set.univ := IsClopen.eq_univ ⟨hclosed, hopen⟩ ⟨⟨s0, hs0⟩, hphase⟩ |
| 134 | intro t ht |
| 135 | have hm : (⟨t, ht⟩ : I) ∈ A := by rw [hAll]; trivial |
| 136 | exact hm |
| 137 | |
| 138 | end PoincareMT.ReducedLength |