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.Induction.Schedules.Models.ReflectionJets |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Schedules.StandardGeometry.StandardNecks |
| 3 | |
| 4 | /-! |
| 5 | # The actual differential of axial reflection |
| 6 | |
| 7 | Morgan--Tian Definition 2.18, p. 31, and Remark 9.73, p. 231. The |
| 8 | opposite neck uses the exact reflected coordinate map. Its metric |
| 9 | pullback is the tensor reflection whose jet norm was already computed. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped Manifold ContDiff |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M45 |
| 20 | |
| 21 | local notation "I" => ModelWithCorners.prod (𝓡 2) 𝓘(ℝ, ℝ) |
| 22 | |
| 23 | /-- The opposite-neck map is a smooth involution. Definition 2.18, p. 31. -/ |
| 24 | theorem cylinderAxialReflection_smooth : |
| 25 | ContMDiff I I ∞ cylinderAxialReflection := |
| 26 | contMDiff_fst.prodMk contMDiff_snd.neg |
| 27 | |
| 28 | /-- Axial reflection is its own inverse. Definition 2.18, p. 31. -/ |
| 29 | @[simp] theorem cylinderAxialReflection_involutive (z : RoundCylinderSpace) : |
| 30 | cylinderAxialReflection (cylinderAxialReflection z) = z := by |
| 31 | simp [cylinderAxialReflection] |
| 32 | |
| 33 | /-- The differential acts by the literal axial sign. Definition 2.18, p. 31. -/ |
| 34 | theorem mfderiv_cylinderAxialReflection (z : RoundCylinderSpace) |
| 35 | (v : RoundCylinderTangent z) : |
| 36 | mfderiv I I cylinderAxialReflection z v = (v.1, -v.2) := by |
| 37 | exact congrArg (fun L : RoundCylinderCoordinates →L[ℝ] RoundCylinderCoordinates => L v) |
| 38 | ((hasMFDerivAt_fst z).prodMk (hasMFDerivAt_snd z).neg).mfderiv |
| 39 | |
| 40 | variable {M : Type u} [TopologicalSpace M] |
| 41 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 42 | |
| 43 | omit [IsManifold (𝓡 3) ∞ M] in |
| 44 | /-- The chain rule under reflection also holds for totalized derivatives |
| 45 | outside the neck domain, because reflection is a smooth involution. |
| 46 | Definition 2.18, p. 31. -/ |
| 47 | theorem mfderiv_comp_cylinderAxialReflection (f : RoundCylinderSpace → M) |
| 48 | (z : RoundCylinderSpace) (v : RoundCylinderTangent z) : |
| 49 | mfderiv I (𝓡 3) (f ∘ cylinderAxialReflection) z v = |
| 50 | mfderiv I (𝓡 3) f (cylinderAxialReflection z) (v.1, -v.2) := by |
| 51 | have hR := cylinderAxialReflection_smooth.mdifferentiable (by simp) |
| 52 | by_cases hf : MDifferentiableAt I (𝓡 3) f (cylinderAxialReflection z) |
| 53 | · rw [mfderiv_comp_apply z hf (hR z), mfderiv_cylinderAxialReflection] |
| 54 | · have hcomp : ¬MDifferentiableAt I (𝓡 3) (f ∘ cylinderAxialReflection) z := by |
| 55 | intro h |
| 56 | have h' := h.comp_of_eq (cylinderAxialReflection z) (hR (cylinderAxialReflection z)) |
| 57 | (cylinderAxialReflection_involutive z) |
| 58 | apply hf |
| 59 | simpa only [Function.comp_def, cylinderAxialReflection_involutive] using h' |
| 60 | rw [mfderiv_zero_of_not_mdifferentiableAt hf, |
| 61 | mfderiv_zero_of_not_mdifferentiableAt hcomp] |
| 62 | rfl |
| 63 | |
| 64 | /-- Pulling back by the opposite neck is exactly tensor reflection. |
| 65 | Definition 2.18, p. 31. -/ |
| 66 | theorem roundCylinderPullback_reflection (g : RiemannianMetric 3 M) |
| 67 | (f : RoundCylinderSpace → M) : |
| 68 | roundCylinderPullback g (f ∘ cylinderAxialReflection) = |
| 69 | cylinderReflectedTensor (roundCylinderPullback g f) := by |
| 70 | funext z v w |
| 71 | exact congrArg₂ (fun v w => g.inner (f (cylinderAxialReflection z)) v w) |
| 72 | (mfderiv_comp_cylinderAxialReflection f z v) |
| 73 | (mfderiv_comp_cylinderAxialReflection f z w) |
| 74 | |
| 75 | /-- Every scalar multiple of an actual pullback is bilinear, including |
| 76 | where the derivative is totalized. Definition 2.16, p. 30. -/ |
| 77 | theorem roundCylinderPullback_bilinear (g : RiemannianMetric 3 M) |
| 78 | (f : RoundCylinderSpace → M) (c : ℝ) (z : RoundCylinderSpace) : |
| 79 | IsBilinearMap ℝ (fun v w => c * roundCylinderPullback g f z v w) := by |
| 80 | constructor |
| 81 | · intro v w q |
| 82 | simp only [roundCylinderPullback, map_add, add_apply, mul_add] |
| 83 | · intro a v w |
| 84 | simp only [roundCylinderPullback, map_smul, smul_apply, smul_eq_mul] |
| 85 | ring |
| 86 | · intro v w q |
| 87 | simp only [roundCylinderPullback, map_add, mul_add] |
| 88 | · intro a v w |
| 89 | simp only [roundCylinderPullback, map_smul, smul_eq_mul] |
| 90 | ring |
| 91 | |
| 92 | /-- Exact metric comparison for the opposite neck, with no tolerance |
| 93 | change. Definitions 2.16 and 2.18, pp. 30-31. -/ |
| 94 | theorem neckMetricComparison_reflection (g : RiemannianMetric 3 M) |
| 95 | {epsilon scale : ℝ} {f : RoundCylinderSpace → M} |
| 96 | (h : NeckMetricJetComparison g epsilon scale f) : |
| 97 | NeckMetricJetComparison g epsilon scale (f ∘ cylinderAxialReflection) := by |
| 98 | refine ⟨?_⟩ |
| 99 | have heq : (fun z v w => scale⁻¹ ^ 2 * |
| 100 | roundCylinderPullback g (f ∘ cylinderAxialReflection) z v w) = |
| 101 | cylinderReflectedTensor (fun z v w => scale⁻¹ ^ 2 * |
| 102 | roundCylinderPullback g f z v w) := by |
| 103 | rw [roundCylinderPullback_reflection] |
| 104 | rfl |
| 105 | rw [heq] |
| 106 | exact cylinderReflectedTensor_close (by norm_num) _ |
| 107 | (roundCylinderPullback_bilinear g f _) h.close |
| 108 | |
| 109 | end PoincareMT.M45 |