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.LGeometry.Continuation.CompleteFlowDerivativeBound |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.ScalarTraceDerivative |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Continuation.ContinuationSpeed |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Path.ReferenceEnergy |
| 5 | |
| 6 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/ContinuationBound.lean` at |
| 7 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 8 | |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set Filter Topology |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.LGeometry |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | set_option maxHeartbeats 1500000 in |
| 26 | /-- A common reference-metric speed bound for all leftward Euler extensions of a seed. -/ |
| 27 | theorem exists_uniform_continuation_referenceSpeedSq_bound {J : Set ℝ} |
| 28 | [ConnectedSpace M] [T3Space M] [SecondCountableTopology M] |
| 29 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 30 | (T τmax c : ℝ) (hc : 0 < c) (hcm : c ^ 2 < τmax) |
| 31 | (hwindow : Icc (T - τmax) T ⊆ J) |
| 32 | (hcurvature : CompleteBoundedCurvatureOn F (Icc (T - τmax) T)) : |
| 33 | ∃ D : ℝ, 0 < D ∧ ∀ (a b : ℝ) (α : ℝ → M), |
| 34 | 0 ≤ a → a < c → c < b → |
| 35 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α (Ioo a b) → |
| 36 | (∀ r ∈ Ioo a b, T - r ^ 2 ∈ J) → |
| 37 | ∀ E : ParametricAlongCurveExtensionOn (Ioo a b) α |
| 38 | (curveVelocityWithin (n := n) α (Ioo a b)), |
| 39 | (∀ r ∈ Ioo a b, regularizedLGeodesicEquation F T α (Ioo a b) E r) → |
| 40 | ∀ s ∈ Ioc a c, referenceSpeedSq (F.metric T) α s ≤ |
| 41 | D * (continuationSpeedSq F T α (Ioo a b) c + 1) := by |
| 42 | obtain ⟨K, hK, hRm⟩ := hcurvature.2 |
| 43 | obtain ⟨B, hB, hgrad⟩ := exists_uniform_curvatureDerivative_bound F hM04 T τmax |
| 44 | (c ^ 2) ((sq_nonneg c).trans_lt hcm) hcm hwindow hcurvature |
| 45 | let C := 4 * c ^ 2 * (n : ℝ) ^ 3 * B + 4 * c * (n : ℝ) ^ 3 * K |
| 46 | let D := Real.exp (2 * (n : ℝ) * K * τmax) * Real.exp (C * c) |
| 47 | have hC : 0 ≤ C := by dsimp only [C]; positivity |
| 48 | refine ⟨D, by dsimp only [D]; positivity, ?_⟩ |
| 49 | intro a b α ha hac hcb hα htime E heq s hs |
| 50 | let U := Ioo a b |
| 51 | let A := curveVelocityWithin (n := n) α U |
| 52 | let q := continuationSpeedSq F T α U |
| 53 | let R := fun r ↦ scalarCurvatureDifferential F (fun t ↦ T - t ^ 2) α r (A r) |
| 54 | let Ric := fun r ↦ (F.connection (T - r ^ 2)).ricci (α r) (A r) (A r) |
| 55 | let q' := fun r ↦ 4 * r ^ 2 * R r - 4 * r * Ric r |
| 56 | have hqnonneg (r : ℝ) : 0 ≤ q r := continuationSpeedSq_nonneg F T α U r |
| 57 | have hsub : Icc s c ⊆ Ioo a b := by |
| 58 | intro r hr |
| 59 | exact ⟨hs.1.trans_le hr.1, hr.2.trans_lt hcb⟩ |
| 60 | have hqcont : ContinuousOn q (Icc s c) := |
| 61 | (continuationSpeedSq_contDiffOn F T α (uniqueDiffOn_Ioo a b) isOpen_Ioo |
| 62 | subset_rfl hα htime).continuousOn.mono hsub |
| 63 | have hqd (r : ℝ) (hr : r ∈ Ioo s c) : HasDerivAt q (q' r) r := by |
| 64 | have hrU := hsub (Ioo_subset_Icc_self hr) |
| 65 | have h := continuationSpeedSq_hasDerivAt F hM04 T α (uniqueDiffOn_Ioo a b) |
| 66 | isOpen_Ioo subset_rfl hα htime E hrU (isOpen_Ioo.mem_nhds hrU) |
| 67 | have he := heq r hrU (A r) |
| 68 | unfold regularizedEulerResidual at he |
| 69 | convert h using 1 <;> dsimp only [q', R, Ric, A, U] at he ⊢ <;> linarith |
| 70 | have hbound (r : ℝ) (hr : r ∈ Ioo s c) : -(C * (q r + 1)) ≤ q' r := by |
| 71 | have hr0 : 0 ≤ r := ha.trans (hs.1.trans hr.1).le |
| 72 | have hrsq : r ^ 2 ≤ c ^ 2 := by nlinarith [hr.2] |
| 73 | have htimeR : T - r ^ 2 ∈ Icc (T - τmax) T := |
| 74 | ⟨by linarith [hrsq], sub_le_self T (sq_nonneg r)⟩ |
| 75 | have hR : |R r| ≤ (n : ℝ) ^ 3 * B * Real.sqrt (q r) := by |
| 76 | have h := scalarCurvature_differential_abs_le hM04 |
| 77 | (F.connection (T - r ^ 2)) (α r) (A r) |
| 78 | change |R r| ≤ (n : ℝ) ^ 3 * |
| 79 | (F.connection (T - r ^ 2)).curvatureDerivativeNorm 1 (α r) * Real.sqrt (q r) at h |
| 80 | exact h.trans (mul_le_mul_of_nonneg_right |
| 81 | (mul_le_mul_of_nonneg_left (hgrad (r ^ 2) ⟨sq_nonneg r, hrsq⟩ (α r)) |
| 82 | (by positivity)) (Real.sqrt_nonneg _)) |
| 83 | have hRic : |Ric r| ≤ (n : ℝ) ^ 3 * K * q r := by |
| 84 | have h := ricci_quadratic_abs_le hM04 (F.connection (T - r ^ 2)) (α r) (A r) |
| 85 | change |Ric r| ≤ (n : ℝ) ^ 3 * |
| 86 | (F.connection (T - r ^ 2)).curvatureTensorNorm (α r) * q r at h |
| 87 | exact h.trans (mul_le_mul_of_nonneg_right |
| 88 | (mul_le_mul_of_nonneg_left ((le_abs_self _).trans (hRm _ htimeR (α r))) |
| 89 | (by positivity)) (hqnonneg r)) |
| 90 | have hsqrt : Real.sqrt (q r) ≤ q r + 1 := by |
| 91 | apply Real.sqrt_le_iff.mpr |
| 92 | constructor |
| 93 | · linarith [hqnonneg r] |
| 94 | · nlinarith [hqnonneg r, sq_nonneg (q r)] |
| 95 | have hRterm : 4 * r ^ 2 * |R r| ≤ |
| 96 | (4 * c ^ 2 * (n : ℝ) ^ 3 * B) * (q r + 1) := by |
| 97 | calc |
| 98 | _ ≤ 4 * r ^ 2 * ((n : ℝ) ^ 3 * B * Real.sqrt (q r)) := |
| 99 | mul_le_mul_of_nonneg_left hR (by positivity) |
| 100 | _ = (4 * r ^ 2 * (n : ℝ) ^ 3 * B) * Real.sqrt (q r) := by ring |
| 101 | _ ≤ _ := mul_le_mul (by gcongr) hsqrt (Real.sqrt_nonneg _) (by positivity) |
| 102 | have hRicterm : 4 * r * |Ric r| ≤ |
| 103 | (4 * c * (n : ℝ) ^ 3 * K) * (q r + 1) := by |
| 104 | calc |
| 105 | _ ≤ 4 * r * ((n : ℝ) ^ 3 * K * q r) := |
| 106 | mul_le_mul_of_nonneg_left hRic (by positivity) |
| 107 | _ = (4 * r * (n : ℝ) ^ 3 * K) * q r := by ring |
| 108 | _ ≤ _ := mul_le_mul (by gcongr; exact hr.2.le) (by linarith) |
| 109 | (hqnonneg r) (by positivity) |
| 110 | calc |
| 111 | -(C * (q r + 1)) = -((4 * c ^ 2 * (n : ℝ) ^ 3 * B) * (q r + 1) + |
| 112 | (4 * c * (n : ℝ) ^ 3 * K) * (q r + 1)) := by dsimp only [C]; ring |
| 113 | _ ≤ -(4 * r ^ 2 * |R r| + 4 * r * |Ric r|) := |
| 114 | neg_le_neg (add_le_add hRterm hRicterm) |
| 115 | _ ≤ q' r := by |
| 116 | dsimp only [q'] |
| 117 | have h₁ := mul_le_mul_of_nonneg_left (neg_abs_le (R r)) |
| 118 | (by positivity : 0 ≤ 4 * r ^ 2) |
| 119 | have h₂ := mul_le_mul_of_nonneg_left (le_abs_self (Ric r)) |
| 120 | (by positivity : 0 ≤ 4 * r) |
| 121 | linarith |
| 122 | have hqbound : q s ≤ Real.exp (C * c) * (q c + 1) := |
| 123 | backward_gronwall_uniform_bound (ha.trans hs.1.le) hC (hqnonneg c) |
| 124 | hqcont hqd hbound ⟨le_rfl, hs.2⟩ |
| 125 | have hsU := hsub ⟨le_rfl, hs.2⟩ |
| 126 | have hA : A s = curveVelocity (n := n) α s := by |
| 127 | simp only [A, U, curveVelocityWithin, curveVelocity, |
| 128 | mfderivWithin_of_mem_nhds (isOpen_Ioo.mem_nhds hsU)] |
| 129 | have hssq : s ^ 2 ≤ τmax := by |
| 130 | have hs0 := ha.trans hs.1.le |
| 131 | nlinarith [hs.2] |
| 132 | have hcomp := (backwardPath_metric_comparison (τ₁ := 0) (τ₂ := s ^ 2) |
| 133 | hM04 hwindow le_rfl (sq_nonneg s) hssq hK hRm (α s) (A s)).2 |
| 134 | simp only [sub_zero] at hcomp |
| 135 | calc |
| 136 | referenceSpeedSq (F.metric T) α s = (F.metric T).inner (α s) (A s) (A s) := by |
| 137 | rw [hA] |
| 138 | rfl |
| 139 | _ ≤ Real.exp (2 * (n : ℝ) * K * s ^ 2) * q s := hcomp |
| 140 | _ ≤ Real.exp (2 * (n : ℝ) * K * τmax) * q s := by |
| 141 | apply mul_le_mul_of_nonneg_right _ (hqnonneg s) |
| 142 | apply Real.exp_le_exp.mpr |
| 143 | exact mul_le_mul_of_nonneg_left hssq (by positivity) |
| 144 | _ ≤ Real.exp (2 * (n : ℝ) * K * τmax) * |
| 145 | (Real.exp (C * c) * (q c + 1)) := |
| 146 | mul_le_mul_of_nonneg_left hqbound (Real.exp_pos _).le |
| 147 | _ = D * (continuationSpeedSq F T α (Ioo a b) c + 1) := by |
| 148 | dsimp only [D, q, U] |
| 149 | ring |
| 150 | |
| 151 | end PoincareMT.LGeometry |