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.Alexandrov.Comparison.SmallScale |
| 2 | import PoincareLib.Topology.MetricSpace.GromovHausdorff.Pointed.Convergence.FiniteMovingPoints |
| 3 | |
| 4 | /-! |
| 5 | # Scaled angular configurations with moving centers |
| 6 | |
| 7 | Finite configurations on small spheres about converging moving centers pass |
| 8 | to spheres about the actual limit center. A strict angular margin survives |
| 9 | vanishing metric scales, with the small-radius bound chosen independently |
| 10 | of the spaces, centers, and configurations. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter Topology |
| 18 | open Poincare.GromovHausdorff |
| 19 | |
| 20 | namespace Poincare.Alexandrov |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | /-- Scaled angular separation on a small common sphere about a converging |
| 25 | moving center gives strict angular separation about its limit center. -/ |
| 26 | theorem exists_pos_radius_for_scaled_moving_configurations |
| 27 | {θ β : ℝ} (hθ : 0 < θ) (hθβ : θ < β) (hβpi : β < Real.pi) : |
| 28 | ∃ R₀ : ℝ, 0 < R₀ ∧ |
| 29 | ∀ {X : ℕ → FiniteDiameterBasedMetricSpace.{u}} |
| 30 | {Y : FiniteDiameterBasedMetricSpace.{u}} |
| 31 | (S : VaryingRealizationSequence |
| 32 | (fun j => (X j).toBasedMetricSpaceBundle) Y.toBasedMetricSpaceBundle) |
| 33 | {u : ∀ j, (X j).carrier} {u0 : Y.carrier}, S.PointConverges u u0 → |
| 34 | ∀ {R ρ σ : ℝ}, 0 < R → R < R₀ → ρ + R < σ → |
| 35 | IsCompact (Metric.closedBall Y.base σ) → |
| 36 | (∀ᶠ j in atTop, dist (X j).base (u j) ≤ ρ) → |
| 37 | ∀ {k : ℕ} (x : ∀ j, Fin k → (X j).carrier), |
| 38 | (∀ j i, dist (u j) (x j i) = R) → |
| 39 | ∀ t : ℕ → ℝ, Tendsto t atTop (𝓝 0) → |
| 40 | (∀ᶠ j in atTop, t j ≠ 0) → |
| 41 | (∀ᶠ j in atTop, ∀ i l : Fin k, i ≠ l → |
| 42 | β ≤ comparisonAngle (t j * dist (u j) (x j i)) |
| 43 | (t j * dist (u j) (x j l)) (t j * dist (x j i) (x j l))) → |
| 44 | ∃ q : Fin k → Y.carrier, (∀ i, dist u0 (q i) = R) ∧ |
| 45 | ∀ i l : Fin k, i ≠ l → |
| 46 | θ < comparisonAngle (dist u0 (q i)) (dist u0 (q l)) |
| 47 | (dist (q i) (q l)) := by |
| 48 | obtain ⟨R₀, hR₀, hsmall⟩ := |
| 49 | exists_pos_comparisonAngle_gt_of_euclidean_angle_ge hθ hθβ hβpi |
| 50 | refine ⟨R₀, hR₀, ?_⟩ |
| 51 | intro X Y S u u0 hu R ρ σ hR hRR₀ hroom hcompact hubound k x hx t ht htne hangle |
| 52 | obtain ⟨η, hη, hηbound⟩ := Filter.extraction_of_frequently_atTop hubound.frequently |
| 53 | let Sη := S.comp η hη.tendsto_atTop |
| 54 | have hbound (j : ℕ) (i : Fin k) : |
| 55 | dist (X (η j)).base (x (η j) i) ≤ ρ + R := by |
| 56 | calc |
| 57 | dist (X (η j)).base (x (η j) i) ≤ |
| 58 | dist (X (η j)).base (u (η j)) + dist (u (η j)) (x (η j) i) := |
| 59 | dist_triangle _ _ _ |
| 60 | _ = dist (X (η j)).base (u (η j)) + R := by rw [hx] |
| 61 | _ ≤ ρ + R := add_le_add (hηbound j) le_rfl |
| 62 | obtain ⟨q, _, φ, hφ, hq⟩ := |
| 63 | exists_subseq_finite_pointConverges Sη hroom hcompact (fun j => x (η j)) hbound |
| 64 | let S' := Sη.comp φ hφ.tendsto_atTop |
| 65 | have hu' : S'.PointConverges (fun j => u (η (φ j))) u0 := |
| 66 | (hu.comp η hη.tendsto_atTop).comp φ hφ.tendsto_atTop |
| 67 | have hcofinal : Tendsto (fun j => η (φ j)) atTop atTop := |
| 68 | hη.tendsto_atTop.comp hφ.tendsto_atTop |
| 69 | have hradconv (i : Fin k) : Tendsto |
| 70 | (fun j => dist (u (η (φ j))) (x (η (φ j)) i)) atTop (𝓝 R) := by |
| 71 | simpa only [hx] using (tendsto_const_nhds : Tendsto (fun _ : ℕ => R) atTop (𝓝 R)) |
| 72 | have hrad (i : Fin k) : dist u0 (q i) = R := |
| 73 | tendsto_nhds_unique (S'.tendsto_dist_of_pointConverges hu' (hq i)) (hradconv i) |
| 74 | refine ⟨q, hrad, ?_⟩ |
| 75 | intro i l hil |
| 76 | have hdist := S'.tendsto_dist_of_pointConverges (hq i) (hq l) |
| 77 | have hscaled := tendsto_comparisonAngle_mul_of_tendsto_zero |
| 78 | (ht.comp hcofinal) (hcofinal.eventually htne) |
| 79 | (hradconv i) (hradconv l) hdist hR hR |
| 80 | have heuc : β ≤ Real.arccos ((2 * R ^ 2 - dist (q i) (q l) ^ 2) / (2 * R ^ 2)) := by |
| 81 | have hbound : β ≤ Real.arccos |
| 82 | ((R ^ 2 + R ^ 2 - dist (q i) (q l) ^ 2) / (2 * R * R)) := by |
| 83 | apply ge_of_tendsto hscaled |
| 84 | filter_upwards [hcofinal.eventually hangle] with j hj |
| 85 | exact hj i l hil |
| 86 | convert hbound using 1 |
| 87 | congr 1 |
| 88 | ring |
| 89 | rw [hrad i, hrad l] |
| 90 | apply hsmall R (dist (q i) (q l)) hR hRR₀ dist_nonneg ?_ heuc |
| 91 | calc |
| 92 | dist (q i) (q l) ≤ dist (q i) u0 + dist u0 (q l) := dist_triangle _ _ _ |
| 93 | _ = 2 * R := by rw [dist_comm (q i), hrad i, hrad l]; ring |
| 94 | |
| 95 | end Poincare.Alexandrov |