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.Smooth.NormalMap |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Normal.Regularity |
| 3 | import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff |
| 4 | import Mathlib.Analysis.SpecialFunctions.Complex.Circle |
| 5 | import Mathlib.Topology.MetricSpace.Thickening |
| 6 | |
| 7 | /-! |
| 8 | # An embedded normal collar over a compact boundary arc |
| 9 | |
| 10 | The actual normal exponential is injective on a neighborhood of each |
| 11 | compact boundary arc shorter than one period. Compactness promotes the |
| 12 | local inverse theorem to one collar of positive width. The width here may |
| 13 | depend on the annulus and the arc; it is not the uniform comparison radius. |
| 14 | |
| 15 | Morgan--Tian context: Claim 19.37, printed pp. 468-469, in the proof of Proposition |
| 16 | 19.35. This module supplies actual normal-geodesic data or its coordinate and measure |
| 17 | transport. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | set_option autoImplicit false |
| 22 | set_option backward.isDefEq.respectTransparency false |
| 23 | |
| 24 | open Set Filter |
| 25 | open scoped Topology Manifold ContDiff Bundle |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | /-- The actual inner-circle parametrization is injective on every closed arc shorter than |
| 30 | one period. Source/construction: Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 31 | theorem m64Intrinsic_boundary_injOn_short_arc {a b : ℝ} |
| 32 | (hab : b - a < rampPeriod) : |
| 33 | InjOn (intrinsicAnnulusBoundary 1) (Icc a b) := by |
| 34 | intro x hx y hy hxy |
| 35 | apply Circle.exp_injOn_Icc hab hx hy |
| 36 | apply Subtype.ext |
| 37 | apply Complex.ext |
| 38 | · have h := congrArg (fun z : AnnulusCoordinates => z 0) hxy |
| 39 | simp only [intrinsicAnnulusBoundary, one_mul, Matrix.cons_val_zero] at h |
| 40 | simpa only [Circle.coe_exp, Complex.exp_ofReal_mul_I_re] using h |
| 41 | · have h := congrArg (fun z : AnnulusCoordinates => z 1) hxy |
| 42 | simp only [intrinsicAnnulusBoundary, one_mul, Matrix.cons_val_one, |
| 43 | Matrix.cons_val_fin_one] at h |
| 44 | simpa only [Circle.coe_exp, Complex.exp_ofReal_mul_I_im] using h |
| 45 | |
| 46 | private theorem normal_map_locally_injective |
| 47 | {u : ℝ × ℝ → AnnulusCoordinates} (hu : ContDiff ℝ ∞ u) |
| 48 | {z : ℝ × ℝ} (hi : Function.Injective (fderiv ℝ u z)) : |
| 49 | ∃ U ∈ 𝓝 z, InjOn u U := by |
| 50 | have hdim : Module.finrank ℝ (ℝ × ℝ) = Module.finrank ℝ AnnulusCoordinates := by |
| 51 | simp |
| 52 | have hs := (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hdim).mp hi |
| 53 | let A : (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates := |
| 54 | (LinearEquiv.ofBijective (fderiv ℝ u z).toLinearMap |
| 55 | ⟨hi, hs⟩).toContinuousLinearEquiv |
| 56 | have hA : A.toContinuousLinearMap = fderiv ℝ u z := rfl |
| 57 | have hd : HasFDerivAt u A.toContinuousLinearMap z := by |
| 58 | rw [hA] |
| 59 | exact (hu.differentiable (by simp) z).hasFDerivAt |
| 60 | let F := hu.contDiffAt.toOpenPartialHomeomorph u hd (by simp) |
| 61 | refine ⟨F.source, F.open_source.mem_nhds |
| 62 | (hu.contDiffAt.mem_toOpenPartialHomeomorph_source hd (by simp)), ?_⟩ |
| 63 | exact F.injOn |
| 64 | |
| 65 | /-- Initial normal data imply one injective collar for an entire compact arc, without |
| 66 | assuming injectivity away from the boundary. Source/construction: Morgan--Tian Claim 19.37, |
| 67 | printed pp. 468-469. -/ |
| 68 | theorem m64Intrinsic_normal_arc_has_embedded_collar |
| 69 | (N : IntrinsicAnnulus) |
| 70 | {normal : ℝ → AnnulusCoordinates} {u : ℝ × ℝ → AnnulusCoordinates} |
| 71 | (hu : ContDiff ℝ ∞ u) |
| 72 | (hboundary : ∀ s, u (s, 0) = intrinsicAnnulusBoundary 1 s) |
| 73 | (hvelocity : ∀ s, HasDerivAt (fun t => u (s, t)) (normal s) 0) |
| 74 | (hunit : ∀ s, N.metric.inner (intrinsicAnnulusBoundary 1 s) (normal s) (normal s) = 1) |
| 75 | (horth : ∀ s, N.metric.inner (intrinsicAnnulusBoundary 1 s) (normal s) |
| 76 | (curveVelocity (n := 2) (intrinsicAnnulusBoundary 1) s) = 0) |
| 77 | {a b : ℝ} (hab : b - a < rampPeriod) : |
| 78 | ∃ r : ℝ, 0 < r ∧ InjOn u (Icc a b ×ˢ Icc (-r) r) := by |
| 79 | let K : Set (ℝ × ℝ) := Icc a b ×ˢ {0} |
| 80 | have hK : IsCompact K := isCompact_Icc.prod isCompact_singleton |
| 81 | have hKinj : InjOn u K := by |
| 82 | rintro ⟨x, t⟩ ⟨hx, ht⟩ ⟨y, s⟩ ⟨hy, hs⟩ heq |
| 83 | have ht0 : t = 0 := ht |
| 84 | have hs0 : s = 0 := hs |
| 85 | subst t |
| 86 | subst s |
| 87 | have hxy : x = y := m64Intrinsic_boundary_injOn_short_arc hab hx hy |
| 88 | (by simpa only [hboundary] using heq) |
| 89 | subst y |
| 90 | rfl |
| 91 | have hlocal : ∀ z ∈ K, ∃ U ∈ 𝓝 z, InjOn u U := by |
| 92 | rintro ⟨x, t⟩ ⟨_, ht⟩ |
| 93 | have ht0 : t = 0 := ht |
| 94 | subst t |
| 95 | apply normal_map_locally_injective hu |
| 96 | exact m64Intrinsic_normal_variation_initial_fderiv_injective N (by norm_num) |
| 97 | (hu.differentiable (by simp) (x, 0)) |
| 98 | (Eventually.of_forall hboundary) (hvelocity x) (hunit x) (horth x) |
| 99 | obtain ⟨U, hU, hKU, hUinj⟩ := hKinj.exists_isOpen_superset hK |
| 100 | (fun z _ => hu.continuous.continuousAt) hlocal |
| 101 | obtain ⟨r, hr, hrU⟩ := hK.exists_cthickening_subset_open hU hKU |
| 102 | refine ⟨r, hr, hUinj.mono ?_⟩ |
| 103 | rintro ⟨x, t⟩ ⟨hx, ht⟩ |
| 104 | apply hrU |
| 105 | apply Metric.mem_cthickening_of_dist_le (x, t) (x, 0) r K ⟨hx, rfl⟩ |
| 106 | simp only [Prod.dist_eq, dist_self, Real.dist_eq, sub_zero] |
| 107 | exact max_le hr.le (abs_le.mpr ht) |
| 108 | |
| 109 | /-- The smooth normal exponential constructed from the metric has a positive-width embedded |
| 110 | collar over every compact arc shorter than a period. Source/construction: Morgan--Tian Claim |
| 111 | 19.37, printed pp. 468-469. -/ |
| 112 | theorem m64Intrinsic_exists_embedded_normal_arc_collars (N : IntrinsicAnnulus) : |
| 113 | ∃ (G : RiemannianMetric 2 AnnulusCoordinates) |
| 114 | (normal : ℝ → AnnulusCoordinates) (u : ℝ × ℝ → AnnulusCoordinates), |
| 115 | (∀ p ∈ standardAnnulusDomain, |
| 116 | G.euclideanCoefficients =ᶠ[𝓝 p] N.metric.euclideanCoefficients) ∧ |
| 117 | ContDiff ℝ ∞ normal ∧ ContDiff ℝ ∞ u ∧ |
| 118 | (∀ a, N.metric.inner (intrinsicAnnulusBoundary 1 a) (normal a) (normal a) = 1 ∧ |
| 119 | N.metric.inner (intrinsicAnnulusBoundary 1 a) (normal a) |
| 120 | (curveVelocity (n := 2) (intrinsicAnnulusBoundary 1) a) = 0 ∧ |
| 121 | 0 < inner ℝ (intrinsicAnnulusBoundary 1 a) (normal a)) ∧ |
| 122 | (∀ a, u (a, 0) = intrinsicAnnulusBoundary 1 a) ∧ |
| 123 | (∀ a, HasDerivAt (fun t => u (a, t)) (normal a) 0) ∧ |
| 124 | (∀ a, G.IsGeodesicOn (fun t => u (a, t)) (Icc (0 : ℝ) 1)) ∧ |
| 125 | ∀ a b : ℝ, b - a < rampPeriod → |
| 126 | ∃ r : ℝ, 0 < r ∧ InjOn u (Icc a b ×ˢ Icc (-r) r) := by |
| 127 | obtain ⟨G, normal, u, hG, hn, hu, hnormal, hboundary, hvelocity, hgeo⟩ := |
| 128 | m64Intrinsic_exists_smooth_extended_normal_map N |
| 129 | refine ⟨G, normal, u, hG, hn, hu, hnormal, hboundary, hvelocity, hgeo, ?_⟩ |
| 130 | intro a b hab |
| 131 | exact m64Intrinsic_normal_arc_has_embedded_collar N hu hboundary hvelocity |
| 132 | (fun s => (hnormal s).1) (fun s => (hnormal s).2.1) hab |
| 133 | |
| 134 | end PoincareMT |