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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/Existence/DeTurckPullbackSourceNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Existence.MetricFamilyProducer |
| 6 | import PoincareLib.Geometry.RicciFlow.Local.Gauge.Pullback.PullbackRicci |
| 7 | |
| 8 | /-! |
| 9 | # Covariance of the actual smooth Ricci-DeTurck source |
| 10 | |
| 11 | Both the current metric and the geometric background are pulled back. |
| 12 | Connection transport gives the actual traced DeTurck field, and its smooth |
| 13 | field identity transports the Lie derivative before Ricci naturality is used. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option maxHeartbeats 1800000 |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | open scoped Manifold ContDiff Bundle BigOperators |
| 23 | |
| 24 | namespace PoincareMT.DeTurckPullbackSourceNative |
| 25 | |
| 26 | open DiffeomorphNative DeTurckNative MetricFamilyProducerNative |
| 27 | |
| 28 | universe u |
| 29 | |
| 30 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 31 | [SecondCountableTopology M] [CompactSpace M] |
| 32 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 33 | (g background : RiemannianMetric n M) |
| 34 | (Phi : Diffeomorph (𝓡 n) (𝓡 n) M M ∞) |
| 35 | |
| 36 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 37 | |
| 38 | /-- The actual pullback metric, with its section smoothness constructed. -/ |
| 39 | def smoothPullbackMetric : RiemannianMetric n M := |
| 40 | pullbackMetric g Phi (contMDiff_pullback_section g Phi) |
| 41 | |
| 42 | @[simp] theorem smoothPullbackMetric_inner (x : M) |
| 43 | (v w : TangentSpace (𝓡 n) x) : |
| 44 | (smoothPullbackMetric g Phi).inner x v w = |
| 45 | g.inner (Phi x) (mfderiv (𝓡 n) (𝓡 n) Phi x v) |
| 46 | (mfderiv (𝓡 n) (𝓡 n) Phi x w) := |
| 47 | pullbackMetric_inner g Phi (contMDiff_pullback_section g Phi) x v w |
| 48 | |
| 49 | /-- The difference tensor transports on arbitrary tangent vectors. -/ |
| 50 | theorem connectionDifference_pullback |
| 51 | (D : LeviCivitaData g) (B : LeviCivitaData background) |
| 52 | (P : LeviCivitaData (smoothPullbackMetric g Phi)) |
| 53 | (Q : LeviCivitaData (smoothPullbackMetric background Phi)) |
| 54 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 55 | mfderiv (𝓡 n) (𝓡 n) Phi x |
| 56 | (CovariantDerivative.difference P.connection Q.connection x u v) = |
| 57 | CovariantDerivative.difference D.connection B.connection (Phi x) |
| 58 | (mfderiv (𝓡 n) (𝓡 n) Phi x u) (mfderiv (𝓡 n) (𝓡 n) Phi x v) := by |
| 59 | let Y : (y : M) → TangentSpace (𝓡 n) y := |
| 60 | FiberBundle.extend E (mfderiv (𝓡 n) (𝓡 n) Phi x u) |
| 61 | have hY : MDifferentiableAt (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) (T% Y) (Phi x) := |
| 62 | FiberBundle.mdifferentiableAt_extend (𝓡 n) E _ |
| 63 | have hYx : Y (Phi x) = mfderiv (𝓡 n) (𝓡 n) Phi x u := |
| 64 | FiberBundle.extend_apply_self E _ |
| 65 | have hpY : pullField Phi Y x = u := by |
| 66 | apply (Phi.mfderivToContinuousLinearEquiv (by simp) x).injective |
| 67 | change mfderiv (𝓡 n) (𝓡 n) Phi x (pullField Phi Y x) = |
| 68 | mfderiv (𝓡 n) (𝓡 n) Phi x u |
| 69 | exact (mfderiv_pullField Phi Y x).trans hYx |
| 70 | calc |
| 71 | _ = mfderiv (𝓡 n) (𝓡 n) Phi x |
| 72 | (P.connection (pullField Phi Y) x v - Q.connection (pullField Phi Y) x v) := by |
| 73 | rw [← hpY, connectionDifference_apply_field P Q (mdifferentiableAt_pullField Phi hY)] |
| 74 | _ = D.connection Y (Phi x) (mfderiv (𝓡 n) (𝓡 n) Phi x v) - |
| 75 | B.connection Y (Phi x) (mfderiv (𝓡 n) (𝓡 n) Phi x v) := by |
| 76 | rw [map_sub, |
| 77 | connection_pullField_apply g Phi (contMDiff_pullback_section g Phi) D P Y hY v, |
| 78 | connection_pullField_apply background Phi (contMDiff_pullback_section background Phi) |
| 79 | B Q Y hY v] |
| 80 | _ = _ := by |
| 81 | rw [← connectionDifference_apply_field D B hY, hYx] |
| 82 | |
| 83 | /-- The inverse-Gram trace commutes with the actual differential. -/ |
| 84 | theorem intrinsicDeTurckField_pullback |
| 85 | (D : LeviCivitaData g) (B : LeviCivitaData background) |
| 86 | (P : LeviCivitaData (smoothPullbackMetric g Phi)) |
| 87 | (Q : LeviCivitaData (smoothPullbackMetric background Phi)) (x : M) : |
| 88 | mfderiv (𝓡 n) (𝓡 n) Phi x (intrinsicDeTurckField P Q x) = |
| 89 | intrinsicDeTurckField D B (Phi x) := by |
| 90 | let A := Phi.mfderivToContinuousLinearEquiv (by simp) x |
| 91 | let b := chartFrameBasis x x (mem_chart_source E x) |
| 92 | let b' := b.map A.toLinearEquiv |
| 93 | let F (i : Fin n) : (y : M) → TangentSpace (𝓡 n) y := FiberBundle.extend E (b i) |
| 94 | let G (i : Fin n) : (y : M) → TangentSpace (𝓡 n) y := FiberBundle.extend E (b' i) |
| 95 | have hF (i : Fin n) : F i x = b i := FiberBundle.extend_apply_self E _ |
| 96 | have hG (i : Fin n) : G i (Phi x) = b' i := FiberBundle.extend_apply_self E _ |
| 97 | have hFG (i : Fin n) : mfderiv (𝓡 n) (𝓡 n) Phi x (F i x) = G i (Phi x) := by |
| 98 | rw [hF, hG] |
| 99 | change mfderiv (𝓡 n) (𝓡 n) Phi x (b i) = A (b i) |
| 100 | exact (congrArg (fun L => L (b i)) |
| 101 | (Diffeomorph.mfderivToContinuousLinearEquiv_coe Phi (by simp) (x := x))).symm |
| 102 | have hgram : (frameMetricJet (smoothPullbackMetric g Phi) F x).value = |
| 103 | (frameMetricJet g G (Phi x)).value := by |
| 104 | ext i j |
| 105 | change (smoothPullbackMetric g Phi).inner x (F i x) (F j x) = |
| 106 | g.inner (Phi x) (G i (Phi x)) (G j (Phi x)) |
| 107 | rw [smoothPullbackMetric_inner, hFG, hFG] |
| 108 | rw [intrinsicDeTurckField_eq_frame_contraction P Q F x b hF, |
| 109 | intrinsicDeTurckField_eq_frame_contraction D B G (Phi x) b' hG] |
| 110 | simp only [map_sum, map_smul, hgram] |
| 111 | apply Finset.sum_congr rfl |
| 112 | intro a _ |
| 113 | apply Finset.sum_congr rfl |
| 114 | intro c _ |
| 115 | rw [connectionDifference_pullback g background Phi D B P Q x, hFG, hFG] |
| 116 | |
| 117 | /-- Equality holds for the whole smooth field, so it can be differentiated. -/ |
| 118 | theorem intrinsicDeTurckField_eq_pullField |
| 119 | (D : LeviCivitaData g) (B : LeviCivitaData background) |
| 120 | (P : LeviCivitaData (smoothPullbackMetric g Phi)) |
| 121 | (Q : LeviCivitaData (smoothPullbackMetric background Phi)) : |
| 122 | intrinsicDeTurckField P Q = pullField Phi (intrinsicDeTurckField D B) := by |
| 123 | funext x |
| 124 | apply (Phi.mfderivToContinuousLinearEquiv (by simp) x).injective |
| 125 | change mfderiv (𝓡 n) (𝓡 n) Phi x (intrinsicDeTurckField P Q x) = |
| 126 | mfderiv (𝓡 n) (𝓡 n) Phi x (pullField Phi (intrinsicDeTurckField D B) x) |
| 127 | rw [mfderiv_pullField] |
| 128 | exact intrinsicDeTurckField_pullback g background Phi D B P Q x |
| 129 | |
| 130 | theorem metricLieDerivative_pullback (D : LeviCivitaData g) |
| 131 | (P : LeviCivitaData (smoothPullbackMetric g Phi)) |
| 132 | (W : (y : M) → TangentSpace (𝓡 n) y) |
| 133 | (hW : ContMDiff (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% W)) |
| 134 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 135 | metricLieDerivative P (pullField Phi W) x u v = |
| 136 | metricLieDerivative D W (Phi x) |
| 137 | (mfderiv (𝓡 n) (𝓡 n) Phi x u) (mfderiv (𝓡 n) (𝓡 n) Phi x v) := by |
| 138 | rw [metricLieDerivative_apply, metricLieDerivative_apply, |
| 139 | smoothPullbackMetric_inner, smoothPullbackMetric_inner, |
| 140 | connection_pullField_apply g Phi (contMDiff_pullback_section g Phi) D P W |
| 141 | (hW.mdifferentiable (by simp) (Phi x)) u, |
| 142 | connection_pullField_apply g Phi (contMDiff_pullback_section g Phi) D P W |
| 143 | (hW.mdifferentiable (by simp) (Phi x)) v] |
| 144 | |
| 145 | /-- Both metrics are actually pulled back; no source covariance is a premise. -/ |
| 146 | theorem smoothRicciDeTurckTensor_pullback |
| 147 | (D : LeviCivitaData g) (B : LeviCivitaData background) |
| 148 | (P : LeviCivitaData (smoothPullbackMetric g Phi)) |
| 149 | (Q : LeviCivitaData (smoothPullbackMetric background Phi)) |
| 150 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 151 | smoothRicciDeTurckTensor P Q x u v = |
| 152 | smoothRicciDeTurckTensor D B (Phi x) |
| 153 | (mfderiv (𝓡 n) (𝓡 n) Phi x u) (mfderiv (𝓡 n) (𝓡 n) Phi x v) := by |
| 154 | rw [smoothRicciDeTurckTensor_apply, smoothRicciDeTurckTensor_apply, |
| 155 | intrinsicDeTurckField_eq_pullField g background Phi D B P Q, |
| 156 | metricLieDerivative_pullback g Phi D P (intrinsicDeTurckField D B) |
| 157 | (intrinsicDeTurckField_contMDiff D B), |
| 158 | ricci_pullback g Phi (contMDiff_pullback_section g Phi) D P] |
| 159 | |
| 160 | end PoincareMT.DeTurckPullbackSourceNative |
| 161 | |
| 162 | end |