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.StandardCap.Existence.InitialEstimates.EndCoordinates |
| 2 | |
| 3 | /-! |
| 4 | # Axial translations of an arbitrary exact end |
| 5 | |
| 6 | Morgan-Tian Lemma 12.3, pp. 294-295. Translation in the axial coordinate |
| 7 | preserves the literal cylinder inner product. Conjugating it by the |
| 8 | supplied end coordinates gives a smooth local metric isometry wherever |
| 9 | both the original and translated heights are positive. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff |
| 16 | |
| 17 | namespace PoincareMT.M34 |
| 18 | |
| 19 | /-- Axial translation in the fixed cylinder model |
| 20 | (Lemma 12.3, pp. 294-295). -/ |
| 21 | def cylinderAxialTranslation (s : ℝ) (z : StandardCylinderSpace) : StandardCylinderSpace := |
| 22 | (z.1, z.2 + s) |
| 23 | |
| 24 | /-- Axial translation is smooth on the whole cylinder |
| 25 | (Lemma 12.3, pp. 294-295). -/ |
| 26 | theorem cylinderAxialTranslation_contMDiff (s : ℝ) : |
| 27 | ContMDiff ((𝓡 2).prod 𝓘(ℝ, ℝ)) ((𝓡 2).prod 𝓘(ℝ, ℝ)) ∞ |
| 28 | (cylinderAxialTranslation s) := |
| 29 | contMDiff_fst.prodMk (contMDiff_snd.add contMDiff_const) |
| 30 | |
| 31 | set_option backward.isDefEq.respectTransparency false in |
| 32 | /-- Axial translation acts as the identity on the cylinder model tangent |
| 33 | vectors (Lemma 12.3, pp. 294-295). -/ |
| 34 | theorem cylinderAxialTranslation_mfderiv (s : ℝ) (z : StandardCylinderSpace) |
| 35 | (v : TangentSpace ((𝓡 2).prod 𝓘(ℝ, ℝ)) z) : |
| 36 | mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 37 | (cylinderAxialTranslation s) z v = v := by |
| 38 | have hs : MDifferentiableAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) 𝓘(ℝ, ℝ) |
| 39 | (fun q : StandardCylinderSpace => q.2 + s) z := |
| 40 | mdifferentiableAt_snd.add mdifferentiableAt_const |
| 41 | have hd : mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) 𝓘(ℝ, ℝ) |
| 42 | (fun q : StandardCylinderSpace => q.2 + s) z = |
| 43 | mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) 𝓘(ℝ, ℝ) Prod.snd z := by |
| 44 | change mvfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 45 | (fun q : StandardCylinderSpace => q.2 + s) z = |
| 46 | mvfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) Prod.snd z |
| 47 | rw [mvfderiv_fun_add mdifferentiableAt_snd mdifferentiableAt_const, |
| 48 | mvfderiv_const, add_zero] |
| 49 | erw [cylinderAxialTranslation, mfderiv_prodMk mdifferentiableAt_fst hs, |
| 50 | hd, mfderiv_fst, mfderiv_snd] |
| 51 | rfl |
| 52 | |
| 53 | variable {g : RiemannianMetric 3 StandardCapSpace} |
| 54 | |
| 55 | /-- The total map that realizes axial translation where the end coordinates |
| 56 | and their translated heights are valid (Lemma 12.3, pp. 294-295). -/ |
| 57 | def endAxialTranslation (e : StandardCylindricalEnd g) (s : ℝ) |
| 58 | (x : StandardCapSpace) : StandardCapSpace := |
| 59 | e.coordinate (cylinderAxialTranslation s (e.inverse x)) |
| 60 | |
| 61 | /-- The translated end point has its prescribed cylinder coordinates |
| 62 | (Lemma 12.3, pp. 294-295). -/ |
| 63 | theorem endAxialTranslation_coordinate (e : StandardCylindricalEnd g) (s : ℝ) |
| 64 | {z : StandardCylinderSpace} (hz : 0 ≤ z.2) : |
| 65 | endAxialTranslation e s (e.coordinate z) = e.coordinate (z.1, z.2 + s) := by |
| 66 | rw [endAxialTranslation, e.coordinate_left_inverse ⟨mem_univ _, hz⟩] |
| 67 | rfl |
| 68 | |
| 69 | /-- Translation is smooth whenever both cylinder heights are positive |
| 70 | (Lemma 12.3, pp. 294-295). -/ |
| 71 | theorem endAxialTranslation_contMDiffAt (e : StandardCylindricalEnd g) (s : ℝ) |
| 72 | {z : StandardCylinderSpace} (hz : 0 < z.2) (hsz : 0 < z.2 + s) : |
| 73 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ (endAxialTranslation e s) (e.coordinate z) := by |
| 74 | have hleft : e.inverse (e.coordinate z) = z := |
| 75 | e.coordinate_left_inverse ⟨mem_univ _, hz.le⟩ |
| 76 | have hc : ContMDiffAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ e.coordinate |
| 77 | (cylinderAxialTranslation s (e.inverse (e.coordinate z))) := by |
| 78 | rw [hleft] |
| 79 | exact end_coordinate_contMDiffAt e hsz |
| 80 | have ht : ContMDiffAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) ((𝓡 2).prod 𝓘(ℝ, ℝ)) ∞ |
| 81 | (cylinderAxialTranslation s) (e.inverse (e.coordinate z)) := |
| 82 | (cylinderAxialTranslation_contMDiff s).contMDiffAt |
| 83 | exact hc.comp (e.coordinate z) (ht.comp (e.coordinate z) (end_inverse_contMDiffAt e hz)) |
| 84 | |
| 85 | set_option backward.isDefEq.respectTransparency false in |
| 86 | /-- The differential of the translated end coordinate is the coordinate |
| 87 | derivative at the new height applied to the old inverse derivative |
| 88 | (Lemma 12.3, pp. 294-295). -/ |
| 89 | theorem endAxialTranslation_mfderiv (e : StandardCylindricalEnd g) (s : ℝ) |
| 90 | {z : StandardCylinderSpace} (hz : 0 < z.2) (hsz : 0 < z.2 + s) |
| 91 | (u : TangentSpace (𝓡 3) (e.coordinate z)) : |
| 92 | mfderiv (𝓡 3) (𝓡 3) (endAxialTranslation e s) (e.coordinate z) u = |
| 93 | mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) e.coordinate (z.1, z.2 + s) |
| 94 | (mfderiv (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) e.inverse (e.coordinate z) u) := by |
| 95 | have hleft : e.inverse (e.coordinate z) = z := |
| 96 | e.coordinate_left_inverse ⟨mem_univ _, hz.le⟩ |
| 97 | have hi := (end_inverse_contMDiffAt e hz).mdifferentiableAt (by simp) |
| 98 | have hs := (cylinderAxialTranslation_contMDiff s).mdifferentiable (by simp) |
| 99 | have hc : MDifferentiableAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) e.coordinate |
| 100 | (cylinderAxialTranslation s (e.inverse (e.coordinate z))) := by |
| 101 | rw [hleft] |
| 102 | exact (end_coordinate_contMDiffAt e hsz).mdifferentiableAt (by simp) |
| 103 | change mfderiv (𝓡 3) (𝓡 3) |
| 104 | (e.coordinate ∘ (cylinderAxialTranslation s ∘ e.inverse)) (e.coordinate z) u = _ |
| 105 | have ht : MDifferentiableAt (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 106 | (cylinderAxialTranslation s ∘ e.inverse) (e.coordinate z) := |
| 107 | (hs (e.inverse (e.coordinate z))).comp (e.coordinate z) hi |
| 108 | erw [mfderiv_comp (e.coordinate z) hc ht, |
| 109 | mfderiv_comp (e.coordinate z) (hs (e.inverse (e.coordinate z))) hi] |
| 110 | change mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) e.coordinate |
| 111 | (cylinderAxialTranslation s (e.inverse (e.coordinate z))) |
| 112 | (mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 113 | (cylinderAxialTranslation s) (e.inverse (e.coordinate z)) |
| 114 | (mfderiv (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) e.inverse (e.coordinate z) u)) = _ |
| 115 | erw [cylinderAxialTranslation_mfderiv] |
| 116 | congr 2 |
| 117 | exact congrArg (cylinderAxialTranslation s) hleft |
| 118 | |
| 119 | set_option backward.isDefEq.respectTransparency false in |
| 120 | /-- Axial translation is a local isometry of the actual supplied metric |
| 121 | where both heights are positive (Lemma 12.3, pp. 294-295). -/ |
| 122 | theorem endAxialTranslation_metric (e : StandardCylindricalEnd g) (s : ℝ) |
| 123 | {z : StandardCylinderSpace} (hz : 0 < z.2) (hsz : 0 < z.2 + s) |
| 124 | (u v : TangentSpace (𝓡 3) (e.coordinate z)) : |
| 125 | g.inner (e.coordinate z) u v = |
| 126 | g.inner (endAxialTranslation e s (e.coordinate z)) |
| 127 | (mfderiv (𝓡 3) (𝓡 3) (endAxialTranslation e s) (e.coordinate z) u) |
| 128 | (mfderiv (𝓡 3) (𝓡 3) (endAxialTranslation e s) (e.coordinate z) v) := by |
| 129 | erw [endAxialTranslation_coordinate e s hz.le, |
| 130 | endAxialTranslation_mfderiv e s hz hsz, endAxialTranslation_mfderiv e s hz hsz, |
| 131 | e.metric_pullback _ hsz.le, end_inverse_metric e hz] |
| 132 | rfl |
| 133 | |
| 134 | /-- Every translation between positive heights is a smooth metric isometry |
| 135 | on an open neighborhood of the original point (Lemma 12.3, pp. 294-295). -/ |
| 136 | theorem endAxialTranslation_local_isometry (e : StandardCylindricalEnd g) (s : ℝ) |
| 137 | {z : StandardCylinderSpace} (hz : 0 < z.2) (hsz : 0 < z.2 + s) : |
| 138 | ∃ U : Set StandardCapSpace, IsOpen U ∧ e.coordinate z ∈ U ∧ |
| 139 | ContMDiffOn (𝓡 3) (𝓡 3) ∞ (endAxialTranslation e s) U ∧ |
| 140 | ∀ x ∈ U, ∀ u v : TangentSpace (𝓡 3) x, |
| 141 | g.inner x u v = g.inner (endAxialTranslation e s x) |
| 142 | (mfderiv (𝓡 3) (𝓡 3) (endAxialTranslation e s) x u) |
| 143 | (mfderiv (𝓡 3) (𝓡 3) (endAxialTranslation e s) x v) := by |
| 144 | let V : Set StandardCylinderSpace := univ ×ˢ Ioi (max 0 (-s)) |
| 145 | have hpos : ∀ w ∈ V, 0 < w.2 := fun _ hw => (le_max_left _ _).trans_lt hw.2 |
| 146 | have hshift : ∀ w ∈ V, 0 < w.2 + s := by |
| 147 | intro w hw |
| 148 | have h := (le_max_right 0 (-s)).trans_lt hw.2 |
| 149 | linarith |
| 150 | refine ⟨e.coordinate '' V, |
| 151 | end_isOpen_coordinate_image e (isOpen_univ.prod isOpen_Ioi) hpos, |
| 152 | ⟨z, ⟨mem_univ _, max_lt_iff.mpr ⟨hz, by linarith⟩⟩, rfl⟩, ?_, ?_⟩ |
| 153 | · rintro _ ⟨w, hw, rfl⟩ |
| 154 | have h := endAxialTranslation_contMDiffAt e s (hpos w hw) (hshift w hw) |
| 155 | exact h.contMDiffWithinAt |
| 156 | · rintro _ ⟨w, hw, rfl⟩ u v |
| 157 | exact endAxialTranslation_metric e s (hpos w hw) (hshift w hw) u v |
| 158 | |
| 159 | end PoincareMT.M34 |