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.RoundCylinderReflectionJets |
| 3 | import PoincareLib.Topology.Manifold.NeckCap.Theory |
| 4 | import PoincareLib.Geometry.RicciFlow.CanonicalNeighborhood.Neck.Convergence.CylinderCoefficients |
| 5 | |
| 6 | /-! |
| 7 | # Actual metric pullbacks under neck reversal |
| 8 | |
| 9 | The literal cylinder reflection gives the two-slot coefficient identity |
| 10 | needed to preserve every metric jet in Morgan--Tian Definition 2.18, |
| 11 | p. 31. The chain rule retains actual pointwise differentiability. See |
| 12 | proof-work/tasks/M25/derivations/2026-09-22-actual-neck-reversal-inventory.md. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | /-- The actual sphere-cylinder diffeomorphism in Definition 2.18, p. 31, |
| 25 | with the same literal line reflection in both directions. -/ |
| 26 | noncomputable def roundCylinderAxialReflection : |
| 27 | Diffeomorph ((𝓡 2).prod 𝓘(ℝ, ℝ)) ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 28 | RoundCylinderSpace RoundCylinderSpace ∞ where |
| 29 | toFun := fun z => (z.1, -z.2) |
| 30 | invFun := fun z => (z.1, -z.2) |
| 31 | left_inv := by intro z; simp |
| 32 | right_inv := by intro z; simp |
| 33 | contMDiff_toFun := contMDiff_fst.prodMk |
| 34 | (contDiff_neg.contMDiff.comp contMDiff_snd) |
| 35 | contMDiff_invFun := contMDiff_fst.prodMk |
| 36 | (contDiff_neg.contMDiff.comp contMDiff_snd) |
| 37 | |
| 38 | variable {M : Type u} [TopologicalSpace M] |
| 39 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 40 | |
| 41 | -- The chain rule uses tangent-space aliases with their model vector spaces. |
| 42 | set_option backward.isDefEq.respectTransparency false in |
| 43 | /-- Both actual metric arguments acquire their basis signs under reversal; |
| 44 | Definitions 2.16 and 2.18, pp. 30-31. -/ |
| 45 | theorem roundCylinderTensorCoefficient_smul_pullback_axialReflection |
| 46 | (g : RiemannianMetric 3 M) (a : ℝ) (f : RoundCylinderSpace → M) |
| 47 | (q : UnitTwoSphere) (p : RoundCylinderCoordinates) |
| 48 | (hf : MDifferentiableAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) f |
| 49 | ((chartAt (EuclideanSpace ℝ (Fin 2)) q).symm p.1, -p.2)) |
| 50 | (i j : Fin 3) : |
| 51 | roundCylinderTensorCoefficient |
| 52 | (fun z v w => a * roundCylinderPullback g |
| 53 | (fun y => f (roundCylinderAxialReflection y)) z v w) |
| 54 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) p i j = |
| 55 | roundCylinderAxialSign i * roundCylinderAxialSign j * |
| 56 | roundCylinderTensorCoefficient |
| 57 | (fun z v w => a * roundCylinderPullback g f z v w) |
| 58 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) |
| 59 | (roundCylinderCoordinateReflection p) i j := by |
| 60 | let c := chartAt (EuclideanSpace ℝ (Fin 2)) q |
| 61 | let ψ : RoundCylinderCoordinates → RoundCylinderSpace := fun y => (c.symm y.1, y.2) |
| 62 | let F : RoundCylinderCoordinates → M := f ∘ ψ |
| 63 | let J := roundCylinderCoordinateReflection |
| 64 | have hρ : MDifferentiableAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 65 | roundCylinderAxialReflection (ψ p) := |
| 66 | roundCylinderAxialReflection.contMDiff.mdifferentiable (by simp) _ |
| 67 | have hfr : MDifferentiableAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) |
| 68 | (fun z => f (roundCylinderAxialReflection z)) (ψ p) := hf.comp (ψ p) hρ |
| 69 | have hF : MDifferentiableAt 𝓘(ℝ, RoundCylinderCoordinates) (𝓡 3) F (J p) := |
| 70 | hf.comp (J p) ((cylinderChart_symm_smooth q).mdifferentiable (by simp) _) |
| 71 | change a * roundCylinderTensorCoefficient |
| 72 | (roundCylinderPullback g (fun z => f (roundCylinderAxialReflection z))) c p i j = |
| 73 | roundCylinderAxialSign i * roundCylinderAxialSign j * |
| 74 | (a * roundCylinderTensorCoefficient (roundCylinderPullback g f) c (J p) i j) |
| 75 | rw [roundCylinderTensorCoefficient_pullback_eq g q _ p hfr i j, |
| 76 | roundCylinderTensorCoefficient_pullback_eq g q f (J p) hf i j] |
| 77 | change a * g.inner (F (J p)) |
| 78 | (mfderiv 𝓘(ℝ, RoundCylinderCoordinates) (𝓡 3) (F ∘ J) p |
| 79 | (roundCylinderCoordinateBasis i)) |
| 80 | (mfderiv 𝓘(ℝ, RoundCylinderCoordinates) (𝓡 3) (F ∘ J) p |
| 81 | (roundCylinderCoordinateBasis j)) = |
| 82 | roundCylinderAxialSign i * roundCylinderAxialSign j * |
| 83 | (a * g.inner (F (J p)) |
| 84 | (mfderiv 𝓘(ℝ, RoundCylinderCoordinates) (𝓡 3) F (J p) |
| 85 | (roundCylinderCoordinateBasis i)) |
| 86 | (mfderiv 𝓘(ℝ, RoundCylinderCoordinates) (𝓡 3) F (J p) |
| 87 | (roundCylinderCoordinateBasis j))) |
| 88 | have hD (v : RoundCylinderCoordinates) : |
| 89 | mfderiv 𝓘(ℝ, RoundCylinderCoordinates) (𝓡 3) (F ∘ J) p v = |
| 90 | mfderiv 𝓘(ℝ, RoundCylinderCoordinates) (𝓡 3) F (J p) (J v) := by |
| 91 | rw [mfderiv_comp_apply p hF J.mdifferentiableAt, J.mfderiv_eq] |
| 92 | rfl |
| 93 | rw [hD, hD] |
| 94 | simp only [J, |
| 95 | roundCylinderCoordinateReflection_basis, map_smul, smul_apply, smul_eq_mul] |
| 96 | ring |
| 97 | |
| 98 | /-- The literal normalized comparison, including its full retained order |
| 99 | and strict witness, survives the reversal of Definition 2.18, p. 31. -/ |
| 100 | theorem NeckMetricJetComparison.axialReflection |
| 101 | {g : RiemannianMetric 3 M} {epsilon scale : ℝ} {f : RoundCylinderSpace → M} |
| 102 | (h : NeckMetricJetComparison g epsilon scale f) |
| 103 | (hf : ContMDiffOn ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ f |
| 104 | (univ ×ˢ Ioo (-epsilon⁻¹) epsilon⁻¹)) : |
| 105 | NeckMetricJetComparison g epsilon scale |
| 106 | (fun z => f (roundCylinderAxialReflection z)) := by |
| 107 | refine ⟨h.close.axialReflection ?_⟩ |
| 108 | intro q p hp i j |
| 109 | have hmem : ((chartAt (EuclideanSpace ℝ (Fin 2)) q).symm p.1, -p.2) ∈ |
| 110 | (univ ×ˢ Ioo (-epsilon⁻¹) epsilon⁻¹ : Set RoundCylinderSpace) := by |
| 111 | refine ⟨mem_univ _, ?_⟩ |
| 112 | constructor <;> linarith [hp.2.1, hp.2.2] |
| 113 | exact roundCylinderTensorCoefficient_smul_pullback_axialReflection g (scale⁻¹ ^ 2) |
| 114 | f q p ((hf.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds hmem)).mdifferentiableAt |
| 115 | (by simp)) i j |
| 116 | |
| 117 | end PoincareMT |