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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.NeckGeometry.FixedCylinderJets |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.FiniteHessian.PullbackTails |
| 4 | |
| 5 | /-! |
| 6 | # Forward errors in the coordinates of a fixed neck |
| 7 | |
| 8 | The forward stage map is differentiated only inside its source. The exact |
| 9 | chart inverse identity first holds on an open neighborhood. Consequently |
| 10 | uniform atlas errors give uniform errors of the actual forward metric in |
| 11 | the fixed neck coordinates. Source: Morgan--Tian Proposition 9.79, |
| 12 | pp. 232-234, and Proposition 10.7, pp. 253-254; M28 derivation 109. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u v |
| 22 | |
| 23 | namespace PoincareMT.Proofs.M28.NeckTransfer |
| 24 | |
| 25 | open PoincareMT.M28.tube FiniteHessian |
| 26 | |
| 27 | variable {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 29 | {g : RiemannianMetric 3 M} |
| 30 | |
| 31 | /-- The literal forward metric equals the chart coefficient field pulled |
| 32 | back by the fixed neck coordinates. All chart and stage guards are actual |
| 33 | open domains. Source: Proposition 10.7; M28 derivation 109. -/ |
| 34 | theorem forwardCylinderCoordinates_source_coefficients |
| 35 | {X : Type v} [TopologicalSpace X] |
| 36 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] [IsManifold (𝓡 3) ∞ X] |
| 37 | (gX : RiemannianMetric 3 X) |
| 38 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) M X ∞) (N : EpsilonNeck g) |
| 39 | (hcapture : N.carrier ⊆ e.source) (q : UnitTwoSphere) (s : ℝ) (p : M) |
| 40 | {x : EuclideanSpace ℝ (Fin 3)} (hx : x ∈ cylinderNeckChartDomain N q s) |
| 41 | (hp : cylinderNeckChart N q s x ∈ (extChartAt (𝓡 3) p).source) : |
| 42 | gX.pullbackCoefficients (e ∘ cylinderNeckChart N q s) x = |
| 43 | (gX.pullbackCoefficients (e ∘ (extChartAt (𝓡 3) p).symm) |
| 44 | ((extChartAt (𝓡 3) p) (cylinderNeckChart N q s x))).bilinearComp |
| 45 | (fderiv ℝ ((extChartAt (𝓡 3) p) ∘ cylinderNeckChart N q s) x) |
| 46 | (fderiv ℝ ((extChartAt (𝓡 3) p) ∘ cylinderNeckChart N q s) x) := by |
| 47 | let c := extChartAt (𝓡 3) p |
| 48 | let f := cylinderNeckChart N q s |
| 49 | let psi := c ∘ f |
| 50 | let e₀ := (Diffeomorph.refl (𝓡 3) M ∞).toPartialDiffeomorph |
| 51 | have hcap₀ : N.carrier ⊆ e₀.target := fun _ _ => mem_univ _ |
| 52 | have hx₀ : x ∈ capturedCylinderChartDomain e₀ N q s p := ⟨hx, hp⟩ |
| 53 | have hU := isOpen_capturedCylinderChartDomain e₀ N hcap₀ q s p |
| 54 | have hpsi : ContDiffAt ℝ ∞ psi x := |
| 55 | (contDiffOn_capturedCylinderCoordinates e₀ N hcap₀ q s p).contDiffAt (hU.mem_nhds hx₀) |
| 56 | have hcinv : ContMDiffAt (𝓡 3) (𝓡 3) ∞ c.symm (psi x) := |
| 57 | (contMDiffOn_extChartAt_symm p).contMDiffAt |
| 58 | ((isOpen_extChartAt_target p).mem_nhds (c.map_source hp)) |
| 59 | have he : ContMDiffAt (𝓡 3) (𝓡 3) ∞ e (c.symm (psi x)) := by |
| 60 | rw [show c.symm (psi x) = f x from c.left_inv hp] |
| 61 | exact e.contMDiffOn_toFun.contMDiffAt (e.open_source.mem_nhds |
| 62 | (hcapture (cylinderNeckChart_mem_carrier N q s hx))) |
| 63 | have heq : (e ∘ c.symm) ∘ psi =ᶠ[𝓝 x] e ∘ f := by |
| 64 | filter_upwards [hU.mem_nhds hx₀] with y hy |
| 65 | change e (c.symm (c (f y))) = e (f y) |
| 66 | have hfy : f y ∈ c.source := hy.2 |
| 67 | rw [c.left_inv hfy] |
| 68 | rw [← gX.pullbackCoefficients_eq_of_eventuallyEq heq] |
| 69 | exact gX.pullbackCoefficients_comp ((he.comp (psi x) hcinv).mdifferentiableAt (by simp)) |
| 70 | (hpsi.differentiableAt (by simp)) |
| 71 | |
| 72 | /-- The forward error is the bilinear pullback of the actual atlas error |
| 73 | on a neighborhood before any derivative is taken. Source: Proposition 9.79; |
| 74 | M28 derivation 109. -/ |
| 75 | theorem forwardCylinderCoordinates_error_germ |
| 76 | {X : Type v} [TopologicalSpace X] |
| 77 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] [IsManifold (𝓡 3) ∞ X] |
| 78 | (gX : RiemannianMetric 3 X) |
| 79 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) M X ∞) (N : EpsilonNeck g) |
| 80 | (hcapture : N.carrier ⊆ e.source) (q : UnitTwoSphere) {s : ℝ} (p : M) |
| 81 | (hs : s ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹) |
| 82 | (hp : N.coordinate_map (q, s) ∈ (extChartAt (𝓡 3) p).source) : |
| 83 | (fun x => gX.pullbackCoefficients (e ∘ cylinderNeckChart N q s) x - |
| 84 | g.pullbackCoefficients (cylinderNeckChart N q s) x) =ᶠ[𝓝 0] |
| 85 | (fun x => (gX.pullbackCoefficients (e ∘ (extChartAt (𝓡 3) p).symm) |
| 86 | ((extChartAt (𝓡 3) p) (cylinderNeckChart N q s x)) - |
| 87 | g.pullbackCoefficients (extChartAt (𝓡 3) p).symm |
| 88 | ((extChartAt (𝓡 3) p) (cylinderNeckChart N q s x))).bilinearComp |
| 89 | (fderiv ℝ ((extChartAt (𝓡 3) p) ∘ cylinderNeckChart N q s) x) |
| 90 | (fderiv ℝ ((extChartAt (𝓡 3) p) ∘ cylinderNeckChart N q s) x)) := by |
| 91 | let e₀ := (Diffeomorph.refl (𝓡 3) M ∞).toPartialDiffeomorph |
| 92 | have hcap₀ : N.carrier ⊆ e₀.target := fun _ _ => mem_univ _ |
| 93 | have hzero := zero_mem_capturedCylinderChartDomain e₀ N q hs p hp |
| 94 | filter_upwards [(isOpen_capturedCylinderChartDomain e₀ N hcap₀ q s p).mem_nhds hzero] |
| 95 | with x hx |
| 96 | rw [forwardCylinderCoordinates_source_coefficients gX e N hcapture q s p hx.1 hx.2] |
| 97 | have hlimit := capturedCylinderCoordinates_limit_coefficients g e₀ N hcap₀ q s p hx |
| 98 | change g.pullbackCoefficients (cylinderNeckChart N q s) x = _ at hlimit |
| 99 | rw [hlimit] |
| 100 | rfl |
| 101 | |
| 102 | /-- Finite uniform atlas convergence controls the actual forward metric |
| 103 | error throughout a family of fixed-neck chart points. Source manifolds may |
| 104 | vary; the coordinate maps are fixed by the original neck and chosen charts. |
| 105 | Source: Proposition 10.7, pp. 253-254; M28 derivation 109. -/ |
| 106 | theorem exists_forwardCylinder_metric_error_tail |
| 107 | {ι : Type*} {X : ι → Type v} [∀ i, TopologicalSpace (X i)] |
| 108 | [∀ i, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (X i)] |
| 109 | [∀ i, IsManifold (𝓡 3) ∞ (X i)] |
| 110 | (gX : ∀ i, RiemannianMetric 3 (X i)) |
| 111 | (e : ∀ i, PartialDiffeomorph (𝓡 3) (𝓡 3) M (X i) ∞) (N : EpsilonNeck g) |
| 112 | (hcapture : ∀ i, N.carrier ⊆ (e i).source) |
| 113 | (q : ι → UnitTwoSphere) (s : ι → ℝ) (p : ι → M) |
| 114 | (hs : ∀ i, s i ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹) |
| 115 | (hp : ∀ i, N.coordinate_map (q i, s i) ∈ (extChartAt (𝓡 3) (p i)).source) |
| 116 | (m : ℕ) (stage : ι → ℕ) |
| 117 | (hmap : HasUniformJetBoundsAt m |
| 118 | (fun i => fderiv ℝ ((extChartAt (𝓡 3) (p i)) ∘ cylinderNeckChart N (q i) (s i))) |
| 119 | (fun _ => 0)) |
| 120 | (herror : ∀ delta : ℝ, 0 < delta → ∃ K : ℕ, ∀ i, K ≤ stage i → |
| 121 | ∀ r ≤ m, ‖iteratedFDeriv ℝ r |
| 122 | ((gX i).pullbackCoefficients ((e i) ∘ (extChartAt (𝓡 3) (p i)).symm)) |
| 123 | ((extChartAt (𝓡 3) (p i)) (N.coordinate_map (q i, s i))) - |
| 124 | iteratedFDeriv ℝ r (g.pullbackCoefficients (extChartAt (𝓡 3) (p i)).symm) |
| 125 | ((extChartAt (𝓡 3) (p i)) (N.coordinate_map (q i, s i)))‖ ≤ delta) : |
| 126 | ∀ rho : ℝ, 0 < rho → ∃ K : ℕ, ∀ i, K ≤ stage i → ∀ r ≤ m, |
| 127 | ‖iteratedFDeriv ℝ r (fun x => |
| 128 | (gX i).pullbackCoefficients ((e i) ∘ cylinderNeckChart N (q i) (s i)) x - |
| 129 | g.pullbackCoefficients (cylinderNeckChart N (q i) (s i)) x) 0‖ ≤ rho := by |
| 130 | let e₀ := (Diffeomorph.refl (𝓡 3) M ∞).toPartialDiffeomorph |
| 131 | have hcap₀ : N.carrier ⊆ e₀.target := fun _ _ => mem_univ _ |
| 132 | let psi := fun i => (extChartAt (𝓡 3) (p i)) ∘ cylinderNeckChart N (q i) (s i) |
| 133 | let B := fun i => (gX i).pullbackCoefficients ((e i) ∘ (extChartAt (𝓡 3) (p i)).symm) |
| 134 | let L := fun i => g.pullbackCoefficients (extChartAt (𝓡 3) (p i)).symm |
| 135 | have hpsi (i : ι) : ContDiffAt ℝ ∞ (psi i) 0 := |
| 136 | (contDiffOn_capturedCylinderCoordinates e₀ N hcap₀ (q i) (s i) (p i)).contDiffAt |
| 137 | ((isOpen_capturedCylinderChartDomain e₀ N hcap₀ (q i) (s i) (p i)).mem_nhds |
| 138 | (zero_mem_capturedCylinderChartDomain e₀ N (q i) (hs i) (p i) (hp i))) |
| 139 | have hzero (i : ι) : psi i 0 = |
| 140 | (extChartAt (𝓡 3) (p i)) (N.coordinate_map (q i, s i)) := by |
| 141 | dsimp only [psi, Function.comp_apply] |
| 142 | rw [cylinderNeckChart_zero] |
| 143 | have hcinv (i : ι) : ContMDiffAt (𝓡 3) (𝓡 3) ∞ |
| 144 | (extChartAt (𝓡 3) (p i)).symm (psi i 0) := by |
| 145 | apply (contMDiffOn_extChartAt_symm (p i)).contMDiffAt |
| 146 | apply (isOpen_extChartAt_target (p i)).mem_nhds |
| 147 | rw [hzero] |
| 148 | exact (extChartAt (𝓡 3) (p i)).map_source (hp i) |
| 149 | have hB (i : ι) : ContDiffAt ℝ ∞ (B i) (psi i 0) := by |
| 150 | apply (gX i).contDiffAt_pullbackCoefficients |
| 151 | apply ContMDiffAt.comp _ _ (hcinv i) |
| 152 | apply (e i).contMDiffOn_toFun.contMDiffAt |
| 153 | apply (e i).open_source.mem_nhds |
| 154 | rw [hzero, (extChartAt (𝓡 3) (p i)).left_inv (hp i)] |
| 155 | exact hcapture i (N.coordinate_map_mem_of_axial _ (hs i)) |
| 156 | have hL (i : ι) : ContDiffAt ℝ ∞ (L i) (psi i 0) := |
| 157 | g.contDiffAt_pullbackCoefficients (hcinv i) |
| 158 | have hE : ∀ delta : ℝ, 0 < delta → ∃ K : ℕ, ∀ i, K ≤ stage i → |
| 159 | ∀ r ≤ m, ‖iteratedFDeriv ℝ r (fun y => B i y - L i y) (psi i 0)‖ ≤ delta := by |
| 160 | intro delta hdelta |
| 161 | obtain ⟨K, hK⟩ := herror delta hdelta |
| 162 | refine ⟨K, fun i hi r hr => ?_⟩ |
| 163 | change ‖iteratedFDeriv ℝ r (B i - L i) (psi i 0)‖ ≤ delta |
| 164 | rw [iteratedFDeriv_sub_apply |
| 165 | ((hB i).of_le (by exact_mod_cast le_top)) |
| 166 | ((hL i).of_le (by exact_mod_cast le_top)), hzero] |
| 167 | exact hK i hi r hr |
| 168 | have htail := exists_bilinear_pullback_error_tail m stage hmap hpsi |
| 169 | (fun i => (hB i).sub (hL i)) hE |
| 170 | intro rho hrho |
| 171 | obtain ⟨K, hK⟩ := htail rho hrho |
| 172 | refine ⟨K, fun i hi r hr => ?_⟩ |
| 173 | rw [((forwardCylinderCoordinates_error_germ (gX i) (e i) N (hcapture i) |
| 174 | (q i) (p i) (hs i) (hp i)).iteratedFDeriv ℝ r).eq_of_nhds] |
| 175 | exact hK i hi r hr |
| 176 | |
| 177 | end PoincareMT.Proofs.M28.NeckTransfer |