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.Smoothing.Charts.Normalization |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Distance.VectorNorm |
| 3 | import PoincareLib.Geometry.Riemannian.Normalization.Volume.LocalDistance |
| 4 | /-! |
| 5 | # Local distance bounds for the fixed normalized chart |
| 6 | |
| 7 | A normalized chart and its inverse are Lipschitz with every constant |
| 8 | greater than one on a sufficiently small coordinate ball. The forward |
| 9 | estimate uses near-minimizing paths; the inverse estimate uses segments. |
| 10 | The chart itself is fixed before the Lipschitz constant is chosen. |
| 11 | |
| 12 | Source: quantitative smoothing in the 2026-09-18 SurgeryComparison.Transport full contract for |
| 13 | Morgan--Tian Claim 18.22, printed p. 433. The semantic argument is recorded |
| 14 | in `proof-work/tasks/SurgeryComparison.Transport/derivations/smooth-chart-distance.md`. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | open Bundle Filter Set |
| 22 | open scoped Topology Manifold ContDiff ENNReal NNReal |
| 23 | |
| 24 | namespace PoincareMT.SurgeryComparison.Transport |
| 25 | |
| 26 | variable {E H M F : Type*} |
| 27 | [NormedAddCommGroup E] [NormedSpace ℝ E] [TopologicalSpace H] |
| 28 | {I : ModelWithCorners ℝ E H} |
| 29 | [EMetricSpace M] [ChartedSpace H M] [IsManifold I ∞ M] |
| 30 | [RiemannianBundle (TangentSpace I : M → Type _)] |
| 31 | [IsContinuousRiemannianBundle E (TangentSpace I : M → Type _)] |
| 32 | [IsRiemannianManifold I M] |
| 33 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 34 | |
| 35 | /-- The literal normalized chart is bilipschitz, with any prescribed |
| 36 | constant above one, between a small coordinate ball and its inverse |
| 37 | image. SurgeryComparison.Transport full contract, quantitative smoothing for Claim 18.22, p. 433. -/ |
| 38 | theorem normalizedSmoothChart_exists_lipschitz_ball |
| 39 | (e : OpenPartialHomeomorph M F) (he : e.MDifferentiable I 𝓘(ℝ, F)) |
| 40 | {x : M} (hx : x ∈ e.source) |
| 41 | (hs : ContMDiffOn I 𝓘(ℝ, F) ∞ e e.source) |
| 42 | (hi : ContMDiffOn 𝓘(ℝ, F) I ∞ e.symm e.target) |
| 43 | (C : ℝ≥0) (hC : 1 < C) : |
| 44 | let n := normalizedSmoothChart e he hx |
| 45 | ∃ R : ℝ, 0 < R ∧ Metric.ball (n x) R ⊆ n.target ∧ |
| 46 | LipschitzOnWith C n.symm (Metric.ball (n x) R) ∧ |
| 47 | LipschitzOnWith C n (n.symm '' Metric.ball (n x) R) := by |
| 48 | let n := normalizedSmoothChart e he hx |
| 49 | have hsource : x ∈ n.source := by |
| 50 | simpa only [n, normalizedSmoothChart_source] using hx |
| 51 | have hf : ContMDiffOn I 𝓘(ℝ, TangentSpace I x) 1 n n.source := |
| 52 | (normalizedSmoothChart_contMDiffOn e he hx hs).of_le (by norm_num) |
| 53 | have hg : ContMDiffOn 𝓘(ℝ, TangentSpace I x) I 1 n.symm n.target := |
| 54 | (normalizedSmoothChart_symm_contMDiffOn e he hx hi).of_le (by norm_num) |
| 55 | obtain ⟨hforward, hinverse⟩ := |
| 56 | normalizedSmoothChart_eventually_norm_mfderiv_lt e he hx hs hi |
| 57 | (C := (C : ℝ)) (by exact_mod_cast hC) |
| 58 | have hwindow : {y | y ∈ n.source ∧ |
| 59 | ‖mfderiv I 𝓘(ℝ, TangentSpace I x) n y‖ < (C : ℝ)} ∈ 𝓝 x := |
| 60 | inter_mem (n.open_source.mem_nhds hsource) hforward |
| 61 | obtain ⟨U, hUsub, hUopen, hxU⟩ := mem_nhds_iff.mp hwindow |
| 62 | obtain ⟨r, hrpos, hrU⟩ := EMetric.mem_nhds_iff.mp (hUopen.mem_nhds hxU) |
| 63 | obtain ⟨d, hdpos, hdsmall⟩ := |
| 64 | ENNReal.exists_nnreal_pos_mul_lt (a := (3 : ℝ≥0∞)) (by norm_num) hrpos.ne' |
| 65 | have hdU : Metric.eball x (3 * (d : ℝ≥0∞)) ⊆ U := |
| 66 | (Metric.eball_subset_eball (by simpa only [mul_comm] using hdsmall.le)).trans hrU |
| 67 | have hforwardLip : LipschitzOnWith C n (Metric.eball x d) := by |
| 68 | apply normalization_lipschitzOnWith_of_mfderiv_bound_ball hUopen |
| 69 | (hf.mono (fun y hy => (hUsub hy).1)) C (zero_lt_one.trans hC) _ x d hdpos hdU |
| 70 | intro y hy |
| 71 | exact mfderiv_enorm_le_vector_target (hUsub hy).2.le |
| 72 | have hreturn : n.symm ⁻¹' Metric.eball x d ∈ 𝓝 (n x) := by |
| 73 | apply (n.continuousAt_symm (n.map_source hsource)).preimage_mem_nhds |
| 74 | rw [n.left_inv hsource] |
| 75 | exact Metric.eball_mem_nhds x (by exact_mod_cast hdpos) |
| 76 | have hcoordinateWindow : {z | z ∈ n.target ∧ |
| 77 | ‖mfderiv 𝓘(ℝ, TangentSpace I x) I n.symm z‖ < (C : ℝ) ∧ |
| 78 | n.symm z ∈ Metric.eball x d} ∈ 𝓝 (n x) := by |
| 79 | filter_upwards [n.open_target.mem_nhds (n.map_source hsource), |
| 80 | hinverse, hreturn] with z hz hzderiv hzreturn |
| 81 | exact ⟨hz, hzderiv, hzreturn⟩ |
| 82 | obtain ⟨R, hRpos, hRwindow⟩ := Metric.mem_nhds_iff.mp hcoordinateWindow |
| 83 | have htarget : Metric.ball (n x) R ⊆ n.target := fun z hz => (hRwindow hz).1 |
| 84 | refine ⟨R, hRpos, htarget, ?_, ?_⟩ |
| 85 | · intro a ha b hb |
| 86 | rw [IsRiemannianManifold.out (I := I)] |
| 87 | apply normalization_riemannianEDist_le_of_mfderiv_bound_convex n.open_target hg |
| 88 | (convex_ball _ _) htarget C _ ha hb |
| 89 | intro z hz |
| 90 | exact mfderiv_enorm_le_vector_source (hRwindow hz).2.1.le |
| 91 | · apply hforwardLip.mono |
| 92 | rintro y ⟨z, hz, rfl⟩ |
| 93 | exact (hRwindow hz).2.2 |
| 94 | |
| 95 | end PoincareMT.SurgeryComparison.Transport |