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.Loop.RegionChart |
| 2 | import PoincareLib.Topology.Surface.Triangulation.Faces.Bands.Gluing |
| 3 | |
| 4 | /-! |
| 5 | # Actual smooth edges through regular points of the return loop |
| 6 | |
| 7 | A short affine reparametrization supplies an embedded smooth edge. The |
| 8 | compact parameter tails supply a neighborhood where it contains the |
| 9 | entire original loop frontier. |
| 10 | |
| 11 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481, including Claim 19.40, |
| 12 | pp. 470-471. These project constructions provide actual fitted boundary pieces and |
| 13 | contacts for the regional Gauss--Bonnet arguments. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Topology ContDiff Manifold |
| 22 | open PoincareMT.Topology.Surface |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | /-- A regular point of the actual simple return loop constructs an embedded smooth edge |
| 27 | through that point and a neighborhood in which the full loop is contained in the edge. |
| 28 | Source: `proof-work/tasks/M64/reports/2026-09-24-relative-boundary-cover.md`. -/ |
| 29 | theorem m64Intrinsic_exists_loop_smooth_edge |
| 30 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) {T p : ℝ} |
| 31 | (hend : gamma 0 = gamma T) (hinj : InjOn gamma (Ico 0 T)) |
| 32 | (hregular : ∀ t ∈ Ioo (0 : ℝ) T, deriv gamma t ≠ 0) |
| 33 | (hp : p ∈ Ioo (0 : ℝ) T) : |
| 34 | ∃ (e : SmoothEdge AnnulusCoordinates) (W : Set AnnulusCoordinates), |
| 35 | e.map (1 / 2) = gamma p ∧ InjOn e.map (Icc (0 : ℝ) 1) ∧ |
| 36 | e.map '' Icc (0 : ℝ) 1 ⊆ gamma '' Icc 0 T ∧ |
| 37 | IsOpen W ∧ gamma p ∈ W ∧ |
| 38 | W ∩ gamma '' Icc 0 T ⊆ e.map '' Icc (0 : ℝ) 1 := by |
| 39 | let radius := min p (T - p) / 2 |
| 40 | have hr : 0 < radius := half_pos (lt_min hp.1 (sub_pos.mpr hp.2)) |
| 41 | have hrp : radius < p := |
| 42 | (half_lt_self (lt_min hp.1 (sub_pos.mpr hp.2))).trans_le (min_le_left _ _) |
| 43 | have hrT : radius < T - p := |
| 44 | (half_lt_self (lt_min hp.1 (sub_pos.mpr hp.2))).trans_le (min_le_right _ _) |
| 45 | let a := p - radius |
| 46 | let b := p + radius |
| 47 | have ha : 0 < a := sub_pos.mpr hrp |
| 48 | have hb : b < T := by dsimp [b]; linarith |
| 49 | have hap : a < p := sub_lt_self p hr |
| 50 | have hpb : p < b := lt_add_of_pos_right p hr |
| 51 | have hab : a < b := hap.trans hpb |
| 52 | let parameter : ℝ → ℝ := fun t => a + t * (b - a) |
| 53 | have hparameter (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : parameter t ∈ Icc a b := by |
| 54 | constructor |
| 55 | · dsimp [parameter] |
| 56 | exact le_add_of_nonneg_right (mul_nonneg ht.1 (sub_pos.mpr hab).le) |
| 57 | · have hmul := mul_le_mul_of_nonneg_right ht.2 (sub_pos.mpr hab).le |
| 58 | dsimp [parameter] |
| 59 | linarith |
| 60 | have hparamI (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : parameter t ∈ Ioo (0 : ℝ) T := |
| 61 | ⟨ha.trans_le (hparameter t ht).1, (hparameter t ht).2.trans_lt hb⟩ |
| 62 | have hparamDeriv (t : ℝ) : HasDerivAt parameter (b - a) t := by |
| 63 | convert! ((hasDerivAt_id t).mul_const (b - a)).const_add a using 1 |
| 64 | simp |
| 65 | have hderiv (t : ℝ) : HasDerivAt (gamma ∘ parameter) |
| 66 | ((b - a) • deriv gamma (parameter t)) t := |
| 67 | ((hg.differentiable (by simp)) (parameter t)).hasDerivAt.scomp t (hparamDeriv t) |
| 68 | let e : SmoothEdge AnnulusCoordinates := { |
| 69 | map := gamma ∘ parameter |
| 70 | smooth := (hg.comp (by dsimp [parameter]; fun_prop)).contMDiff.contMDiffOn |
| 71 | regular := by |
| 72 | intro t ht |
| 73 | rw [mfderiv_eq_fderiv, (hderiv t).hasFDerivAt.fderiv] |
| 74 | have hne : (b - a) • deriv gamma (parameter t) ≠ 0 := |
| 75 | smul_ne_zero (sub_pos.mpr hab).ne' (hregular _ (hparamI t (Ioo_subset_Icc_self ht))) |
| 76 | exact smul_left_injective ℝ hne } |
| 77 | have heq (s : ℝ) : e.map s = gamma (parameter s) := rfl |
| 78 | have hhalf : parameter (1 / 2) = p := by dsimp [parameter, a, b]; ring |
| 79 | have himage : e.map '' Icc (0 : ℝ) 1 = gamma '' Icc a b := by |
| 80 | ext z |
| 81 | constructor |
| 82 | · rintro ⟨t, ht, rfl⟩ |
| 83 | exact ⟨parameter t, hparameter t ht, rfl⟩ |
| 84 | · rintro ⟨t, ht, rfl⟩ |
| 85 | refine ⟨(t - a) / (b - a), |
| 86 | ⟨div_nonneg (sub_nonneg.mpr ht.1) (sub_pos.mpr hab).le, |
| 87 | (div_le_one (sub_pos.mpr hab)).mpr (sub_le_sub_right ht.2 a)⟩, ?_⟩ |
| 88 | rw [heq] |
| 89 | congr 1 |
| 90 | dsimp [parameter] |
| 91 | rw [div_mul_cancel₀ _ (sub_pos.mpr hab).ne', add_sub_cancel] |
| 92 | let tail := gamma '' (Icc (0 : ℝ) a ∪ Icc b T) |
| 93 | have htail : IsClosed tail := |
| 94 | ((isCompact_Icc.union isCompact_Icc).image hg.continuous).isClosed |
| 95 | have hpnot : gamma p ∉ tail := by |
| 96 | rintro ⟨t, ht, htp⟩ |
| 97 | have htI : t ∈ Icc (0 : ℝ) T := by |
| 98 | rcases ht with ht | ht |
| 99 | · exact ⟨ht.1, ht.2.trans (hab.le.trans hb.le)⟩ |
| 100 | · exact ⟨(ha.le.trans hab.le).trans ht.1, ht.2⟩ |
| 101 | have htT : t < T := by |
| 102 | by_contra hn |
| 103 | have ht' : t = T := le_antisymm htI.2 (le_of_not_gt hn) |
| 104 | have h0p := hinj ⟨le_rfl, hp.1.trans hp.2⟩ ⟨hp.1.le, hp.2⟩ |
| 105 | (hend.trans (ht' ▸ htp)) |
| 106 | linarith [hp.1] |
| 107 | have htp' := hinj ⟨htI.1, htT⟩ ⟨hp.1.le, hp.2⟩ htp |
| 108 | subst t |
| 109 | rcases ht with ht | ht <;> linarith [ht.1, ht.2] |
| 110 | refine ⟨e, tailᶜ, by rw [heq, hhalf], ?_, ?_, htail.isOpen_compl, hpnot, ?_⟩ |
| 111 | · intro s hs t ht hst |
| 112 | have h := hinj |
| 113 | ⟨(hparamI s hs).1.le, (hparamI s hs).2⟩ |
| 114 | ⟨(hparamI t ht).1.le, (hparamI t ht).2⟩ hst |
| 115 | dsimp [parameter] at h |
| 116 | exact mul_right_cancel₀ (sub_pos.mpr hab).ne' (add_left_cancel h) |
| 117 | · rw [himage] |
| 118 | exact image_mono (fun _ ht => ⟨ha.le.trans ht.1, ht.2.trans hb.le⟩) |
| 119 | · rintro z ⟨hznot, t, ht, rfl⟩ |
| 120 | rw [himage] |
| 121 | refine ⟨t, ⟨?_, ?_⟩, rfl⟩ |
| 122 | · by_contra hn |
| 123 | exact hznot ⟨t, Or.inl ⟨ht.1, (lt_of_not_ge hn).le⟩, rfl⟩ |
| 124 | · by_contra hn |
| 125 | exact hznot ⟨t, Or.inr ⟨(lt_of_not_ge hn).le, ht.2⟩, rfl⟩ |
| 126 | |
| 127 | end PoincareMT |