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.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.RadialUnitFieldBound |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.RadialShapeDerivative |
| 4 | import PoincareLib.Geometry.Riemannian.Connection.Pullback |
| 5 | |
| 6 | /-! |
| 7 | # Retaining the oriented radial field through actual metric germs |
| 8 | |
| 9 | The selected cylinder maps have invertible differential. Pulling the actual |
| 10 | outward field back through that differential preserves its unit length and |
| 11 | its covariant-derivative estimate for each actual local metric realization. |
| 12 | This uses the native Levi-Civita naturality theorem. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Filter VectorField |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | namespace PoincareMT.M35.Uniqueness |
| 22 | |
| 23 | /-- The literal radial field is a smooth tangent section off the original tip. -/ |
| 24 | theorem radialUnitField_contMDiffAt |
| 25 | (g : RiemannianMetric 3 StandardCapSpace) {x : StandardCapSpace} (hx : x ≠ 0) : |
| 26 | ContMDiffAt (𝓡 3) ((𝓡 3).prod (𝓡 3)) ∞ |
| 27 | (fun y => Bundle.TotalSpace.mk' StandardCapSpace y |
| 28 | (E := TangentSpace (𝓡 3)) (radialUnitField g y)) x := by |
| 29 | rw [Bundle.contMDiffAt_totalSpace] |
| 30 | exact ⟨contMDiffAt_id, by simpa using (radialUnitField_contDiffAt g hx).contMDiffAt⟩ |
| 31 | |
| 32 | /-- A genuine local metric pullback retains the same outward unit direction |
| 33 | and the same actual derivative bound, through the inverse differential. -/ |
| 34 | theorem radialUnitField_pullback |
| 35 | {M : Type*} [TopologicalSpace M] |
| 36 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 37 | {g : RiemannianMetric 3 M} (D : LeviCivitaData g) |
| 38 | {G : RiemannianMetric 3 StandardCapSpace} (DG : LeviCivitaData G) |
| 39 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 40 | ∀ x u v : StandardCapSpace, |
| 41 | G.inner (standardRotation A x) |
| 42 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 43 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = G.inner x u v) |
| 44 | {f : M → StandardCapSpace} {x : M} |
| 45 | (hf : ContMDiffAt (𝓡 3) (𝓡 3) ∞ f x) |
| 46 | (hinv : ∀ᶠ y in 𝓝 x, (mfderiv (𝓡 3) (𝓡 3) f y).IsInvertible) |
| 47 | (hmetric : ∀ᶠ y in 𝓝 x, ∀ u v : TangentSpace (𝓡 3) y, |
| 48 | g.inner y u v = G.inner (f y) |
| 49 | (mfderiv (𝓡 3) (𝓡 3) f y u) (mfderiv (𝓡 3) (𝓡 3) f y v)) |
| 50 | (hzero : f x ≠ 0) (b : ℝ) |
| 51 | (hbound : ∀ w : StandardCapSpace, |
| 52 | G.inner (f x) (DG.connection (radialUnitField G) (f x) w) |
| 53 | (DG.connection (radialUnitField G) (f x) w) ≤ b ^ 2 * G.inner (f x) w w) : |
| 54 | let Z := mpullback (𝓡 3) (𝓡 3) f (radialUnitField G) |
| 55 | ContMDiffAt (𝓡 3) ((𝓡 3).prod (𝓡 3)) ∞ (T% Z) x ∧ |
| 56 | g.inner x (Z x) (Z x) = 1 ∧ |
| 57 | ∀ w : TangentSpace (𝓡 3) x, |
| 58 | g.inner x (D.connection Z x w) (D.connection Z x w) ≤ b ^ 2 * g.inner x w w := by |
| 59 | let Z := mpullback (𝓡 3) (𝓡 3) f (radialUnitField G) |
| 60 | have hZ := radialUnitField_contMDiffAt G hzero |
| 61 | have hi := hinv.self_of_nhds |
| 62 | refine ⟨hZ.mpullback_vectorField_preimage hf hi (by simp), ?_, ?_⟩ |
| 63 | · rw [hmetric.self_of_nhds] |
| 64 | simp only [mpullback, hi.self_apply_inverse] |
| 65 | exact radialUnitField_unit G hrotation hzero |
| 66 | · intro w |
| 67 | have hc := D.connection_mpullback_of_metric_pullback DG hf hinv hmetric |
| 68 | (hZ.mdifferentiableAt (by simp)) w |
| 69 | change D.connection Z x w = _ at hc |
| 70 | rw [hc, hmetric.self_of_nhds, hmetric.self_of_nhds] |
| 71 | simp only [hi.self_apply_inverse] |
| 72 | exact hbound (mfderiv (𝓡 3) (𝓡 3) f x w) |
| 73 | |
| 74 | /-- The full shape-operator equation retains the orientation through |
| 75 | the actual inverse differential, with the pulled-back metric pairing. -/ |
| 76 | theorem radialUnitField_pullback_connection |
| 77 | {g G : RiemannianMetric 3 StandardCapSpace} (D : LeviCivitaData g) |
| 78 | (DG : LeviCivitaData G) |
| 79 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 80 | ∀ x u v : StandardCapSpace, |
| 81 | G.inner (standardRotation A x) |
| 82 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 83 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = G.inner x u v) |
| 84 | {f : StandardCapSpace → StandardCapSpace} {x : StandardCapSpace} |
| 85 | (hf : ContMDiffAt (𝓡 3) (𝓡 3) ∞ f x) |
| 86 | (hinv : ∀ᶠ y in 𝓝 x, (mfderiv (𝓡 3) (𝓡 3) f y).IsInvertible) |
| 87 | (hmetric : ∀ᶠ y in 𝓝 x, ∀ u v : StandardCapSpace, |
| 88 | g.inner y u v = G.inner (f y) |
| 89 | (mfderiv (𝓡 3) (𝓡 3) f y u) (mfderiv (𝓡 3) (𝓡 3) f y v)) |
| 90 | (hzero : f x ≠ 0) (w : StandardCapSpace) : |
| 91 | let Z : StandardCapSpace → StandardCapSpace := |
| 92 | fun y => (fderiv ℝ f y).inverse (radialUnitField G (f y)) |
| 93 | D.connection Z x w = |
| 94 | (axisWarpingSlope G ‖f x‖ / axisWarpingRadius G ‖f x‖) • |
| 95 | (w - g.inner x (Z x) w • Z x) := by |
| 96 | have hi := hinv.self_of_nhds |
| 97 | have hZ := (radialUnitField_contMDiffAt G hzero).mdifferentiableAt (by simp) |
| 98 | have hc := D.connection_mpullback_of_metric_pullback DG hf hinv hmetric hZ w |
| 99 | rw [radialUnitField_connection DG hrotation hzero] at hc |
| 100 | let Z := mpullback (𝓡 3) (𝓡 3) f (radialUnitField G) |
| 101 | have he : D.connection Z x w = |
| 102 | (axisWarpingSlope G ‖f x‖ / axisWarpingRadius G ‖f x‖) • |
| 103 | (@Sub.sub (TangentSpace (𝓡 3) x) _ w (g.inner x (Z x) w • Z x)) := by |
| 104 | rw [hc, hmetric.self_of_nhds] |
| 105 | simp only [Z, mpullback, map_smul, map_sub, |
| 106 | hi.self_apply_inverse, hi.inverse_apply_self] |
| 107 | rfl |
| 108 | simpa only [Z, mpullback_eq_pullback, VectorField.pullback] using! he |
| 109 | |
| 110 | /-- The scalar shape equation pulls back through the same actual metric |
| 111 | germ. Its ordinary differential uses the pulled-back unit covector. -/ |
| 112 | theorem radial_shape_pullback_hasFDerivAt |
| 113 | {g G : RiemannianMetric 3 StandardCapSpace} |
| 114 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 115 | ∀ x u v : StandardCapSpace, |
| 116 | G.inner (standardRotation A x) |
| 117 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 118 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = G.inner x u v) |
| 119 | {f : StandardCapSpace → StandardCapSpace} {x : StandardCapSpace} |
| 120 | (hf : DifferentiableAt ℝ f x) |
| 121 | (hinv : (mfderiv (𝓡 3) (𝓡 3) f x).IsInvertible) |
| 122 | (hmetric : ∀ u v : StandardCapSpace, |
| 123 | g.inner x u v = G.inner (f x) |
| 124 | (mfderiv (𝓡 3) (𝓡 3) f x u) (mfderiv (𝓡 3) (𝓡 3) f x v)) |
| 125 | (hzero : f x ≠ 0) : |
| 126 | let Z : StandardCapSpace → StandardCapSpace := |
| 127 | fun y => (fderiv ℝ f y).inverse (radialUnitField G (f y)) |
| 128 | HasFDerivAt (fun y => axisWarpingSlope G ‖f y‖ / axisWarpingRadius G ‖f y‖) |
| 129 | (-(radialMixedCurvatureFactor G ‖f x‖ / axisRadialCoefficient G ‖f x‖ + |
| 130 | (axisWarpingSlope G ‖f x‖ / axisWarpingRadius G ‖f x‖) ^ 2) • |
| 131 | g.euclideanCoefficients x (Z x)) x := by |
| 132 | have h := (radial_shape_hasFDerivAt G hrotation hzero).comp x hf.hasFDerivAt |
| 133 | dsimp only |
| 134 | apply h.congr_fderiv |
| 135 | ext w |
| 136 | simp only [smul_apply, ContinuousLinearMap.comp_apply, smul_eq_mul] |
| 137 | change _ = -(radialMixedCurvatureFactor G ‖f x‖ / axisRadialCoefficient G ‖f x‖ + |
| 138 | (axisWarpingSlope G ‖f x‖ / axisWarpingRadius G ‖f x‖) ^ 2) * |
| 139 | g.euclideanCoefficients x ((fderiv ℝ f x).inverse (radialUnitField G (f x))) w |
| 140 | have hm (u v : StandardCapSpace) : g.euclideanCoefficients x u v = |
| 141 | G.euclideanCoefficients (f x) (fderiv ℝ f x u) (fderiv ℝ f x v) := by |
| 142 | simpa only [mfderiv_eq_fderiv, RiemannianMetric.euclideanCoefficients] using! hmetric u v |
| 143 | rw [hm] |
| 144 | have hi : (fderiv ℝ f x).IsInvertible := by |
| 145 | simpa only [mfderiv_eq_fderiv] using hinv |
| 146 | rw [hi.self_apply_inverse] |
| 147 | |
| 148 | end PoincareMT.M35.Uniqueness |