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.RadialNormalization |
| 3 | |
| 4 | /-! |
| 5 | # The actual outward unit radial field |
| 6 | |
| 7 | Morgan-Tian Theorem 12.32, pp. 326-327. Away from the original tip, |
| 8 | normalizing the position field gives a globally oriented radial direction. |
| 9 | Its retained covariant derivative is the actual orbit slope divided by |
| 10 | the actual orbit radius, times the angular orthogonal projection. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | namespace PoincareMT.M35.Uniqueness |
| 20 | |
| 21 | /-- The outward radial field with unit length in the actual metric. -/ |
| 22 | noncomputable def radialUnitField (g : RiemannianMetric 3 StandardCapSpace) |
| 23 | (x : StandardCapSpace) : StandardCapSpace := |
| 24 | (‖x‖ * axisRadialSpeed g ‖x‖)⁻¹ • x |
| 25 | |
| 26 | private theorem radius_hasFDerivAt {x : StandardCapSpace} (hx : x ≠ 0) : |
| 27 | HasFDerivAt (fun y : StandardCapSpace => ‖y‖) |
| 28 | (‖x‖⁻¹ • innerSL ℝ x) x := by |
| 29 | have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx |
| 30 | have h := (hasStrictFDerivAt_norm_sq x).hasFDerivAt.sqrt (pow_ne_zero 2 hn) |
| 31 | simp only [Real.sqrt_sq_eq_abs, abs_norm] at h |
| 32 | convert! h using 1 |
| 33 | ext w |
| 34 | simp [smul_eq_mul] |
| 35 | ring |
| 36 | |
| 37 | private theorem amplitude_hasDerivAt (g : RiemannianMetric 3 StandardCapSpace) |
| 38 | {r : ℝ} (hr : 0 < r) : |
| 39 | HasDerivAt (fun s => (s * axisRadialSpeed g s)⁻¹) |
| 40 | (-(1 + r ^ 2 * (2 * radialConnectionAlpha g r + |
| 41 | radialConnectionBeta g r + radialConnectionGamma g r * r ^ 2)) / |
| 42 | (r ^ 2 * axisRadialSpeed g r)) r := by |
| 43 | have hb := ((axisRadialCoefficient_contDiff g).differentiable (by simp) r).hasDerivAt |
| 44 | have hs := hb.sqrt (axisRadialCoefficient_pos g r).ne' |
| 45 | have hd := ((hasDerivAt_id r).mul hs).inv |
| 46 | (mul_ne_zero hr.ne' (axisRadialSpeed_pos g r).ne') |
| 47 | convert! hd using 1 |
| 48 | simp only [Pi.mul_apply, id_eq, one_mul] |
| 49 | rw [axisRadialCoefficient_deriv_eq_connection g hr] |
| 50 | unfold axisRadialSpeed |
| 51 | field_simp [hr.ne', (Real.sqrt_pos.mpr (axisRadialCoefficient_pos g r)).ne'] |
| 52 | rw [Real.sq_sqrt (axisRadialCoefficient_pos g r).le] |
| 53 | ring |
| 54 | |
| 55 | /-- The actual radial field is smooth everywhere off the tip. -/ |
| 56 | theorem radialUnitField_contDiffAt (g : RiemannianMetric 3 StandardCapSpace) |
| 57 | {x : StandardCapSpace} (hx : x ≠ 0) : |
| 58 | ContDiffAt ℝ ∞ (radialUnitField g) x := by |
| 59 | have hr : ContDiffAt ℝ ∞ (fun y : StandardCapSpace => ‖y‖) x := contDiffAt_norm ℝ hx |
| 60 | have hb := (axisRadialCoefficient_contDiff g).contDiffAt.comp x hr |
| 61 | have hs := hb.sqrt (axisRadialCoefficient_pos g ‖x‖).ne' |
| 62 | exact ((hr.mul hs).inv (mul_ne_zero (norm_ne_zero_iff.mpr hx) |
| 63 | (axisRadialSpeed_pos g ‖x‖).ne')).smul contDiffAt_id |
| 64 | |
| 65 | /-- The actual radial covector is the Euclidean radial covector times |
| 66 | the radial metric coefficient. -/ |
| 67 | theorem rotational_inner_position |
| 68 | (g : RiemannianMetric 3 StandardCapSpace) |
| 69 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 70 | ∀ x u v : StandardCapSpace, |
| 71 | g.inner (standardRotation A x) |
| 72 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 73 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = g.inner x u v) |
| 74 | {x : StandardCapSpace} (hx : x ≠ 0) (w : StandardCapSpace) : |
| 75 | g.inner x x w = axisRadialCoefficient g ‖x‖ * inner ℝ x w := by |
| 76 | rw [rotational_metric_form_correction g hrotation hx] |
| 77 | simp only [real_inner_self_eq_norm_sq, axisCorrectionCoefficient] |
| 78 | field_simp [norm_ne_zero_iff.mpr hx] |
| 79 | ring |
| 80 | |
| 81 | /-- The displayed outward radial field has actual unit length. -/ |
| 82 | theorem radialUnitField_unit |
| 83 | (g : RiemannianMetric 3 StandardCapSpace) |
| 84 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 85 | ∀ x u v : StandardCapSpace, |
| 86 | g.inner (standardRotation A x) |
| 87 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 88 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = g.inner x u v) |
| 89 | {x : StandardCapSpace} (hx : x ≠ 0) : |
| 90 | g.inner x (radialUnitField g x) (radialUnitField g x) = 1 := by |
| 91 | simp only [radialUnitField, map_smul, smul_apply, smul_eq_mul] |
| 92 | rw [rotational_inner_position g hrotation hx, real_inner_self_eq_norm_sq] |
| 93 | unfold axisRadialSpeed |
| 94 | field_simp [norm_ne_zero_iff.mpr hx, |
| 95 | (Real.sqrt_pos.mpr (axisRadialCoefficient_pos g ‖x‖)).ne'] |
| 96 | rw [Real.sq_sqrt (axisRadialCoefficient_pos g ‖x‖).le] |
| 97 | |
| 98 | /-- The actual radial orthogonal projection has the same vector as its |
| 99 | Euclidean radial expression. -/ |
| 100 | theorem radialUnitField_projection |
| 101 | (g : RiemannianMetric 3 StandardCapSpace) |
| 102 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 103 | ∀ x u v : StandardCapSpace, |
| 104 | g.inner (standardRotation A x) |
| 105 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 106 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = g.inner x u v) |
| 107 | {x : StandardCapSpace} (hx : x ≠ 0) (w : StandardCapSpace) : |
| 108 | g.inner x (radialUnitField g x) w • radialUnitField g x = |
| 109 | (inner ℝ x w / ‖x‖ ^ 2) • x := by |
| 110 | simp only [radialUnitField, map_smul, smul_apply, smul_eq_mul, smul_smul] |
| 111 | rw [rotational_inner_position g hrotation hx] |
| 112 | congr 1 |
| 113 | unfold axisRadialSpeed |
| 114 | field_simp [norm_ne_zero_iff.mpr hx, |
| 115 | (Real.sqrt_pos.mpr (axisRadialCoefficient_pos g ‖x‖)).ne'] |
| 116 | rw [Real.sq_sqrt (axisRadialCoefficient_pos g ‖x‖).le] |
| 117 | |
| 118 | /-- The retained covariant derivative of the outward unit field is exactly |
| 119 | the radial shape coefficient times the angular orthogonal projection. -/ |
| 120 | theorem radialUnitField_connection |
| 121 | {g : RiemannianMetric 3 StandardCapSpace} (D : LeviCivitaData g) |
| 122 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 123 | ∀ x u v : StandardCapSpace, |
| 124 | g.inner (standardRotation A x) |
| 125 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 126 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = g.inner x u v) |
| 127 | {x : StandardCapSpace} (hx : x ≠ 0) (w : StandardCapSpace) : |
| 128 | D.connection (radialUnitField g) x w = |
| 129 | (axisWarpingSlope g ‖x‖ / axisWarpingRadius g ‖x‖) • |
| 130 | (w - g.inner x (radialUnitField g x) w • radialUnitField g x) := by |
| 131 | have hr := norm_pos_iff.mpr hx |
| 132 | have ha := (amplitude_hasDerivAt g hr).comp_hasFDerivAt x (radius_hasFDerivAt hx) |
| 133 | have hd := ha.smul (hasFDerivAt_id x) |
| 134 | change HasFDerivAt (radialUnitField g) _ x at hd |
| 135 | have hc := rotational_connection_const D hrotation hx w (radialUnitField g x) |
| 136 | change D.euclideanConnection w (radialUnitField g x) x = _ at hc |
| 137 | rw [D.connection_eq_fderiv_add |
| 138 | ((radialUnitField_contDiffAt g hx).differentiableAt (by simp))] |
| 139 | rw [hd.fderiv, hc, radialUnitField_projection g hrotation hx] |
| 140 | simp only [add_apply, ContinuousLinearMap.smulRight_apply, smul_apply, |
| 141 | ContinuousLinearMap.id_apply, innerSL_apply_apply, smul_eq_mul, |
| 142 | radialUnitField, inner_smul_right, Function.comp_apply, id_eq, |
| 143 | real_inner_self_eq_norm_sq, real_inner_comm w x] |
| 144 | unfold axisWarpingSlope axisWarpingRadius |
| 145 | change @Eq StandardCapSpace _ _ |
| 146 | ext i |
| 147 | simp only [PiLp.add_apply, PiLp.sub_apply, PiLp.smul_apply, smul_eq_mul] |
| 148 | field_simp [hr.ne', (axisRadialSpeed_pos g ‖x‖).ne', |
| 149 | (Real.sqrt_pos.mpr (axisAngularCoefficient_pos g ‖x‖)).ne'] |
| 150 | ring |
| 151 | |
| 152 | end PoincareMT.M35.Uniqueness |