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.Regularity.EndpointEulerEquation |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Extension.GlobalCurveExtension |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/EndpointExtensionGluing.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | |
| 16 | universe u v |
| 17 | |
| 18 | namespace PoincareMT.LGeometry |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | def restrictParametricVelocityExtension {C U : Set ℝ} (hU : IsOpen U) |
| 24 | (hCU : C ⊆ U) (hC : UniqueDiffOn ℝ C) (α : ℝ → M) |
| 25 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 26 | (E : ParametricAlongCurveExtensionOn U α (curveVelocityWithin (n := n) α U)) : |
| 27 | ParametricAlongCurveExtensionOn C α (curveVelocityWithin (n := n) α C) where |
| 28 | extension := E.extension |
| 29 | domain := E.domain |
| 30 | open_domain := E.open_domain |
| 31 | graph_mem s hs := E.graph_mem s (hCU hs) |
| 32 | smooth := E.smooth |
| 33 | agrees s hs := (E.agrees s (hCU hs)).trans |
| 34 | (curveVelocityWithin_eq_of_uniqueDiff hU hCU hC α hα hs).symm |
| 35 | |
| 36 | theorem restrictParametricVelocityExtension_equation {J C U : Set ℝ} |
| 37 | (F : RicciFlow n M J) (T : ℝ) (hU : IsOpen U) |
| 38 | (hCU : C ⊆ U) (hC : UniqueDiffOn ℝ C) (α : ℝ → M) |
| 39 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 40 | (E : ParametricAlongCurveExtensionOn U α (curveVelocityWithin (n := n) α U)) |
| 41 | {s : ℝ} (hs : s ∈ C) (heq : regularizedLGeodesicEquation F T α U E s) : |
| 42 | regularizedLGeodesicEquation F T α C |
| 43 | (restrictParametricVelocityExtension hU hCU hC α hα E) s := by |
| 44 | intro W |
| 45 | unfold regularizedEulerResidual pullbackCovariantDerivative restrictParametricVelocityExtension |
| 46 | rw [curveVelocityWithin_eq_of_uniqueDiff hU hCU hC α hα hs] |
| 47 | exact heq W |
| 48 | |
| 49 | theorem exists_local_velocityExtension_of_smooth {U : Set ℝ} (hU : IsOpen U) |
| 50 | (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) {s : ℝ} (hs : s ∈ U) : |
| 51 | ∃ V : Set ℝ, IsOpen V ∧ s ∈ V ∧ V ⊆ U ∧ |
| 52 | Nonempty (ParametricAlongCurveExtensionOn V α (curveVelocityWithin (n := n) α V)) := by |
| 53 | let x := α s |
| 54 | let V := U ∩ α ⁻¹' (chartAt (EuclideanSpace ℝ (Fin n)) x).source |
| 55 | have hV : IsOpen V := hα.continuousOn.isOpen_inter_preimage hU |
| 56 | (chartAt (EuclideanSpace ℝ (Fin n)) x).open_source |
| 57 | exact ⟨V, hV, ⟨hs, mem_chart_source _ _⟩, inter_subset_left, |
| 58 | ⟨chartVelocityExtension hV x α (hα.mono inter_subset_left) (fun _ hr ↦ hr.2)⟩⟩ |
| 59 | |
| 60 | variable {ι : Type v} |
| 61 | |
| 62 | theorem gluedParametricExtension_equation_at {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) |
| 63 | (I : TopologicalSpace.Opens ℝ) |
| 64 | (ρ : SmoothPartitionOfUnity ι (𝓘(ℝ, ℝ)) I univ) |
| 65 | (U : ι → Set ℝ) (hU : ∀ i, IsOpen (U i)) (α : ℝ → M) |
| 66 | (E : ∀ i, ParametricAlongCurveExtensionOn (U i) α |
| 67 | (curveVelocityWithin (n := n) α (U i))) |
| 68 | (hρ : ρ.IsSubordinate (fun i ↦ (Subtype.val : I → ℝ) ⁻¹' U i)) |
| 69 | (s : I) (heq : ∀ i ∈ ρ.fintsupport s, |
| 70 | regularizedLGeodesicEquation F T α (U i) (E i) s) : |
| 71 | regularizedLGeodesicEquation F T α I |
| 72 | (gluedParametricExtension I ρ U hU α E hρ) s := by |
| 73 | intro W |
| 74 | let G := (F.metric (T - (s : ℝ) ^ 2)).inner (α s) |
| 75 | let V (i : ι) := pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α |
| 76 | (curveVelocityWithin (n := n) α (U i)) (U i) (E i) s |
| 77 | let R := scalarCurvatureDifferential F (fun r ↦ T - r ^ 2) α s W |
| 78 | let C := 4 * (s : ℝ) * (F.connection (T - (s : ℝ) ^ 2)).ricci (α s) |
| 79 | (curveVelocityWithin (n := n) α I s) W |
| 80 | let B := 2 * (s : ℝ) ^ 2 * R - C |
| 81 | have hS := (timePartitionWeight_eventually_support_subset I ρ s).self_of_nhds |
| 82 | have hinnerLocal : ∀ i ∈ ρ.fintsupport s, G (V i) W = B := by |
| 83 | intro i hi |
| 84 | have hsU : (s : ℝ) ∈ U i := hρ i ((ρ.mem_fintsupport_iff s i).mp hi) |
| 85 | have h := heq i hi W |
| 86 | unfold regularizedEulerResidual at h |
| 87 | rw [← curveVelocityWithin_eq_of_open I.isOpen (hU i) s.property hsU] at h |
| 88 | change G (V i) W - 2 * (s : ℝ) ^ 2 * R + C = 0 at h |
| 89 | dsimp only [B] |
| 90 | linarith |
| 91 | have hmetric : G (∑ i ∈ ρ.fintsupport s, timePartitionWeight I ρ i (s : ℝ) • V i) W = |
| 92 | ∑ i ∈ ρ.fintsupport s, timePartitionWeight I ρ i (s : ℝ) * G (V i) W := by |
| 93 | rw [map_sum] |
| 94 | simp only [sum_apply] |
| 95 | apply Finset.sum_congr rfl |
| 96 | intro i hi |
| 97 | rw [G.map_smul] |
| 98 | rfl |
| 99 | have hinner : G (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α |
| 100 | (curveVelocityWithin (n := n) α I) I |
| 101 | (gluedParametricExtension I ρ U hU α E hρ) s) W = B := by |
| 102 | rw [gluedParametricExtension_pullback F (fun r ↦ T - r ^ 2) I ρ U hU α E hρ s] |
| 103 | change G (∑ i ∈ ρ.fintsupport s, timePartitionWeight I ρ i (s : ℝ) • V i) W = B |
| 104 | rw [hmetric] |
| 105 | calc |
| 106 | (∑ i ∈ ρ.fintsupport s, timePartitionWeight I ρ i (s : ℝ) * G (V i) W) = |
| 107 | ∑ i ∈ ρ.fintsupport s, timePartitionWeight I ρ i (s : ℝ) * B := |
| 108 | Finset.sum_congr rfl (fun i hi ↦ congrArg |
| 109 | (fun r ↦ timePartitionWeight I ρ i (s : ℝ) * r) (hinnerLocal i hi)) |
| 110 | _ = (∑ i ∈ ρ.fintsupport s, timePartitionWeight I ρ i (s : ℝ)) * B := |
| 111 | (Finset.sum_mul ..).symm |
| 112 | _ = B := by rw [timePartitionWeight_sum_eq_one I ρ s hS, one_mul] |
| 113 | change G (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α |
| 114 | (curveVelocityWithin (n := n) α I) I |
| 115 | (gluedParametricExtension I ρ U hU α E hρ) s) W - 2 * (s : ℝ) ^ 2 * R + C = 0 |
| 116 | rw [hinner] |
| 117 | dsimp only [B] |
| 118 | ring |
| 119 | |
| 120 | theorem exists_closedEuler_extension_of_local {J : Set ℝ} (F : RicciFlow n M J) |
| 121 | (T : ℝ) {C U : Set ℝ} (hCclosed : IsClosed C) (hC : UniqueDiffOn ℝ C) |
| 122 | (hU : IsOpen U) (hCU : C ⊆ U) (α : ℝ → M) |
| 123 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 124 | (hloc : ∀ s ∈ C, ∃ V : Set ℝ, IsOpen V ∧ s ∈ V ∧ V ⊆ U ∧ |
| 125 | ∃ E : ParametricAlongCurveExtensionOn V α (curveVelocityWithin (n := n) α V), |
| 126 | ∀ r ∈ V, r ∈ C → regularizedLGeodesicEquation F T α V E r) : |
| 127 | ∃ E : ParametricAlongCurveExtensionOn C α (curveVelocityWithin (n := n) α C), |
| 128 | ∀ s ∈ C, regularizedLGeodesicEquation F T α C E s := by |
| 129 | classical |
| 130 | have hlocal (s : ℝ) (hs : s ∈ U) : |
| 131 | ∃ V : Set ℝ, IsOpen V ∧ s ∈ V ∧ V ⊆ U ∧ |
| 132 | ∃ E : ParametricAlongCurveExtensionOn V α (curveVelocityWithin (n := n) α V), |
| 133 | ∀ r ∈ V, r ∈ C → regularizedLGeodesicEquation F T α V E r := by |
| 134 | by_cases hsC : s ∈ C |
| 135 | · exact hloc s hsC |
| 136 | · obtain ⟨V, hV, hsV, hVU, ⟨E⟩⟩ := exists_local_velocityExtension_of_smooth |
| 137 | (hU.sdiff hCclosed) α (hα.mono sdiff_subset) ⟨hs, hsC⟩ |
| 138 | exact ⟨V, hV, hsV, hVU.trans sdiff_subset, E, |
| 139 | fun r hr hrC ↦ False.elim ((hVU hr).2 hrC)⟩ |
| 140 | let O : TopologicalSpace.Opens ℝ := ⟨U, hU⟩ |
| 141 | let : LocallyCompactSpace O := O.isOpen.locallyCompactSpace |
| 142 | choose V hV hsV _hsub E heq using fun s : O ↦ hlocal s s.property |
| 143 | have hcover : (univ : Set O) ⊆ ⋃ i : O, (Subtype.val : O → ℝ) ⁻¹' V i := by |
| 144 | intro s _ |
| 145 | exact mem_iUnion.mpr ⟨s, hsV s⟩ |
| 146 | obtain ⟨ρ, hρ⟩ : ∃ ρ : SmoothPartitionOfUnity O (𝓘(ℝ, ℝ)) O univ, |
| 147 | ρ.IsSubordinate (fun i ↦ (Subtype.val : O → ℝ) ⁻¹' V i) := |
| 148 | SmoothPartitionOfUnity.exists_isSubordinate (𝓘(ℝ, ℝ)) isClosed_univ _ |
| 149 | (fun i ↦ (hV i).preimage continuous_subtype_val) hcover |
| 150 | let Eg := gluedParametricExtension O ρ V hV α E hρ |
| 151 | refine ⟨restrictParametricVelocityExtension hU hCU hC α hα Eg, ?_⟩ |
| 152 | intro s hs |
| 153 | apply restrictParametricVelocityExtension_equation F T hU hCU hC α hα Eg hs |
| 154 | apply gluedParametricExtension_equation_at F T O ρ V hV α E hρ ⟨s, hCU hs⟩ |
| 155 | intro i hi |
| 156 | exact heq i s (hρ i ((ρ.mem_fintsupport_iff ⟨s, hCU hs⟩ i).mp hi)) hs |
| 157 | |
| 158 | end PoincareMT.LGeometry |
| 159 |