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.CurveShortening.Ramp.LocalFlowTheory |
| 2 | |
| 3 | /-! |
| 4 | # Locality of the actual C2 curve equation |
| 5 | |
| 6 | Restriction, equality on the time set, and gluing of closed prefixes |
| 7 | preserve every primitive C2 solution field. These are the fixed-label |
| 8 | locality steps in Claim 19.1 and Lemma 19.14, MT2007 pp. 437, 446-447. |
| 9 | See `2026-09-21-closed-continuation.md`; the corrected curvature estimate |
| 10 | used after gluing is in MT2015Correction pp. 8-9. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M63 |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {a b : ℝ} {F : RicciFlow n M (Icc a b)} {c d : ℝ → ℝ → M} {J K : Set ℝ} |
| 25 | |
| 26 | /-- The actual C2 equation restricts to a smaller time set, with its |
| 27 | own interior and included endpoints. Claim 19.1, MT2007 p. 437. -/ |
| 28 | theorem c2_restrict (hc : M63C2ShrinkingCurveOn F c J) (hK : K ⊆ J) : |
| 29 | M63C2ShrinkingCurveOn F c K where |
| 30 | domain_subset := hK.trans hc.domain_subset |
| 31 | periodic t ht := hc.periodic t (hK ht) |
| 32 | spatial_regular t ht := hc.spatial_regular t (hK ht) |
| 33 | joint_c1 := hc.joint_c1.mono (Set.prod_mono Subset.rfl (interior_mono hK)) |
| 34 | immersed t ht := hc.immersed t (hK ht) |
| 35 | continuous := hc.continuous.mono (Set.prod_mono Subset.rfl hK) |
| 36 | velocity_continuous := hc.velocity_continuous.mono (Set.prod_mono Subset.rfl hK) |
| 37 | curvature_continuous := hc.curvature_continuous.mono (Set.prod_mono Subset.rfl hK) |
| 38 | equation t ht := hc.equation t (interior_mono hK ht) |
| 39 | |
| 40 | /-- Equality of the entire parameterized curve on the time set transports |
| 41 | the actual C2 solution. Time derivatives use neighborhood equality in the |
| 42 | interior. Claim 19.1 and Lemma 19.14, MT2007 pp. 437, 446-447. -/ |
| 43 | theorem c2_congr (hc : M63C2ShrinkingCurveOn F c J) |
| 44 | (h : ∀ t ∈ J, ∀ x, d x t = c x t) : M63C2ShrinkingCurveOn F d J := by |
| 45 | have hslice (t : ℝ) (ht : t ∈ J) : (fun x => d x t) = (fun x => c x t) := |
| 46 | funext (h t ht) |
| 47 | refine |
| 48 | { domain_subset := hc.domain_subset |
| 49 | periodic := fun t ht => ?_ |
| 50 | spatial_regular := fun t ht => ?_ |
| 51 | joint_c1 := hc.joint_c1.congr (fun z hz => h z.2 (interior_subset hz.2) z.1) |
| 52 | immersed := fun t ht x => ?_ |
| 53 | continuous := hc.continuous.congr (fun z hz => h z.2 hz.2 z.1) |
| 54 | velocity_continuous := hc.velocity_continuous.congr (fun z hz => ?_) |
| 55 | curvature_continuous := hc.curvature_continuous.congr (fun z hz => ?_) |
| 56 | equation := fun t ht x => ?_ } |
| 57 | · rw [hslice t ht] |
| 58 | exact hc.periodic t ht |
| 59 | · rw [hslice t ht] |
| 60 | exact hc.spatial_regular t ht |
| 61 | · rw [hslice t ht] |
| 62 | exact hc.immersed t ht x |
| 63 | · exact congrArg (fun gamma : ℝ → M => |
| 64 | (⟨gamma z.1, curveVelocity (n := n) gamma z.1⟩ : TangentBundle (𝓡 n) M)) |
| 65 | (hslice z.2 hz.2) |
| 66 | · exact congrArg (fun gamma : ℝ → M => |
| 67 | (⟨gamma z.1, m62CurvatureVector F (fun x _ => gamma x) z.2 z.1⟩ : |
| 68 | TangentBundle (𝓡 n) M)) (hslice z.2 hz.2) |
| 69 | · have heq : (fun s => d x s) =ᶠ[𝓝 t] (fun s => c x s) := by |
| 70 | filter_upwards [isOpen_interior.mem_nhds ht] with s hs |
| 71 | exact h s (interior_subset hs) x |
| 72 | have hv : curveVelocity (n := n) (fun s => d x s) t = |
| 73 | curveVelocity (n := n) (fun s => c x s) t := by |
| 74 | unfold curveVelocity |
| 75 | rw [heq.mfderiv_eq] |
| 76 | rfl |
| 77 | have hH : m62CurvatureVector F d t x = m62CurvatureVector F c t x := |
| 78 | congrArg (fun gamma : ℝ → M => m62CurvatureVector F (fun y _ => gamma y) t x) |
| 79 | (hslice t (interior_subset ht)) |
| 80 | rw [hv, hH] |
| 81 | exact hc.equation t ht x |
| 82 | |
| 83 | /-- Closed solution prefixes reaching beyond every included time give the |
| 84 | actual half-open C2 solution. The assertion also covers an empty time set. |
| 85 | Claim 19.1 and Lemma 19.14, MT2007 pp. 437, 446-447. -/ |
| 86 | theorem c2_of_closed_prefixes {T : ℝ} |
| 87 | (hprefix : ∀ t ∈ Ico a T, ∃ s, t < s ∧ s < T ∧ |
| 88 | M63C2ShrinkingCurveOn F c (Icc a s)) : |
| 89 | M63C2ShrinkingCurveOn F c (Ico a T) := by |
| 90 | have hcont {Z : Type u} [TopologicalSpace Z] (f : ℝ × ℝ → Z) |
| 91 | (hf : ∀ s, M63C2ShrinkingCurveOn F c (Icc a s) → |
| 92 | ContinuousOn f (univ ×ˢ Icc a s)) : ContinuousOn f (univ ×ˢ Ico a T) := by |
| 93 | apply continuousOn_of_locally_continuousOn |
| 94 | intro z hz |
| 95 | obtain ⟨s, hts, _, hs⟩ := hprefix z.2 hz.2 |
| 96 | refine ⟨univ ×ˢ Iio s, isOpen_univ.prod isOpen_Iio, ⟨mem_univ _, hts⟩, ?_⟩ |
| 97 | exact (hf s hs).mono (fun y hy => ⟨mem_univ _, hy.1.2.1, hy.2.2.le⟩) |
| 98 | refine |
| 99 | { domain_subset := fun t ht => ?_ |
| 100 | periodic := fun t ht => ?_ |
| 101 | spatial_regular := fun t ht => ?_ |
| 102 | joint_c1 := ?_ |
| 103 | immersed := fun t ht => ?_ |
| 104 | continuous := hcont _ (fun _ hs => hs.continuous) |
| 105 | velocity_continuous := hcont _ (fun _ hs => hs.velocity_continuous) |
| 106 | curvature_continuous := hcont _ (fun _ hs => hs.curvature_continuous) |
| 107 | equation := fun t ht => ?_ } |
| 108 | · obtain ⟨s, hts, _, hs⟩ := hprefix t ht |
| 109 | exact hs.domain_subset ⟨ht.1, hts.le⟩ |
| 110 | · obtain ⟨s, hts, _, hs⟩ := hprefix t ht |
| 111 | exact hs.periodic t ⟨ht.1, hts.le⟩ |
| 112 | · obtain ⟨s, hts, _, hs⟩ := hprefix t ht |
| 113 | exact hs.spatial_regular t ⟨ht.1, hts.le⟩ |
| 114 | · rw [interior_Ico] |
| 115 | apply contMDiffOn_of_locally_contMDiffOn |
| 116 | intro z hz |
| 117 | obtain ⟨s, hts, _, hs⟩ := hprefix z.2 (Ioo_subset_Ico_self hz.2) |
| 118 | refine ⟨univ ×ˢ Iio s, isOpen_univ.prod isOpen_Iio, ⟨mem_univ _, hts⟩, ?_⟩ |
| 119 | apply hs.joint_c1.mono |
| 120 | rw [interior_Icc] |
| 121 | exact fun y hy => ⟨mem_univ _, hy.1.2.1, hy.2.2⟩ |
| 122 | · obtain ⟨s, hts, _, hs⟩ := hprefix t ht |
| 123 | exact hs.immersed t ⟨ht.1, hts.le⟩ |
| 124 | · rw [interior_Ico] at ht |
| 125 | obtain ⟨s, hts, _, hs⟩ := hprefix t (Ioo_subset_Ico_self ht) |
| 126 | exact hs.equation t (by rw [interior_Icc]; exact ⟨ht.1, hts⟩) |
| 127 | |
| 128 | end PoincareMT.M63 |