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.Normal.Variation |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Slope |
| 3 | |
| 4 | /-! |
| 5 | # Boundary regularity and one-sided image of the normal variation |
| 6 | |
| 7 | The initial circle velocity and metric unit normal are independent, hence |
| 8 | the actual normal variation is an immersion at the boundary. Positive |
| 9 | radial pairing makes each short positive-time segment enter the annulus. |
| 10 | |
| 11 | Morgan--Tian context: Claim 19.37, printed pp. 468-469, in the proof of Proposition |
| 12 | 19.35. This module supplies actual normal-geodesic data or its coordinate and measure |
| 13 | transport. |
| 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 Manifold ContDiff Bundle |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 26 | normedSpaceTangentSpaceVectorSpace |
| 27 | |
| 28 | /-- The initial differential of the normal variation is injective; no immersion assumption |
| 29 | is retained. Source/construction: Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 30 | theorem m64Intrinsic_normal_variation_initial_fderiv_injective |
| 31 | (N : IntrinsicAnnulus) {radius : ℝ} (hradius : radius ≠ 0) |
| 32 | {F : ℝ × ℝ → AnnulusCoordinates} {a : ℝ} {normal : AnnulusCoordinates} |
| 33 | (hF : DifferentiableAt ℝ F (a, 0)) |
| 34 | (hboundary : (fun x => F (x, 0)) =ᶠ[𝓝 a] intrinsicAnnulusBoundary radius) |
| 35 | (hnormal : HasDerivAt (fun t => F (a, t)) normal 0) |
| 36 | (hunit : N.metric.inner (intrinsicAnnulusBoundary radius a) normal normal = 1) |
| 37 | (horth : N.metric.inner (intrinsicAnnulusBoundary radius a) normal |
| 38 | (curveVelocity (n := 2) (intrinsicAnnulusBoundary radius) a) = 0) : |
| 39 | Function.Injective (fderiv ℝ F (a, 0)) := by |
| 40 | let velocity : AnnulusCoordinates := curveVelocity (n := 2) (intrinsicAnnulusBoundary radius) a |
| 41 | let L := fderiv ℝ F (a, 0) |
| 42 | have hfst : L (1, 0) = velocity := by |
| 43 | have hd := hF.hasFDerivAt.comp_hasDerivAt (l := F) (f := fun x => (x, (0 : ℝ))) a |
| 44 | ((hasDerivAt_id a).prodMk (hasDerivAt_const a (0 : ℝ))) |
| 45 | have hg : HasDerivAt (fun x => F (x, 0)) velocity a := by |
| 46 | have h := m64Intrinsic_hasDerivAt_boundary radius a |
| 47 | rw [← m64Intrinsic_boundary_velocity] at h |
| 48 | exact h.congr_of_eventuallyEq hboundary |
| 49 | exact hd.unique hg |
| 50 | have hsnd : L (0, 1) = normal := by |
| 51 | have hd := hF.hasFDerivAt.comp_hasDerivAt (l := F) (f := fun t => (a, t)) 0 |
| 52 | ((hasDerivAt_const 0 a).prodMk (hasDerivAt_id 0)) |
| 53 | exact hd.unique hnormal |
| 54 | have hL (z : ℝ × ℝ) : L z = z.1 • velocity + z.2 • normal := by |
| 55 | have hz : z = z.1 • (1, 0) + z.2 • (0, 1) := by ext <;> simp |
| 56 | calc |
| 57 | L z = L (z.1 • (1, 0) + z.2 • (0, 1)) := congrArg L hz |
| 58 | _ = _ := by rw [map_add, map_smul, map_smul, hfst, hsnd] |
| 59 | have hvpos : 0 < N.metric.inner (intrinsicAnnulusBoundary radius a) velocity velocity := |
| 60 | Real.sqrt_pos.mp (m64Intrinsic_boundarySpeed_pos N hradius a) |
| 61 | change N.metric.inner (intrinsicAnnulusBoundary radius a) normal velocity = 0 at horth |
| 62 | have horth' : N.metric.inner (intrinsicAnnulusBoundary radius a) velocity normal = 0 := by |
| 63 | rw [N.metric.symm] |
| 64 | exact horth |
| 65 | apply (injective_iff_map_eq_zero L).mpr |
| 66 | intro z hz |
| 67 | have hsecond := congrArg (fun v => N.metric.inner |
| 68 | (intrinsicAnnulusBoundary radius a) v normal) hz |
| 69 | rw [hL] at hsecond |
| 70 | simp only [map_add, add_apply, map_smul, smul_apply, smul_eq_mul, |
| 71 | horth', hunit, mul_zero, zero_add, mul_one, map_zero, zero_apply] at hsecond |
| 72 | have hfirst := congrArg (fun v => N.metric.inner |
| 73 | (intrinsicAnnulusBoundary radius a) v velocity) hz |
| 74 | rw [hL] at hfirst |
| 75 | simp only [map_add, add_apply, map_smul, smul_apply, smul_eq_mul, |
| 76 | horth, mul_zero, add_zero, map_zero, zero_apply] at hfirst |
| 77 | have hzero : z.1 = 0 := (mul_eq_zero.mp hfirst).resolve_right hvpos.ne' |
| 78 | exact Prod.ext hzero hsecond |
| 79 | |
| 80 | /-- The constructed normal variation remains regular on a neighborhood of each initial |
| 81 | boundary point. This is qualitative; the scalar comparison later supplies the uniform radius |
| 82 | before the annulus exit time. Source/construction: Morgan--Tian Claim 19.37, printed pp. |
| 83 | 468-469. -/ |
| 84 | theorem m64Intrinsic_normal_variation_regular_neighborhood |
| 85 | (N : IntrinsicAnnulus) {radius : ℝ} (hradius : radius ≠ 0) |
| 86 | {F : ℝ × ℝ → AnnulusCoordinates} {a : ℝ} {normal : AnnulusCoordinates} |
| 87 | (hF : ContDiffAt ℝ ∞ F (a, 0)) |
| 88 | (hboundary : (fun x => F (x, 0)) =ᶠ[𝓝 a] intrinsicAnnulusBoundary radius) |
| 89 | (hnormal : HasDerivAt (fun t => F (a, t)) normal 0) |
| 90 | (hunit : N.metric.inner (intrinsicAnnulusBoundary radius a) normal normal = 1) |
| 91 | (horth : N.metric.inner (intrinsicAnnulusBoundary radius a) normal |
| 92 | (curveVelocity (n := 2) (intrinsicAnnulusBoundary radius) a) = 0) : |
| 93 | ∃ U : Set (ℝ × ℝ), IsOpen U ∧ (a, 0) ∈ U ∧ |
| 94 | ∀ z ∈ U, Function.Injective (fderiv ℝ F z) := by |
| 95 | have hinj := m64Intrinsic_normal_variation_initial_fderiv_injective N hradius |
| 96 | (hF.differentiableAt (by simp)) hboundary hnormal hunit horth |
| 97 | have hdim : Module.finrank ℝ (ℝ × ℝ) = Module.finrank ℝ AnnulusCoordinates := by simp |
| 98 | have hsurj := (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hdim).mp hinj |
| 99 | let A : (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates := |
| 100 | (LinearEquiv.ofBijective (fderiv ℝ F (a, 0)).toLinearMap ⟨hinj, hsurj⟩).toContinuousLinearEquiv |
| 101 | have hA : A.toContinuousLinearMap = fderiv ℝ F (a, 0) := rfl |
| 102 | have hnear : {z : ℝ × ℝ | (fderiv ℝ F z).IsInvertible} ∈ 𝓝 (a, 0) := by |
| 103 | have h := A.nhds |
| 104 | rw [hA] at h |
| 105 | exact ((hF.fderiv_right (m := 0) (by simp)).continuousAt).preimage_mem_nhds h |
| 106 | obtain ⟨U, hUsub, hU, ha⟩ := mem_nhds_iff.mp hnear |
| 107 | exact ⟨U, hU, ha, fun z hz => (hUsub hz).injective⟩ |
| 108 | |
| 109 | /-- A positive radial initial velocity enters the annulus at positive time. This uses the |
| 110 | actual norm defining `standardAnnulusDomain`. Source/construction: Morgan--Tian Claim 19.37, |
| 111 | printed pp. 468-469. -/ |
| 112 | theorem m64Intrinsic_inward_curve_enters_annulus |
| 113 | {gamma : ℝ → AnnulusCoordinates} {a : ℝ} {v : AnnulusCoordinates} |
| 114 | (hzero : gamma 0 = intrinsicAnnulusBoundary 1 a) |
| 115 | (hderiv : HasDerivAt gamma v 0) |
| 116 | (hinward : 0 < inner ℝ (intrinsicAnnulusBoundary 1 a) v) : |
| 117 | ∃ epsilon : ℝ, 0 < epsilon ∧ |
| 118 | ∀ t ∈ Ioo (0 : ℝ) epsilon, 1 < ‖gamma t‖ ∧ ‖gamma t‖ < 2 := by |
| 119 | have hnorm : ‖gamma 0‖ = 1 := by |
| 120 | have h := m64Intrinsic_boundary_self_inner 1 a |
| 121 | rw [real_inner_self_eq_norm_sq] at h |
| 122 | rw [hzero] |
| 123 | nlinarith [norm_nonneg (intrinsicAnnulusBoundary 1 a)] |
| 124 | have hnormsq : HasDerivAt (fun t => ‖gamma t‖ ^ 2) |
| 125 | (2 * inner ℝ (gamma 0) v) 0 := by |
| 126 | convert! (hasStrictFDerivAt_norm_sq (gamma 0)).hasFDerivAt.comp_hasDerivAt |
| 127 | (l := fun p : AnnulusCoordinates => ‖p‖ ^ 2) (f := gamma) 0 hderiv using 1 |
| 128 | simp only [two_smul, add_apply, innerSL_apply_apply, two_mul] |
| 129 | have hpos : 0 < 2 * inner ℝ (gamma 0) v := by rw [hzero]; positivity |
| 130 | have hslope := hnormsq.tendsto_slope_zero_right |
| 131 | have heventual : ∀ᶠ t in 𝓝[>] (0 : ℝ), 1 < ‖gamma t‖ := by |
| 132 | filter_upwards [hslope.eventually (Ioi_mem_nhds hpos), self_mem_nhdsWithin] with t ht htp |
| 133 | change 0 < t at htp |
| 134 | simp only [zero_add, hnorm, one_pow, smul_eq_mul] at ht |
| 135 | have hsq : 0 < ‖gamma t‖ ^ 2 - 1 := by |
| 136 | have h := (mul_pos_iff_of_pos_left (inv_pos.mpr htp)).mp ht |
| 137 | exact h |
| 138 | nlinarith [norm_nonneg (gamma t)] |
| 139 | have hupper : ∀ᶠ t in 𝓝[>] (0 : ℝ), ‖gamma t‖ < 2 := by |
| 140 | exact (hderiv.continuousAt.norm.eventually (Iio_mem_nhds (by |
| 141 | change ‖gamma 0‖ < 2 |
| 142 | rw [hnorm] |
| 143 | norm_num))).filter_mono nhdsWithin_le_nhds |
| 144 | obtain ⟨epsilon, hepsilon, hsub⟩ := |
| 145 | mem_nhdsGT_iff_exists_Ioc_subset.mp (heventual.and hupper) |
| 146 | exact ⟨epsilon, hepsilon, fun t ht => hsub ⟨ht.1, ht.2.le⟩⟩ |
| 147 | |
| 148 | end PoincareMT |