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.PartialLimits.MetricComparison |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.SourceMetric |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.Convergence.Volume.PathComparison |
| 4 | import PoincareLib.Geometry.Riemannian.Distance.CompleteBalls |
| 5 | |
| 6 | /-! |
| 7 | # Uniform spatial bounds for retained compact images |
| 8 | |
| 9 | Morgan--Tian Theorem 5.9 and Corollary 5.10, pp. 88--89, and Claim 11.5, |
| 10 | p. 270. Compact quadratic comparison controls all short paths in a fixed |
| 11 | ball on one tail. Completeness then gives one source radius for the image |
| 12 | of any fixed compact limit set, using the original comparison maps. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M30.PartialPointedMetricConvergence |
| 23 | |
| 24 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 25 | FlowCarrier.isManifold FlowCarrier.t2Space FlowCarrier.t3Space |
| 26 | |
| 27 | variable {n : ℕ} {M : ℕ → Type u} [∀ k, TopologicalSpace (M k)] |
| 28 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 29 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 30 | {g : ∀ k, RiemannianMetric n (M k)} {p : ∀ k, M k} {A : ℝ} |
| 31 | (G : PartialPointedMetricConvergence g p A) |
| 32 | |
| 33 | /-- A compact ball closure gives one eventual image bound for every point |
| 34 | of that ball, retaining the actual maps (Theorem 5.9, pp. 88--89). -/ |
| 35 | theorem eventually_image_ball_subset_double {r : ℝ} |
| 36 | (hcompact : IsCompact (closure (G.limitMetric.ball G.base r))) : |
| 37 | ∀ᶠ k in atTop, |
| 38 | G.embedding k '' G.limitMetric.ball G.base r ⊆ |
| 39 | (g (G.subsequence k)).ball (p (G.subsequence k)) (2 * r) := by |
| 40 | let : Bundle.RiemannianBundle |
| 41 | (TangentSpace (𝓡 n) : G.limitCarrier.carrier → Type _) := |
| 42 | ⟨G.limitMetric.toRiemannianMetric⟩ |
| 43 | obtain ⟨j, hj⟩ := G.exists_exhaustion_superset hcompact |
| 44 | have hsqrt : Real.sqrt 2 ≤ 2 := by |
| 45 | nlinarith [Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2), Real.sqrt_nonneg (2 : ℝ)] |
| 46 | filter_upwards [G.eventually_pullback_inner_le_twice hcompact, |
| 47 | eventually_ge_atTop j] with k hk hjk |
| 48 | rintro _ ⟨x, hx, rfl⟩ |
| 49 | obtain ⟨γ, hγ0, hγ1, hγ, hlength, _⟩ := |
| 50 | Manifold.exists_lt_locally_constant_of_riemannianEDist_lt hx zero_lt_one |
| 51 | have hpath : MapsTo γ (Icc (0 : ℝ) 1) (G.limitMetric.ball G.base r) := by |
| 52 | intro t ht |
| 53 | exact ((Manifold.riemannianEDist_le_pathELength |
| 54 | (hγ.contMDiffOn.mono (Icc_subset_Icc_right ht.2)) hγ0 rfl ht.1).trans |
| 55 | (Manifold.pathELength_mono le_rfl ht.2)).trans_lt hlength |
| 56 | have hmap (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |
| 57 | ContMDiffAt (𝓡 n) (𝓡 n) 1 (G.embedding k) (γ t) := |
| 58 | ((G.embedding_smooth k |
| 59 | ⟨γ t, G.exhaustion_monotone hjk (hj (subset_closure (hpath ht)))⟩).contMDiffAt).of_le |
| 60 | (by simp) |
| 61 | have hlength' := G.limitMetric.pathELength_comp_le_of_tangentNorm_le_on_Icc |
| 62 | (g (G.subsequence k)) (by norm_num : (0 : ℝ) ≤ 2) hγ hmap (by |
| 63 | intro t ht v |
| 64 | change Real.sqrt _ ≤ 2 * Real.sqrt _ |
| 65 | calc |
| 66 | _ ≤ Real.sqrt (2 * G.limitMetric.inner (γ t) v v) := |
| 67 | Real.sqrt_le_sqrt (hk (γ t) (subset_closure (hpath ht)) v) |
| 68 | _ = Real.sqrt 2 * Real.sqrt (G.limitMetric.inner (γ t) v v) := |
| 69 | Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 2) _ |
| 70 | _ ≤ _ := mul_le_mul_of_nonneg_right hsqrt (Real.sqrt_nonneg _)) |
| 71 | let : Bundle.RiemannianBundle |
| 72 | (TangentSpace (𝓡 n) : M (G.subsequence k) → Type _) := |
| 73 | ⟨(g (G.subsequence k)).toRiemannianMetric⟩ |
| 74 | have hreg : ContMDiffOn 𝓘(ℝ) (𝓡 n) 1 (G.embedding k ∘ γ) (Icc 0 1) := |
| 75 | fun t ht => ((hmap t ht).comp t hγ.contMDiffAt).contMDiffWithinAt |
| 76 | have hd : (g (G.subsequence k)).edist (p (G.subsequence k)) (G.embedding k x) ≤ |
| 77 | (g (G.subsequence k)).pathELength (G.embedding k ∘ γ) 0 1 := |
| 78 | Manifold.riemannianEDist_le_pathELength hreg |
| 79 | (by simpa only [Function.comp_apply, hγ0] using G.base_preserving k) |
| 80 | (by simp only [Function.comp_apply, hγ1]) zero_le_one |
| 81 | change _ < ENNReal.ofReal (2 * r) |
| 82 | rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 83 | exact (hd.trans hlength').trans_lt |
| 84 | (ENNReal.mul_lt_mul_right (by norm_num : ENNReal.ofReal (2 : ℝ) ≠ 0) |
| 85 | ENNReal.ofReal_ne_top hlength) |
| 86 | |
| 87 | /-- Every fixed compact set in the complete static limit has one bounded |
| 88 | source image on one tail (Claim 11.5, p. 270). Completeness belongs only to |
| 89 | the actual limit metric. -/ |
| 90 | theorem exists_eventually_compact_image_ball |
| 91 | (hcomplete : G.limitCarrier.metricComplete G.limitMetric) |
| 92 | {K : Set G.limitCarrier.carrier} (hK : IsCompact K) : |
| 93 | ∃ R : ℝ, 0 < R ∧ ∀ᶠ k in atTop, |
| 94 | G.embedding k '' K ⊆ (g (G.subsequence k)).ball (p (G.subsequence k)) R := by |
| 95 | let : MetricSpace G.limitCarrier.carrier := G.limitCarrier.metricSpaceOf G.limitMetric |
| 96 | obtain ⟨r, hr, hKr⟩ := hK.isBounded.subset_ball_lt 0 G.base |
| 97 | have hKr' : K ⊆ G.limitMetric.ball G.base r := by |
| 98 | simpa only [FlowCarrier.metricBall_eq_metricBallOf, FlowCarrier.metricBall] using hKr |
| 99 | have hcompact : IsCompact (closure (G.limitMetric.ball G.base r)) := by |
| 100 | apply IsCompact.of_isClosed_subset |
| 101 | (G.limitMetric.isCompact_closedBall_of_metricComplete hcomplete G.base r) isClosed_closure |
| 102 | apply closure_minimal |
| 103 | (fun x (hx : G.limitMetric.edist G.base x < ENNReal.ofReal r) => hx.le) |
| 104 | exact isClosed_le (continuous_const.edist continuous_id) continuous_const |
| 105 | exact ⟨2 * r, by positivity, (G.eventually_image_ball_subset_double hcompact).mono |
| 106 | fun _ hk => (image_mono hKr').trans hk⟩ |
| 107 | |
| 108 | end PoincareMT.M30.PartialPointedMetricConvergence |