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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Spheres.RoundMetricDerivatives |
| 3 | import Mathlib.Analysis.Calculus.BumpFunction.Basic |
| 4 | |
| 5 | /-! |
| 6 | # A smooth coordinate section of the actual round metric error |
| 7 | |
| 8 | The normalized source-minus-model coefficients are smooth on the domain of |
| 9 | any smooth model chart. A compact cutoff produces a global smooth bilinear |
| 10 | field agreeing with those coefficients near the chart centre. Its tensor |
| 11 | evaluation is smooth on arbitrary smooth Euclidean sections, so it can be |
| 12 | used in M07's covariant pullback naturality theorem. No source curvature or |
| 13 | ordinary metric-jet comparison is assumed here. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | set_option maxSynthPendingDepth 12 |
| 20 | |
| 21 | open Set Filter Metric |
| 22 | open scoped Manifold ContDiff Bundle Topology |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M28.tube |
| 27 | |
| 28 | open PoincareMT.SpacetimeBounds |
| 29 | |
| 30 | private abbrev GaussE := EuclideanSpace ℝ (Fin 3) |
| 31 | |
| 32 | variable {M : Type u} [TopologicalSpace M] |
| 33 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 34 | [IsManifold (𝓡 3) ∞ M] |
| 35 | |
| 36 | /-- Both metrics are written in the same actual model parametrization. -/ |
| 37 | def roundGaussErrorCoefficients |
| 38 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 39 | (N : SingularRoundComponent g epsilon) (e : GaussE → N.model.carrier) : |
| 40 | GaussE → MetricCoefficient 3 := |
| 41 | fun y => N.scale • g.pullbackCoefficients (N.forward ∘ e) y - |
| 42 | N.model_metric.pullbackCoefficients e y |
| 43 | |
| 44 | theorem contDiffOn_roundGaussErrorCoefficients |
| 45 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 46 | (N : SingularRoundComponent g epsilon) |
| 47 | {e : GaussE → N.model.carrier} {U : Set GaussE} (hU : IsOpen U) |
| 48 | (he : ContMDiffOn (𝓡 3) (𝓡 3) ∞ e U) : |
| 49 | ContDiffOn ℝ ∞ (roundGaussErrorCoefficients N e) U := by |
| 50 | intro y hy |
| 51 | have he' := he.contMDiffAt (hU.mem_nhds hy) |
| 52 | have hf := (N.forward_smooth (e y)).comp y he' |
| 53 | exact ((g.contDiffAt_pullbackCoefficients hf).const_smul N.scale).sub |
| 54 | (N.model_metric.contDiffAt_pullbackCoefficients he') |>.contDiffWithinAt |
| 55 | |
| 56 | theorem roundGaussErrorCoefficients_apply |
| 57 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 58 | (N : SingularRoundComponent g epsilon) |
| 59 | {e : GaussE → N.model.carrier} {y : GaussE} |
| 60 | (he : ContMDiffAt (𝓡 3) (𝓡 3) ∞ e y) (v : Fin 2 → GaussE) : |
| 61 | roundGaussErrorCoefficients N e y (v 0) (v 1) = |
| 62 | roundMetricError N (e y) |
| 63 | (fun i => mfderiv (𝓡 3) (𝓡 3) e y (v i)) := by |
| 64 | have hderiv := mfderiv_comp y |
| 65 | ((N.forward_smooth (e y)).mdifferentiableAt (by simp)) |
| 66 | (he.mdifferentiableAt (by simp)) |
| 67 | simp only [roundGaussErrorCoefficients, roundMetricError, |
| 68 | RiemannianMetric.pullbackCoefficients, singularMetricPullback, |
| 69 | hderiv, sub_apply, smul_apply, smul_eq_mul] |
| 70 | rfl |
| 71 | |
| 72 | private theorem smooth_bilinear_tensor |
| 73 | {B : GaussE → MetricCoefficient 3} (hB : ContDiff ℝ ∞ B) : |
| 74 | IsSmoothCovariantTensor |
| 75 | (fun (y : GaussE) (v : Fin 2 → TangentSpace (𝓡 3) y) => |
| 76 | B y (v 0) (v 1)) := by |
| 77 | constructor |
| 78 | · intro y |
| 79 | let A : MultilinearMap ℝ |
| 80 | (fun _ : Fin 2 => TangentSpace (𝓡 3) y) ℝ := |
| 81 | MultilinearMap.mk' (fun v => B y (v 0) (v 1)) |
| 82 | (by intro v i a b; fin_cases i <;> simp [map_add]) |
| 83 | (by intro v i c a; fin_cases i <;> simp [map_smul]) |
| 84 | exact ⟨A, fun _ => rfl⟩ |
| 85 | · intro U hU X hX y hy |
| 86 | have hXi (i : Fin 2) : ContDiffAt ℝ ∞ (X i) y := by |
| 87 | have h := (Bundle.contMDiffAt_totalSpace.mp |
| 88 | ((hX i).contMDiffAt (hU.mem_nhds hy))).2 |
| 89 | simpa using contMDiffAt_iff_contDiffAt.mp h |
| 90 | exact (contMDiffAt_iff_contDiffAt.mpr |
| 91 | ((hB.contDiffAt.clm_apply (hXi 0)).clm_apply (hXi 1))).contMDiffWithinAt |
| 92 | |
| 93 | /-- A compactly supported smooth bilinear section realizes the actual |
| 94 | normalized metric error on a prescribed smaller ball and as a germ at zero. |
| 95 | This needs only chart smoothness; Gauss normalization and invertibility will |
| 96 | be used by subsequent derivative estimates. -/ |
| 97 | theorem exists_round_gauss_error_section |
| 98 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 99 | (N : SingularRoundComponent g epsilon) |
| 100 | {r s R : ℝ} (hr : 0 < r) (hrs : r < s) (hsR : s < R) |
| 101 | (e : GaussE → N.model.carrier) |
| 102 | (he : ContMDiffOn (𝓡 3) (𝓡 3) ∞ e (ball 0 R)) : |
| 103 | ∃ B : GaussE → MetricCoefficient 3, |
| 104 | ContDiff ℝ ∞ B ∧ HasCompactSupport B ∧ |
| 105 | IsSmoothCovariantTensor |
| 106 | (fun (y : GaussE) (v : Fin 2 → TangentSpace (𝓡 3) y) => |
| 107 | B y (v 0) (v 1)) ∧ |
| 108 | (∀ y ∈ closedBall (0 : GaussE) r, |
| 109 | B y = roundGaussErrorCoefficients N e y) ∧ |
| 110 | (∀ y ∈ ball (0 : GaussE) r, ∀ v : Fin 2 → GaussE, |
| 111 | B y (v 0) (v 1) = roundMetricError N (e y) |
| 112 | (fun i => mfderiv (𝓡 3) (𝓡 3) e y (v i))) ∧ |
| 113 | (∀ᶠ y in 𝓝 (0 : GaussE), ∀ v : Fin 2 → GaussE, |
| 114 | B y (v 0) (v 1) = roundMetricError N (e y) |
| 115 | (fun i => mfderiv (𝓡 3) (𝓡 3) e y (v i))) := by |
| 116 | let f : ContDiffBump (0 : GaussE) := ⟨r, s, hr, hrs⟩ |
| 117 | let B : GaussE → MetricCoefficient 3 := |
| 118 | fun y => f y • roundGaussErrorCoefficients N e y |
| 119 | have hraw := contDiffOn_roundGaussErrorCoefficients N isOpen_ball he |
| 120 | have hsupport (y : GaussE) (hy : y ∈ tsupport f) : y ∈ ball (0 : GaussE) R := by |
| 121 | rw [f.tsupport_eq] at hy |
| 122 | exact lt_of_le_of_lt hy hsR |
| 123 | have hB : ContDiff ℝ ∞ B := by |
| 124 | apply contDiff_iff_contDiffAt.mpr |
| 125 | intro y |
| 126 | by_cases hy : y ∈ tsupport f |
| 127 | · exact f.contDiff.contDiffAt.smul |
| 128 | (hraw.contDiffAt (isOpen_ball.mem_nhds (hsupport y hy))) |
| 129 | · apply (contDiffAt_const (c := (0 : MetricCoefficient 3))).congr_of_eventuallyEq |
| 130 | filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hy] with z hz |
| 131 | simp [B, hz] |
| 132 | have hcompact : HasCompactSupport B := f.hasCompactSupport.smul_right |
| 133 | have heq (y : GaussE) (hy : y ∈ closedBall (0 : GaussE) r) : |
| 134 | B y = roundGaussErrorCoefficients N e y := by |
| 135 | simp only [B, f.one_of_mem_closedBall hy, one_smul] |
| 136 | have herror (y : GaussE) (hy : y ∈ ball (0 : GaussE) r) (v : Fin 2 → GaussE) : |
| 137 | B y (v 0) (v 1) = roundMetricError N (e y) |
| 138 | (fun i => mfderiv (𝓡 3) (𝓡 3) e y (v i)) := by |
| 139 | rw [heq y (ball_subset_closedBall hy)] |
| 140 | exact roundGaussErrorCoefficients_apply N |
| 141 | (he.contMDiffAt (isOpen_ball.mem_nhds |
| 142 | (ball_subset_ball (hrs.trans hsR).le hy))) v |
| 143 | refine ⟨B, hB, hcompact, smooth_bilinear_tensor hB, heq, herror, ?_⟩ |
| 144 | exact Filter.eventually_of_mem (isOpen_ball.mem_nhds (mem_ball_self hr)) herror |
| 145 | |
| 146 | end PoincareMT.M28.tube |