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.ReducedGeometry.ReducedLength.Minimum.Variational.Recovery.Chart |
| 2 | |
| 3 | /-! |
| 4 | Adapted from Mapher `Proofs/M08/ChartPerturbation.lean`, commit |
| 5 | `49331b7d7ecad38f53e4300c3b35d6a84b2cc648`. |
| 6 | -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open MeasureTheory Set Filter Topology |
| 12 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 13 | |
| 14 | namespace PoincareMT.ReducedLengthMinimum.Variational |
| 15 | |
| 16 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 17 | |
| 18 | theorem exists_uniform_affine_tube {a b : ℝ} (u η : ℝ → E) |
| 19 | (hu : ContinuousOn u (Icc a b)) (hη : ContinuousOn η (Icc a b)) |
| 20 | {K : Set E} (huK : u '' Icc a b ⊆ interior K) : |
| 21 | ∃ δ : ℝ, 0 < δ ∧ δ ≤ 1 ∧ ∀ ε : ℝ, |ε| < δ → |
| 22 | MapsTo (fun s ↦ u s + ε • η s) (Icc a b) K := by |
| 23 | obtain ⟨r, hr, hmargin⟩ := (isCompact_Icc.image_of_continuousOn hu).exists_cthickening_subset_open |
| 24 | isOpen_interior huK |
| 25 | obtain ⟨D, hD⟩ := isCompact_Icc.exists_bound_of_continuousOn hη |
| 26 | let C := max D 0 |
| 27 | have hC : 0 ≤ C := le_max_right _ _ |
| 28 | have hCp : 0 < C + 1 := by positivity |
| 29 | let δ := min 1 (r / (C + 1)) |
| 30 | have hδ : 0 < δ := lt_min zero_lt_one (div_pos hr hCp) |
| 31 | have hδr : δ * (C + 1) ≤ r := (le_div_iff₀ hCp).mp (min_le_right _ _) |
| 32 | refine ⟨δ, hδ, min_le_left _ _, ?_⟩ |
| 33 | intro ε hε s hs |
| 34 | have hηbound : ‖η s‖ ≤ C := (hD s hs).trans (le_max_left _ _) |
| 35 | have hnorm : ‖ε • η s‖ < r := by |
| 36 | rw [norm_smul, Real.norm_eq_abs] |
| 37 | have hmul := mul_le_mul_of_nonneg_left hηbound (abs_nonneg ε) |
| 38 | have hmul' := mul_le_mul_of_nonneg_right hε.le hC |
| 39 | nlinarith |
| 40 | apply interior_subset (hmargin ?_) |
| 41 | apply Metric.mem_cthickening_of_dist_le _ (u s) _ _ (mem_image_of_mem u hs) |
| 42 | simpa only [dist_eq_norm, add_sub_cancel_left] using hnorm.le |
| 43 | |
| 44 | theorem intervalL2_affine_primitive {a b : ℝ} (hab : a ≤ b) |
| 45 | (u : ℝ → E) (w : IntervalL2 E a b) |
| 46 | (hw : ∀ s ∈ Icc a b, u s = u a + ∫ r in a..s, w r) |
| 47 | (η ν : ℝ → E) (hη : ContinuousOn η (Icc a b)) |
| 48 | (hd : ∀ s ∈ Ioo a b, HasDerivAt η (ν s) s) |
| 49 | (hν : MemLp ν 2 (volume.restrict (Icc a b))) (ε : ℝ) : |
| 50 | ∃ v : IntervalL2 E a b, |
| 51 | (v : ℝ → E) =ᵐ[volume.restrict (Icc a b)] (fun s ↦ w s + ε • ν s) ∧ |
| 52 | ∀ s ∈ Icc a b, u s + ε • η s = u a + ε • η a + ∫ r in a..s, v r := by |
| 53 | have hLp : MemLp (fun s ↦ w s + ε • ν s) 2 (volume.restrict (Icc a b)) := |
| 54 | (Lp.memLp w).add (hν.const_smul ε) |
| 55 | let v := hLp.toLp (fun s ↦ w s + ε • ν s) |
| 56 | refine ⟨v, hLp.coeFn_toLp, ?_⟩ |
| 57 | intro s hs |
| 58 | have hsub : uIcc a s ⊆ uIcc a b := by |
| 59 | rw [uIcc_of_le hs.1, uIcc_of_le hab] |
| 60 | exact Icc_subset_Icc_right hs.2 |
| 61 | have hwint0 : IntervalIntegrable w volume a b := |
| 62 | (intervalIntegrable_iff_integrableOn_Icc_of_le hab).mpr ((Lp.memLp w).integrable (by norm_num)) |
| 63 | have hwint := hwint0.mono_set hsub |
| 64 | have hνint : IntervalIntegrable ν volume a s := by |
| 65 | apply (intervalIntegrable_iff_integrableOn_Icc_of_le hs.1).mpr |
| 66 | exact IntegrableOn.mono_set (hν.integrable (by norm_num)) (Icc_subset_Icc_right hs.2) |
| 67 | have heq : (∫ r in a..s, v r) = ∫ r in a..s, w r + ε • ν r := by |
| 68 | apply intervalIntegral.integral_congr_ae_restrict |
| 69 | rw [uIoc_of_le hs.1] |
| 70 | exact ae_mono (Measure.restrict_mono |
| 71 | (Ioc_subset_Icc_self.trans (Icc_subset_Icc_right hs.2)) le_rfl) hLp.coeFn_toLp |
| 72 | have hFTC := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hs.1 |
| 73 | (hη.mono (Icc_subset_Icc_right hs.2)) |
| 74 | (fun r hr ↦ hd r ⟨hr.1, hr.2.trans_le hs.2⟩) hνint |
| 75 | have hεν : IntervalIntegrable (fun r ↦ ε • ν r) volume a s := hνint.smul ε |
| 76 | rw [heq, intervalIntegral.integral_add hwint hεν, |
| 77 | intervalIntegral.integral_smul, hFTC, hw s hs, smul_sub] |
| 78 | abel |
| 79 | |
| 80 | universe uM |
| 81 | |
| 82 | variable {n : ℕ} {M : Type uM} [MetricSpace M] |
| 83 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 84 | |
| 85 | theorem exists_chart_affine_buffer {a b : ℝ} (x : M) |
| 86 | (γ : ℝ → M) (hγ : ContinuousOn γ (Icc a b)) |
| 87 | (hsrc : MapsTo γ (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 88 | (η : ℝ → EuclideanSpace ℝ (Fin n)) (hη : ContinuousOn η (Icc a b)) : |
| 89 | ∃ K : Set (EuclideanSpace ℝ (Fin n)), IsCompact K ∧ |
| 90 | K ⊆ (extChartAt (𝓡 n) x).target ∧ |
| 91 | (extChartAt (𝓡 n) x ∘ γ) '' Icc a b ⊆ interior K ∧ |
| 92 | ∃ δ : ℝ, 0 < δ ∧ δ ≤ 1 ∧ ∀ ε : ℝ, |ε| < δ → |
| 93 | MapsTo (fun s ↦ extChartAt (𝓡 n) x (γ s) + ε • η s) (Icc a b) K := by |
| 94 | let e := extChartAt (𝓡 n) x |
| 95 | have hsrc' : MapsTo γ (Icc a b) e.source := by |
| 96 | simpa only [e, extChartAt_source] using hsrc |
| 97 | have hu : ContinuousOn (e ∘ γ) (Icc a b) := |
| 98 | (continuousOn_extChartAt (I := 𝓡 n) x).comp hγ hsrc' |
| 99 | have htarget : (e ∘ γ) '' Icc a b ⊆ e.target := by |
| 100 | rintro _ ⟨s, hs, rfl⟩ |
| 101 | exact e.map_source (hsrc' hs) |
| 102 | obtain ⟨K, hK, huK, hKt⟩ := exists_compact_between |
| 103 | (isCompact_Icc.image_of_continuousOn hu) (isOpen_extChartAt_target (I := 𝓡 n) x) htarget |
| 104 | obtain ⟨δ, hδ, hδ1, hδK⟩ := exists_uniform_affine_tube (e ∘ γ) η hu hη huK |
| 105 | exact ⟨K, hK, hKt, huK, δ, hδ, hδ1, hδK⟩ |
| 106 | |
| 107 | theorem chart_affine_competitor {a b : ℝ} (hab : a ≤ b) |
| 108 | (x : M) (γ : ℝ → M) (hγ : ContinuousOn γ (Icc a b)) |
| 109 | (hsrc : MapsTo γ (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 110 | (w : IntervalL2 (EuclideanSpace ℝ (Fin n)) a b) |
| 111 | (hw : ∀ s ∈ Icc a b, extChartAt (𝓡 n) x (γ s) = |
| 112 | extChartAt (𝓡 n) x (γ a) + ∫ r in a..s, w r) |
| 113 | (η ν : ℝ → EuclideanSpace ℝ (Fin n)) |
| 114 | (hη : ContinuousOn η (Icc a b)) (hd : ∀ s ∈ Ioo a b, HasDerivAt η (ν s) s) |
| 115 | (hν : MemLp ν 2 (volume.restrict (Icc a b))) |
| 116 | (hηa : η a = 0) (hηb : η b = 0) (ε : ℝ) |
| 117 | (htarget : MapsTo (fun s ↦ extChartAt (𝓡 n) x (γ s) + ε • η s) (Icc a b) |
| 118 | (extChartAt (𝓡 n) x).target) : |
| 119 | ∃ (ξ : ℝ → M) (v : IntervalL2 (EuclideanSpace ℝ (Fin n)) a b), |
| 120 | ContinuousOn ξ (Icc a b) ∧ ξ a = γ a ∧ ξ b = γ b ∧ |
| 121 | MapsTo ξ (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source ∧ |
| 122 | (∀ s, ξ s = (extChartAt (𝓡 n) x).symm (extChartAt (𝓡 n) x (γ s) + ε • η s)) ∧ |
| 123 | ((v : ℝ → EuclideanSpace ℝ (Fin n)) =ᵐ[volume.restrict (Icc a b)] |
| 124 | (fun s ↦ w s + ε • ν s)) ∧ |
| 125 | (∀ s ∈ Icc a b, extChartAt (𝓡 n) x (ξ s) = |
| 126 | extChartAt (𝓡 n) x (γ s) + ε • η s) ∧ |
| 127 | ∀ s ∈ Icc a b, extChartAt (𝓡 n) x (ξ s) = |
| 128 | extChartAt (𝓡 n) x (ξ a) + ∫ r in a..s, v r := by |
| 129 | let e := extChartAt (𝓡 n) x |
| 130 | let u : ℝ → EuclideanSpace ℝ (Fin n) := e ∘ γ |
| 131 | have hsrc' : MapsTo γ (Icc a b) e.source := by |
| 132 | simpa only [e, extChartAt_source] using hsrc |
| 133 | have hu : ContinuousOn u (Icc a b) := |
| 134 | (continuousOn_extChartAt (I := 𝓡 n) x).comp hγ hsrc' |
| 135 | obtain ⟨v, hv, hprimitive⟩ := intervalL2_affine_primitive hab u w hw η ν hη hd hν ε |
| 136 | let ξ : ℝ → M := fun s ↦ e.symm (u s + ε • η s) |
| 137 | have hξ : ContinuousOn ξ (Icc a b) := |
| 138 | (continuousOn_extChartAt_symm (I := 𝓡 n) x).comp (hu.add (hη.const_smul ε)) htarget |
| 139 | have hξa : ξ a = γ a := by |
| 140 | simp only [ξ, hηa, smul_zero, add_zero] |
| 141 | exact e.left_inv (hsrc' ⟨le_rfl, hab⟩) |
| 142 | have hξb : ξ b = γ b := by |
| 143 | simp only [ξ, hηb, smul_zero, add_zero] |
| 144 | exact e.left_inv (hsrc' ⟨hab, le_rfl⟩) |
| 145 | have hξsrc : MapsTo ξ (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source := by |
| 146 | intro s hs |
| 147 | simpa only [ξ, u, Function.comp_apply, e, extChartAt_source] using e.map_target (htarget hs) |
| 148 | have hcoord (s : ℝ) (hs : s ∈ Icc a b) : e (ξ s) = u s + ε • η s := |
| 149 | e.right_inv (htarget hs) |
| 150 | refine ⟨ξ, v, hξ, hξa, hξb, hξsrc, fun _ ↦ rfl, hv, hcoord, ?_⟩ |
| 151 | intro s hs |
| 152 | change e (ξ s) = e (ξ a) + _ |
| 153 | rw [hcoord s hs, hcoord a ⟨le_rfl, hab⟩] |
| 154 | exact hprimitive s hs |
| 155 | |
| 156 | end PoincareMT.ReducedLengthMinimum.Variational |
| 157 |