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.No.Conjugate |
| 2 | |
| 3 | /-! |
| 4 | # Jacobi lower bounds for the inward normal strip |
| 5 | |
| 6 | Unlike the polar coefficient, the normal-strip coefficient starts at one. |
| 7 | The comparison below proves positivity by a first-zero argument and compares |
| 8 | it to a positive constant-curvature model with the same initial value and a |
| 9 | smaller initial derivative. Source: Morgan--Tian, Claim 19.37, pp. 468-469. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Topology Manifold ContDiff |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- A nonnegative Wronskian derivative and initial Wronskian make the ratio to a positive |
| 22 | model nondecreasing. Source/construction: Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 23 | theorem m64Intrinsic_jacobi_ratio_monotone |
| 24 | {R : ℝ} (hR : 0 < R) {J J' J'' M M' M'' : ℝ → ℝ} |
| 25 | (hJ : ∀ t ∈ Icc (0 : ℝ) R, HasDerivAt J (J' t) t) |
| 26 | (hJ' : ContinuousOn J' (Icc (0 : ℝ) R)) |
| 27 | (hJ'' : ∀ t ∈ Ioo (0 : ℝ) R, HasDerivAt J' (J'' t) t) |
| 28 | (hM : ∀ t ∈ Icc (0 : ℝ) R, HasDerivAt M (M' t) t) |
| 29 | (hM' : ContinuousOn M' (Icc (0 : ℝ) R)) |
| 30 | (hM'' : ∀ t ∈ Ioo (0 : ℝ) R, HasDerivAt M' (M'' t) t) |
| 31 | (hpos : ∀ t ∈ Icc (0 : ℝ) R, 0 < M t) |
| 32 | (hinitial : 0 ≤ J' 0 * M 0 - J 0 * M' 0) |
| 33 | (hineq : ∀ t ∈ Ioo (0 : ℝ) R, 0 ≤ J'' t * M t - J t * M'' t) : |
| 34 | MonotoneOn (fun t => J t / M t) (Icc (0 : ℝ) R) := by |
| 35 | have hJc : ContinuousOn J (Icc (0 : ℝ) R) := |
| 36 | fun t ht => (hJ t ht).continuousAt.continuousWithinAt |
| 37 | have hMc : ContinuousOn M (Icc (0 : ℝ) R) := |
| 38 | fun t ht => (hM t ht).continuousAt.continuousWithinAt |
| 39 | have hWd (t : ℝ) (ht : t ∈ Ioo (0 : ℝ) R) : |
| 40 | HasDerivAt (fun s => J' s * M s - J s * M' s) |
| 41 | (J'' t * M t - J t * M'' t) t := by |
| 42 | convert! ((hJ'' t ht).mul (hM t ⟨ht.1.le, ht.2.le⟩)).sub |
| 43 | ((hJ t ⟨ht.1.le, ht.2.le⟩).mul (hM'' t ht)) using 1 |
| 44 | ring |
| 45 | have hWmono : MonotoneOn (fun t => J' t * M t - J t * M' t) |
| 46 | (Icc (0 : ℝ) R) := by |
| 47 | apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc _ _) |
| 48 | ((hJ'.mul hMc).sub (hJc.mul hM')) |
| 49 | (fun t ht => (hWd t (by simpa only [interior_Icc] using ht)).hasDerivWithinAt) |
| 50 | intro t ht |
| 51 | exact hineq t (by simpa only [interior_Icc] using ht) |
| 52 | apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc _ _) |
| 53 | (hJc.div hMc (fun t ht => (hpos t ht).ne')) |
| 54 | (fun t ht => ((hJ t (interior_subset ht)).div |
| 55 | (hM t (interior_subset ht)) (hpos t (interior_subset ht)).ne').hasDerivWithinAt) |
| 56 | intro t ht |
| 57 | have ht' : t ∈ Icc (0 : ℝ) R := interior_subset ht |
| 58 | exact div_nonneg (hinitial.trans (hWmono ⟨le_rfl, hR.le⟩ ht' ht'.1)) (sq_nonneg _) |
| 59 | |
| 60 | /-- An upper curvature coefficient bound gives a lower Jacobi bound against any positive |
| 61 | model. Positivity of the compared solution is a conclusion. Source/construction: |
| 62 | Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 63 | theorem m64Intrinsic_jacobi_ge_positive_model |
| 64 | {R kappa : ℝ} (hR : 0 < R) {J J' J'' M M' M'' k : ℝ → ℝ} |
| 65 | (hJ : ∀ t ∈ Icc (0 : ℝ) R, HasDerivAt J (J' t) t) |
| 66 | (hJ' : ContinuousOn J' (Icc (0 : ℝ) R)) |
| 67 | (hJ'' : ∀ t ∈ Ioo (0 : ℝ) R, HasDerivAt J' (J'' t) t) |
| 68 | (hM : ∀ t ∈ Icc (0 : ℝ) R, HasDerivAt M (M' t) t) |
| 69 | (hM' : ContinuousOn M' (Icc (0 : ℝ) R)) |
| 70 | (hM'' : ∀ t ∈ Ioo (0 : ℝ) R, HasDerivAt M' (M'' t) t) |
| 71 | (hpos : ∀ t ∈ Icc (0 : ℝ) R, 0 < M t) |
| 72 | (hzero : J 0 = M 0) (hinitial : M' 0 ≤ J' 0) |
| 73 | (hjac : ∀ t ∈ Ioo (0 : ℝ) R, J'' t + k t * J t = 0) |
| 74 | (hmodel : ∀ t ∈ Ioo (0 : ℝ) R, M'' t + kappa ^ 2 * M t = 0) |
| 75 | (hk : ∀ t ∈ Ioo (0 : ℝ) R, k t ≤ kappa ^ 2) : |
| 76 | ∀ t ∈ Icc (0 : ℝ) R, M t ≤ J t := by |
| 77 | have hM0 := hpos 0 ⟨le_rfl, hR.le⟩ |
| 78 | have hJc : ContinuousOn J (Icc (0 : ℝ) R) := |
| 79 | fun t ht => (hJ t ht).continuousAt.continuousWithinAt |
| 80 | have hW0 : 0 ≤ J' 0 * M 0 - J 0 * M' 0 := by |
| 81 | rw [hzero] |
| 82 | nlinarith [mul_le_mul_of_nonneg_right hinitial hM0.le] |
| 83 | have hineq (t : ℝ) (ht : t ∈ Ioo (0 : ℝ) R) (hjt : 0 ≤ J t) : |
| 84 | 0 ≤ J'' t * M t - J t * M'' t := by |
| 85 | have hJval : J'' t = -k t * J t := by linarith [hjac t ht] |
| 86 | have hMval : M'' t = -kappa ^ 2 * M t := by linarith [hmodel t ht] |
| 87 | rw [hJval, hMval] |
| 88 | have hp := mul_nonneg (mul_nonneg (sub_nonneg.mpr (hk t ht)) hjt) |
| 89 | (hpos t ⟨ht.1.le, ht.2.le⟩).le |
| 90 | nlinarith |
| 91 | have hpositive : ∀ t ∈ Icc (0 : ℝ) R, 0 < J t := by |
| 92 | intro t ht |
| 93 | by_contra hnot |
| 94 | let S : Set ℝ := Icc 0 t ∩ J ⁻¹' Iic 0 |
| 95 | have hSc : IsCompact S := by |
| 96 | apply (isCompact_Icc : IsCompact (Icc (0 : ℝ) t)).of_isClosed_subset |
| 97 | · exact (hJc.mono (Icc_subset_Icc le_rfl ht.2)).preimage_isClosed_of_isClosed |
| 98 | isClosed_Icc isClosed_Iic |
| 99 | · exact inter_subset_left |
| 100 | have hSne : S.Nonempty := ⟨t, ⟨⟨ht.1, le_rfl⟩, le_of_not_gt hnot⟩⟩ |
| 101 | obtain ⟨c, hc, hmin⟩ := hSc.exists_isLeast hSne |
| 102 | have hcpos : 0 < c := by |
| 103 | refine lt_of_le_of_ne hc.1.1 ?_ |
| 104 | intro heq |
| 105 | have hbad := hc.2 |
| 106 | change J c ≤ 0 at hbad |
| 107 | rw [← heq, hzero] at hbad |
| 108 | exact hM0.not_ge hbad |
| 109 | have hcR : c ≤ R := hc.1.2.trans ht.2 |
| 110 | have hbefore (s : ℝ) (hs : s ∈ Ioo (0 : ℝ) c) : 0 < J s := by |
| 111 | by_contra hnot |
| 112 | have hsS : s ∈ S := ⟨⟨hs.1.le, hs.2.le.trans hc.1.2⟩, le_of_not_gt hnot⟩ |
| 113 | exact hs.2.not_ge (hmin hsS) |
| 114 | have hratio := m64Intrinsic_jacobi_ratio_monotone hcpos |
| 115 | (fun s hs => hJ s ⟨hs.1, hs.2.trans hcR⟩) |
| 116 | (hJ'.mono (Icc_subset_Icc le_rfl hcR)) |
| 117 | (fun s hs => hJ'' s ⟨hs.1, hs.2.trans_le hcR⟩) |
| 118 | (fun s hs => hM s ⟨hs.1, hs.2.trans hcR⟩) |
| 119 | (hM'.mono (Icc_subset_Icc le_rfl hcR)) |
| 120 | (fun s hs => hM'' s ⟨hs.1, hs.2.trans_le hcR⟩) |
| 121 | (fun s hs => hpos s ⟨hs.1, hs.2.trans hcR⟩) hW0 |
| 122 | (fun s hs => hineq s ⟨hs.1, hs.2.trans_le hcR⟩ (hbefore s hs).le) |
| 123 | have hquot := hratio ⟨le_rfl, hcpos.le⟩ ⟨hcpos.le, le_rfl⟩ hcpos.le |
| 124 | change J 0 / M 0 ≤ J c / M c at hquot |
| 125 | rw [hzero, div_self hM0.ne'] at hquot |
| 126 | have hnonpos := div_nonpos_of_nonpos_of_nonneg hc.2 (hpos c ⟨hcpos.le, hcR⟩).le |
| 127 | linarith |
| 128 | have hratio := m64Intrinsic_jacobi_ratio_monotone hR hJ hJ' hJ'' hM hM' hM'' hpos |
| 129 | hW0 (fun t ht => hineq t ht (hpositive t ⟨ht.1.le, ht.2.le⟩).le) |
| 130 | intro t ht |
| 131 | have hquot := hratio ⟨le_rfl, hR.le⟩ ht ht.1 |
| 132 | change J 0 / M 0 ≤ J t / M t at hquot |
| 133 | rw [hzero, div_self hM0.ne'] at hquot |
| 134 | exact (one_le_div (hpos t ht)).mp hquot |
| 135 | |
| 136 | end PoincareMT |