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.Compactness.Embedding.MetricComparison |
| 2 | import Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 3 | |
| 4 | /-! |
| 5 | # Static metric comparison along the actual source maps |
| 6 | |
| 7 | Compact quadratic control transfers terminal balls along an exhausting |
| 8 | sequence of spatial maps. Source: MT Theorem 5.9, pp. 88-89; |
| 9 | derivations/terminal-germs-completeness.md, Stage A4. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 17 | |
| 18 | universe u v |
| 19 | |
| 20 | namespace PoincareMT.M47 |
| 21 | |
| 22 | /-- The spatial chain rule and an actual quadratic comparison control |
| 23 | the length of a fixed smooth path, including both endpoints. -/ |
| 24 | theorem terminalGerms_pathELength_le_two |
| 25 | {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 27 | {N : Type v} [TopologicalSpace N] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) N] [IsManifold (𝓡 3) ∞ N] |
| 29 | (g : RiemannianMetric 3 M) (h : RiemannianMetric 3 N) |
| 30 | {f : M → N} {γ : ℝ → M} |
| 31 | (hγ : ContMDiff (𝓘(ℝ, ℝ)) (𝓡 3) 1 γ) |
| 32 | (hf : ∀ t ∈ Icc (0 : ℝ) 1, ContMDiffAt (𝓡 3) (𝓡 3) ∞ f (γ t)) |
| 33 | (hquad : ∀ t ∈ Icc (0 : ℝ) 1, ∀ v : TangentSpace (𝓡 3) (γ t), |
| 34 | h.inner (f (γ t)) (mfderiv (𝓡 3) (𝓡 3) f (γ t) v) |
| 35 | (mfderiv (𝓡 3) (𝓡 3) f (γ t) v) ≤ 4 * g.inner (γ t) v v) : |
| 36 | h.pathELength (f ∘ γ) 0 1 ≤ 2 * g.pathELength γ 0 1 := by |
| 37 | have hspeed : ∀ t ∈ Icc (0 : ℝ) 1, |
| 38 | h.tangentNorm (f (γ t)) (mfderiv (𝓘(ℝ, ℝ)) (𝓡 3) (f ∘ γ) t 1) ≤ |
| 39 | 2 * g.tangentNorm (γ t) (mfderiv (𝓘(ℝ, ℝ)) (𝓡 3) γ t 1) := by |
| 40 | intro t ht |
| 41 | have hchain := mfderiv_comp_apply t ((hf t ht).mdifferentiableAt (by simp)) |
| 42 | (hγ.mdifferentiable (by simp) t) (1 : ℝ) |
| 43 | change Real.sqrt _ ≤ 2 * Real.sqrt _ |
| 44 | rw [hchain] |
| 45 | calc |
| 46 | _ ≤ Real.sqrt (4 * g.inner (γ t) |
| 47 | (mfderiv (𝓘(ℝ, ℝ)) (𝓡 3) γ t 1) |
| 48 | (mfderiv (𝓘(ℝ, ℝ)) (𝓡 3) γ t 1)) := Real.sqrt_le_sqrt (hquad t ht _) |
| 49 | _ = _ := by |
| 50 | rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)] |
| 51 | rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.sqrt_sq (by norm_num)] |
| 52 | rw [RiemannianMetric.pathELength_eq_lintegral_tangentNorm, |
| 53 | RiemannianMetric.pathELength_eq_lintegral_tangentNorm] |
| 54 | calc |
| 55 | _ ≤ ∫⁻ t in Icc (0 : ℝ) 1, ENNReal.ofReal |
| 56 | (2 * g.tangentNorm (γ t) (mfderiv (𝓘(ℝ, ℝ)) (𝓡 3) γ t 1)) := by |
| 57 | apply lintegral_mono_ae |
| 58 | filter_upwards [ae_restrict_mem measurableSet_Icc] with t ht |
| 59 | exact ENNReal.ofReal_le_ofReal (hspeed t ht) |
| 60 | _ = _ := by |
| 61 | simp_rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 62 | rw [lintegral_const_mul'] |
| 63 | · norm_num |
| 64 | · exact ENNReal.ofReal_ne_top |
| 65 | |
| 66 | /-- A terminal point in an actual ball maps eventually into the doubled |
| 67 | source ball. No common time interval or complete source is needed. -/ |
| 68 | theorem terminalGerms_eventually_mem_ball |
| 69 | {M : Type u} [TopologicalSpace M] |
| 70 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 71 | {N : ℕ → Type v} [∀ k, TopologicalSpace (N k)] |
| 72 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (N k)] |
| 73 | [∀ k, IsManifold (𝓡 3) ∞ (N k)] |
| 74 | (g : RiemannianMetric 3 M) (h : ∀ k, RiemannianMetric 3 (N k)) |
| 75 | (E : ℕ → Set M) (hE : ∀ k, IsOpen (E k)) (hmono : Monotone E) |
| 76 | (hcover : (⋃ k, E k) = univ) (f : ∀ k, M → N k) |
| 77 | (hf : ∀ k, IsLocalDiffeomorphOn (𝓡 3) (𝓡 3) ∞ (f k) (E k)) |
| 78 | (hquad : ∀ K : Set M, IsCompact K → ∀ᶠ k in atTop, |
| 79 | ∀ x ∈ K, ∀ v : TangentSpace (𝓡 3) x, |
| 80 | (h k).inner (f k x) (mfderiv (𝓡 3) (𝓡 3) (f k) x v) |
| 81 | (mfderiv (𝓡 3) (𝓡 3) (f k) x v) ≤ 4 * g.inner x v v) |
| 82 | {p x : M} {A : ℝ} (hx : x ∈ g.ball p A) : |
| 83 | ∀ᶠ k in atTop, f k x ∈ (h k).ball (f k p) (2 * A) := by |
| 84 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 85 | ⟨g.toRiemannianMetric⟩ |
| 86 | change Manifold.riemannianEDist (𝓡 3) p x < ENNReal.ofReal A at hx |
| 87 | obtain ⟨γ, hγ0, hγ1, hγ, hlength, _⟩ := |
| 88 | Manifold.exists_lt_locally_constant_of_riemannianEDist_lt hx |
| 89 | (zero_lt_one : (0 : ℝ) < 1) |
| 90 | have hK : IsCompact (γ '' Icc (0 : ℝ) 1) := isCompact_Icc.image hγ.continuous |
| 91 | obtain ⟨j, hj⟩ := hK.elim_directed_cover E hE |
| 92 | (by rw [hcover]; exact subset_univ _) hmono.directed_le |
| 93 | filter_upwards [hquad _ hK, eventually_ge_atTop j] with k hk hjk |
| 94 | have hfγ : ∀ t ∈ Icc (0 : ℝ) 1, ContMDiffAt (𝓡 3) (𝓡 3) ∞ (f k) (γ t) := |
| 95 | fun t ht => (hf k ⟨γ t, hmono hjk (hj (mem_image_of_mem γ ht))⟩).contMDiffAt |
| 96 | have hη : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 3) 1 (f k ∘ γ) (Icc 0 1) := by |
| 97 | intro t ht |
| 98 | exact ((hfγ t ht).of_le (by simp) |>.comp t hγ.contMDiffAt).contMDiffWithinAt |
| 99 | have hdist : (h k).edist (f k p) (f k x) ≤ (h k).pathELength (f k ∘ γ) 0 1 := by |
| 100 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : N k → Type _) := |
| 101 | ⟨(h k).toRiemannianMetric⟩ |
| 102 | exact Manifold.riemannianEDist_le_pathELength hη (by simp [hγ0]) |
| 103 | (by simp [hγ1]) zero_le_one |
| 104 | have hlen := terminalGerms_pathELength_le_two g (h k) hγ hfγ |
| 105 | (fun t ht => hk (γ t) (mem_image_of_mem γ ht)) |
| 106 | change _ < ENNReal.ofReal (2 * A) |
| 107 | calc |
| 108 | _ ≤ 2 * g.pathELength γ 0 1 := hdist.trans hlen |
| 109 | _ < 2 * ENNReal.ofReal A := |
| 110 | (ENNReal.mul_lt_mul_right (by norm_num : (2 : ℝ≥0∞) ≠ 0) (by norm_num)) hlength |
| 111 | _ = _ := by rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)]; norm_num |
| 112 | |
| 113 | end PoincareMT.M47 |