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.Blowup.Construction.SourceNames |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.PartialLimits.MetricComparison |
| 3 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.PartialLimits.BoundaryCoverage |
| 4 | import PoincareLib.Geometry.Riemannian.Homothety.Length |
| 5 | |
| 6 | /-! |
| 7 | # Compact balls below a partial-limit cutoff |
| 8 | |
| 9 | Retained metric convergence transfers each compact short path into the |
| 10 | sources. Fixed-stage source-ball coverage then confines limit balls to a |
| 11 | compact exhaustion stage. Morgan--Tian Theorems 5.6 and 5.9, pp. 85-89; |
| 12 | the finite-cutoff conclusion is local and does not assert completeness. |
| 13 | See the independently reviewed partial-limit-compact-balls derivation. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter MeasureTheory |
| 19 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M30.PartialPointedMetricConvergence |
| 24 | |
| 25 | variable {n : ℕ} {M : ℕ → Type u} [∀ k, TopologicalSpace (M k)] |
| 26 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 27 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 28 | {g : ∀ k, RiemannianMetric n (M k)} {p : ∀ k, M k} {A : ℝ} |
| 29 | (G : PartialPointedMetricConvergence g p A) |
| 30 | |
| 31 | private theorem eventually_pathELength_le {γ : ℝ → G.limitCarrier.carrier} |
| 32 | (hγ : letI := G.limitCarrier.topologicalSpace |
| 33 | letI := G.limitCarrier.chartedSpace |
| 34 | letI := G.limitCarrier.isManifold |
| 35 | ContMDiffOn 𝓘(ℝ) (𝓡 n) 1 γ (Icc (0 : ℝ) 1)) : |
| 36 | letI := G.limitCarrier.topologicalSpace |
| 37 | letI := G.limitCarrier.chartedSpace |
| 38 | letI := G.limitCarrier.isManifold |
| 39 | ∀ᶠ k in atTop, |
| 40 | (g (G.subsequence k)).pathELength (G.embedding k ∘ γ) 0 1 ≤ |
| 41 | ENNReal.ofReal (Real.sqrt 2) * G.limitMetric.pathELength γ 0 1 := by |
| 42 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 43 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 44 | G.limitCarrier.chartedSpace |
| 45 | let : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 46 | let K := γ '' Icc (0 : ℝ) 1 |
| 47 | have hK : IsCompact K := isCompact_Icc.image_of_continuousOn hγ.continuousOn |
| 48 | obtain ⟨j, hj⟩ := G.exists_exhaustion_superset hK |
| 49 | filter_upwards [G.eventually_pullback_inner_le_twice hK, eventually_ge_atTop j] |
| 50 | with k hk hjk |
| 51 | rw [M13.pathELength_eq_lintegral_tangentNorm, |
| 52 | M13.pathELength_eq_lintegral_tangentNorm, |
| 53 | ← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] |
| 54 | apply setLIntegral_mono' measurableSet_Ioo |
| 55 | intro t ht |
| 56 | rw [← ENNReal.ofReal_mul (Real.sqrt_nonneg 2)] |
| 57 | apply ENNReal.ofReal_le_ofReal |
| 58 | have hγt : γ t ∈ K := mem_image_of_mem γ ⟨ht.1.le, ht.2.le⟩ |
| 59 | have hmap := (G.embedding_smooth k |
| 60 | ⟨γ t, G.exhaustion_monotone hjk (hj hγt)⟩).contMDiffAt |
| 61 | have hdiff : MDifferentiableAt 𝓘(ℝ) (𝓡 n) γ t := |
| 62 | (hγ.mdifferentiableOn one_ne_zero t ⟨ht.1.le, ht.2.le⟩).mdifferentiableAt |
| 63 | (Icc_mem_nhds ht.1 ht.2) |
| 64 | change Real.sqrt _ ≤ Real.sqrt 2 * Real.sqrt _ |
| 65 | rw [← Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 66 | apply Real.sqrt_le_sqrt |
| 67 | rw [mfderiv_comp t (hmap.mdifferentiableAt (by simp)) hdiff] |
| 68 | exact hk (γ t) hγt (mfderiv 𝓘(ℝ) (𝓡 n) γ t 1) |
| 69 | |
| 70 | /-- Each point of a limit ball eventually maps into the doubled source |
| 71 | ball, along the same retained maps (Theorems 5.6 and 5.9, pp. 85-89). |
| 72 | The index threshold may depend on the point. -/ |
| 73 | theorem eventually_mem_ball {r : ℝ} {x : G.limitCarrier.carrier} |
| 74 | (hx : letI := G.limitCarrier.topologicalSpace |
| 75 | letI := G.limitCarrier.chartedSpace |
| 76 | letI := G.limitCarrier.isManifold |
| 77 | x ∈ G.limitMetric.ball G.base r) : |
| 78 | ∀ᶠ k in atTop, |
| 79 | G.embedding k x ∈ (g (G.subsequence k)).ball (p (G.subsequence k)) (2 * r) := by |
| 80 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 81 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 82 | G.limitCarrier.chartedSpace |
| 83 | let : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 84 | obtain ⟨γ, h0, h1, hγ, hlength⟩ := M13.exists_pathELength_lt G.limitMetric hx |
| 85 | obtain ⟨j, hj⟩ := G.exists_exhaustion_superset |
| 86 | (isCompact_Icc.image_of_continuousOn hγ.continuousOn) |
| 87 | filter_upwards [G.eventually_pathELength_le hγ, eventually_ge_atTop j] with k hk hjk |
| 88 | have hf : ContMDiffOn (𝓡 n) (𝓡 n) 1 (G.embedding k) (G.exhaustion k) := by |
| 89 | intro y hy |
| 90 | exact ((G.embedding_smooth k ⟨y, hy⟩).contMDiffAt.of_le (by simp)).contMDiffWithinAt |
| 91 | have hη : ContMDiffOn 𝓘(ℝ) (𝓡 n) 1 (G.embedding k ∘ γ) (Icc (0 : ℝ) 1) := |
| 92 | hf.comp hγ (fun t ht => G.exhaustion_monotone hjk (hj (mem_image_of_mem γ ht))) |
| 93 | have hη0 : (G.embedding k ∘ γ) 0 = p (G.subsequence k) := by |
| 94 | simpa only [Function.comp_apply, h0] using G.base_preserving k |
| 95 | have hη1 : (G.embedding k ∘ γ) 1 = G.embedding k x := by |
| 96 | simp only [Function.comp_apply, h1] |
| 97 | have hdist := M13.edist_le_pathELength (g (G.subsequence k)) hη hη0 hη1 zero_le_one |
| 98 | have hsqrt : (0 : ℝ) < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num) |
| 99 | have hsqrt_le : Real.sqrt 2 ≤ 2 := by |
| 100 | have := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2) |
| 101 | nlinarith [Real.sqrt_nonneg (2 : ℝ)] |
| 102 | change _ < ENNReal.ofReal (2 * r) |
| 103 | calc |
| 104 | _ ≤ ENNReal.ofReal (Real.sqrt 2) * G.limitMetric.pathELength γ 0 1 := hdist.trans hk |
| 105 | _ < ENNReal.ofReal (Real.sqrt 2) * ENNReal.ofReal r := |
| 106 | (ENNReal.mul_lt_mul_right (ne_of_gt (ENNReal.ofReal_pos.mpr hsqrt)) |
| 107 | ENNReal.ofReal_ne_top) hlength |
| 108 | _ ≤ ENNReal.ofReal 2 * ENNReal.ofReal r := |
| 109 | mul_le_mul' (ENNReal.ofReal_le_ofReal hsqrt_le) le_rfl |
| 110 | _ = ENNReal.ofReal (2 * r) := (ENNReal.ofReal_mul (by norm_num)).symm |
| 111 | |
| 112 | /-- Fixed-stage coverage of doubled source balls confines the limit ball |
| 113 | to that same stage (Theorem 5.9, p. 88). Only stagewise injectivity is used. -/ |
| 114 | theorem ball_subset_exhaustion_of_source_ball_coverage {r : ℝ} {l : ℕ} |
| 115 | (hcover : ∀ᶠ k in atTop, |
| 116 | (g (G.subsequence k)).ball (p (G.subsequence k)) (2 * r) ⊆ |
| 117 | G.embedding k '' G.exhaustion l) : |
| 118 | letI := G.limitCarrier.topologicalSpace |
| 119 | letI := G.limitCarrier.chartedSpace |
| 120 | letI := G.limitCarrier.isManifold |
| 121 | G.limitMetric.ball G.base r ⊆ G.exhaustion l := by |
| 122 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 123 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 124 | G.limitCarrier.chartedSpace |
| 125 | let : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 126 | intro x hx |
| 127 | obtain ⟨i, hi⟩ := G.exists_exhaustion_superset (K := {x}) isCompact_singleton |
| 128 | have hxstage : x ∈ G.exhaustion i := hi (mem_singleton x) |
| 129 | obtain ⟨k, hkcover, hkball, hlk, hik⟩ := |
| 130 | (hcover.and ((G.eventually_mem_ball hx).and |
| 131 | ((eventually_ge_atTop l).and (eventually_ge_atTop i)))).exists |
| 132 | obtain ⟨y, hy, heq⟩ := hkcover hkball |
| 133 | have hyx : y = x := congrArg Subtype.val ((G.embedding_open k).injective |
| 134 | (a₁ := ⟨y, G.exhaustion_monotone hlk hy⟩) |
| 135 | (a₂ := ⟨x, G.exhaustion_monotone hik hxstage⟩) heq) |
| 136 | simpa only [hyx] using hy |
| 137 | |
| 138 | /-- Below half the partial cutoff, limit balls have compact closure |
| 139 | (the buffered local form of Theorem 5.9, p. 88). -/ |
| 140 | theorem isCompact_closure_ball [∀ k, T2Space (M k)] {r : ℝ} |
| 141 | (hr : 0 < r) (hrA : 2 * r < A) : |
| 142 | letI := G.limitCarrier.topologicalSpace |
| 143 | letI := G.limitCarrier.chartedSpace |
| 144 | letI := G.limitCarrier.isManifold |
| 145 | IsCompact (closure (G.limitMetric.ball G.base r)) := by |
| 146 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 147 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 148 | G.limitCarrier.chartedSpace |
| 149 | let : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 150 | let : T2Space G.limitCarrier.carrier := G.limitCarrier.t2Space |
| 151 | obtain ⟨l, hl⟩ := G.source_ball_coverage (by positivity : 0 < 2 * r) hrA |
| 152 | exact (G.exhaustion_compactClosure l).of_isClosed_subset isClosed_closure |
| 153 | (closure_mono (G.ball_subset_exhaustion_of_source_ball_coverage hl)) |
| 154 | |
| 155 | end PoincareMT.M30.PartialPointedMetricConvergence |