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.Riemannian.Distance.BallCoverage |
| 2 | |
| 3 | /-! |
| 4 | # Exact nested ball images for the initial exponential chart |
| 5 | |
| 6 | Morgan--Tian, Claim 16.6 and Corollary 16.7, pp. 371-372, with the |
| 7 | exact-ball obligation in the frozen cap-local contract. The supplied |
| 8 | smooth exponential family covers every smaller metric ball. Injectivity, |
| 9 | when obtained from the perturbation argument, gives radial distance |
| 10 | equality. Neither injectivity nor compact confinement is assumed proved |
| 11 | for the initial surgery metric here. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Topology ENNReal |
| 18 | |
| 19 | namespace PoincareMT.RiemannianMetric |
| 20 | |
| 21 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | /-- A minimizing velocity is a preimage for any exponential endpoint |
| 25 | family with the same initial data. This is the exact-ball step of |
| 26 | Claim 16.6, pp. 371-372, using the published M07 minimizing theorem. -/ |
| 27 | theorem exists_minimizing_velocity_for_exponential |
| 28 | (g : RiemannianMetric n M) (p : M) {R : ℝ} (hR : 0 < R) |
| 29 | (hcompact : IsCompact (closure (g.ball p R))) |
| 30 | (e : EuclideanSpace ℝ (Fin n) → M) |
| 31 | (hexp : ∀ v, g.tangentNorm p v < R → |
| 32 | ∃ ε : ℝ, 0 < ε ∧ ∃ γ : ℝ → M, |
| 33 | g.IsGeodesicOn γ (Ioo (-ε) (1 + ε)) ∧ γ 0 = p ∧ |
| 34 | HasDerivAt (fun t => extChartAt (𝓡 n) p (γ t)) v 0 ∧ γ 1 = e v) |
| 35 | {q : M} (hq : q ∈ g.ball p R) : |
| 36 | ∃ v : EuclideanSpace ℝ (Fin n), g.tangentNorm p v < R ∧ |
| 37 | e v = q ∧ ENNReal.ofReal (g.tangentNorm p v) = g.edist p q := by |
| 38 | obtain ⟨ε, hε, γ, hγ, hγ0, hγ1, hmin⟩ := |
| 39 | g.exists_minimizing_geodesic_of_precompact_ball p q hR hcompact hq |
| 40 | have hzero : (0 : ℝ) ∈ Ioo (-ε) (1 + ε) := by constructor <;> linarith |
| 41 | let v := deriv (fun t => extChartAt (𝓡 n) p (γ t)) 0 |
| 42 | have hγv : HasDerivAt (fun t => extChartAt (𝓡 n) p (γ t)) v 0 := |
| 43 | (hγ.hasDerivAt_chart_at hzero p |
| 44 | (by simpa only [hγ0] using mem_extChartAt_source p)).1 |
| 45 | have hnorm : ENNReal.ofReal (g.tangentNorm p v) = g.edist p q := |
| 46 | hγ.initial_tangentNorm_eq_of_edist_segment hε hγ0 hγv hmin |
| 47 | have hv : g.tangentNorm p v < R := by |
| 48 | apply (ENNReal.ofReal_lt_ofReal_iff hR).mp |
| 49 | rw [hnorm] |
| 50 | exact hq |
| 51 | obtain ⟨δ, hδ, η, hη, hη0, hηv, hη1⟩ := hexp v hv |
| 52 | have hγ' : g.IsGeodesicOn γ (Icc (0 : ℝ) 1) := |
| 53 | fun s hs => hγ s ⟨by linarith [hs.1], by linarith [hs.2]⟩ |
| 54 | have hη' : g.IsGeodesicOn η (Icc (0 : ℝ) 1) := |
| 55 | fun s hs => hη s ⟨by linarith [hs.1], by linarith [hs.2]⟩ |
| 56 | have hend := geodesic_endpoint_eq_of_initial_data hγ' hη' hγ0 hη0 hγv hηv |
| 57 | exact ⟨v, hv, hη1.symm.trans (hend.symm.trans hγ1), hnorm⟩ |
| 58 | |
| 59 | /-- The same exponential family has the correct image on every smaller |
| 60 | radius, as required for restricting the enlarged cap chart in Prop. 16.5. -/ |
| 61 | theorem exponential_image_tangent_ball_eq |
| 62 | (g : RiemannianMetric n M) (p : M) {R : ℝ} (hR : 0 < R) |
| 63 | (hcompact : IsCompact (closure (g.ball p R))) |
| 64 | (e : EuclideanSpace ℝ (Fin n) → M) |
| 65 | (hexp : ∀ v, g.tangentNorm p v < R → |
| 66 | ∃ ε : ℝ, 0 < ε ∧ ∃ γ : ℝ → M, |
| 67 | g.IsGeodesicOn γ (Ioo (-ε) (1 + ε)) ∧ γ 0 = p ∧ |
| 68 | HasDerivAt (fun t => extChartAt (𝓡 n) p (γ t)) v 0 ∧ γ 1 = e v) |
| 69 | (hbound : ∀ v, g.tangentNorm p v < R → |
| 70 | g.edist p (e v) ≤ ENNReal.ofReal (g.tangentNorm p v)) |
| 71 | {r : ℝ} (hr : 0 < r) (hrR : r ≤ R) : |
| 72 | e '' {v | g.tangentNorm p v < r} = g.ball p r := by |
| 73 | apply Subset.antisymm |
| 74 | · rintro _ ⟨v, hv, rfl⟩ |
| 75 | exact lt_of_le_of_lt (hbound v (hv.trans_le hrR)) |
| 76 | ((ENNReal.ofReal_lt_ofReal_iff hr).mpr hv) |
| 77 | · intro q hq |
| 78 | have hqR : q ∈ g.ball p R := hq.trans_le (ENNReal.ofReal_le_ofReal hrR) |
| 79 | obtain ⟨v, _, hev, hnorm⟩ := |
| 80 | g.exists_minimizing_velocity_for_exponential p hR hcompact e hexp hqR |
| 81 | refine ⟨v, ?_, hev⟩ |
| 82 | apply (ENNReal.ofReal_lt_ofReal_iff hr).mp |
| 83 | rw [hnorm] |
| 84 | exact hq |
| 85 | |
| 86 | /-- An injective exponential family is distance preserving from its center |
| 87 | on the controlled tangent ball. This discharges the radial distance part |
| 88 | of the initial-chart adjustment, not its perturbative injectivity. -/ |
| 89 | theorem exponential_radial_edist_of_injective |
| 90 | (g : RiemannianMetric n M) (p : M) {R : ℝ} (hR : 0 < R) |
| 91 | (hcompact : IsCompact (closure (g.ball p R))) |
| 92 | (e : EuclideanSpace ℝ (Fin n) → M) |
| 93 | (hexp : ∀ v, g.tangentNorm p v < R → |
| 94 | ∃ ε : ℝ, 0 < ε ∧ ∃ γ : ℝ → M, |
| 95 | g.IsGeodesicOn γ (Ioo (-ε) (1 + ε)) ∧ γ 0 = p ∧ |
| 96 | HasDerivAt (fun t => extChartAt (𝓡 n) p (γ t)) v 0 ∧ γ 1 = e v) |
| 97 | (hbound : ∀ v, g.tangentNorm p v < R → |
| 98 | g.edist p (e v) ≤ ENNReal.ofReal (g.tangentNorm p v)) |
| 99 | (hinj : InjOn e {v | g.tangentNorm p v < R}) |
| 100 | {v : EuclideanSpace ℝ (Fin n)} (hv : g.tangentNorm p v < R) : |
| 101 | g.edist p (e v) = ENNReal.ofReal (g.tangentNorm p v) := by |
| 102 | have hmem : e v ∈ g.ball p R := (hbound v hv).trans_lt |
| 103 | ((ENNReal.ofReal_lt_ofReal_iff hR).mpr hv) |
| 104 | obtain ⟨w, hw, hew, hnorm⟩ := |
| 105 | g.exists_minimizing_velocity_for_exponential p hR hcompact e hexp hmem |
| 106 | exact hnorm.symm.trans (congrArg (fun z => ENNReal.ofReal (g.tangentNorm p z)) |
| 107 | (hinj hw hv hew)) |
| 108 | |
| 109 | /-- Compact confinement supplies a smooth endpoint with all nested exact |
| 110 | ball images, retaining its derivative and actual geodesic initial data. |
| 111 | Source: the exponential adjustment in the cap-local review of Claim 16.6. -/ |
| 112 | theorem exists_smooth_exponential_with_ball_images |
| 113 | (g : RiemannianMetric n M) (p : M) {R : ℝ} (hR : 0 < R) |
| 114 | (hcompact : IsCompact (closure (g.ball p R))) : |
| 115 | ∃ e : EuclideanSpace ℝ (Fin n) → M, |
| 116 | ContMDiffOn (𝓡 n) (𝓡 n) ∞ e {v | g.tangentNorm p v < R} ∧ |
| 117 | e 0 = p ∧ |
| 118 | HasFDerivAt (fun v => extChartAt (𝓡 n) p (e v)) |
| 119 | (ContinuousLinearMap.id ℝ (EuclideanSpace ℝ (Fin n))) 0 ∧ |
| 120 | (∀ v, g.tangentNorm p v < R → |
| 121 | ∃ ε : ℝ, 0 < ε ∧ ∃ γ : ℝ → M, |
| 122 | g.IsGeodesicOn γ (Ioo (-ε) (1 + ε)) ∧ γ 0 = p ∧ |
| 123 | HasDerivAt (fun t => extChartAt (𝓡 n) p (γ t)) v 0 ∧ γ 1 = e v) ∧ |
| 124 | (∀ v, g.tangentNorm p v < R → |
| 125 | g.edist p (e v) ≤ ENNReal.ofReal (g.tangentNorm p v)) ∧ |
| 126 | ∀ r : ℝ, 0 < r → r ≤ R → |
| 127 | e '' {v | g.tangentNorm p v < r} = g.ball p r := by |
| 128 | have hnorm (v : EuclideanSpace ℝ (Fin n)) : |
| 129 | Real.sqrt (g.pullbackCoefficients (extChartAt (𝓡 n) p).symm |
| 130 | (extChartAt (𝓡 n) p p) v v) = g.tangentNorm p v := by |
| 131 | unfold tangentNorm |
| 132 | rw [g.chartCoefficients_self] |
| 133 | obtain ⟨e, he, he0, hderiv, hgeo⟩ := |
| 134 | g.exists_exponential_of_precompact_ball p hR hcompact |
| 135 | simp only [hnorm] at he hgeo |
| 136 | have hexp v (hv : g.tangentNorm p v < R) : |
| 137 | ∃ ε : ℝ, 0 < ε ∧ ∃ γ : ℝ → M, |
| 138 | g.IsGeodesicOn γ (Ioo (-ε) (1 + ε)) ∧ γ 0 = p ∧ |
| 139 | HasDerivAt (fun t => extChartAt (𝓡 n) p (γ t)) v 0 ∧ γ 1 = e v := by |
| 140 | obtain ⟨ε, hε, γ, hγ, hγ0, hγv, hγ1, _⟩ := hgeo v hv |
| 141 | exact ⟨ε, hε, γ, hγ, hγ0, hγv, hγ1⟩ |
| 142 | have hbound v (hv : g.tangentNorm p v < R) : |
| 143 | g.edist p (e v) ≤ ENNReal.ofReal (g.tangentNorm p v) := by |
| 144 | obtain ⟨_, _, _, _, _, _, _, hb⟩ := hgeo v hv |
| 145 | exact hb |
| 146 | exact ⟨e, he, he0, hderiv, hexp, hbound, |
| 147 | fun _ hr hrR => g.exponential_image_tangent_ball_eq p hR hcompact e hexp hbound hr hrR⟩ |
| 148 | |
| 149 | end PoincareMT.RiemannianMetric |