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.RicciFlow.ReducedGeometry.ReducedLength.Barrier.SmoothJoinDensityBound |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Barrier.JoinIntegralEstimate |
| 3 | |
| 4 | /-! |
| 5 | # Admissible smooth approximations of broken square-time curves |
| 6 | |
| 7 | The interpolation preserves both outer endpoints. Its action error is |
| 8 | bounded by the width of the transition interval times one fixed constant. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | set_option maxHeartbeats 800000 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | theorem squareCurveActionDensity_intervalIntegrable {J : Set ℝ} (F : RicciFlow n M J) |
| 25 | (hM04 : RicciFlowCurvatureTheory.{u}) (T τmax : ℝ) (hτmax : 0 < τmax) |
| 26 | (hwindow : Set.Icc (T - τmax) T ⊆ J) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 27 | (α : ℝ → M) (D : Set ℝ) (hD : IsOpen D) (hI : Set.Icc 0 (Real.sqrt b) ⊆ D) |
| 28 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α D) : |
| 29 | IntervalIntegrable (squareCurveActionDensity F T α) MeasureTheory.volume 0 (Real.sqrt b) := by |
| 30 | let U := D ∩ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) |
| 31 | have hU : IsOpen U := hD.inter isOpen_Ioo |
| 32 | have hIU : Set.Icc 0 (Real.sqrt b) ⊆ U := by |
| 33 | intro s hs |
| 34 | exact ⟨hI hs, (neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le hs.1, |
| 35 | hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 36 | exact ((squareCurveActionDensity_contDiffOn F hM04 T τmax hτmax hwindow α U hU |
| 37 | (hα.mono Set.inter_subset_left) Set.inter_subset_right).continuousOn.mono hIU).intervalIntegrable_of_Icc |
| 38 | (Real.sqrt_nonneg b) |
| 39 | |
| 40 | theorem exists_backwardPath_smoothJoin_action_le {J : Set ℝ} (F : RicciFlow n M J) |
| 41 | (hM04 : RicciFlowCurvatureTheory.{u}) (T τmax : ℝ) (hτmax : 0 < τmax) |
| 42 | (hwindow : Set.Icc (T - τmax) T ⊆ J) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 43 | (α β : ℝ → M) (D : Set ℝ) (hD : IsOpen D) (hI : Set.Icc 0 (Real.sqrt b) ⊆ D) |
| 44 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α D) |
| 45 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ β D) |
| 46 | (c : ℝ) (hc : c ∈ Set.Ioo 0 (Real.sqrt b)) (heq : α c = β c) |
| 47 | (η : ℝ) (hη : 0 < η) : |
| 48 | ∃ P : BackwardTimePath F T 0 b, P.curve 0 = α 0 ∧ P.curve b = β (Real.sqrt b) ∧ |
| 49 | backwardLLength F T 0 b P.curve ≤ |
| 50 | (∫ s in 0..c, squareCurveActionDensity F T α s) + |
| 51 | (∫ s in c..Real.sqrt b, squareCurveActionDensity F T β s) + η := by |
| 52 | let U := D ∩ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) |
| 53 | have hU : IsOpen U := hD.inter isOpen_Ioo |
| 54 | have hIU : Set.Icc 0 (Real.sqrt b) ⊆ U := by |
| 55 | intro s hs |
| 56 | exact ⟨hI hs, (neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le hs.1, |
| 57 | hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 58 | have hαU := hα.mono (show U ⊆ D from Set.inter_subset_left) |
| 59 | have hβU := hβ.mono (show U ⊆ D from Set.inter_subset_left) |
| 60 | obtain ⟨r, hr, hrc, hcr, C, hC, hjoin⟩ := exists_smoothJoin_uniform_density |
| 61 | F hM04 T τmax hτmax hwindow α β U hU hαU hβU Set.inter_subset_right |
| 62 | (Real.sqrt b) c hIU hc heq |
| 63 | let d := min (r / 2) (η / (8 * (C + 1))) |
| 64 | have hd : 0 < d := lt_min (by positivity) (by positivity) |
| 65 | have hdr : d < r := (min_le_left _ _).trans_lt (by linarith) |
| 66 | have herror : 4 * C * d ≤ η := by |
| 67 | have hden : 0 < 8 * (C + 1) := by positivity |
| 68 | have hsmall : d * (8 * (C + 1)) ≤ η := |
| 69 | (le_div_iff₀ hden).mp (min_le_right _ _) |
| 70 | nlinarith [mul_nonneg hC hd.le] |
| 71 | obtain ⟨γ, hγ, hleft, hright, hbound⟩ := hjoin d hd hdr |
| 72 | obtain ⟨P, hP, hPaction⟩ := exists_backwardPath_of_smoothSquareCurve F hM04 T τmax |
| 73 | hτmax hwindow b hb hmax γ U hU hIU hγ |
| 74 | have hiα := squareCurveActionDensity_intervalIntegrable F hM04 T τmax hτmax hwindow |
| 75 | b hb hmax α U hU hIU hαU |
| 76 | have hiβ := squareCurveActionDensity_intervalIntegrable F hM04 T τmax hτmax hwindow |
| 77 | b hb hmax β U hU hIU hβU |
| 78 | have hiγ := squareCurveActionDensity_intervalIntegrable F hM04 T τmax hτmax hwindow |
| 79 | b hb hmax γ U hU hIU hγ |
| 80 | have hdleft : Set.EqOn (squareCurveActionDensity F T γ) (squareCurveActionDensity F T α) |
| 81 | (Set.Ioo 0 (c - d)) := by |
| 82 | intro s hs |
| 83 | apply squareCurveActionDensity_congr |
| 84 | filter_upwards [gt_mem_nhds hs.2] with t ht |
| 85 | exact hleft ht.le |
| 86 | have hdright : Set.EqOn (squareCurveActionDensity F T γ) (squareCurveActionDensity F T β) |
| 87 | (Set.Ioo (c + d) (Real.sqrt b)) := by |
| 88 | intro s hs |
| 89 | apply squareCurveActionDensity_congr |
| 90 | filter_upwards [lt_mem_nhds hs.1] with t ht |
| 91 | exact hright ht.le |
| 92 | have hestimate := integral_join_error_bound (squareCurveActionDensity F T α) |
| 93 | (squareCurveActionDensity F T β) (squareCurveActionDensity F T γ) |
| 94 | 0 (Real.sqrt b) c d C hd (by linarith) (by linarith) hiα hiβ hiγ hdleft hdright hbound |
| 95 | refine ⟨P, ?_, ?_, ?_⟩ |
| 96 | · simp only [hP, Real.sqrt_zero] |
| 97 | exact hleft (by change (0 : ℝ) ≤ c - d; linarith) |
| 98 | · rw [hP] |
| 99 | exact hright (by change c + d ≤ Real.sqrt b; linarith) |
| 100 | · change backwardLLength F T 0 b P.curve ≤ _ |
| 101 | rw [hPaction] |
| 102 | change (∫ s in 0..Real.sqrt b, squareCurveActionDensity F T γ s) ≤ _ |
| 103 | have hle := (le_abs_self ((∫ s in 0..Real.sqrt b, squareCurveActionDensity F T γ s) - |
| 104 | ((∫ s in 0..c, squareCurveActionDensity F T α s) + |
| 105 | ∫ s in c..Real.sqrt b, squareCurveActionDensity F T β s))).trans hestimate |
| 106 | linarith |
| 107 | |
| 108 | end PoincareMT.ReducedLength |