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.RadialForm |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Metric.WeightedRadialConnection |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.Deriv |
| 4 | |
| 5 | /-! |
| 6 | # The connection of an arbitrary standard initial metric |
| 7 | |
| 8 | Morgan-Tian Lemma 12.3, pp. 294-295. The supplied Levi-Civita connection |
| 9 | is identified by its actual constant-frame Koszul identity. The radial |
| 10 | eigenvalue is retained throughout; no arclength reparameterization or |
| 11 | replacement of the supplied metric is used. See weighted-radial-positivity. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | namespace PoincareMT.M34 |
| 20 | |
| 21 | /-- The rank-one coefficient in the supplied radial metric away from |
| 22 | the origin (Lemma 12.3 computation, pp. 294-295). -/ |
| 23 | noncomputable def initialRankOneCoefficient (g₀ : StandardInitialMetric) (r : ℝ) : ℝ := |
| 24 | (initialRadialCoefficient g₀ r - initialAngularCoefficient g₀ r) / r ^ 2 |
| 25 | |
| 26 | /-- Smoothness of the rank-one coefficient away from zero |
| 27 | (Lemma 12.3 computation, pp. 294-295). -/ |
| 28 | theorem initialRankOneCoefficient_contDiffAt (g₀ : StandardInitialMetric) |
| 29 | {r : ℝ} (hr : r ≠ 0) : ContDiffAt ℝ ∞ (initialRankOneCoefficient g₀) r := |
| 30 | ((initialRadialCoefficient_contDiff g₀).contDiffAt.sub |
| 31 | (initialAngularCoefficient_contDiff g₀).contDiffAt).div |
| 32 | (contDiffAt_id.pow 2) (pow_ne_zero 2 hr) |
| 33 | |
| 34 | /-- The angular Christoffel coefficient (Lemma 12.3, pp. 294-295). -/ |
| 35 | noncomputable def initialChristoffelA (g₀ : StandardInitialMetric) (r : ℝ) : ℝ := |
| 36 | deriv (initialAngularCoefficient g₀) r / (2 * r * initialAngularCoefficient g₀ r) |
| 37 | |
| 38 | /-- The Euclidean inner-product Christoffel coefficient |
| 39 | (Lemma 12.3, pp. 294-295). -/ |
| 40 | noncomputable def initialChristoffelB (g₀ : StandardInitialMetric) (r : ℝ) : ℝ := |
| 41 | (initialRankOneCoefficient g₀ r - deriv (initialAngularCoefficient g₀) r / (2 * r)) / |
| 42 | initialRadialCoefficient g₀ r |
| 43 | |
| 44 | /-- The radial rank-one Christoffel coefficient (Lemma 12.3, pp. 294-295). -/ |
| 45 | noncomputable def initialChristoffelC (g₀ : StandardInitialMetric) (r : ℝ) : ℝ := |
| 46 | (deriv (initialRankOneCoefficient g₀) r / (2 * r) - |
| 47 | 2 * initialChristoffelA g₀ r * initialRankOneCoefficient g₀ r) / |
| 48 | initialRadialCoefficient g₀ r |
| 49 | |
| 50 | /-- All three connection coefficients are smooth at nonzero radii |
| 51 | (Lemma 12.3 curvature calculation, pp. 294-295). -/ |
| 52 | theorem initialChristoffel_contDiffAt (g₀ : StandardInitialMetric) |
| 53 | {r : ℝ} (hr : r ≠ 0) : |
| 54 | ContDiffAt ℝ ∞ (initialChristoffelA g₀) r ∧ |
| 55 | ContDiffAt ℝ ∞ (initialChristoffelB g₀) r ∧ |
| 56 | ContDiffAt ℝ ∞ (initialChristoffelC g₀) r := by |
| 57 | have hl := (initialRadialCoefficient_contDiff g₀).contDiffAt (x := r) |
| 58 | have hc := (initialAngularCoefficient_contDiff g₀).contDiffAt (x := r) |
| 59 | have hb := initialRankOneCoefficient_contDiffAt g₀ hr |
| 60 | have hcp : ContDiffAt ℝ ∞ (deriv (initialAngularCoefficient g₀)) r := |
| 61 | hc.derivWithin (by simp) |
| 62 | have hbp : ContDiffAt ℝ ∞ (deriv (initialRankOneCoefficient g₀)) r := |
| 63 | hb.derivWithin (by simp) |
| 64 | have hA : ContDiffAt ℝ ∞ (initialChristoffelA g₀) r := by |
| 65 | exact hcp.div ((contDiffAt_const.mul contDiffAt_id).mul hc) |
| 66 | (mul_ne_zero (mul_ne_zero (by norm_num) hr) (initialCoefficients_pos g₀ r).2.ne') |
| 67 | refine ⟨hA, ?_, ?_⟩ |
| 68 | · exact (hb.sub (hcp.div (contDiffAt_const.mul contDiffAt_id) |
| 69 | (mul_ne_zero (by norm_num) hr))).div hl (initialCoefficients_pos g₀ r).1.ne' |
| 70 | · exact ((hbp.div (contDiffAt_const.mul contDiffAt_id) |
| 71 | (mul_ne_zero (by norm_num) hr)).sub ((contDiffAt_const.mul hA).mul hb)).div |
| 72 | hl (initialCoefficients_pos g₀ r).1.ne' |
| 73 | |
| 74 | /-- The first metric derivative in fixed Cartesian directions |
| 75 | (Lemma 12.3 connection calculation, pp. 294-295). -/ |
| 76 | theorem initialMetricInner_fderiv (g₀ : StandardInitialMetric) |
| 77 | {x : StandardCapSpace} (hx : x ≠ 0) (u v w : StandardCapSpace) : |
| 78 | fderiv ℝ (fun y => g₀.metric.inner y u v) x w = |
| 79 | deriv (initialAngularCoefficient g₀) ‖x‖ / ‖x‖ * inner ℝ x w * inner ℝ u v + |
| 80 | deriv (initialRankOneCoefficient g₀) ‖x‖ / ‖x‖ * inner ℝ x w * |
| 81 | (inner ℝ x u * inner ℝ x v) + |
| 82 | initialRankOneCoefficient g₀ ‖x‖ * |
| 83 | (inner ℝ w u * inner ℝ x v + inner ℝ x u * inner ℝ w v) := by |
| 84 | have he : (fun y : StandardCapSpace => g₀.metric.inner y u v) =ᶠ[𝓝 x] |
| 85 | (fun y => initialAngularCoefficient g₀ ‖y‖ * inner ℝ u v + |
| 86 | initialRankOneCoefficient g₀ ‖y‖ * (inner ℝ y u * inner ℝ y v)) := by |
| 87 | filter_upwards [eventually_ne_nhds hx] with y hy |
| 88 | rw [initialMetric_radial_inner g₀ hy] |
| 89 | simp only [initialRankOneCoefficient, mul_assoc] |
| 90 | rw [he.fderiv_eq] |
| 91 | exact Poincare.fderiv_radial_pairing hx |
| 92 | (((initialAngularCoefficient_contDiff g₀).differentiable (by simp)) ‖x‖).hasDerivAt |
| 93 | ((initialRankOneCoefficient_contDiffAt g₀ (norm_ne_zero_iff.mpr hx)).differentiableAt |
| 94 | (by simp)).hasDerivAt u v w |
| 95 | |
| 96 | set_option backward.isDefEq.respectTransparency false in |
| 97 | /-- The supplied connection has the weighted radial Christoffel form |
| 98 | away from the origin (Lemma 12.3, pp. 294-295). -/ |
| 99 | theorem initialConnection_formula (g₀ : StandardInitialMetric) |
| 100 | {x : StandardCapSpace} (hx : x ≠ 0) (u v : StandardCapSpace) : |
| 101 | g₀.connection.connection (fun _ => v) x u = |
| 102 | Poincare.radialChristoffel (initialChristoffelA g₀ ‖x‖) |
| 103 | (initialChristoffelB g₀ ‖x‖) (initialChristoffelC g₀ ‖x‖) x u v := by |
| 104 | apply (g₀.metric.inner_isInvertible x).injective |
| 105 | ext w |
| 106 | have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx |
| 107 | have hl : initialRadialCoefficient g₀ ‖x‖ ≠ 0 := (initialCoefficients_pos g₀ ‖x‖).1.ne' |
| 108 | have hc : initialAngularCoefficient g₀ ‖x‖ ≠ 0 := (initialCoefficients_pos g₀ ‖x‖).2.ne' |
| 109 | have hr : initialAngularCoefficient g₀ ‖x‖ + |
| 110 | initialRankOneCoefficient g₀ ‖x‖ * ‖x‖ ^ 2 = initialRadialCoefficient g₀ ‖x‖ := by |
| 111 | unfold initialRankOneCoefficient |
| 112 | field_simp |
| 113 | ring |
| 114 | have hA : 2 * initialAngularCoefficient g₀ ‖x‖ * initialChristoffelA g₀ ‖x‖ = |
| 115 | deriv (initialAngularCoefficient g₀) ‖x‖ / ‖x‖ := by |
| 116 | unfold initialChristoffelA |
| 117 | field_simp |
| 118 | have hB : 2 * initialRadialCoefficient g₀ ‖x‖ * initialChristoffelB g₀ ‖x‖ = |
| 119 | 2 * initialRankOneCoefficient g₀ ‖x‖ - |
| 120 | deriv (initialAngularCoefficient g₀) ‖x‖ / ‖x‖ := by |
| 121 | unfold initialChristoffelB |
| 122 | field_simp |
| 123 | have hC : 2 * (initialRadialCoefficient g₀ ‖x‖ * initialChristoffelC g₀ ‖x‖ + |
| 124 | 2 * initialChristoffelA g₀ ‖x‖ * initialRankOneCoefficient g₀ ‖x‖) = |
| 125 | deriv (initialRankOneCoefficient g₀) ‖x‖ / ‖x‖ := by |
| 126 | unfold initialChristoffelC |
| 127 | field_simp |
| 128 | ring |
| 129 | have hk := g₀.connection.inner_connection_const x u v w |
| 130 | rw [initialMetricInner_fderiv g₀ hx, initialMetricInner_fderiv g₀ hx, |
| 131 | initialMetricInner_fderiv g₀ hx] at hk |
| 132 | have he := Poincare.weightedRadialChristoffel_koszul _ _ _ _ _ _ _ _ x u v w hr hA hB hC |
| 133 | change g₀.metric.inner x (g₀.connection.connection (fun _ => v) x u) w = |
| 134 | g₀.metric.inner x _ w |
| 135 | rw [initialMetric_radial_inner g₀ hx] at hk ⊢ |
| 136 | rw [initialMetric_radial_inner g₀ hx] |
| 137 | change 2 * (initialAngularCoefficient g₀ ‖x‖ * _ + |
| 138 | initialRankOneCoefficient g₀ ‖x‖ * _ * _) = _ at hk |
| 139 | dsimp only [initialRankOneCoefficient] at he hk |
| 140 | linarith only [hk, he] |
| 141 | |
| 142 | end PoincareMT.M34 |