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.Riemannian.Comparison.Laplacian.Branch.Complete |
| 2 | import PoincareLib.Geometry.Riemannian.Normalization.Scaling.Geometry |
| 3 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.AncientVolume.Splitting.EndpointSelection |
| 4 | |
| 5 | /-! |
| 6 | # Actual source segments at escaping centers |
| 7 | |
| 8 | Complete Riemannian metrics provide finite minimizing geodesics. Constant |
| 9 | reparameterization gives unit-speed segments, including for the metrics |
| 10 | rescaled by an inverse squared length. Comparison cosines are unchanged |
| 11 | by this rescaling. The point-selection radius-to-distance limit and the |
| 12 | farther-vertex estimate force both normalized endpoint lengths to infinity. |
| 13 | |
| 14 | These are source-space inputs to Kleiner--Lott, Appendix G, p. 2852, and |
| 15 | Morgan--Tian, arXiv:math/0607607v2, Theorem 5.35, pp. 122--123. Hinge and |
| 16 | corresponding-side comparisons remain explicit inputs to the neighboring |
| 17 | selection and arc-construction theorems. |
| 18 | |
| 19 | Direct statement comparison: the segment theorem constructs the segments |
| 20 | from completeness and endpoints. The divergence theorem assumes only the |
| 21 | stated numerical point-selection and farther-vertex bounds. No segment, |
| 22 | line, distance convergence, or splitting is an input to either conclusion. |
| 23 | -/ |
| 24 | |
| 25 | set_option autoImplicit false |
| 26 | |
| 27 | open Filter Set |
| 28 | open scoped Topology Manifold ContDiff Bundle ENNReal |
| 29 | |
| 30 | namespace Poincare.AncientVolume.Splitting |
| 31 | |
| 32 | /-- The spatial point-selection scale and farther-vertex bound force both |
| 33 | endpoint distances to diverge in the normalized metric. -/ |
| 34 | theorem normalized_endpoint_lengths_tendsto_atTop |
| 35 | {X : Type*} [MetricSpace X] (p : X) (q y : ℕ → X) (r : ℕ → ℝ) |
| 36 | (hq : ∀ i, 0 < dist p (q i)) (hr : ∀ i, 0 < r i) |
| 37 | (hsmall : Tendsto (fun i => r i / dist p (q i)) atTop (𝓝 0)) |
| 38 | (hfar : ∀ i, dist p (q i) * ((i : ℝ) + 2) + 1 ≤ dist p (y i)) : |
| 39 | Tendsto (fun i => dist p (q i) / r i) atTop atTop ∧ |
| 40 | Tendsto (fun i => dist (q i) (y i) / r i) atTop atTop := by |
| 41 | have hsmall' : Tendsto (fun i => r i / dist p (q i)) atTop (𝓝[>] (0 : ℝ)) := |
| 42 | tendsto_nhdsWithin_iff.mpr ⟨hsmall, Eventually.of_forall fun i => div_pos (hr i) (hq i)⟩ |
| 43 | have hleft : Tendsto (fun i => dist p (q i) / r i) atTop atTop := by |
| 44 | simpa only [Function.comp_def, inv_div] using tendsto_inv_nhdsGT_zero.comp hsmall' |
| 45 | refine ⟨hleft, tendsto_atTop_mono (fun i => ?_) hleft⟩ |
| 46 | apply div_le_div_of_nonneg_right _ (hr i).le |
| 47 | have htri := dist_triangle p (q i) (y i) |
| 48 | have hnonneg := mul_nonneg (hq i).le (Nat.cast_nonneg i : 0 ≤ (i : ℝ)) |
| 49 | nlinarith [hfar i] |
| 50 | |
| 51 | end Poincare.AncientVolume.Splitting |
| 52 | |
| 53 | namespace PoincareMT.RiemannianMetric |
| 54 | |
| 55 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 56 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 57 | |
| 58 | /-- Exact intrinsic distance after normalization by an inverse squared |
| 59 | length. This identity does not require completeness. -/ |
| 60 | theorem rescaledMetric_edist_toReal_of_inverse_square |
| 61 | (g : RiemannianMetric n M) (r : ℝ) (hr : 0 < r) (x y : M) : |
| 62 | ((rescaledMetric g ((r ^ 2)⁻¹) (by positivity)).edist x y).toReal = |
| 63 | (g.edist x y).toReal / r := by |
| 64 | rw [rescaledMetric_edist, ENNReal.toReal_mul, |
| 65 | ENNReal.toReal_ofReal (Real.sqrt_nonneg _), Real.sqrt_inv, Real.sqrt_sq hr.le] |
| 66 | ring |
| 67 | |
| 68 | /-- Constant positive metric rescaling preserves the intrinsic Euclidean |
| 69 | comparison cosine of three endpoints. -/ |
| 70 | theorem endpoint_comparison_cosine_rescaledMetric |
| 71 | (g : RiemannianMetric n M) (c : ℝ) (hc : 0 < c) (p q y : M) : |
| 72 | let d := fun x z => (g.edist x z).toReal |
| 73 | let D := fun x z => ((rescaledMetric g c hc).edist x z).toReal |
| 74 | (D p q ^ 2 + D q y ^ 2 - D p y ^ 2) / (2 * D p q * D q y) = |
| 75 | (d p q ^ 2 + d q y ^ 2 - d p y ^ 2) / (2 * d p q * d q y) := by |
| 76 | dsimp only |
| 77 | simp only [rescaledMetric_edist, ENNReal.toReal_mul, |
| 78 | ENNReal.toReal_ofReal (Real.sqrt_nonneg _)] |
| 79 | have hfactor : Real.sqrt c ≠ 0 := (Real.sqrt_pos.2 hc).ne' |
| 80 | by_cases hleft : (g.edist p q).toReal = 0 |
| 81 | · simp [hleft] |
| 82 | by_cases hright : (g.edist q y).toReal = 0 |
| 83 | · simp [hright] |
| 84 | field_simp |
| 85 | |
| 86 | /-- A complete metric constructs a finite unit-speed minimizing segment |
| 87 | between any two distinct endpoints. -/ |
| 88 | theorem exists_unit_speed_minimizing_segment_of_metricComplete |
| 89 | [T3Space M] [PreconnectedSpace M] |
| 90 | (g : RiemannianMetric n M) (hc : MetricComplete g) (p q : M) |
| 91 | (hd : 0 < (g.edist p q).toReal) : |
| 92 | ∃ γ : ℝ → M, γ 0 = p ∧ γ (g.edist p q).toReal = q ∧ |
| 93 | ∀ s ∈ Icc (0 : ℝ) (g.edist p q).toReal, |
| 94 | ∀ t ∈ Icc (0 : ℝ) (g.edist p q).toReal, |
| 95 | (g.edist (γ s) (γ t)).toReal = |s - t| := by |
| 96 | obtain ⟨ε, _, γ, _, hγ0, hγ1, hγ⟩ := |
| 97 | g.exists_minimizing_geodesic_of_metricComplete hc p q |
| 98 | refine ⟨fun t => γ (t / (g.edist p q).toReal), ?_, ?_, ?_⟩ |
| 99 | · simpa only [zero_div] using hγ0 |
| 100 | · simpa only [div_self hd.ne'] using hγ1 |
| 101 | · intro s hs t ht |
| 102 | rw [hγ (s / (g.edist p q).toReal) |
| 103 | ⟨div_nonneg hs.1 hd.le, (div_le_one hd).mpr hs.2⟩ |
| 104 | (t / (g.edist p q).toReal) |
| 105 | ⟨div_nonneg ht.1 hd.le, (div_le_one hd).mpr ht.2⟩, |
| 106 | ENNReal.toReal_mul, ENNReal.toReal_ofReal (abs_nonneg _), |
| 107 | ← sub_div, abs_div, abs_of_pos hd, div_mul_cancel₀ _ hd.ne'] |
| 108 | |
| 109 | /-- Actual normalized source segments from each center to the original |
| 110 | base point and its chosen farther vertex. -/ |
| 111 | theorem exists_normalized_source_segments |
| 112 | [T3Space M] [PreconnectedSpace M] |
| 113 | (g : RiemannianMetric n M) (hc : MetricComplete g) |
| 114 | (p : M) (q y : ℕ → M) (r : ℕ → ℝ) |
| 115 | (hq : ∀ i, 0 < (g.edist (q i) p).toReal) |
| 116 | (hy : ∀ i, 0 < (g.edist (q i) (y i)).toReal) |
| 117 | (hr : ∀ i, 0 < r i) : |
| 118 | let G := fun i => rescaledMetric g ((r i ^ 2)⁻¹) (inv_pos.mpr (pow_pos (hr i) 2)) |
| 119 | let a := fun i => (g.edist (q i) p).toReal / r i |
| 120 | let b := fun i => (g.edist (q i) (y i)).toReal / r i |
| 121 | ∃ minus plus : ℕ → ℝ → M, |
| 122 | (∀ i, minus i 0 = q i ∧ minus i (a i) = p ∧ |
| 123 | plus i 0 = q i ∧ plus i (b i) = y i) ∧ |
| 124 | (∀ i, ∀ s ∈ Icc (0 : ℝ) (a i), ∀ t ∈ Icc (0 : ℝ) (a i), |
| 125 | ((G i).edist (minus i s) (minus i t)).toReal = |s - t|) ∧ |
| 126 | (∀ i, ∀ s ∈ Icc (0 : ℝ) (b i), ∀ t ∈ Icc (0 : ℝ) (b i), |
| 127 | ((G i).edist (plus i s) (plus i t)).toReal = |s - t|) := by |
| 128 | dsimp only |
| 129 | have hsegments (i : ℕ) (z : M) (hz : 0 < (g.edist (q i) z).toReal) : |
| 130 | ∃ γ : ℝ → M, γ 0 = q i ∧ γ ((g.edist (q i) z).toReal / r i) = z ∧ |
| 131 | ∀ s ∈ Icc (0 : ℝ) ((g.edist (q i) z).toReal / r i), |
| 132 | ∀ t ∈ Icc (0 : ℝ) ((g.edist (q i) z).toReal / r i), |
| 133 | ((rescaledMetric g ((r i ^ 2)⁻¹) (inv_pos.mpr (pow_pos (hr i) 2))).edist |
| 134 | (γ s) (γ t)).toReal = |
| 135 | |s - t| := by |
| 136 | have hdist := g.rescaledMetric_edist_toReal_of_inverse_square (r i) (hr i) (q i) z |
| 137 | obtain ⟨γ, hγ0, hγend, hγ⟩ := |
| 138 | (rescaledMetric g ((r i ^ 2)⁻¹) (inv_pos.mpr (pow_pos (hr i) 2))).exists_unit_speed_minimizing_segment_of_metricComplete |
| 139 | (metricComplete_rescaledMetric _ _ _ hc) (q i) z (by rw [hdist]; exact div_pos hz (hr i)) |
| 140 | exact ⟨γ, hγ0, by simpa only [hdist] using hγend, by simpa only [hdist] using hγ⟩ |
| 141 | choose minus hminus0 hminusend hminus using fun i => hsegments i p (hq i) |
| 142 | choose plus hplus0 hplusend hplus using fun i => hsegments i (y i) (hy i) |
| 143 | exact ⟨minus, plus, fun i => ⟨hminus0 i, hminusend i, hplus0 i, hplusend i⟩, |
| 144 | hminus, hplus⟩ |
| 145 | |
| 146 | end PoincareMT.RiemannianMetric |