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.CanonicalInduction.Positive.PositiveHistoryFlow |
| 2 | |
| 3 | /-! |
| 4 | # Glue the included birth slice to an ordinary history |
| 5 | |
| 6 | Two actual ordinary flows whose metrics agree on their overlapping time |
| 7 | domains glue across the included initial endpoint. Every smoothness and |
| 8 | equation assertion is within the resulting closed interval. This is the |
| 9 | fixed-carrier gluing used on Morgan--Tian, pp. 393-394. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The two selected connections follow the same piecewise metric. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M47Positive |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | /-- An actual initial closed slab and strict-left history with identical |
| 27 | metrics on their overlap give a closed ordinary flow, including its |
| 28 | initial within-domain equation; MT pp. 35, 61 and 393-394. -/ |
| 29 | theorem exists_closed_flow_of_initial_overlap |
| 30 | {a b c : ℝ} (hac : a < c) (hcb : c ≤ b) |
| 31 | (F0 : RicciFlow n M (Icc a c)) (F1 : RicciFlow n M (Ioc a b)) |
| 32 | (hmetric : ∀ t ∈ Ioc a c, F0.metric t = F1.metric t) : |
| 33 | ∃ G : RicciFlow n M (Icc a b), |
| 34 | (∀ t ∈ Icc a c, G.metric t = F0.metric t) ∧ |
| 35 | (∀ t ∈ Ioc a b, G.metric t = F1.metric t) := by |
| 36 | classical |
| 37 | let g (t : ℝ) := if t ≤ a then F0.metric t else F1.metric t |
| 38 | let D (t : ℝ) : LeviCivitaData (g t) := by |
| 39 | dsimp only [g] |
| 40 | split_ifs |
| 41 | · exact F0.connection t |
| 42 | · exact F1.connection t |
| 43 | have hg0 (t : ℝ) (ht : t ∈ Icc a c) : g t = F0.metric t := by |
| 44 | dsimp only [g] |
| 45 | split_ifs with hta |
| 46 | · rfl |
| 47 | · exact (hmetric t ⟨lt_of_not_ge hta, ht.2⟩).symm |
| 48 | have hg1 (t : ℝ) (ht : t ∈ Ioc a b) : g t = F1.metric t := |
| 49 | if_neg (not_le_of_gt ht.1) |
| 50 | have hricci {g₀ g₁ : RiemannianMetric n M} (D₀ : LeviCivitaData g₀) |
| 51 | (D₁ : LeviCivitaData g₁) (heq : g₀ = g₁) (x : M) |
| 52 | (v w : TangentSpace (𝓡 n) x) : D₀.ricci x v w = D₁.ricci x v w := by |
| 53 | subst g₁ |
| 54 | have h := D₀.ricci_eq_of_local_isometry D₁ (f := id) isOpen_univ |
| 55 | contMDiff_id.contMDiffOn |
| 56 | (fun _ _ _ _ => by simp only [mfderiv_id]; rfl) |
| 57 | (mem_univ x) v w |
| 58 | simp only [mfderiv_id] at h |
| 59 | convert h using 1 |
| 60 | rfl |
| 61 | have hsm0 : RiemannianMetric.IsSmoothFamilyOn g (Icc a c) := by |
| 62 | apply F0.smooth.congr |
| 63 | intro p hp |
| 64 | rw [hg0 p.1 hp.1] |
| 65 | have hsm1 : RiemannianMetric.IsSmoothFamilyOn g (Ioc a b) := by |
| 66 | apply F1.smooth.congr |
| 67 | intro p hp |
| 68 | rw [hg1 p.1 hp.1] |
| 69 | have hsmooth : RiemannianMetric.IsSmoothFamilyOn g (Icc a b) := by |
| 70 | intro p hp |
| 71 | by_cases hpa : p.1 ≤ a |
| 72 | · have hpc : p.1 < c := hpa.trans_lt hac |
| 73 | apply (hsm0 p ⟨⟨hp.1.1, hpc.le⟩, hp.2⟩).mono_of_mem_nhdsWithin |
| 74 | have hn : ∀ᶠ q : ℝ × M in 𝓝 p, q.1 < c := |
| 75 | continuous_fst.continuousAt.eventually (Iio_mem_nhds hpc) |
| 76 | filter_upwards [self_mem_nhdsWithin, |
| 77 | Filter.Eventually.filter_mono nhdsWithin_le_nhds hn] with q hq hqc |
| 78 | exact ⟨⟨hq.1.1, hqc.le⟩, hq.2⟩ |
| 79 | · have hap : a < p.1 := lt_of_not_ge hpa |
| 80 | apply (hsm1 p ⟨⟨hap, hp.1.2⟩, hp.2⟩).mono_of_mem_nhdsWithin |
| 81 | have hn : ∀ᶠ q : ℝ × M in 𝓝 p, a < q.1 := |
| 82 | continuous_fst.continuousAt.eventually (Ioi_mem_nhds hap) |
| 83 | filter_upwards [self_mem_nhdsWithin, |
| 84 | Filter.Eventually.filter_mono nhdsWithin_le_nhds hn] with q hq haq |
| 85 | exact ⟨⟨haq, hq.1.2⟩, hq.2⟩ |
| 86 | have hequation (t : ℝ) (ht : t ∈ Icc a b) (x : M) |
| 87 | (v w : TangentSpace (𝓡 n) x) : |
| 88 | HasDerivWithinAt (fun s => (g s).inner x v w) |
| 89 | (-2 * (D t).ricci x v w) (Icc a b) t := by |
| 90 | by_cases hta : t ≤ a |
| 91 | · have htaeq : t = a := le_antisymm hta ht.1 |
| 92 | subst t |
| 93 | have hder : HasDerivWithinAt (fun s => (g s).inner x v w) |
| 94 | (-2 * (F0.connection a).ricci x v w) (Icc a c) a := by |
| 95 | apply (F0.equation a ⟨le_rfl, hac.le⟩ x v w).congr_of_mem |
| 96 | · intro s hs |
| 97 | rw [hg0 s hs] |
| 98 | · exact ⟨le_rfl, hac.le⟩ |
| 99 | have hnear : Icc a c ∈ 𝓝[Icc a b] a := by |
| 100 | filter_upwards [self_mem_nhdsWithin, |
| 101 | Filter.Eventually.filter_mono nhdsWithin_le_nhds (Iio_mem_nhds hac)] with s hs hsc |
| 102 | exact ⟨hs.1, hsc.le⟩ |
| 103 | rw [hricci (D a) (F0.connection a) (hg0 a ⟨le_rfl, hac.le⟩)] |
| 104 | exact hder.mono_of_mem_nhdsWithin hnear |
| 105 | · have hat : a < t := lt_of_not_ge hta |
| 106 | have hder : HasDerivWithinAt (fun s => (g s).inner x v w) |
| 107 | (-2 * (F1.connection t).ricci x v w) (Ioc a b) t := by |
| 108 | apply (F1.equation t ⟨hat, ht.2⟩ x v w).congr_of_mem |
| 109 | · intro s hs |
| 110 | rw [hg1 s hs] |
| 111 | · exact ⟨hat, ht.2⟩ |
| 112 | have hnear : Ioc a b ∈ 𝓝[Icc a b] t := by |
| 113 | filter_upwards [self_mem_nhdsWithin, |
| 114 | Filter.Eventually.filter_mono nhdsWithin_le_nhds (Ioi_mem_nhds hat)] with s hs has |
| 115 | exact ⟨has, hs.2⟩ |
| 116 | rw [hricci (D t) (F1.connection t) (hg1 t ⟨hat, ht.2⟩)] |
| 117 | exact hder.mono_of_mem_nhdsWithin hnear |
| 118 | let G : RicciFlow n M (Icc a b) := |
| 119 | { metric := g |
| 120 | connection := D |
| 121 | interval := ordConnected_Icc |
| 122 | nontrivial := ⟨a, ⟨le_rfl, hac.le.trans hcb⟩, |
| 123 | b, ⟨hac.le.trans hcb, le_rfl⟩, (hac.trans_le hcb).ne⟩ |
| 124 | smooth := hsmooth |
| 125 | equation := hequation } |
| 126 | exact ⟨G, hg0, hg1⟩ |
| 127 | |
| 128 | end PoincareMT.M47Positive |