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.Surgery.Comparison.Distance.Riemannian |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Smoothing.Charts.Construction |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Smoothing.FiniteIteration |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Smoothing.Local.Patch |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Distance.MetricLocalToGlobal |
| 6 | /-! |
| 7 | # Global quantitative smooth approximation |
| 8 | |
| 9 | The finite smoothing argument in the 2026-09-18 SurgeryComparison.Transport full contract, |
| 10 | following Claim 18.22, Morgan-Tian p. 433, uses a fixed chart family and |
| 11 | additive error budgets. Every local update preserves previous smoothness |
| 12 | and supplies its homotopy. Local metric bounds globalize through the |
| 13 | actual Riemannian path distance before the next update is performed. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter MeasureTheory |
| 19 | open scoped Topology Manifold ContDiff Bundle ENNReal NNReal |
| 20 | |
| 21 | namespace PoincareMT.SurgeryComparison.Transport |
| 22 | |
| 23 | variable {M N : Type*} |
| 24 | [TopologicalSpace M] [T2Space M] [CompactSpace M] [PreconnectedSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 26 | [TopologicalSpace N] [T2Space N] [CompactSpace N] [PreconnectedSpace N] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) N] [IsManifold (𝓡 3) ∞ N] |
| 28 | |
| 29 | /-- A Lipschitz map between compact connected smooth three-manifolds has |
| 30 | uniformly close smooth homotopic approximants with any positive additive |
| 31 | loss in the specified Riemannian distance bound. This is the internal |
| 32 | quantitative smoothing obligation for Claim 18.22, Morgan-Tian p. 433. -/ |
| 33 | theorem exists_smooth_approximation |
| 34 | (g : RiemannianMetric 3 M) (h : RiemannianMetric 3 N) (f₀ : C(M, N)) |
| 35 | {L epsilon sigma : ℝ} (hL : 0 ≤ L) (hepsilon : 0 < epsilon) (hsigma : 0 < sigma) |
| 36 | (hf₀ : ∀ x y, h.edist (f₀ x) (f₀ y) ≤ ENNReal.ofReal L * g.edist x y) : |
| 37 | ∃ f : C(M, N), ContMDiff (𝓡 3) (𝓡 3) ∞ f ∧ |
| 38 | ContinuousMap.Homotopic f f₀ ∧ |
| 39 | (∀ x, h.edist (f x) (f₀ x) < ENNReal.ofReal epsilon) ∧ |
| 40 | (∀ x y, h.edist (f x) (f y) ≤ ENNReal.ofReal (L + sigma) * g.edist x y) := by |
| 41 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 42 | ⟨g.toRiemannianMetric⟩ |
| 43 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : N → Type _) := |
| 44 | ⟨h.toRiemannianMetric⟩ |
| 45 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 3)) |
| 46 | (TangentSpace (𝓡 3) : M → Type _) := |
| 47 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 48 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 3)) |
| 49 | (TangentSpace (𝓡 3) : N → Type _) := |
| 50 | ⟨⟨h.inner, h.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 51 | let : MetricSpace M := metricSpaceOfRiemannianMetric g |
| 52 | let : MetricSpace N := metricSpaceOfRiemannianMetric h |
| 53 | let : IsRiemannianManifold (𝓡 3) M := ⟨fun _ _ => rfl⟩ |
| 54 | let : IsRiemannianManifold (𝓡 3) N := ⟨fun _ _ => rfl⟩ |
| 55 | obtain ⟨n, c, rho, margin, hmargin, hsupp, hsmooth, hcover, hvalid⟩ := |
| 56 | exists_finite_smoothing_charts (E := EuclideanSpace ℝ (Fin 3)) |
| 57 | (F := EuclideanSpace ℝ (Fin 3)) f₀ |
| 58 | let tolerance : ℝ := min epsilon margin |
| 59 | have htolerance : 0 < tolerance := lt_min hepsilon hmargin |
| 60 | let W : Fin n → Set M := fun i => {x | (rho i : M → ℝ) =ᶠ[𝓝 x] 1} |
| 61 | have hstep : ∀ (i : Fin n) (f : C(M, N)) (B : ℝ), 0 ≤ B → |
| 62 | (∀ x, h.edist (f x) (f₀ x) < ENNReal.ofReal tolerance) → |
| 63 | (∀ x y, h.edist (f x) (f y) ≤ ENNReal.ofReal B * g.edist x y) → |
| 64 | ∀ s e : ℝ, 0 < s → 0 < e → |
| 65 | ∃ f' : C(M, N), |
| 66 | (∀ x ∈ W i, ContMDiffAt (𝓡 3) (𝓡 3) ∞ f' x) ∧ |
| 67 | (∀ x, ContMDiffAt (𝓡 3) (𝓡 3) ∞ f x → |
| 68 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ f' x) ∧ |
| 69 | ContinuousMap.Homotopic f' f ∧ |
| 70 | (∀ x, h.edist (f' x) (f x) < ENNReal.ofReal e) ∧ |
| 71 | (∀ x y, h.edist (f' x) (f' y) ≤ ENNReal.ofReal (B + s) * g.edist x y) := by |
| 72 | intro i f B hB hclose hbound s e hs he |
| 73 | have hcloseMargin : ∀ x, edist (f x) (f₀ x) < ENNReal.ofReal margin := fun x => |
| 74 | (hclose x).trans_le (ENNReal.ofReal_le_ofReal (min_le_right _ _)) |
| 75 | have hLip : LipschitzWith ⟨B, hB⟩ f := by |
| 76 | intro x y |
| 77 | have hb := hbound x y |
| 78 | change edist (f x) (f y) ≤ ENNReal.ofReal B * edist x y at hb |
| 79 | rw [ENNReal.ofReal_eq_coe_nnreal hB] at hb |
| 80 | exact hb |
| 81 | obtain ⟨f', hnew, hpreserve, hhom, hmove, hlocal⟩ := |
| 82 | exists_supported_smooth_approximation volume |
| 83 | (chartAt (EuclideanSpace ℝ (Fin 3)) (c i)) |
| 84 | (chartAt (EuclideanSpace ℝ (Fin 3)) (f₀ (c i))) |
| 85 | contMDiffOn_chart contMDiffOn_chart_symm |
| 86 | contMDiffOn_chart contMDiffOn_chart_symm (rho i) (hsmooth i) |
| 87 | (fun _ => (rho i).mem_Icc) |
| 88 | (isClosed_tsupport (rho i)).isCompact (hsupp i) |
| 89 | f (hvalid f hcloseMargin i) ⟨B, hB⟩ hLip s e hs he |
| 90 | refine ⟨f', hnew, hpreserve, hhom, ?_, ?_⟩ |
| 91 | · intro x |
| 92 | change edist (f' x) (f x) < ENNReal.ofReal e |
| 93 | rw [edist_dist] |
| 94 | exact (ENNReal.ofReal_lt_ofReal_iff he).mpr (hmove x) |
| 95 | · apply metric_edist_le_mul_of_local_pair_bound g h f' (by linarith) |
| 96 | intro x |
| 97 | obtain ⟨V, hV, hVLip⟩ := hlocal x |
| 98 | refine ⟨V, hV, fun y hy z hz => ?_⟩ |
| 99 | change edist (f' y) (f' z) ≤ ENNReal.ofReal (B + s) * edist y z |
| 100 | rw [ENNReal.ofReal_eq_coe_nnreal (add_nonneg hB hs.le)] |
| 101 | exact hVLip hy hz |
| 102 | obtain ⟨f, hf, hhom, hclose, hbound⟩ := |
| 103 | exists_smooth_of_finite_local_smoothing W hcover g.edist h.edist |
| 104 | (fun y => by |
| 105 | change edist y y = 0 |
| 106 | exact edist_self y) (fun x y z => by |
| 107 | change edist x z ≤ edist x y + edist y z |
| 108 | exact edist_triangle x y z) |
| 109 | f₀ hL htolerance hsigma hf₀ hstep |
| 110 | exact ⟨f, hf, hhom, fun x => (hclose x).trans_le |
| 111 | (ENNReal.ofReal_le_ofReal (min_le_left _ _)), hbound⟩ |
| 112 | |
| 113 | end PoincareMT.SurgeryComparison.Transport |