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/CoordinateConnectionNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Connection.Koszul |
| 6 | import PoincareLib.Analysis.Parabolic.Quasilinear.Charts.Coordinates.ChartJetSource |
| 7 | import Mathlib.Analysis.InnerProductSpace.GramMatrix |
| 8 | |
| 9 | /-! |
| 10 | # Native Christoffel coefficients in a commuting frame |
| 11 | |
| 12 | The metric jet below is formed from actual bundle pairings and directional |
| 13 | derivatives. Koszul's formula and inversion of its Gram matrix identify the |
| 14 | finite jet Christoffel expression with the retained Levi-Civita connection. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option maxHeartbeats 1200000 |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle BigOperators |
| 21 | open Matrix |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.DeTurckNative |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 31 | |
| 32 | def frameMetricJet (g : RiemannianMetric n M) |
| 33 | (F : Fin n → (x : M) → TangentSpace (𝓡 n) x) (x : M) : |
| 34 | MetricJet2 (n := n) where |
| 35 | value i j := g.inner x (F i x) (F j x) |
| 36 | first a i j := |
| 37 | mvfderiv (𝓡 n) (fun y => g.inner y (F i y) (F j y)) x (F a x) |
| 38 | second a b i j := |
| 39 | mvfderiv (𝓡 n) |
| 40 | (fun y => mvfderiv (𝓡 n) |
| 41 | (fun z => g.inner z (F i z) (F j z)) y (F b y)) x (F a x) |
| 42 | |
| 43 | theorem frameMetricJet_first_symm (g : RiemannianMetric n M) |
| 44 | (F : Fin n → (x : M) → TangentSpace (𝓡 n) x) |
| 45 | (x : M) (a i j : Fin n) : |
| 46 | (frameMetricJet g F x).first a i j = |
| 47 | (frameMetricJet g F x).first a j i := by |
| 48 | exact congrArg (fun f : M → ℝ => mvfderiv (𝓡 n) f x (F a x)) |
| 49 | (funext fun y => g.symm y (F i y) (F j y)) |
| 50 | |
| 51 | theorem frameMetricJet_value_posDef (g : RiemannianMetric n M) |
| 52 | (F : Fin n → (x : M) → TangentSpace (𝓡 n) x) |
| 53 | (x : M) (b : Module.Basis (Fin n) ℝ (TangentSpace (𝓡 n) x)) |
| 54 | (hF : ∀ i, F i x = b i) : |
| 55 | (frameMetricJet g F x).value.PosDef := by |
| 56 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 57 | ⟨g.toRiemannianMetric⟩ |
| 58 | have hgram : (frameMetricJet g F x).value = Matrix.gram ℝ b := by |
| 59 | ext i j |
| 60 | change g.inner x (F i x) (F j x) = g.inner x (b i) (b j) |
| 61 | rw [hF i, hF j] |
| 62 | rw [hgram] |
| 63 | exact Matrix.posDef_gram_of_linearIndependent b.linearIndependent |
| 64 | |
| 65 | theorem connection_repr_eq_christoffelJet |
| 66 | {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 67 | (F : Fin n → (x : M) → TangentSpace (𝓡 n) x) |
| 68 | {x : M} (b : Module.Basis (Fin n) ℝ (TangentSpace (𝓡 n) x)) |
| 69 | (hF : ∀ a, F a x = b a) |
| 70 | (hregular : ∀ a, MDifferentiableAt (𝓡 n) |
| 71 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) (T% (F a)) x) |
| 72 | (hbracket : ∀ a c, VectorField.mlieBracket (𝓡 n) (F a) (F c) x = 0) |
| 73 | (k i j : Fin n) : |
| 74 | b.repr (D.connection (F j) x (F i x)) k = |
| 75 | christoffelJet (frameMetricJet g F x) k i j := by |
| 76 | classical |
| 77 | let G := (frameMetricJet g F x).value |
| 78 | let V := D.connection (F j) x (F i x) |
| 79 | let A : Fin n → ℝ := fun r => b.repr V r |
| 80 | let P : Fin n → ℝ := fun l => |
| 81 | (frameMetricJet g F x).first i l j + |
| 82 | (frameMetricJet g F x).first j l i - |
| 83 | (frameMetricJet g F x).first l i j |
| 84 | have hpair (l : Fin n) : |
| 85 | g.inner x V (F l x) = ∑ r, G l r * A r := by |
| 86 | calc |
| 87 | g.inner x V (F l x) = |
| 88 | g.inner x (∑ r, b.repr V r • b r) (b l) := by |
| 89 | rw [b.sum_repr V, hF l] |
| 90 | _ = ∑ r, G l r * A r := by |
| 91 | simp only [map_sum, map_smul, ContinuousLinearMap.sum_apply, |
| 92 | ContinuousLinearMap.smul_apply, smul_eq_mul] |
| 93 | apply Finset.sum_congr rfl |
| 94 | intro r _ |
| 95 | dsimp [G, A, frameMetricJet] |
| 96 | rw [hF l, hF r, g.symm x (b r) (b l)] |
| 97 | ring |
| 98 | have hkoszul (l : Fin n) : 2 * g.inner x V (F l x) = P l := by |
| 99 | have h := D.koszul (F i) (F j) (F l) |
| 100 | (hregular i) (hregular j) (hregular l) |
| 101 | rw [hbracket i j, hbracket i l, hbracket j l] at h |
| 102 | simp only [map_zero, ContinuousLinearMap.zero_apply, add_zero, sub_zero] at h |
| 103 | change 2 * g.inner x V (F l x) = |
| 104 | (frameMetricJet g F x).first i j l + |
| 105 | (frameMetricJet g F x).first j l i - |
| 106 | (frameMetricJet g F x).first l i j at h |
| 107 | rw [frameMetricJet_first_symm g F x i j l] at h |
| 108 | exact h |
| 109 | have hmatrix : G *ᵥ A = fun l => (1 / 2 : ℝ) * P l := by |
| 110 | funext l |
| 111 | change (∑ r, G l r * A r) = (1 / 2 : ℝ) * P l |
| 112 | rw [← hpair l] |
| 113 | linarith only [hkoszul l] |
| 114 | have hpos : G.PosDef := frameMetricJet_value_posDef g F x b hF |
| 115 | have hinverse : G⁻¹ *ᵥ (G *ᵥ A) = A := by |
| 116 | rw [Matrix.mulVec_mulVec, |
| 117 | Matrix.nonsing_inv_mul G (isUnit_iff_ne_zero.mpr (ne_of_gt hpos.det_pos)), |
| 118 | Matrix.one_mulVec] |
| 119 | change A k = christoffelJet (frameMetricJet g F x) k i j |
| 120 | calc |
| 121 | A k = (G⁻¹ *ᵥ (G *ᵥ A)) k := (congrFun hinverse k).symm |
| 122 | _ = (∑ l, G⁻¹ k l * ((1 / 2 : ℝ) * P l)) := by |
| 123 | rw [hmatrix] |
| 124 | rfl |
| 125 | _ = christoffelJet (frameMetricJet g F x) k i j := by |
| 126 | change (∑ l, G⁻¹ k l * ((1 / 2 : ℝ) * P l)) = |
| 127 | (1 / 2 : ℝ) * ∑ l, G⁻¹ k l * P l |
| 128 | rw [Finset.mul_sum] |
| 129 | apply Finset.sum_congr rfl |
| 130 | intro l _ |
| 131 | ring |
| 132 | |
| 133 | end PoincareMT.DeTurckNative |
| 134 | |
| 135 | end |