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 | /- |
| 2 | Provenance and modification notice (recorded 2026-09-29). |
| 3 | Source: https://github.com/qinz1yang/differential-geometry |
| 4 | DifferentialGeometry/Analysis/ODE/Flow/SolutionOperator.lean |
| 5 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 6 | Changes: Imports, module paths, and namespaces were adapted to the subject-organized PoincareLib library. |
| 7 | License: Apache-2.0. Source licenses and notices are retained under |
| 8 | PoincareConjecture/provenance/2026-09-29/licenses/. |
| 9 | See PoincareConjecture/MODIFICATIONS.md for the reviewed source mapping. |
| 10 | -/ |
| 11 | |
| 12 | /- |
| 13 | Copyright (c) 2026 The DifferentialGeometry contributors. |
| 14 | Released under Apache 2.0 license. |
| 15 | |
| 16 | Adapted from DifferentialGeometry/Analysis/ODE/Flow/SolutionOperator.lean |
| 17 | at revision 1b535dd102b94cc42b107cca27059687888f08b3. |
| 18 | Original SHA-256: 4d1b20df8e09eded3971b1d00e860015385288c4665faed8910ce90590c8f362 |
| 19 | Changes: library paths and namespaces. |
| 20 | -/ |
| 21 | import PoincareLib.Analysis.ODE.LocalFlow.HigherRegularity.VariationalLinearMapSmoothness |
| 22 | import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension |
| 23 | |
| 24 | |
| 25 | noncomputable section |
| 26 | |
| 27 | open Set Function Filter Metric Asymptotics Real |
| 28 | open scoped Topology NNReal ContDiff |
| 29 | |
| 30 | namespace Poincare.ODE.LocalFlow |
| 31 | |
| 32 | section ShortIntervalExistence |
| 33 | |
| 34 | variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 35 | |
| 36 | theorem exists_linearODE_solution_of_short |
| 37 | {A : ℝ → (G →L[ℝ] G)} {h₀ : ℝ} {T M : ℝ} |
| 38 | (hT : 0 < T) (hM : 0 ≤ M) (hMT : M * T < 1) |
| 39 | (hA_cont : ContinuousOn A (Icc (h₀ - T) (h₀ + T))) |
| 40 | (hA_bd : ∀ t ∈ Icc (h₀ - T) (h₀ + T), ‖A t‖ ≤ M) |
| 41 | (Z₀ : G) : |
| 42 | ∃ Z : ℝ → G, Z h₀ = Z₀ ∧ |
| 43 | ∀ t ∈ Icc (h₀ - T) (h₀ + T), HasDerivWithinAt Z (A t (Z t)) |
| 44 | (Icc (h₀ - T) (h₀ + T)) t := by |
| 45 | set v : ℝ → G → G := fun t y => A t y with hv_def |
| 46 | set r₀ : ℝ := ‖Z₀‖ with hr₀_def |
| 47 | have hr₀_nn : 0 ≤ r₀ := norm_nonneg _ |
| 48 | have h1mMT_pos : 0 < 1 - M * T := by linarith |
| 49 | set a₀ : ℝ := (r₀ + 1) / (1 - M * T) with ha₀_def |
| 50 | have ha₀_pos : 0 < a₀ := div_pos (by linarith [hr₀_nn]) h1mMT_pos |
| 51 | have ha₀_nn : 0 ≤ a₀ := le_of_lt ha₀_pos |
| 52 | have hMaT_le : M * a₀ * T ≤ a₀ - r₀ := by |
| 53 | have hkey : a₀ * (1 - M * T) = r₀ + 1 := by |
| 54 | rw [ha₀_def]; field_simp |
| 55 | have h1 : a₀ - M * a₀ * T = r₀ + 1 := by |
| 56 | have : a₀ - M * a₀ * T = a₀ * (1 - M * T) := by ring |
| 57 | rw [this, hkey] |
| 58 | linarith |
| 59 | let tmin : ℝ := h₀ - T |
| 60 | let tmax : ℝ := h₀ + T |
| 61 | have htmin_le_t₀ : tmin ≤ h₀ := by change h₀ - T ≤ h₀; linarith |
| 62 | have ht₀_le_tmax : h₀ ≤ tmax := by change h₀ ≤ h₀ + T; linarith |
| 63 | let t₀Icc : Icc tmin tmax := ⟨h₀, ⟨htmin_le_t₀, ht₀_le_tmax⟩⟩ |
| 64 | let aN : ℝ≥0 := NNReal.mk a₀ ha₀_nn |
| 65 | let rN : ℝ≥0 := NNReal.mk r₀ hr₀_nn |
| 66 | let LN : ℝ≥0 := NNReal.mk (M * a₀) (mul_nonneg hM ha₀_nn) |
| 67 | let KN : ℝ≥0 := NNReal.mk M hM |
| 68 | have hpl : IsPicardLindelof v t₀Icc (0 : G) aN rN LN KN := by |
| 69 | refine |
| 70 | { lipschitzOnWith := ?_, |
| 71 | continuousOn := ?_, |
| 72 | norm_le := ?_, |
| 73 | mul_max_le := ?_ } |
| 74 | · intro t ht |
| 75 | have hAτ_bd : ‖A t‖ ≤ M := hA_bd t ht |
| 76 | have hlip : LipschitzWith KN (A t) := (A t).lipschitzWith_of_opNorm_le hAτ_bd |
| 77 | exact hlip.lipschitzOnWith (s := closedBall (0 : G) aN) |
| 78 | · intro y _ |
| 79 | have happly : Continuous (fun B : G →L[ℝ] G => B y) := |
| 80 | (ContinuousLinearMap.apply ℝ G y).continuous |
| 81 | exact happly.comp_continuousOn hA_cont |
| 82 | · intro t ht y hy |
| 83 | have hAt_bd : ‖A t‖ ≤ M := hA_bd t ht |
| 84 | have hy_norm : ‖y‖ ≤ a₀ := by |
| 85 | have hy' : ‖y‖ ≤ (aN : ℝ) := by |
| 86 | simpa only [mem_closedBall_zero_iff] using hy |
| 87 | simpa only [aN, NNReal.coe_mk] using hy' |
| 88 | change ‖v t y‖ ≤ (LN : ℝ) |
| 89 | calc ‖v t y‖ = ‖A t y‖ := rfl |
| 90 | _ ≤ ‖A t‖ * ‖y‖ := (A t).le_opNorm y |
| 91 | _ ≤ M * a₀ := mul_le_mul hAt_bd hy_norm (norm_nonneg _) hM |
| 92 | · change (LN : ℝ) * max (tmax - h₀) (h₀ - tmin) ≤ (aN : ℝ) - (rN : ℝ) |
| 93 | have hmax_eq : max (tmax - h₀) (h₀ - tmin) = T := by |
| 94 | have h1 : tmax - h₀ = T := by change (h₀ + T) - h₀ = T; ring |
| 95 | have h2 : h₀ - tmin = T := by change h₀ - (h₀ - T) = T; ring |
| 96 | rw [h1, h2]; exact max_self _ |
| 97 | rw [hmax_eq] |
| 98 | change M * a₀ * T ≤ a₀ - r₀ |
| 99 | exact hMaT_le |
| 100 | have hZ₀_mem : Z₀ ∈ closedBall (0 : G) rN := by |
| 101 | rw [mem_closedBall_zero_iff]; change ‖Z₀‖ ≤ r₀; rfl |
| 102 | obtain ⟨Z, hZ_init, hZ_deriv⟩ := |
| 103 | hpl.exists_eq_forall_mem_Icc_hasDerivWithinAt hZ₀_mem |
| 104 | exact ⟨Z, hZ_init, hZ_deriv⟩ |
| 105 | |
| 106 | end ShortIntervalExistence |
| 107 | |
| 108 | section Uniqueness |
| 109 | |
| 110 | variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 111 | |
| 112 | theorem linearODE_unique_on_Ioo |
| 113 | {A : ℝ → (G →L[ℝ] G)} {a b h₀ : ℝ} |
| 114 | (ht₀ : h₀ ∈ Ioo a b) |
| 115 | (hA_cont : ContinuousOn A (Ioo a b)) |
| 116 | {Z₁ Z₂ : ℝ → G} |
| 117 | (hZ₁ : ∀ t ∈ Ioo a b, HasDerivAt Z₁ (A t (Z₁ t)) t) |
| 118 | (hZ₂ : ∀ t ∈ Ioo a b, HasDerivAt Z₂ (A t (Z₂ t)) t) |
| 119 | (heq : Z₁ h₀ = Z₂ h₀) : |
| 120 | EqOn Z₁ Z₂ (Ioo a b) := by |
| 121 | intro t ht |
| 122 | let v : ℝ → G → G := fun t y => A t y |
| 123 | set a' := (a + min t h₀) / 2 with ha' |
| 124 | set b' := (b + max t h₀) / 2 with hb' |
| 125 | have hmin_lt : a < min t h₀ := lt_min ht.1 ht₀.1 |
| 126 | have hmax_lt : max t h₀ < b := max_lt ht.2 ht₀.2 |
| 127 | have hmin_le_t : min t h₀ ≤ t := min_le_left _ _ |
| 128 | have hmin_le_t₀ : min t h₀ ≤ h₀ := min_le_right _ _ |
| 129 | have ht_le_max : t ≤ max t h₀ := le_max_left _ _ |
| 130 | have ht₀_le_max : h₀ ≤ max t h₀ := le_max_right _ _ |
| 131 | have ha'_lt_min : a' < min t h₀ := by rw [ha']; linarith |
| 132 | have ha_lt_a' : a < a' := by rw [ha']; linarith |
| 133 | have hmax_lt_b' : max t h₀ < b' := by rw [hb']; linarith |
| 134 | have hb'_lt_b : b' < b := by rw [hb']; linarith |
| 135 | have hsub : Ioo a' b' ⊆ Ioo a b := fun s hs => |
| 136 | ⟨lt_trans ha_lt_a' hs.1, lt_trans hs.2 hb'_lt_b⟩ |
| 137 | have ht_mem' : t ∈ Ioo a' b' := |
| 138 | ⟨lt_of_lt_of_le ha'_lt_min hmin_le_t, lt_of_le_of_lt ht_le_max hmax_lt_b'⟩ |
| 139 | have ht₀_mem' : h₀ ∈ Ioo a' b' := |
| 140 | ⟨lt_of_lt_of_le ha'_lt_min hmin_le_t₀, lt_of_le_of_lt ht₀_le_max hmax_lt_b'⟩ |
| 141 | have hab_le : a' ≤ b' := le_of_lt (lt_trans ha'_lt_min (lt_of_le_of_lt hmin_le_t |
| 142 | (lt_of_lt_of_le ht_mem'.2 (le_refl _)))) |
| 143 | have hIcc_sub : Icc a' b' ⊆ Ioo a b := fun s hs => |
| 144 | ⟨lt_of_lt_of_le ha_lt_a' hs.1, lt_of_le_of_lt hs.2 hb'_lt_b⟩ |
| 145 | have hbd : ∃ M : ℝ, 0 ≤ M ∧ ∀ τ ∈ Icc a' b', ‖A τ‖ ≤ M := by |
| 146 | have hcont' : ContinuousOn A (Icc a' b') := hA_cont.mono hIcc_sub |
| 147 | have hcont_norm : ContinuousOn (fun τ => ‖A τ‖) (Icc a' b') := |
| 148 | continuous_norm.comp_continuousOn hcont' |
| 149 | have hcpt : IsCompact (Icc a' b') := isCompact_Icc |
| 150 | have hne : (Icc a' b').Nonempty := ⟨a', left_mem_Icc.mpr hab_le⟩ |
| 151 | rcases hcpt.exists_isMaxOn hne hcont_norm with ⟨τ₁, _, hτ₁_max⟩ |
| 152 | exact ⟨‖A τ₁‖, norm_nonneg _, fun τ hτ => hτ₁_max hτ⟩ |
| 153 | obtain ⟨M, hM_nn, hMbd⟩ := hbd |
| 154 | let K : ℝ≥0 := ⟨M, hM_nn⟩ |
| 155 | have hv_lip : ∀ τ ∈ Ioo a' b', LipschitzOnWith K (v τ) univ := by |
| 156 | intro τ hτ |
| 157 | have hlip : LipschitzWith K (A τ) := |
| 158 | (A τ).lipschitzWith_of_opNorm_le (hMbd τ (Ioo_subset_Icc_self hτ)) |
| 159 | exact (LipschitzWith.lipschitzOnWith (s := (univ : Set G)) hlip) |
| 160 | exact (ODE_solution_unique_of_mem_Ioo (v := v) (s := fun _ => univ) (K := K) |
| 161 | hv_lip ht₀_mem' |
| 162 | (fun τ hτ => ⟨hZ₁ τ (hsub hτ), mem_univ _⟩) |
| 163 | (fun τ hτ => ⟨hZ₂ τ (hsub hτ), mem_univ _⟩) |
| 164 | heq) ht_mem' |
| 165 | |
| 166 | end Uniqueness |
| 167 | |
| 168 | section SolutionOperator |
| 169 | |
| 170 | variable {F G : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 171 | [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 172 | |
| 173 | def HasLinearODESolution |
| 174 | (A : F → ℝ → (G →L[ℝ] G)) (a b h₀ : ℝ) (Z₀ : F → G) (x : F) : Prop := |
| 175 | ∃ Z : ℝ → G, Z h₀ = Z₀ x ∧ ∀ t ∈ Ioo a b, HasDerivAt Z (A x t (Z t)) t |
| 176 | |
| 177 | noncomputable def linearODESolution |
| 178 | (A : F → ℝ → (G →L[ℝ] G)) (a b h₀ : ℝ) (Z₀ : F → G) : |
| 179 | F → ℝ → G := by |
| 180 | classical |
| 181 | exact fun x => |
| 182 | if h : HasLinearODESolution A a b h₀ Z₀ x then |
| 183 | Classical.choose h |
| 184 | else |
| 185 | fun _ => Z₀ x |
| 186 | |
| 187 | omit [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace G] in |
| 188 | @[simp] |
| 189 | theorem linearODESolution_init |
| 190 | (A : F → ℝ → (G →L[ℝ] G)) (a b h₀ : ℝ) (Z₀ : F → G) (x : F) : |
| 191 | linearODESolution A a b h₀ Z₀ x h₀ = Z₀ x := by |
| 192 | unfold linearODESolution |
| 193 | by_cases h : HasLinearODESolution A a b h₀ Z₀ x |
| 194 | · simp only [dif_pos h] |
| 195 | exact (Classical.choose_spec h).1 |
| 196 | · simp only [dif_neg h] |
| 197 | |
| 198 | omit [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace G] in |
| 199 | theorem linearODESolution_hasDerivAt_of_hasSolution |
| 200 | (A : F → ℝ → (G →L[ℝ] G)) (a b h₀ : ℝ) (Z₀ : F → G) |
| 201 | {x : F} (hx : HasLinearODESolution A a b h₀ Z₀ x) {t : ℝ} (ht : t ∈ Ioo a b) : |
| 202 | HasDerivAt (linearODESolution A a b h₀ Z₀ x ·) |
| 203 | (A x t (linearODESolution A a b h₀ Z₀ x t)) t := by |
| 204 | have hZ_eq : linearODESolution A a b h₀ Z₀ x = Classical.choose hx := by |
| 205 | unfold linearODESolution |
| 206 | simp only [dif_pos hx] |
| 207 | rw [hZ_eq] |
| 208 | exact (Classical.choose_spec hx).2 t ht |
| 209 | |
| 210 | end SolutionOperator |
| 211 | |
| 212 | end Poincare.ODE.LocalFlow |
| 213 | |
| 214 | end |