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.StandardCap.Persistence.Limit.Coordinates.IntrinsicJets |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.Exponential.JetBounds.TensorNaturality |
| 3 | import PoincareLib.Geometry.Riemannian.Tensor.Algebra |
| 4 | |
| 5 | /-! |
| 6 | # Actual intrinsic error tensors under round parameter maps |
| 7 | |
| 8 | The round certificate is a smooth metric pullback. Its actual error |
| 9 | jets, including every covariant slot, transport to a local model |
| 10 | realization. Morgan--Tian, Definition 9.76 and Lemma 11.2, as used |
| 11 | in Lemma 16.8, pp. 372-373; M44 derivations 29 and 30. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | namespace PoincareMT.M44 |
| 21 | |
| 22 | variable {n : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 25 | [IsManifold (𝓡 n) ∞ M] [IsManifold (𝓡 n) ∞ N] |
| 26 | |
| 27 | /-- A smooth map gives a genuinely smooth multilinear metric pullback, |
| 28 | even before any local invertibility is imposed. Source: the comparison |
| 29 | tensor in Definition 9.76; M44 derivation 30. -/ |
| 30 | theorem isSmoothCovariantTensor_metric_pullback (g : RiemannianMetric n N) |
| 31 | {f : M → N} (hf : ContMDiff (𝓡 n) (𝓡 n) ∞ f) : |
| 32 | IsSmoothCovariantTensor (k := 2) (fun x v => |
| 33 | g.inner (f x) (mfderiv (𝓡 n) (𝓡 n) f x (v 0)) |
| 34 | (mfderiv (𝓡 n) (𝓡 n) f x (v 1))) := by |
| 35 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : N → Type _) := |
| 36 | ⟨g.toRiemannianMetric⟩ |
| 37 | constructor |
| 38 | · intro x |
| 39 | refine ⟨MultilinearMap.mk' (R := ℝ) _ ?_ ?_, fun _ => rfl⟩ |
| 40 | · intro v i a b |
| 41 | fin_cases i <;> simp [map_add] |
| 42 | · intro v i r a |
| 43 | fin_cases i <;> simp [map_smul] |
| 44 | · intro U hU X hX x hx |
| 45 | have hV (i : Fin 2) : ContMDiffAt (𝓡 n) ((𝓡 n).prod (𝓡 n)) ∞ |
| 46 | (fun y => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (f y) |
| 47 | (mfderiv (𝓡 n) (𝓡 n) f y (X i y))) x := |
| 48 | ((hf x).mfderiv_const (m := ∞) (by simp)).clm_apply_of_inCoordinates |
| 49 | ((hX i).contMDiffAt (hU.mem_nhds hx)) (hf x) |
| 50 | exact ((hV 0).inner_bundle (hV 1)).contMDiffWithinAt |
| 51 | |
| 52 | /-- The metric itself is a smooth bilinear evaluation. Source: |
| 53 | Definition 2.16, used by the round comparison in Definition 9.76. -/ |
| 54 | theorem isSmoothCovariantTensor_metric (g : RiemannianMetric n M) : |
| 55 | IsSmoothCovariantTensor (k := 2) (fun x v => g.inner x (v 0) (v 1)) := by |
| 56 | simpa only [mfderiv_id, ContinuousLinearMap.id_apply, id_eq] using |
| 57 | isSmoothCovariantTensor_metric_pullback g (f := id) contMDiff_id |
| 58 | |
| 59 | /-- The full intrinsic norm of each covariant jet is preserved by a |
| 60 | local metric pullback. Source: Definition 2.16 in Lemma 16.8; |
| 61 | this retains all derivative slots of the round error tensor. -/ |
| 62 | theorem tensorNorm_iterated_eq_of_metric_pullback |
| 63 | {g : RiemannianMetric n M} {h : RiemannianMetric n N} |
| 64 | (D : LeviCivitaData g) (D' : LeviCivitaData h) {f : M → N} {U : Set M} |
| 65 | (hU : IsOpen U) (hf : ContMDiffOn (𝓡 n) (𝓡 n) ∞ f U) |
| 66 | (hinv : ∀ y ∈ U, (mfderiv (𝓡 n) (𝓡 n) f y).IsInvertible) |
| 67 | (hmetric : ∀ y ∈ U, ∀ u v : TangentSpace (𝓡 n) y, |
| 68 | g.inner y u v = h.inner (f y) (mfderiv (𝓡 n) (𝓡 n) f y u) |
| 69 | (mfderiv (𝓡 n) (𝓡 n) f y v)) |
| 70 | {k : ℕ} {S : CovariantTensorEvaluation n M k} {T : CovariantTensorEvaluation n N k} |
| 71 | (hS : IsSmoothCovariantTensor S) (hT : IsSmoothCovariantTensor T) |
| 72 | (hST : ∀ y ∈ U, ∀ v, |
| 73 | S y v = T (f y) (fun i => mfderiv (𝓡 n) (𝓡 n) f y (v i))) |
| 74 | (m : ℕ) {x : M} (hx : x ∈ U) : |
| 75 | g.tensorNorm (D.iteratedCovariantTensorDerivative S m) x = |
| 76 | h.tensorNorm (D'.iteratedCovariantTensorDerivative T m) (f x) := by |
| 77 | obtain ⟨e, he⟩ := hinv x hx |
| 78 | have he' (v : TangentSpace (𝓡 n) x) : e v = mfderiv (𝓡 n) (𝓡 n) f x v := |
| 79 | congrArg (fun L => L v) he |
| 80 | obtain ⟨A, hA⟩ := (D'.iteratedCovariantTensorDerivative_isSmooth hT m).1 (f x) |
| 81 | apply g.tensorNorm_eq_of_linearEquiv h _ _ x (f x) e.toLinearEquiv _ _ A hA |
| 82 | · intro u v |
| 83 | simpa only [ContinuousLinearEquiv.coe_toLinearEquiv, he', |
| 84 | ContinuousLinearEquiv.coe_coe] using (hmetric x hx u v).symm |
| 85 | · intro v |
| 86 | simpa only [ContinuousLinearEquiv.coe_toLinearEquiv, he', |
| 87 | ContinuousLinearEquiv.coe_coe] using |
| 88 | D.iteratedCovariantTensorDerivative_eq_pullback D' hU hf hinv hmetric hS hT hST m hx v |
| 89 | |
| 90 | /-- The actual global round error is smooth, so its iterated covariant |
| 91 | derivatives have genuine multilinear realizations. Source: |
| 92 | Definition 9.76; M44 derivation 30. -/ |
| 93 | theorem round_error_isSmooth {X : Type*} [TopologicalSpace X] |
| 94 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] [IsManifold (𝓡 3) ∞ X] |
| 95 | {g : RiemannianMetric 3 X} {epsilon : ℝ} (R : SingularRoundComponent g epsilon) : |
| 96 | IsSmoothCovariantTensor (fun y v => R.scale * singularMetricPullback g R.forward y v - |
| 97 | R.model_metric.inner y (v 0) (v 1)) := |
| 98 | ((isSmoothCovariantTensor_metric_pullback g R.forward_smooth).const_mul R.scale).sub |
| 99 | (isSmoothCovariantTensor_metric R.model_metric) |
| 100 | |
| 101 | /-- Each available intrinsic error jet of the actual round certificate |
| 102 | is less than epsilon. Source: Definition 9.76 in Lemma 11.2. -/ |
| 103 | theorem round_covariant_error_lt {X : Type*} [TopologicalSpace X] |
| 104 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] [IsManifold (𝓡 3) ∞ X] |
| 105 | {g : RiemannianMetric 3 X} {epsilon : ℝ} (R : SingularRoundComponent g epsilon) |
| 106 | {j : ℕ} (hj : j ≤ ⌊epsilon⁻¹⌋₊) (x : R.model.carrier) : |
| 107 | R.model_metric.tensorNorm (R.model_connection.iteratedCovariantTensorDerivative |
| 108 | (fun y v => R.scale * singularMetricPullback g R.forward y v - |
| 109 | R.model_metric.inner y (v 0) (v 1)) j) x < epsilon := by |
| 110 | obtain ⟨B, hB, hjet⟩ := R.metric_comparison |
| 111 | exact metric_covariant_error_lt_of_jet_error R.model_metric R.model_connection |
| 112 | (fun y v => R.scale * singularMetricPullback g R.forward y v) hj R.epsilon_pos |
| 113 | ((hjet x).trans_lt hB) |
| 114 | |
| 115 | /-- The actual normalized round metric has the expected quadratic |
| 116 | comparison at every model point. Source: Definition 9.76 in the |
| 117 | forward estimate of Lemma 11.2. -/ |
| 118 | theorem round_quadratic_bounds {X : Type*} [TopologicalSpace X] |
| 119 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] [IsManifold (𝓡 3) ∞ X] |
| 120 | {g : RiemannianMetric 3 X} {epsilon : ℝ} (R : SingularRoundComponent g epsilon) |
| 121 | (x : R.model.carrier) (v : TangentSpace (𝓡 3) x) : |
| 122 | (1 - epsilon) * R.model_metric.inner x v v ≤ |
| 123 | R.scale * g.inner (R.forward x) (mfderiv (𝓡 3) (𝓡 3) R.forward x v) |
| 124 | (mfderiv (𝓡 3) (𝓡 3) R.forward x v) ∧ |
| 125 | R.scale * g.inner (R.forward x) (mfderiv (𝓡 3) (𝓡 3) R.forward x v) |
| 126 | (mfderiv (𝓡 3) (𝓡 3) R.forward x v) ≤ |
| 127 | (1 + epsilon) * R.model_metric.inner x v v := by |
| 128 | let T : CovariantTensorEvaluation 3 R.model.carrier 2 := fun y z => |
| 129 | R.scale * singularMetricPullback g R.forward y z - |
| 130 | R.model_metric.inner y (z 0) (z 1) |
| 131 | obtain ⟨A, hA⟩ := (round_error_isSmooth R).1 x |
| 132 | have hn : R.model_metric.tensorNorm T x < epsilon := |
| 133 | round_covariant_error_lt R (Nat.zero_le _) x |
| 134 | have hv : 0 ≤ R.model_metric.inner x v v := by |
| 135 | by_cases hv : v = 0 |
| 136 | · simp [hv] |
| 137 | · exact (R.model_metric.pos x v hv).le |
| 138 | have hp : (∏ i : Fin 2, R.model_metric.tangentNorm x (![v, v] i)) = |
| 139 | R.model_metric.inner x v v := by |
| 140 | simp only [Fin.prod_univ_two, Matrix.cons_val_zero, Matrix.cons_val_one, |
| 141 | RiemannianMetric.tangentNorm, ← sq, Real.sq_sqrt hv] |
| 142 | have hh := abs_tensor_evaluation_le_tensorNorm R.model_metric T x A hA ![v, v] |
| 143 | rw [hp] at hh |
| 144 | have hb := abs_le.mp (hh.trans (mul_le_mul_of_nonneg_right hn.le hv)) |
| 145 | dsimp only [T, singularMetricPullback, Matrix.cons_val_zero, Matrix.cons_val_one] at hb |
| 146 | constructor <;> nlinarith [hb.1, hb.2] |
| 147 | |
| 148 | end PoincareMT.M44 |