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.Blowup.Cylinder.Geometry.CylinderCharts |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.EuclideanFields |
| 4 | |
| 5 | /-! |
| 6 | # The actual connection of the round factor times a line |
| 7 | |
| 8 | The source is written in the fixed cylinder coordinate equivalence. Koszul's |
| 9 | identity for the actual product metric proves the connection splits; the |
| 10 | round factor itself is an arbitrary genuine metric, with no chosen round |
| 11 | parametrization or flat substitute connection. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Filter |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | namespace PoincareMT.M35 |
| 21 | |
| 22 | local notation "V" => EuclideanSpace ℝ (Fin 3) |
| 23 | local notation "E2" => EuclideanSpace ℝ (Fin 2) |
| 24 | |
| 25 | /-- The actual derivative of a product metric coefficient sees only the |
| 26 | horizontal part of its basepoint direction. -/ |
| 27 | theorem product_metric_coefficient_fderiv |
| 28 | {g : RiemannianMetric 3 V} {h : RiemannianMetric 2 E2} {x : V} |
| 29 | (hmetric : ∀ᶠ y in 𝓝 x, ∀ u v : V, |
| 30 | g.inner y u v = h.inner (cylinderCoordinateEquiv y).1 |
| 31 | (cylinderCoordinateEquiv u).1 (cylinderCoordinateEquiv v).1 + |
| 32 | (cylinderCoordinateEquiv u).2 * (cylinderCoordinateEquiv v).2) |
| 33 | (u v w : V) : |
| 34 | fderiv ℝ (fun y : V => g.inner y u v) x w = |
| 35 | fderiv ℝ (fun y : E2 => h.inner y |
| 36 | (cylinderCoordinateEquiv u).1 (cylinderCoordinateEquiv v).1) |
| 37 | (cylinderCoordinateEquiv x).1 (cylinderCoordinateEquiv w).1 := by |
| 38 | let L := (ContinuousLinearMap.fst ℝ E2 ℝ).comp |
| 39 | cylinderCoordinateEquiv.toContinuousLinearMap |
| 40 | let a := (cylinderCoordinateEquiv u).1 |
| 41 | let b := (cylinderCoordinateEquiv v).1 |
| 42 | have hs : DifferentiableAt ℝ (fun y : E2 => h.inner y a b) (L x) := |
| 43 | (((h.contDiffAt_euclideanCoefficients (L x)).clm_apply contDiffAt_const).clm_apply |
| 44 | contDiffAt_const).differentiableAt (by simp) |
| 45 | have hd := (hs.hasFDerivAt.comp x L.hasFDerivAt).add_const |
| 46 | ((cylinderCoordinateEquiv u).2 * (cylinderCoordinateEquiv v).2) |
| 47 | have he : (fun y : V => g.inner y u v) =ᶠ[𝓝 x] |
| 48 | (fun y => h.inner (L y) a b + |
| 49 | (cylinderCoordinateEquiv u).2 * (cylinderCoordinateEquiv v).2) := |
| 50 | hmetric.mono fun y hy => hy u v |
| 51 | rw [he.fderiv_eq] |
| 52 | simpa only [Function.comp_def, ContinuousLinearMap.comp_apply] using! |
| 53 | congrArg (fun A : V →L[ℝ] ℝ => A w) hd.fderiv |
| 54 | |
| 55 | /-- The native product connection has exactly the factor connection in |
| 56 | its horizontal component and zero axial Christoffel component. -/ |
| 57 | theorem product_euclideanConnection |
| 58 | {g : RiemannianMetric 3 V} {h : RiemannianMetric 2 E2} |
| 59 | (D : LeviCivitaData g) (Dh : LeviCivitaData h) {x : V} |
| 60 | (hmetric : ∀ᶠ y in 𝓝 x, ∀ u v : V, |
| 61 | g.inner y u v = h.inner (cylinderCoordinateEquiv y).1 |
| 62 | (cylinderCoordinateEquiv u).1 (cylinderCoordinateEquiv v).1 + |
| 63 | (cylinderCoordinateEquiv u).2 * (cylinderCoordinateEquiv v).2) |
| 64 | (u v : V) : |
| 65 | D.euclideanConnection u v x = cylinderCoordinateEquiv.symm |
| 66 | (Dh.euclideanConnection (cylinderCoordinateEquiv u).1 |
| 67 | (cylinderCoordinateEquiv v).1 (cylinderCoordinateEquiv x).1, 0) := by |
| 68 | apply (g.inner_isInvertible x).injective |
| 69 | apply ContinuousLinearMap.ext |
| 70 | intro w |
| 71 | have h3 := D.inner_connection_const x u v w |
| 72 | have h2 := Dh.inner_connection_const (cylinderCoordinateEquiv x).1 |
| 73 | (cylinderCoordinateEquiv u).1 (cylinderCoordinateEquiv v).1 |
| 74 | (cylinderCoordinateEquiv w).1 |
| 75 | rw [product_metric_coefficient_fderiv hmetric, |
| 76 | product_metric_coefficient_fderiv hmetric, |
| 77 | product_metric_coefficient_fderiv hmetric] at h3 |
| 78 | have hpair := hmetric.self_of_nhds |
| 79 | change @Eq ℝ _ _ |
| 80 | rw [hpair, hpair] |
| 81 | simp only [ContinuousLinearEquiv.apply_symm_apply, zero_mul, add_zero] |
| 82 | rw [hpair] at h3 |
| 83 | change 2 * (h.inner (cylinderCoordinateEquiv x).1 |
| 84 | (cylinderCoordinateEquiv (D.euclideanConnection u v x)).1 |
| 85 | (cylinderCoordinateEquiv w).1 + |
| 86 | (cylinderCoordinateEquiv (D.euclideanConnection u v x)).2 * |
| 87 | (cylinderCoordinateEquiv w).2) = _ at h3 |
| 88 | change 2 * h.inner (cylinderCoordinateEquiv x).1 |
| 89 | (Dh.euclideanConnection (cylinderCoordinateEquiv u).1 |
| 90 | (cylinderCoordinateEquiv v).1 (cylinderCoordinateEquiv x).1) |
| 91 | (cylinderCoordinateEquiv w).1 = _ at h2 |
| 92 | linarith only [h3, h2] |
| 93 | |
| 94 | /-- The actual axial derivative of a field is its axial covariant |
| 95 | derivative for the product metric. -/ |
| 96 | theorem product_connection_axial |
| 97 | {g : RiemannianMetric 3 V} {h : RiemannianMetric 2 E2} |
| 98 | (D : LeviCivitaData g) (Dh : LeviCivitaData h) {x : V} |
| 99 | (hmetric : ∀ᶠ y in 𝓝 x, ∀ u v : V, |
| 100 | g.inner y u v = h.inner (cylinderCoordinateEquiv y).1 |
| 101 | (cylinderCoordinateEquiv u).1 (cylinderCoordinateEquiv v).1 + |
| 102 | (cylinderCoordinateEquiv u).2 * (cylinderCoordinateEquiv v).2) |
| 103 | {Z : V → V} (hZ : DifferentiableAt ℝ Z x) (w : V) : |
| 104 | fderiv ℝ (fun y => (cylinderCoordinateEquiv (Z y)).2) x w = |
| 105 | (cylinderCoordinateEquiv (D.connection Z x w)).2 := by |
| 106 | let L := (ContinuousLinearMap.snd ℝ E2 ℝ).comp |
| 107 | cylinderCoordinateEquiv.toContinuousLinearMap |
| 108 | have hd := (L.hasFDerivAt.comp x hZ.hasFDerivAt).fderiv |
| 109 | have hd' : fderiv ℝ (fun y => L (Z y)) x w = L (fderiv ℝ Z x w) := by |
| 110 | simpa only [Function.comp_def, ContinuousLinearMap.comp_apply] using |
| 111 | congrArg (fun A : V →L[ℝ] ℝ => A w) hd |
| 112 | change fderiv ℝ (fun y => L (Z y)) x w = _ |
| 113 | rw [hd', D.connection_eq_fderiv_add hZ, product_euclideanConnection D Dh hmetric] |
| 114 | simp [L, ContinuousLinearMap.comp_apply] |
| 115 | |
| 116 | /-- Restricting a field to a horizontal slice transports the horizontal |
| 117 | component of its actual covariant derivative to the actual factor connection. -/ |
| 118 | theorem product_connection_horizontal |
| 119 | {g : RiemannianMetric 3 V} {h : RiemannianMetric 2 E2} |
| 120 | (D : LeviCivitaData g) (Dh : LeviCivitaData h) {x : V} |
| 121 | (hmetric : ∀ᶠ y in 𝓝 x, ∀ u v : V, |
| 122 | g.inner y u v = h.inner (cylinderCoordinateEquiv y).1 |
| 123 | (cylinderCoordinateEquiv u).1 (cylinderCoordinateEquiv v).1 + |
| 124 | (cylinderCoordinateEquiv u).2 * (cylinderCoordinateEquiv v).2) |
| 125 | {Z : V → V} (hZ : DifferentiableAt ℝ Z x) (w : E2) : |
| 126 | Dh.connection (fun y : E2 => (cylinderCoordinateEquiv |
| 127 | (Z (cylinderCoordinateEquiv.symm (y, (cylinderCoordinateEquiv x).2)))).1) |
| 128 | (cylinderCoordinateEquiv x).1 w = |
| 129 | (cylinderCoordinateEquiv |
| 130 | (D.connection Z x (cylinderCoordinateEquiv.symm (w, 0)))).1 := by |
| 131 | let L := (ContinuousLinearMap.fst ℝ E2 ℝ).comp |
| 132 | cylinderCoordinateEquiv.toContinuousLinearMap |
| 133 | let A := cylinderCoordinateEquiv.symm.toContinuousLinearMap.comp |
| 134 | (ContinuousLinearMap.inl ℝ E2 ℝ) |
| 135 | let phi : E2 → V := fun y => cylinderCoordinateEquiv.symm |
| 136 | (y, (cylinderCoordinateEquiv x).2) |
| 137 | have hphi : HasFDerivAt phi A (cylinderCoordinateEquiv x).1 := |
| 138 | cylinderCoordinateEquiv.symm.hasFDerivAt.comp _ |
| 139 | ((hasFDerivAt_id _).prodMk (hasFDerivAt_const _ _)) |
| 140 | have hphi0 : phi (cylinderCoordinateEquiv x).1 = x := |
| 141 | cylinderCoordinateEquiv.symm_apply_apply x |
| 142 | have hZphi : HasFDerivAt Z (fderiv ℝ Z x) (phi (cylinderCoordinateEquiv x).1) := by |
| 143 | simpa only [hphi0] using hZ.hasFDerivAt |
| 144 | have hd := L.hasFDerivAt.comp _ (hZphi.comp _ hphi) |
| 145 | have hd' : fderiv ℝ (fun y => L (Z (phi y))) (cylinderCoordinateEquiv x).1 w = |
| 146 | L (fderiv ℝ Z x (A w)) := by |
| 147 | simpa only [Function.comp_def, ContinuousLinearMap.comp_apply] using |
| 148 | congrArg (fun B : E2 →L[ℝ] E2 => B w) hd.fderiv |
| 149 | have hYs : DifferentiableAt ℝ (fun y => L (Z (phi y))) |
| 150 | (cylinderCoordinateEquiv x).1 := hd.differentiableAt |
| 151 | change Dh.connection (fun y => L (Z (phi y))) (cylinderCoordinateEquiv x).1 w = _ |
| 152 | rw [Dh.connection_eq_fderiv_add hYs, D.connection_eq_fderiv_add hZ] |
| 153 | change @Eq E2 _ _ |
| 154 | rw [hd', product_euclideanConnection D Dh hmetric] |
| 155 | simp [L, A, hphi0, ContinuousLinearMap.comp_apply] |
| 156 | |
| 157 | end PoincareMT.M35 |