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.MetricCompactness |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Theory |
| 3 | import Mathlib.Geometry.Manifold.Riemannian.PathELength |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/AdmissiblePaths.lean` at |
| 6 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 7 | |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | set_option maxHeartbeats 5000000 |
| 11 | |
| 12 | open scoped Manifold ContDiff Bundle intervalIntegral ENNReal |
| 13 | |
| 14 | universe u |
| 15 | |
| 16 | namespace PoincareMT.LGeometry |
| 17 | |
| 18 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 19 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 20 | [IsManifold (𝓡 n) ∞ M] |
| 21 | |
| 22 | private theorem curveVelocity_continuous {γ : ℝ → M} |
| 23 | (hγ : ContMDiff (𝓘(ℝ, ℝ)) (𝓡 n) 1 γ) : |
| 24 | Continuous (fun s ↦ Bundle.TotalSpace.mk' |
| 25 | (EuclideanSpace ℝ (Fin n)) (γ s) (curveVelocity (n := n) γ s)) := by |
| 26 | let ι : ℝ → TangentBundle (𝓘(ℝ, ℝ)) ℝ := |
| 27 | (tangentBundleModelSpaceHomeomorph (𝓘(ℝ, ℝ))).symm ∘ |
| 28 | (fun s : ℝ ↦ (s, (1 : ℝ))) |
| 29 | have hι : Continuous ι := by |
| 30 | exact (contMDiff_tangentBundleModelSpaceHomeomorph_symm |
| 31 | (I := 𝓘(ℝ, ℝ)) (n := ∞)).continuous.comp |
| 32 | (continuous_id.prodMk continuous_const) |
| 33 | have ht : Continuous (tangentMap (𝓘(ℝ, ℝ)) (𝓡 n) γ) := |
| 34 | hγ.continuous_tangentMap (by norm_num) |
| 35 | have hcomp : Continuous |
| 36 | (fun s ↦ tangentMap (𝓘(ℝ, ℝ)) (𝓡 n) γ (ι s)) := ht.comp hι |
| 37 | have heq : (fun s ↦ Bundle.TotalSpace.mk' |
| 38 | (EuclideanSpace ℝ (Fin n)) (γ s) (curveVelocity (n := n) γ s)) = |
| 39 | (fun s ↦ tangentMap (𝓘(ℝ, ℝ)) (𝓡 n) γ (ι s)) := by |
| 40 | funext s |
| 41 | simp [ι, tangentMap, curveVelocity, Bundle.TotalSpace.toProd, |
| 42 | Function.comp_def] <;> rfl |
| 43 | rw [heq] |
| 44 | exact hcomp |
| 45 | |
| 46 | private theorem metric_inner_continuousOn {J : Set ℝ} {F : RicciFlow n M J} |
| 47 | {time : ℝ → ℝ} {γ : ℝ → M} {v w : ∀ s, TangentSpace (𝓡 n) (γ s)} |
| 48 | {S : Set ℝ} |
| 49 | (hpath : ContinuousOn γ S) |
| 50 | (htime : Continuous time) |
| 51 | (hv : ContinuousOn (fun s ↦ Bundle.TotalSpace.mk' |
| 52 | (EuclideanSpace ℝ (Fin n)) (γ s) (v s)) S) |
| 53 | (hw : ContinuousOn (fun s ↦ Bundle.TotalSpace.mk' |
| 54 | (EuclideanSpace ℝ (Fin n)) (γ s) (w s)) S) |
| 55 | (hdom : Set.MapsTo (fun s ↦ (time s, γ s)) S (J ×ˢ Set.univ)) : |
| 56 | ContinuousOn (fun s ↦ (F.metric (time s)).inner (γ s) (v s) (w s)) S := by |
| 57 | let b : ℝ → M := γ |
| 58 | let ψ : ∀ s, TangentSpace (𝓡 n) (b s) →L[ℝ] |
| 59 | TangentSpace (𝓡 n) (b s) →L[ℝ] ℝ := |
| 60 | fun s ↦ (F.metric (time s)).inner (b s) |
| 61 | have hpair : ContinuousOn (fun s ↦ (time s, b s)) S := |
| 62 | htime.continuousOn.prodMk hpath |
| 63 | have hmetric : ContinuousOn (fun s ↦ Bundle.TotalSpace.mk' |
| 64 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 65 | (E := fun x : M ↦ TangentSpace (𝓡 n) x →L[ℝ] |
| 66 | TangentSpace (𝓡 n) x →L[ℝ] ℝ) (b s) (ψ s)) S := by |
| 67 | exact F.smooth.continuousOn.comp hpair hdom |
| 68 | have happly := hmetric.clm_bundle_apply₂ (F₃ := ℝ) |
| 69 | (E₃ := Bundle.Trivial M ℝ) hv hw |
| 70 | intro s hs |
| 71 | have hs' := happly s hs |
| 72 | simp only [FiberBundle.continuousWithinAt_totalSpace] at hs' |
| 73 | exact hs'.2 |
| 74 | |
| 75 | private theorem backwardLIntegrand_continuousOn {J : Set ℝ} {F : RicciFlow n M J} |
| 76 | {T τ₁ τ₂ : ℝ} {γ : ℝ → M} |
| 77 | (hγ : ContMDiff (𝓘(ℝ, ℝ)) (𝓡 n) 1 γ) |
| 78 | (hM04 : RicciFlowCurvatureTheory.{u}) |
| 79 | (hmem : ∀ τ ∈ Set.Icc τ₁ τ₂, T - τ ∈ J) : |
| 80 | ContinuousOn (backwardLIntegrand F T γ) (Set.Icc τ₁ τ₂) := by |
| 81 | let S : Set ℝ := Set.Icc τ₁ τ₂ |
| 82 | have htime : Continuous (fun s : ℝ ↦ T - s) := |
| 83 | continuous_const.sub continuous_id |
| 84 | have hpath : ContinuousOn γ S := hγ.continuous.continuousOn |
| 85 | have hvel : ContinuousOn (fun s ↦ Bundle.TotalSpace.mk' |
| 86 | (EuclideanSpace ℝ (Fin n)) (γ s) (curveVelocity (n := n) γ s)) S := |
| 87 | (curveVelocity_continuous hγ).continuousOn |
| 88 | have hdom : Set.MapsTo (fun s : ℝ ↦ (T - s, γ s)) S (J ×ˢ Set.univ) := by |
| 89 | intro s hs |
| 90 | exact ⟨hmem s hs, Set.mem_univ _⟩ |
| 91 | have hscalar : ContinuousOn |
| 92 | (fun s ↦ (F.connection (T - s)).scalarCurvature (γ s)) S := by |
| 93 | have hsmooth := hM04.scalar_regular n M J F |
| 94 | have hcomp := hsmooth.continuousOn.comp |
| 95 | (htime.continuousOn.prodMk hpath) hdom |
| 96 | convert hcomp using 1 |
| 97 | funext s |
| 98 | rfl |
| 99 | have hkin : ContinuousOn |
| 100 | (fun s ↦ (F.metric (T - s)).inner (γ s) |
| 101 | (curveVelocity (n := n) γ s) (curveVelocity (n := n) γ s)) S := by |
| 102 | exact metric_inner_continuousOn hpath htime hvel hvel hdom |
| 103 | have hsum : ContinuousOn |
| 104 | (fun s ↦ (F.connection (T - s)).scalarCurvature (γ s) + |
| 105 | (F.metric (T - s)).inner (γ s) |
| 106 | (curveVelocity (n := n) γ s) (curveVelocity (n := n) γ s)) S := |
| 107 | hscalar.add hkin |
| 108 | have hsqrt : ContinuousOn Real.sqrt S := Real.continuous_sqrt.continuousOn |
| 109 | exact (hsqrt.mul hsum).congr (fun s hs ↦ by rfl) |
| 110 | |
| 111 | theorem exists_backwardTimePath {J : Set ℝ} [ConnectedSpace M] [T3Space M] |
| 112 | {F : RicciFlow n M J} {T τ₁ τ₂ : ℝ} |
| 113 | (hM04 : RicciFlowCurvatureTheory.{u}) (hT : T ∈ J) |
| 114 | (hτ₁ : 0 ≤ τ₁) (hordered : τ₁ < τ₂) |
| 115 | (hmem : ∀ τ ∈ Set.Icc τ₁ τ₂, T - τ ∈ J) |
| 116 | (p₁ p₂ : M) : ∃ p : BackwardTimePath F T τ₁ τ₂, |
| 117 | p.curve τ₁ = p₁ ∧ p.curve τ₂ = p₂ := by |
| 118 | let g := F.metric T |
| 119 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 120 | ⟨g.toRiemannianMetric⟩ |
| 121 | letI : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 122 | (TangentSpace (𝓡 n) : M → Type _) := |
| 123 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 124 | letI : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 125 | have hfinite : edist p₁ p₂ ≠ ⊤ := finiteEdistMetric g p₁ p₂ |
| 126 | have hlt : edist p₁ p₂ < ENNReal.ofReal ((edist p₁ p₂).toReal + 1) := by |
| 127 | rw [ENNReal.lt_ofReal_iff_toReal_lt hfinite] |
| 128 | linarith |
| 129 | have hpath := Manifold.exists_lt_locally_constant_of_riemannianEDist_lt |
| 130 | (I := 𝓡 n) (x := p₁) (y := p₂) hlt hordered |
| 131 | obtain ⟨γ, hγ₁, hγ₂, hγsmooth, hγlen, hγleft, hγright⟩ := hpath |
| 132 | let p : BackwardTimePath F T τ₁ τ₂ := |
| 133 | { curve := γ |
| 134 | nonnegative := hτ₁ |
| 135 | ordered := hordered |
| 136 | terminal_mem := hT |
| 137 | time_mem := hmem |
| 138 | continuous := by exact hγsmooth.continuous.continuousOn |
| 139 | regular := by exact hγsmooth.contMDiffOn |
| 140 | l_integrable := by |
| 141 | have hc := backwardLIntegrand_continuousOn |
| 142 | (F := F) (T := T) (τ₁ := τ₁) (τ₂ := τ₂) (γ := γ) |
| 143 | hγsmooth hM04 hmem |
| 144 | have hcu : ContinuousOn (backwardLIntegrand F T γ) |
| 145 | (Set.uIcc τ₁ τ₂) := by |
| 146 | simpa only [Set.uIcc_of_le hordered.le] using hc |
| 147 | exact hcu.intervalIntegrable } |
| 148 | refine ⟨p, ?_, ?_⟩ |
| 149 | · exact hγ₁ |
| 150 | · exact hγ₂ |
| 151 | |
| 152 | end PoincareMT.LGeometry |