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.Surgery.Singular.RegularLimit.Canonical.RoundComparison.ScalarModulus |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.Exponential.JetBounds.TensorNaturality |
| 3 | import PoincareLib.Geometry.Riemannian.Metric.LocalExtension |
| 4 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryInvariants |
| 5 | |
| 6 | /-! |
| 7 | # Intrinsic metric comparison through a local isometry |
| 8 | |
| 9 | The norm of every covariant tensor jet is unchanged by a local isometry. |
| 10 | Metric germs can therefore use the scalar tolerance of one fixed Euclidean |
| 11 | reference metric. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | set_option maxHeartbeats 800000 |
| 19 | |
| 20 | open Set Filter Bundle |
| 21 | open scoped Manifold ContDiff Topology BigOperators |
| 22 | |
| 23 | namespace PoincareMT.SingularRegularLimit.RoundComparison |
| 24 | |
| 25 | variable {n : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 28 | [IsManifold (𝓡 n) ∞ M] [IsManifold (𝓡 n) ∞ N] |
| 29 | {g : RiemannianMetric n M} {h : RiemannianMetric n N} |
| 30 | |
| 31 | /-- A local isometry preserves every intrinsic tensor jet norm. -/ |
| 32 | theorem tensorNorm_iteratedCovariantDerivative_pullback |
| 33 | (D : LeviCivitaData g) (D' : LeviCivitaData h) {f : M → N} {U : Set M} |
| 34 | (hU : IsOpen U) (hf : ContMDiffOn (𝓡 n) (𝓡 n) ∞ f U) |
| 35 | (hinv : ∀ y ∈ U, (mfderiv (𝓡 n) (𝓡 n) f y).IsInvertible) |
| 36 | (hmetric : ∀ y ∈ U, ∀ u v : TangentSpace (𝓡 n) y, |
| 37 | g.inner y u v = h.inner (f y) (mfderiv (𝓡 n) (𝓡 n) f y u) |
| 38 | (mfderiv (𝓡 n) (𝓡 n) f y v)) |
| 39 | {k : ℕ} {S : CovariantTensorEvaluation n M k} {T : CovariantTensorEvaluation n N k} |
| 40 | (hS : IsSmoothCovariantTensor S) (hT : IsSmoothCovariantTensor T) |
| 41 | (hST : ∀ y ∈ U, ∀ v, |
| 42 | S y v = T (f y) (fun i => mfderiv (𝓡 n) (𝓡 n) f y (v i))) |
| 43 | (m : ℕ) {x : M} (hx : x ∈ U) : |
| 44 | g.tensorNorm (D.iteratedCovariantTensorDerivative S m) x = |
| 45 | h.tensorNorm (D'.iteratedCovariantTensorDerivative T m) (f x) := by |
| 46 | obtain ⟨e, he⟩ := hinv x hx |
| 47 | obtain ⟨A, hA⟩ := (D'.iteratedCovariantTensorDerivative_isSmooth hT m).1 (f x) |
| 48 | apply g.tensorNorm_eq_of_linearEquiv h _ _ x (f x) e.toLinearEquiv |
| 49 | (fun u v => ?_) (fun v => ?_) A hA |
| 50 | · change h.inner (f x) (e u) (e v) = g.inner x u v |
| 51 | have heval (v : TangentSpace (𝓡 n) x) : e v = mfderiv (𝓡 n) (𝓡 n) f x v := |
| 52 | congrArg (fun L => L v) he |
| 53 | simpa only [heval] using (hmetric x hx u v).symm |
| 54 | · have heval (v : TangentSpace (𝓡 n) x) : e v = mfderiv (𝓡 n) (𝓡 n) f x v := |
| 55 | congrArg (fun L => L v) he |
| 56 | simpa only [ContinuousLinearEquiv.coe_toLinearEquiv, heval] using |
| 57 | D.iteratedCovariantTensorDerivative_eq_pullback D' hU hf hinv hmetric hS hT hST m hx v |
| 58 | |
| 59 | /-- The tolerance depends only on the fixed Euclidean reference germ and |
| 60 | the requested scalar-curvature error. -/ |
| 61 | def scalarTolerance |
| 62 | {g₀ : RiemannianMetric n (EuclideanSpace ℝ (Fin n))} |
| 63 | (D₀ : LeviCivitaData g₀) (p : EuclideanSpace ℝ (Fin n)) |
| 64 | {α : ℝ} (hα : 0 < α) : ℝ := |
| 65 | (exists_scalar_control_of_covariant_metric_twoJet D₀ p hα).choose |
| 66 | |
| 67 | theorem scalarTolerance_pos |
| 68 | {g₀ : RiemannianMetric n (EuclideanSpace ℝ (Fin n))} |
| 69 | (D₀ : LeviCivitaData g₀) (p : EuclideanSpace ℝ (Fin n)) |
| 70 | {α : ℝ} (hα : 0 < α) : 0 < scalarTolerance D₀ p hα := |
| 71 | (exists_scalar_control_of_covariant_metric_twoJet D₀ p hα).choose_spec.1 |
| 72 | |
| 73 | /-- The fixed Euclidean scalar tolerance applies on every manifold through |
| 74 | a local isometry of the reference metric. -/ |
| 75 | theorem scalar_control_of_local_isometry |
| 76 | {g₀ : RiemannianMetric n (EuclideanSpace ℝ (Fin n))} |
| 77 | (D₀ : LeviCivitaData g₀) (p : EuclideanSpace ℝ (Fin n)) |
| 78 | {α : ℝ} (hα : 0 < α) |
| 79 | {gM hM : RiemannianMetric n M} (DM : LeviCivitaData gM) (DH : LeviCivitaData hM) |
| 80 | {f : EuclideanSpace ℝ (Fin n) → M} {U : Set (EuclideanSpace ℝ (Fin n))} |
| 81 | (hU : IsOpen U) (hp : p ∈ U) (hf : ContMDiffOn (𝓡 n) (𝓡 n) ∞ f U) |
| 82 | (hinv : ∀ y ∈ U, (mfderiv (𝓡 n) (𝓡 n) f y).IsInvertible) |
| 83 | (hmetric : ∀ y ∈ U, ∀ v w : EuclideanSpace ℝ (Fin n), |
| 84 | g₀.inner y v w = gM.inner (f y) (mfderiv (𝓡 n) (𝓡 n) f y v) |
| 85 | (mfderiv (𝓡 n) (𝓡 n) f y w)) |
| 86 | (hclose : ∀ r : ℕ, r ≤ 2 → gM.tensorNorm |
| 87 | (DM.iteratedCovariantTensorDerivative |
| 88 | (fun y (v : Fin 2 → TangentSpace (𝓡 n) y) => |
| 89 | hM.inner y (v 0) (v 1) - gM.inner y (v 0) (v 1)) r) |
| 90 | (f p) < scalarTolerance D₀ p hα) : |
| 91 | |DH.scalarCurvature (f p) - D₀.scalarCurvature p| < α := by |
| 92 | have hB : ContDiffOn ℝ ∞ (hM.pullbackCoefficients f) U := by |
| 93 | intro y hy |
| 94 | exact (hM.contDiffAt_pullbackCoefficients |
| 95 | (hf.contMDiffAt (hU.mem_nhds hy))).contDiffWithinAt |
| 96 | have hpos (y : EuclideanSpace ℝ (Fin n)) (hy : y ∈ U) |
| 97 | (v : EuclideanSpace ℝ (Fin n)) (hv : v ≠ 0) : |
| 98 | 0 < hM.pullbackCoefficients f y v v := by |
| 99 | obtain ⟨e, he⟩ := hinv y hy |
| 100 | apply hM.pos |
| 101 | intro hz |
| 102 | apply hv |
| 103 | apply e.injective |
| 104 | calc |
| 105 | e v = mfderiv (𝓡 n) (𝓡 n) f y v := congrArg (fun L => L v) he |
| 106 | _ = 0 := hz |
| 107 | _ = e 0 := (map_zero e).symm |
| 108 | obtain ⟨hE, V, hV, hpV, hVU, hEeq⟩ := RiemannianMetric.exists_local_extension |
| 109 | hU hp (hM.pullbackCoefficients f) hB |
| 110 | (fun y _ v w => hM.symm (f y) _ _) hpos |
| 111 | let DE := hE.euclideanLeviCivitaData |
| 112 | have hEmetric (y : EuclideanSpace ℝ (Fin n)) (hy : y ∈ V) |
| 113 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 114 | hE.inner y v w = hM.inner (f y) (mfderiv (𝓡 n) (𝓡 n) f y v) |
| 115 | (mfderiv (𝓡 n) (𝓡 n) f y w) := by |
| 116 | change hE.euclideanCoefficients y v w = hM.pullbackCoefficients f y v w |
| 117 | rw [hEeq y hy] |
| 118 | have hjet (r : ℕ) : |
| 119 | g₀.tensorNorm (D₀.iteratedCovariantTensorDerivative |
| 120 | (metricDifferenceTensor g₀ hE) r) p = |
| 121 | gM.tensorNorm (DM.iteratedCovariantTensorDerivative |
| 122 | (fun y (v : Fin 2 → TangentSpace (𝓡 n) y) => |
| 123 | hM.inner y (v 0) (v 1) - gM.inner y (v 0) (v 1)) r) (f p) := by |
| 124 | apply tensorNorm_iteratedCovariantDerivative_pullback D₀ DM hV (hf.mono hVU) |
| 125 | (fun y hy => hinv y (hVU hy)) (fun y hy => hmetric y (hVU hy)) |
| 126 | (metricDifferenceTensor_isSmooth g₀ hE) |
| 127 | ((Poincare.RicciFlow.Harnack.metric_isSmoothCovariantTensor hM).sub |
| 128 | (Poincare.RicciFlow.Harnack.metric_isSmoothCovariantTensor gM)) |
| 129 | (fun y hy v => ?_) r hpV |
| 130 | exact congrArg₂ (· - ·) (hEmetric y hy (v 0) (v 1)) |
| 131 | (hmetric y (hVU hy) (v 0) (v 1)) |
| 132 | have hscalar := (exists_scalar_control_of_covariant_metric_twoJet D₀ p hα).choose_spec.2 |
| 133 | hE DE (fun r hr => (hjet r).trans_lt (hclose r hr)) |
| 134 | have htransport := DE.scalarCurvature_eq_of_local_isometry DH hV |
| 135 | (hf.mono hVU) hEmetric hpV |
| 136 | rwa [htransport] at hscalar |
| 137 | |
| 138 | end PoincareMT.SingularRegularLimit.RoundComparison |