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.IntrinsicComparison.Region.Minimizer |
| 2 | import PoincareLib.Geometry.Riemannian.Distance.SegmentLocality |
| 3 | |
| 4 | /-! |
| 5 | # Interior subarcs of constrained minimizers realize distance |
| 6 | |
| 7 | An interior point of the compact region has a small intrinsic ball contained |
| 8 | in that region. M07 constructs ambient minimizing segments in smaller |
| 9 | precompact balls, and the constrained subarc minimum gives the reverse |
| 10 | distance inequality for the original unit-speed curve. |
| 11 | |
| 12 | Morgan--Tian context: Claim 19.40, printed pp. 470-471, in the proof of Proposition |
| 13 | 19.35. The project construction retains the actual constrained path and its boundary |
| 14 | contacts. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Topology ENNReal NNReal Manifold ContDiff Bundle |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | /-- At an interior point of its constraint region, a unit-speed constrained minimizer is |
| 27 | locally an intrinsic metric segment. Both compactness of the replacement balls and |
| 28 | confinement of the replacing curves are constructed. Source: MT Claim 19.40, pp. 470-471; |
| 29 | `proof-work/tasks/M64/reports/2026-09-24-intrinsic-radial-scalar.md`, Interior metric |
| 30 | segments and smooth geodesicity. -/ |
| 31 | theorem m64Intrinsic_constrained_minimizer_local_metric_segment |
| 32 | (G : RiemannianMetric 2 AnnulusCoordinates) {K : Set AnnulusCoordinates} |
| 33 | (hK : IsCompact K) {γ : ℝ → AnnulusCoordinates} {L : ℝ} |
| 34 | (hlip : ∀ s ∈ Icc 0 L, ∀ t ∈ Icc 0 L, |
| 35 | G.edist (γ s) (γ t) ≤ ENNReal.ofReal |s - t|) |
| 36 | (hmin : ∀ a ∈ Icc 0 L, ∀ b ∈ Icc 0 L, a ≤ b → |
| 37 | ∀ τ : ℝ → AnnulusCoordinates, ContinuousOn τ (Icc 0 1) → |
| 38 | τ 0 = γ a → τ 1 = γ b → MapsTo τ (Icc 0 1) K → |
| 39 | ENNReal.ofReal (b - a) ≤ m64IntrinsicCurveVariation G τ 0 1) |
| 40 | {u : ℝ} (hu : u ∈ Ioo 0 L) (hinterior : γ u ∈ interior K) : |
| 41 | ∃ epsilon : ℝ, 0 < epsilon ∧ Icc (u - epsilon) (u + epsilon) ⊆ Icc 0 L ∧ |
| 42 | ∀ s ∈ Icc (u - epsilon) (u + epsilon), |
| 43 | ∀ t ∈ Icc (u - epsilon) (u + epsilon), |
| 44 | G.edist (γ s) (γ t) = ENNReal.ofReal |s - t| := by |
| 45 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 2) : AnnulusCoordinates → Type _) := |
| 46 | ⟨G.toRiemannianMetric⟩ |
| 47 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 2)) |
| 48 | (TangentSpace (𝓡 2) : AnnulusCoordinates → Type _) := |
| 49 | ⟨⟨G.inner, G.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 50 | obtain ⟨c, hc, hcK⟩ := setOfPred_riemannianEDist_lt_subset_nhds (𝓡 2) |
| 51 | (mem_interior_iff_mem_nhds.mp hinterior) |
| 52 | let R : ℝ := c |
| 53 | have hR : 0 < R := by exact_mod_cast hc |
| 54 | let epsilon := min (min (u / 2) ((L - u) / 2)) (R / 10) |
| 55 | have hepsilon : 0 < epsilon := |
| 56 | lt_min (lt_min (half_pos hu.1) (half_pos (sub_pos.mpr hu.2))) (by positivity) |
| 57 | have hepsu : epsilon ≤ u / 2 := (min_le_left _ _).trans (min_le_left _ _) |
| 58 | have hepsL : epsilon ≤ (L - u) / 2 := (min_le_left _ _).trans (min_le_right _ _) |
| 59 | have hepsR : epsilon ≤ R / 10 := min_le_right _ _ |
| 60 | have hJ : Icc (u - epsilon) (u + epsilon) ⊆ Icc 0 L := by |
| 61 | intro t ht |
| 62 | constructor <;> linarith [ht.1, ht.2, hu.1, hu.2] |
| 63 | have hnear (s : ℝ) (hs : s ∈ Icc (u - epsilon) (u + epsilon)) : |
| 64 | G.edist (γ u) (γ s) ≤ ENNReal.ofReal epsilon := by |
| 65 | apply (hlip u ⟨hu.1.le, hu.2.le⟩ s (hJ hs)).trans |
| 66 | exact ENNReal.ofReal_le_ofReal (abs_le.mpr ⟨by linarith [hs.2], by linarith [hs.1]⟩) |
| 67 | have hball (s : ℝ) (hs : s ∈ Icc (u - epsilon) (u + epsilon)) : |
| 68 | G.ball (γ s) (R / 2) ⊆ K := by |
| 69 | intro z hz |
| 70 | apply hcK |
| 71 | have hdist : G.edist (γ u) z < ENNReal.ofReal R := calc |
| 72 | G.edist (γ u) z ≤ G.edist (γ u) (γ s) + G.edist (γ s) z := |
| 73 | Manifold.riemannianEDist_triangle |
| 74 | _ ≤ ENNReal.ofReal epsilon + G.edist (γ s) z := add_le_add (hnear s hs) le_rfl |
| 75 | _ < ENNReal.ofReal epsilon + ENNReal.ofReal (R / 2) := |
| 76 | ENNReal.add_lt_add_left ENNReal.ofReal_ne_top hz |
| 77 | _ = ENNReal.ofReal (epsilon + R / 2) := |
| 78 | (ENNReal.ofReal_add hepsilon.le (half_pos hR).le).symm |
| 79 | _ ≤ ENNReal.ofReal R := ENNReal.ofReal_le_ofReal (by linarith) |
| 80 | change G.edist (γ u) z < (c : ℝ≥0∞) |
| 81 | simpa only [R, ENNReal.ofReal_coe_nnreal] using hdist |
| 82 | refine ⟨epsilon, hepsilon, hJ, ?_⟩ |
| 83 | intro s hs t ht |
| 84 | wlog hst : s ≤ t generalizing s t |
| 85 | · have hcomm : G.edist (γ s) (γ t) = G.edist (γ t) (γ s) := |
| 86 | Manifold.riemannianEDist_comm |
| 87 | rw [hcomm, abs_sub_comm] |
| 88 | exact this t ht s hs (le_of_not_ge hst) |
| 89 | apply le_antisymm (hlip s (hJ hs) t (hJ ht)) |
| 90 | have hcompact : IsCompact (closure (G.ball (γ s) (R / 2))) := |
| 91 | hK.of_isClosed_subset isClosed_closure (closure_minimal (hball s hs) hK.isClosed) |
| 92 | have htball : γ t ∈ G.ball (γ s) (R / 2) := by |
| 93 | apply (hlip s (hJ hs) t (hJ ht)).trans_lt |
| 94 | apply (ENNReal.ofReal_lt_ofReal_iff (half_pos hR)).mpr |
| 95 | rw [abs_of_nonpos (sub_nonpos.mpr hst), neg_sub] |
| 96 | linarith [hs.1, ht.2] |
| 97 | obtain ⟨η, hη0, hη1, hηball, hηdist⟩ := |
| 98 | G.exists_intrinsic_metric_segment_of_precompact_ball (γ s) (γ t) |
| 99 | (half_pos hR) hcompact htball |
| 100 | have hηc := G.continuousOn_of_edist_segment (G.edist_ne_top (γ s) (γ t)) hηdist |
| 101 | have hηvar : m64IntrinsicCurveVariation G η 0 1 ≤ G.edist (γ s) (γ t) := by |
| 102 | have h := m64Intrinsic_curveVariation_le_of_edist_le G |
| 103 | (C := (G.edist (γ s) (γ t)).toReal) ENNReal.toReal_nonneg (by |
| 104 | intro a ha b hb |
| 105 | rw [hηdist a ha b hb, ENNReal.ofReal_mul ENNReal.toReal_nonneg, |
| 106 | ENNReal.ofReal_toReal (G.edist_ne_top (γ s) (γ t)), mul_comm]) |
| 107 | simpa only [ENNReal.ofReal_toReal (G.edist_ne_top (γ s) (γ t))] using h |
| 108 | have h := (hmin s (hJ hs) t (hJ ht) hst η hηc hη0 hη1 |
| 109 | (fun a ha => hball s hs (hηball ha))).trans hηvar |
| 110 | simpa only [abs_of_nonpos (sub_nonpos.mpr hst), neg_sub] using h |
| 111 | |
| 112 | end PoincareMT |