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.Riemannian.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Comparison.BilinearPerturbation |
| 3 | import Mathlib.Geometry.Manifold.ContMDiffMFDeriv |
| 4 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 5 | |
| 6 | /-! |
| 7 | # The actual pullback metric near a noncritical point |
| 8 | |
| 9 | The smooth map's genuine manifold differential pulls back the selected |
| 10 | metric. Finite-dimensional continuity and the bilinear estimate compare |
| 11 | its tangent norm with the fixed differential at the center. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Bundle ContinuousLinearMap Filter Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedVolume |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | set_option backward.isDefEq.respectTransparency false in |
| 27 | /-- The actual selected metric pulled back by the actual manifold differential. -/ |
| 28 | noncomputable def pullbackMetricForm (g : RiemannianMetric n M) |
| 29 | (f : EuclideanSpace ℝ (Fin n) → M) (x : EuclideanSpace ℝ (Fin n)) : |
| 30 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ := |
| 31 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 32 | ⟨g.toRiemannianMetric⟩ |
| 33 | (g.inner (f x)).bilinearComp (mfderiv (𝓡 n) (𝓡 n) f x) |
| 34 | (mfderiv (𝓡 n) (𝓡 n) f x) |
| 35 | |
| 36 | set_option backward.isDefEq.respectTransparency false in |
| 37 | /-- A C1 germ gives a continuous tangent-valued differential on each fixed vector. -/ |
| 38 | theorem continuousAt_mfderiv_apply_vector |
| 39 | {f : EuclideanSpace ℝ (Fin n) → M} {x : EuclideanSpace ℝ (Fin n)} |
| 40 | (hf : ContMDiffAt (𝓡 n) (𝓡 n) 1 f x) (v : EuclideanSpace ℝ (Fin n)) : |
| 41 | ContinuousAt (fun y ↦ (⟨f y, mfderiv (𝓡 n) (𝓡 n) f y v⟩ : |
| 42 | TangentBundle (𝓡 n) M)) x := by |
| 43 | have hD := (hf.mfderiv_const (m := 0) (by simp)).continuousAt |
| 44 | have hsection : Continuous |
| 45 | (fun y : EuclideanSpace ℝ (Fin n) ↦ |
| 46 | (⟨y, v⟩ : TangentBundle (𝓡 n) (EuclideanSpace ℝ (Fin n)))) := |
| 47 | (tangentBundleModelSpaceHomeomorph (𝓡 n)).symm.continuous.comp |
| 48 | (continuous_id.prodMk continuous_const) |
| 49 | exact hD.clm_apply_of_inCoordinates hsection.continuousAt hf.continuousAt |
| 50 | |
| 51 | set_option backward.isDefEq.respectTransparency false in |
| 52 | /-- The genuine pullback form varies continuously in the bilinear operator norm. -/ |
| 53 | theorem pullbackMetricForm_continuousAt (g : RiemannianMetric n M) |
| 54 | {f : EuclideanSpace ℝ (Fin n) → M} {x : EuclideanSpace ℝ (Fin n)} |
| 55 | (hf : ContMDiffAt (𝓡 n) (𝓡 n) 1 f x) : |
| 56 | ContinuousAt (pullbackMetricForm g f) x := by |
| 57 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 58 | ⟨g.toRiemannianMetric⟩ |
| 59 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 60 | (TangentSpace (𝓡 n) : M → Type _) := |
| 61 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 62 | apply continuousAt_clm_apply.mpr |
| 63 | intro v |
| 64 | apply continuousAt_clm_apply.mpr |
| 65 | intro w |
| 66 | exact (continuousAt_mfderiv_apply_vector hf v).inner_bundle |
| 67 | (continuousAt_mfderiv_apply_vector hf w) |
| 68 | |
| 69 | set_option backward.isDefEq.respectTransparency false in |
| 70 | /-- At a noncritical point, the actual differential norms are arbitrarily close locally. -/ |
| 71 | theorem eventually_pullback_tangentNorm_comparison (g : RiemannianMetric n M) |
| 72 | {f : EuclideanSpace ℝ (Fin n) → M} {x : EuclideanSpace ℝ (Fin n)} |
| 73 | (hf : ContMDiffAt (𝓡 n) (𝓡 n) 1 f x) |
| 74 | (hD : Function.Bijective (mfderiv (𝓡 n) (𝓡 n) f x)) |
| 75 | {r : ℝ} (hr : 1 < r) : |
| 76 | ∀ᶠ y in 𝓝 x, ∀ v : EuclideanSpace ℝ (Fin n), |
| 77 | g.tangentNorm (f x) (mfderiv (𝓡 n) (𝓡 n) f x v) / r ≤ |
| 78 | g.tangentNorm (f y) (mfderiv (𝓡 n) (𝓡 n) f y v) ∧ |
| 79 | g.tangentNorm (f y) (mfderiv (𝓡 n) (𝓡 n) f y v) ≤ |
| 80 | r * g.tangentNorm (f x) (mfderiv (𝓡 n) (𝓡 n) f x v) := by |
| 81 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 82 | ⟨g.toRiemannianMetric⟩ |
| 83 | let L : EuclideanSpace ℝ (Fin n) ≃L[ℝ] TangentSpace (𝓡 n) (f x) := |
| 84 | LinearEquiv.toContinuousLinearEquiv |
| 85 | (LinearEquiv.ofBijective (mfderiv (𝓡 n) (𝓡 n) f x).toLinearMap hD) |
| 86 | have hcenter : ∀ v, pullbackMetricForm g f x v v = ‖L v‖ ^ 2 := by |
| 87 | intro v |
| 88 | exact real_inner_self_eq_norm_sq (L v) |
| 89 | have h := eventually_sqrt_bilinear_comparison |
| 90 | (pullbackMetricForm_continuousAt g hf) L hcenter hr |
| 91 | filter_upwards [h] with y hy |
| 92 | intro v |
| 93 | have hnorm : ‖L v‖ = |
| 94 | g.tangentNorm (f x) (mfderiv (𝓡 n) (𝓡 n) f x v) := |
| 95 | norm_eq_sqrt_real_inner (L v) |
| 96 | have hvalue : Real.sqrt (pullbackMetricForm g f y v v) = |
| 97 | g.tangentNorm (f y) (mfderiv (𝓡 n) (𝓡 n) f y v) := rfl |
| 98 | simpa only [hnorm, hvalue] using hy v |
| 99 | |
| 100 | end PoincareMT.ReducedVolume |