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.Predecessors.Necks.Spheres.RoundCylinderTensorReflection |
| 3 | import Mathlib.Analysis.Calculus.FDeriv.Congr |
| 4 | import Mathlib.Analysis.Calculus.ContDiff.Comp |
| 5 | |
| 6 | /-! |
| 7 | # Full neck jet comparison under axial reflection |
| 8 | |
| 9 | The exact all-rank identities transport Definition 2.16's full covariant |
| 10 | jet sum and strict witness under the reversal of Definition 2.18, |
| 11 | Morgan--Tian pp. 30-31. Coefficient identities are required on the actual |
| 12 | open chart strip, so no derivative of an arbitrary extension is used. |
| 13 | See proof-work/tasks/M25/derivations/2026-09-22-axial-reflection-jet-inventory.md. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open scoped BigOperators Topology ContDiff |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | /-- The frozen covariant derivative depends only on the open-set germ; |
| 23 | the local form needed for Definition 2.16, p. 30. -/ |
| 24 | theorem roundCylinderTensorDerivative_congrOn |
| 25 | (u : ℝ) |
| 26 | (c : OpenPartialHomeomorph UnitTwoSphere (EuclideanSpace ℝ (Fin 2))) |
| 27 | {r : ℕ} {U : Set RoundCylinderCoordinates} (hU : IsOpen U) |
| 28 | {T T' : RoundCylinderCoordinates → (Fin r → Fin 3) → ℝ} |
| 29 | (hT : Set.EqOn T T' U) : |
| 30 | Set.EqOn (roundCylinderTensorDerivative u c T) |
| 31 | (roundCylinderTensorDerivative u c T') U := by |
| 32 | intro p hp |
| 33 | funext a |
| 34 | have hmem : ∀ᶠ x in 𝓝 p, x ∈ U := hU.mem_nhds hp |
| 35 | have hev : (fun x => T x (fun i => a i.succ)) =ᶠ[𝓝 p] |
| 36 | (fun x => T' x (fun i => a i.succ)) := |
| 37 | hmem.mono fun x hx => congrFun (hT hx) _ |
| 38 | unfold roundCylinderTensorDerivative |
| 39 | rw [hev.fderiv_eq, hT hp] |
| 40 | |
| 41 | /-- A local two-slot coefficient identity transports every iterated |
| 42 | covariant derivative in Definition 2.16, p. 30. -/ |
| 43 | theorem roundCylinderIteratedDerivative_axialReflection |
| 44 | (q : UnitTwoSphere) (B B' : RoundCylinderTwoTensor) |
| 45 | {U : Set RoundCylinderCoordinates} (hU : IsOpen U) |
| 46 | (hcoeff : ∀ p ∈ U, ∀ a b : Fin 3, |
| 47 | roundCylinderTensorCoefficient B' |
| 48 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) p a b = |
| 49 | roundCylinderAxialSign a * roundCylinderAxialSign b * |
| 50 | roundCylinderTensorCoefficient B |
| 51 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) |
| 52 | (roundCylinderCoordinateReflection p) a b) |
| 53 | (k : ℕ) : |
| 54 | Set.EqOn |
| 55 | (roundCylinderIteratedDerivative 0 |
| 56 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) B' k) |
| 57 | (roundCylinderTensorReflection |
| 58 | (roundCylinderIteratedDerivative 0 |
| 59 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) B k)) U := by |
| 60 | induction k with |
| 61 | | zero => |
| 62 | intro p hp |
| 63 | funext a |
| 64 | change roundCylinderTensorCoefficient B' _ p (a 0) (a 1) - |
| 65 | roundCylinderGram 0 _ p (a 0) (a 1) = |
| 66 | roundCylinderSlotSign a * |
| 67 | (roundCylinderTensorCoefficient B _ (roundCylinderCoordinateReflection p) |
| 68 | (a 0) (a 1) - |
| 69 | roundCylinderGram 0 _ (roundCylinderCoordinateReflection p) (a 0) (a 1)) |
| 70 | rw [hcoeff p hp, roundCylinderGram_axialReflection q p] |
| 71 | have hslot : roundCylinderSlotSign a = |
| 72 | roundCylinderAxialSign (a 0) * roundCylinderAxialSign (a 1) := |
| 73 | Fin.prod_univ_two _ |
| 74 | rw [hslot] |
| 75 | ring |
| 76 | | succ k ih => |
| 77 | intro p hp |
| 78 | funext a |
| 79 | exact (congrFun (roundCylinderTensorDerivative_congrOn 0 _ hU ih hp) a).trans |
| 80 | (roundCylinderTensorDerivative_axialReflection q |
| 81 | (roundCylinderIteratedDerivative 0 _ B k) p a) |
| 82 | |
| 83 | /-- The exact finite covariant-jet sum is unchanged on the retained strip; |
| 84 | Definitions 2.16 and 2.18, pp. 30-31. -/ |
| 85 | theorem roundCylinderJetErrorSquared_axialReflection |
| 86 | (epsilon : ℝ) (B B' : RoundCylinderTwoTensor) |
| 87 | (hcoeff : ∀ (q : UnitTwoSphere) (p : RoundCylinderCoordinates), |
| 88 | p ∈ (chartAt (EuclideanSpace ℝ (Fin 2)) q).target ×ˢ |
| 89 | Set.Ioo (-epsilon⁻¹) epsilon⁻¹ → |
| 90 | ∀ a b : Fin 3, |
| 91 | roundCylinderTensorCoefficient B' |
| 92 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) p a b = |
| 93 | roundCylinderAxialSign a * roundCylinderAxialSign b * |
| 94 | roundCylinderTensorCoefficient B |
| 95 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) |
| 96 | (roundCylinderCoordinateReflection p) a b) |
| 97 | (order : ℕ) (z : RoundCylinderSpace) |
| 98 | (hz : z.2 ∈ Set.Ioo (-epsilon⁻¹) epsilon⁻¹) : |
| 99 | roundCylinderJetErrorSquared 0 B' order z = |
| 100 | roundCylinderJetErrorSquared 0 B order (z.1, -z.2) := by |
| 101 | let c := chartAt (EuclideanSpace ℝ (Fin 2)) z.1 |
| 102 | let p : RoundCylinderCoordinates := (c z.1, z.2) |
| 103 | have hp : p ∈ c.target ×ˢ Set.Ioo (-epsilon⁻¹) epsilon⁻¹ := |
| 104 | ⟨mem_chart_target _ _, hz⟩ |
| 105 | change (∑ k ∈ Finset.range (order + 1), |
| 106 | roundCylinderTensorNormSquared 0 c p |
| 107 | (roundCylinderIteratedDerivative 0 c B' k p)) = |
| 108 | ∑ k ∈ Finset.range (order + 1), |
| 109 | roundCylinderTensorNormSquared 0 c (roundCylinderCoordinateReflection p) |
| 110 | (roundCylinderIteratedDerivative 0 c B k (roundCylinderCoordinateReflection p)) |
| 111 | apply Finset.sum_congr rfl |
| 112 | intro k _ |
| 113 | have hjet := roundCylinderIteratedDerivative_axialReflection z.1 B B' |
| 114 | (c.open_target.prod isOpen_Ioo) (hcoeff z.1) k hp |
| 115 | rw [hjet] |
| 116 | exact roundCylinderTensorNormSquared_axialReflection z.1 p |
| 117 | (roundCylinderIteratedDerivative 0 c B k (roundCylinderCoordinateReflection p)) |
| 118 | |
| 119 | /-- Coefficient smoothness on the actual open chart strip survives |
| 120 | Definition 2.18's reversal, p. 31. -/ |
| 121 | theorem RoundCylinderTensorSmoothOn.axialReflection |
| 122 | {epsilon : ℝ} {B B' : RoundCylinderTwoTensor} |
| 123 | (hB : RoundCylinderTensorSmoothOn epsilon B) |
| 124 | (hcoeff : ∀ (q : UnitTwoSphere) (p : RoundCylinderCoordinates), |
| 125 | p ∈ (chartAt (EuclideanSpace ℝ (Fin 2)) q).target ×ˢ |
| 126 | Set.Ioo (-epsilon⁻¹) epsilon⁻¹ → |
| 127 | ∀ a b : Fin 3, |
| 128 | roundCylinderTensorCoefficient B' |
| 129 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) p a b = |
| 130 | roundCylinderAxialSign a * roundCylinderAxialSign b * |
| 131 | roundCylinderTensorCoefficient B |
| 132 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) |
| 133 | (roundCylinderCoordinateReflection p) a b) : |
| 134 | RoundCylinderTensorSmoothOn epsilon B' := by |
| 135 | intro q a b |
| 136 | let U := (chartAt (EuclideanSpace ℝ (Fin 2)) q).target ×ˢ |
| 137 | Set.Ioo (-epsilon⁻¹) epsilon⁻¹ |
| 138 | have hmap : Set.MapsTo roundCylinderCoordinateReflection U U := by |
| 139 | intro p hp |
| 140 | refine ⟨hp.1, ?_⟩ |
| 141 | change -epsilon⁻¹ < -p.2 ∧ -p.2 < epsilon⁻¹ |
| 142 | constructor <;> linarith [hp.2.1, hp.2.2] |
| 143 | have hs : ContDiffOn ℝ ∞ |
| 144 | (fun p => roundCylinderAxialSign a * roundCylinderAxialSign b * |
| 145 | roundCylinderTensorCoefficient B |
| 146 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) |
| 147 | (roundCylinderCoordinateReflection p) a b) U := |
| 148 | contDiffOn_const.mul ((hB q a b).comp |
| 149 | roundCylinderCoordinateReflection.contDiff.contDiffOn hmap) |
| 150 | exact hs.congr fun p hp => hcoeff q p hp a b |
| 151 | |
| 152 | /-- Reversal keeps the strict comparison witness and every retained jet |
| 153 | of Definitions 2.16 and 2.18, pp. 30-31. -/ |
| 154 | theorem RoundCylinderClose.axialReflection |
| 155 | {epsilon : ℝ} {B B' : RoundCylinderTwoTensor} |
| 156 | (hB : RoundCylinderClose epsilon 0 B) |
| 157 | (hcoeff : ∀ (q : UnitTwoSphere) (p : RoundCylinderCoordinates), |
| 158 | p ∈ (chartAt (EuclideanSpace ℝ (Fin 2)) q).target ×ˢ |
| 159 | Set.Ioo (-epsilon⁻¹) epsilon⁻¹ → |
| 160 | ∀ a b : Fin 3, |
| 161 | roundCylinderTensorCoefficient B' |
| 162 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) p a b = |
| 163 | roundCylinderAxialSign a * roundCylinderAxialSign b * |
| 164 | roundCylinderTensorCoefficient B |
| 165 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) |
| 166 | (roundCylinderCoordinateReflection p) a b) : |
| 167 | RoundCylinderClose epsilon 0 B' := by |
| 168 | rcases hB with ⟨hsmooth, bound, hbound, hjet⟩ |
| 169 | refine ⟨hsmooth.axialReflection hcoeff, bound, hbound, ?_⟩ |
| 170 | intro z hz |
| 171 | rw [roundCylinderJetErrorSquared_axialReflection epsilon B B' hcoeff _ z hz] |
| 172 | apply hjet |
| 173 | constructor <;> dsimp <;> linarith [hz.1, hz.2] |
| 174 | |
| 175 | end PoincareMT |