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.Path.CompleteMetricBalls |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Theory |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/CompleteFlowDerivativeBound.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter Topology |
| 14 | open scoped Manifold ContDiff Bundle ENNReal |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.LGeometry |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | def shiftedContinuationFlow {J : Set ℝ} (F : RicciFlow n M J) |
| 24 | (T τmax : ℝ) (hτmax : 0 < τmax) (hwindow : Icc (T - τmax) T ⊆ J) : |
| 25 | RicciFlow n M (Icc 0 τmax) where |
| 26 | metric t := F.metric (T - τmax + t) |
| 27 | connection t := F.connection (T - τmax + t) |
| 28 | interval := ordConnected_Icc |
| 29 | nontrivial := ⟨0, ⟨le_rfl, hτmax.le⟩, τmax, ⟨hτmax.le, le_rfl⟩, ne_of_lt hτmax⟩ |
| 30 | smooth := by |
| 31 | have hm : MapsTo (fun z : ℝ × M ↦ (T - τmax + z.1, z.2)) |
| 32 | (Icc 0 τmax ×ˢ univ) (J ×ˢ univ) := by |
| 33 | intro z hz |
| 34 | exact ⟨hwindow ⟨by linarith [hz.1.1], by linarith [hz.1.2]⟩, mem_univ _⟩ |
| 35 | exact F.smooth.comp |
| 36 | ((contMDiff_const.add contMDiff_fst).prodMk contMDiff_snd).contMDiffOn hm |
| 37 | equation t ht x v w := by |
| 38 | have hm : MapsTo (fun r : ℝ ↦ T - τmax + r) (Icc 0 τmax) J := by |
| 39 | intro r hr |
| 40 | exact hwindow ⟨by linarith [hr.1], by linarith [hr.2]⟩ |
| 41 | have h := (F.equation (T - τmax + t) (hm ht) x v w).comp t |
| 42 | ((hasDerivAt_id t).const_add (T - τmax)).hasDerivWithinAt hm |
| 43 | simpa only [mul_one, Function.comp_def] using h |
| 44 | |
| 45 | set_option maxHeartbeats 1000000 in |
| 46 | theorem exists_uniform_curvatureDerivative_bound {J : Set ℝ} |
| 47 | [ConnectedSpace M] [T3Space M] [SecondCountableTopology M] |
| 48 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 49 | (T τmax τ₁ : ℝ) (hτmax : 0 < τmax) (hτ₁ : τ₁ < τmax) |
| 50 | (hwindow : Icc (T - τmax) T ⊆ J) |
| 51 | (hcurvature : CompleteBoundedCurvatureOn F (Icc (T - τmax) T)) : |
| 52 | ∃ B : ℝ, 0 < B ∧ ∀ τ ∈ Icc 0 τ₁, ∀ x : M, |
| 53 | (F.connection (T - τ)).curvatureDerivativeNorm 1 x ≤ B := by |
| 54 | obtain ⟨K, hK, hRm⟩ := hcurvature.2 |
| 55 | let G := shiftedContinuationFlow F T τmax hτmax hwindow |
| 56 | have hK' : 0 < K + 1 := by linarith |
| 57 | obtain ⟨C, hC, hshi⟩ := hM04.local_derivative_estimates n 1 (K + 1) |
| 58 | ((K + 1) * τmax) 1 hK' (mul_pos hK' hτmax) zero_lt_one |
| 59 | have hratio : τmax ≤ ((K + 1) * τmax) / (K + 1) := by |
| 60 | rw [mul_div_cancel_left₀ _ (ne_of_gt hK')] |
| 61 | have hbase : MetricComplete (F.metric (T - τmax)) := |
| 62 | hcurvature.1 _ ⟨le_rfl, sub_le_self T hτmax.le⟩ |
| 63 | have hcompact (x : M) : IsCompact (closure ((G.metric 0).ball x 1)) := by |
| 64 | simpa only [G, shiftedContinuationFlow, add_zero] using |
| 65 | isCompact_closure_referenceBall (F.metric (T - τmax)) hbase x zero_lt_one |
| 66 | have hbound (t : ℝ) (ht : t ∈ Icc 0 τmax) (x : M) : |
| 67 | (G.connection t).curvatureTensorNorm x ≤ K + 1 := by |
| 68 | have hm : T - τmax + t ∈ Icc (T - τmax) T := |
| 69 | ⟨by linarith [ht.1], by linarith [ht.2]⟩ |
| 70 | exact ((le_abs_self _).trans (hRm _ hm x)).trans (by linarith) |
| 71 | refine ⟨C / Real.sqrt (τmax - τ₁), div_pos hC (Real.sqrt_pos.mpr (sub_pos.mpr hτ₁)), ?_⟩ |
| 72 | intro τ hτ x |
| 73 | have ht : τmax - τ ∈ Ioc 0 τmax := ⟨by linarith [hτ.2], by linarith [hτ.1]⟩ |
| 74 | have hcenter : x ∈ (G.metric 0).ball x ((1 : ℝ) / 2) := by |
| 75 | change (G.metric 0).edist x x < ENNReal.ofReal ((1 : ℝ) / 2) |
| 76 | have hself : (G.metric 0).edist x x = 0 := by |
| 77 | letI : MetricSpace M := referenceMetricSpace (G.metric 0) |
| 78 | change edist x x = 0 |
| 79 | exact edist_self x |
| 80 | rw [hself] |
| 81 | exact ENNReal.ofReal_pos.mpr (by norm_num) |
| 82 | have h := hshi M τmax hτmax hratio G x (hcompact x) |
| 83 | (fun t ht y _ ↦ hbound t ht y) (τmax - τ) ht x hcenter |
| 84 | have heq : T - τmax + (τmax - τ) = T - τ := by ring |
| 85 | have h' : (F.connection (T - τ)).curvatureDerivativeNorm 1 x ≤ |
| 86 | C / Real.sqrt (τmax - τ) := by |
| 87 | dsimp only [G, shiftedContinuationFlow] at h |
| 88 | simp only [Nat.cast_one, ← Real.sqrt_eq_rpow] at h |
| 89 | have hnorm := congrArg (fun t : ℝ ↦ (F.connection t).curvatureDerivativeNorm 1 x) heq |
| 90 | exact hnorm ▸ h |
| 91 | exact h'.trans (div_le_div_of_nonneg_left hC.le |
| 92 | (Real.sqrt_pos.mpr (sub_pos.mpr hτ₁)) (Real.sqrt_le_sqrt (by linarith [hτ.2]))) |
| 93 | |
| 94 | end PoincareMT.LGeometry |