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.CurveShortening.Comparison.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.PolygonApproximation.Sampled.PolygonCloseness |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.Approximation |
| 4 | import PoincareLib.Geometry.CurveShortening.Ramp.Approximation.Raw.LoopLength |
| 5 | import PoincareLib.Geometry.Riemannian.LoopSpace.Length.PeriodicSpeed |
| 6 | |
| 7 | /-! |
| 8 | # Uniform sampled-polygon shortness |
| 9 | |
| 10 | The actual C1 first jets over a compact parameter family and one angular |
| 11 | period give one speed bound. Combined with the quantitative polygon mesh |
| 12 | estimate, this gives a single threshold for every sufficiently large cell |
| 13 | count and every sampled minimizing polygon in the family. |
| 14 | |
| 15 | Morgan--Tian context: Section 19.4, Definition 19.18 and Claims 19.19-19.22, printed pp. |
| 16 | 450-453. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set Filter MeasureTheory Bundle |
| 23 | open scoped Manifold ContDiff Topology Bundle ENNReal |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | variable {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace LoopAmbient M] [IsManifold (𝓡 3) ∞ M] |
| 31 | |
| 32 | /-- Joint first-jet continuity on a compact family and one period gives a common nonnegative |
| 33 | speed bound. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. |
| 34 | 450-453; project construction in |
| 35 | `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 36 | theorem m64_compact_family_speed_bound |
| 37 | (g : RiemannianMetric 3 M) |
| 38 | {Z : Type*} [TopologicalSpace Z] [CompactSpace Z] |
| 39 | (Gamma : Z → C1FreeLoopSpace (M := M)) (hGamma : Continuous Gamma) : |
| 40 | ∃ S : ℝ, 0 ≤ S ∧ ∀ z : Z, ∀ x ∈ Icc (0 : ℝ) curvePeriod, |
| 41 | g.tangentNorm (periodicFreeLoop (Gamma z) x) |
| 42 | (curveVelocity (periodicFreeLoop (Gamma z)) x) ≤ S := by |
| 43 | let : RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 44 | ⟨g.toRiemannianMetric⟩ |
| 45 | let : IsContinuousRiemannianBundle LoopAmbient (TangentSpace (𝓡 3) : M → Type _) := |
| 46 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 47 | let Y := Z × Icc (0 : ℝ) curvePeriod |
| 48 | have hjet : Continuous (fun w : Y => |
| 49 | m63AngularFirstJet (periodicFreeLoop (Gamma w.1)) w.2) := |
| 50 | m63AngularFirstJet_continuous.comp |
| 51 | ((hGamma.comp continuous_fst).prodMk |
| 52 | (continuous_subtype_val.comp continuous_snd)) |
| 53 | have hspeed : Continuous (fun w : Y => |
| 54 | g.tangentNorm (periodicFreeLoop (Gamma w.1) w.2) |
| 55 | (curveVelocity (periodicFreeLoop (Gamma w.1)) w.2)) := |
| 56 | (hjet.inner_bundle hjet).sqrt |
| 57 | obtain ⟨S0, hS0⟩ := (isCompact_range hspeed).bddAbove |
| 58 | refine ⟨max S0 0, le_max_right _ _, ?_⟩ |
| 59 | intro z x hx |
| 60 | exact (hS0 (mem_range_self (z, (⟨x, hx⟩ : Icc (0 : ℝ) curvePeriod)))).trans |
| 61 | (le_max_left _ _) |
| 62 | |
| 63 | /-- A positive target scale admits a positive count cutoff valid for every larger mesh |
| 64 | count. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; |
| 65 | project construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 66 | theorem m64_exists_mesh_threshold {S r : ℝ} (hr : 0 < r) : |
| 67 | ∃ N0 : ℕ, 0 < N0 ∧ ∀ N : ℕ, N0 ≤ N → |
| 68 | 2 * S * m63CellLength N < r := by |
| 69 | obtain ⟨N0, hlarge⟩ := exists_nat_gt |
| 70 | (max (1 : ℝ) (2 * S * curvePeriod / r)) |
| 71 | have hN0 : 0 < N0 := by |
| 72 | have h1 : (1 : ℝ) < N0 := (le_max_left _ _).trans_lt hlarge |
| 73 | exact_mod_cast (zero_lt_one.trans h1) |
| 74 | refine ⟨N0, hN0, ?_⟩ |
| 75 | intro N hN0N |
| 76 | have hN : 0 < N := hN0.trans_le hN0N |
| 77 | have hNreal : (0 : ℝ) < N := by exact_mod_cast hN |
| 78 | have hratio : 2 * S * curvePeriod / r < (N : ℝ) := |
| 79 | ((le_max_right _ _).trans_lt hlarge).trans_le (by exact_mod_cast hN0N) |
| 80 | have hprod := (div_lt_iff₀ hr).mp hratio |
| 81 | dsimp only [m63CellLength] |
| 82 | rw [← mul_div_assoc] |
| 83 | apply (div_lt_iff₀ hNreal).mpr |
| 84 | nlinarith only [hprod] |
| 85 | |
| 86 | /-- Every sufficiently fine sampled minimizing polygon is uniformly close to its |
| 87 | compact-family source loop. Source: Auxiliary step for MT Definition 19.18 and Claims |
| 88 | 19.19/19.22, pp. 450-453; project construction in |
| 89 | `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 90 | theorem m64_uniform_sampled_polygon_short |
| 91 | (g : RiemannianMetric 3 M) (D : LeviCivitaData g) |
| 92 | {Z : Type*} [TopologicalSpace Z] [CompactSpace Z] |
| 93 | (Gamma : Z → C1FreeLoopSpace (M := M)) (hGamma : Continuous Gamma) |
| 94 | {r : ℝ} (hr : 0 < r) : |
| 95 | ∃ N0 : ℕ, 0 < N0 ∧ ∀ N : ℕ, N0 ≤ N → ∀ z : Z, |
| 96 | ∀ polygon : M63GeodesicPolygon g D N, |
| 97 | M64SampledPolygon (Gamma z) polygon → ∀ x : ℝ, |
| 98 | g.edist (periodicFreeLoop (Gamma z) x) (polygon.map x) < |
| 99 | ENNReal.ofReal r := by |
| 100 | obtain ⟨S, hS, hbound⟩ := m64_compact_family_speed_bound g Gamma hGamma |
| 101 | obtain ⟨N0, hN0, hmesh⟩ := m64_exists_mesh_threshold (S := S) hr |
| 102 | refine ⟨N0, hN0, ?_⟩ |
| 103 | intro N hN0N z polygon hsampled x |
| 104 | have hN : 0 < N := hN0.trans_le hN0N |
| 105 | exact (m64_sampled_polygon_edist_le hN polygon |
| 106 | (Proofs.M58.contMDiff_periodicFreeLoop (Gamma z)) |
| 107 | (Proofs.M58.periodic_periodicFreeLoop (Gamma z)) |
| 108 | hsampled hS (hbound z) x).trans_lt |
| 109 | ((ENNReal.ofReal_lt_ofReal_iff hr).mpr (hmesh N hN0N)) |
| 110 | |
| 111 | /-- The same shortness cutoff applies to all loops in an arbitrary compact C1 set. Source: |
| 112 | Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project |
| 113 | construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 114 | theorem m64_uniform_compact_sampled_polygon_short |
| 115 | (g : RiemannianMetric 3 M) (D : LeviCivitaData g) |
| 116 | (X : Set (C1FreeLoopSpace (M := M))) (hX : IsCompact X) |
| 117 | {r : ℝ} (hr : 0 < r) : |
| 118 | ∃ N0 : ℕ, 0 < N0 ∧ ∀ N : ℕ, N0 ≤ N → |
| 119 | ∀ gamma : C1FreeLoopSpace (M := M), gamma ∈ X → |
| 120 | ∀ polygon : M63GeodesicPolygon g D N, |
| 121 | M64SampledPolygon gamma polygon → ∀ x : ℝ, |
| 122 | g.edist (periodicFreeLoop gamma x) (polygon.map x) < |
| 123 | ENNReal.ofReal r := by |
| 124 | let : CompactSpace X := isCompact_iff_compactSpace.mp hX |
| 125 | obtain ⟨N0, hN0, hshort⟩ := m64_uniform_sampled_polygon_short g D |
| 126 | (fun gamma : X => gamma.1) continuous_subtype_val hr |
| 127 | exact ⟨N0, hN0, fun N hN gamma hgamma polygon hsampled x => |
| 128 | hshort N hN ⟨gamma, hgamma⟩ polygon hsampled x⟩ |
| 129 | |
| 130 | end PoincareMT |