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 Mathlib.Analysis.ODE.PicardLindelof |
| 2 | import Mathlib.Analysis.ODE.ExistUnique |
| 3 | import Mathlib.Analysis.ODE.Gronwall |
| 4 | |
| 5 | /-! |
| 6 | # Global existence for linear ODEs with continuous coefficient |
| 7 | |
| 8 | Mathlib's Picard–Lindelöf theory (`Mathlib.Analysis.ODE.PicardLindelof`) proves only |
| 9 | *local* existence: from `IsPicardLindelof` one gets a solution on a time interval short |
| 10 | enough that the a-priori bound keeps the trajectory inside a fixed ball. For a **linear** |
| 11 | ODE `V'(t) = A(t) V(t)` with a continuous bounded coefficient `A : ℝ → (E →L[ℝ] E)` the |
| 12 | solution exists on *any* compact interval, but that global statement is not in mathlib. |
| 13 | |
| 14 | This file supplies it, as reusable infrastructure: |
| 15 | |
| 16 | * `Riemannian.LinearODE.exists_hasDerivWithinAt_of_small` — short-time existence: on `[a,b]` |
| 17 | with `(b-a)·‖A‖ ≤ 1/2` a solution with prescribed left-endpoint value exists (a direct |
| 18 | `IsPicardLindelof` application). |
| 19 | * `Riemannian.LinearODE.exists_hasDerivWithinAt_Icc` — global existence on an arbitrary |
| 20 | compact `[a,b]`, obtained by chopping `[a,b]` into finitely many short pieces, solving |
| 21 | each with the short-time lemma, and gluing the pieces at the junctions. |
| 22 | |
| 23 | The parallel-transport ODE `V' = -Γ(u', V)(u)` (do Carmo Ch. 2, Prop. 2.6) is the special |
| 24 | case `A(t) = -chartChristoffelContractionRight g α (u' t) (u t)`; see |
| 25 | `DoCarmoLib/Riemannian/Geodesic/CovariantDerivative.lean`. |
| 26 | -/ |
| 27 | |
| 28 | open scoped Topology NNReal |
| 29 | open Set Metric |
| 30 | |
| 31 | |
| 32 | noncomputable section |
| 33 | |
| 34 | namespace Poincare.ODE.Linear |
| 35 | |
| 36 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 37 | |
| 38 | /-- **Short-time existence for a linear ODE.** If the coefficient `A : ℝ → (E →L[ℝ] E)` is |
| 39 | continuous on `[a,b]`, bounded there by `K`, and the interval is short in the sense |
| 40 | `(b-a)·K ≤ 1/2`, then for any initial value `x₀` there is a curve `V` with `V a = x₀` |
| 41 | solving `V'(t) = A(t) V(t)` on `[a,b]`. -/ |
| 42 | theorem exists_hasDerivWithinAt_of_small {a b : ℝ} (hab : a ≤ b) (A : ℝ → E →L[ℝ] E) |
| 43 | (x₀ : E) {K : ℝ≥0} (hcont : ContinuousOn A (Icc a b)) |
| 44 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) (hsmall : (b - a) * (K : ℝ) ≤ 1 / 2) : |
| 45 | ∃ V : ℝ → E, V a = x₀ ∧ |
| 46 | ∀ t ∈ Icc a b, HasDerivWithinAt V (A t (V t)) (Icc a b) t := by |
| 47 | set aBall : ℝ≥0 := 2 * (‖x₀‖₊ + 1) with haBall |
| 48 | set L : ℝ≥0 := K * (‖x₀‖₊ + aBall) with hL |
| 49 | have hPL : IsPicardLindelof (fun t x => A t x) (⟨a, by simp [hab]⟩ : Icc a b) x₀ aBall 0 L K := by |
| 50 | refine ⟨?_, ?_, ?_, ?_⟩ |
| 51 | · intro t ht |
| 52 | exact ((A t).lipschitz.lipschitzOnWith).weaken (hK t ht) |
| 53 | · intro x hx |
| 54 | exact (hcont.clm_apply continuousOn_const) |
| 55 | · intro t ht x hx |
| 56 | rw [hL] |
| 57 | push_cast |
| 58 | calc ‖A t x‖ ≤ ‖A t‖ * ‖x‖ := (A t).le_opNorm x |
| 59 | _ ≤ (K : ℝ) * ‖x‖ := by |
| 60 | gcongr |
| 61 | exact_mod_cast hK t ht |
| 62 | _ ≤ (K : ℝ) * (‖x₀‖ + aBall) := by |
| 63 | gcongr |
| 64 | have : ‖x - x₀‖ ≤ (aBall : ℝ) := by rw [← dist_eq_norm]; exact hx |
| 65 | calc ‖x‖ = ‖x - x₀ + x₀‖ := by rw [sub_add_cancel] |
| 66 | _ ≤ ‖x - x₀‖ + ‖x₀‖ := norm_add_le _ _ |
| 67 | _ ≤ (aBall : ℝ) + ‖x₀‖ := by gcongr |
| 68 | _ = ‖x₀‖ + aBall := by ring |
| 69 | _ = (K : ℝ) * (‖x₀‖ + aBall) := by ring |
| 70 | · have ht0 : (↑(⟨a, by simp [hab]⟩ : Icc a b) : ℝ) = a := rfl |
| 71 | rw [ht0, sub_self, max_eq_left (by linarith : (0 : ℝ) ≤ b - a), hL, haBall] |
| 72 | push_cast |
| 73 | nlinarith [hsmall, norm_nonneg x₀, K.coe_nonneg, sub_nonneg.mpr hab, |
| 74 | mul_nonneg (sub_nonneg.mpr hab) K.coe_nonneg] |
| 75 | obtain ⟨V, hV0, hVd⟩ := hPL.exists_eq_forall_mem_Icc_hasDerivWithinAt₀ |
| 76 | exact ⟨V, hV0, hVd⟩ |
| 77 | |
| 78 | omit [CompleteSpace E] in |
| 79 | /-- **Gluing two solutions of a linear ODE.** If `V₁` solves `V' = A(t)V` on `[a,c]` and |
| 80 | `V₂` solves it on `[c,b]` with the same value at the junction `c`, the concatenation |
| 81 | `t ↦ if t ≤ c then V₁ t else V₂ t` solves it on all of `[a,b]`, keeping the left-endpoint |
| 82 | value `V₁ a`. This is the continuation step that upgrades short-time to global existence. -/ |
| 83 | theorem exists_hasDerivWithinAt_glue {a c b : ℝ} (hac : a ≤ c) (hcb : c ≤ b) |
| 84 | (A : ℝ → E →L[ℝ] E) {V₁ V₂ : ℝ → E} |
| 85 | (h₁ : ∀ t ∈ Icc a c, HasDerivWithinAt V₁ (A t (V₁ t)) (Icc a c) t) |
| 86 | (h₂ : ∀ t ∈ Icc c b, HasDerivWithinAt V₂ (A t (V₂ t)) (Icc c b) t) |
| 87 | (hjoin : V₂ c = V₁ c) : |
| 88 | ∃ V : ℝ → E, V a = V₁ a ∧ |
| 89 | ∀ t ∈ Icc a b, HasDerivWithinAt V (A t (V t)) (Icc a b) t := by |
| 90 | set V : ℝ → E := fun t => if t ≤ c then V₁ t else V₂ t with hV |
| 91 | have hVval : ∀ x, V x = if x ≤ c then V₁ x else V₂ x := fun x => by rw [hV] |
| 92 | have hVc : V c = V₁ c := by rw [hVval, if_pos le_rfl] |
| 93 | refine ⟨V, by rw [hVval, if_pos hac], fun t ht => ?_⟩ |
| 94 | rcases lt_trichotomy t c with htc | htc | htc |
| 95 | · -- left of the junction: `V` agrees with `V₁` near `t` |
| 96 | have hVt : V t = V₁ t := by rw [hVval, if_pos (le_of_lt htc)] |
| 97 | have hset : (Icc a c : Set ℝ) =ᶠ[𝓝 t] Icc a b := by |
| 98 | rw [Filter.eventuallyEq_set] |
| 99 | filter_upwards [isOpen_Iio.mem_nhds htc] with x hx |
| 100 | simp only [Set.mem_Icc] |
| 101 | exact ⟨fun h => ⟨h.1, h.2.trans hcb⟩, fun h => ⟨h.1, le_of_lt hx⟩⟩ |
| 102 | have hd := ((h₁ t ⟨ht.1, le_of_lt htc⟩).congr_set hset) |
| 103 | have hVeq : V =ᶠ[𝓝[Icc a b] t] V₁ := by |
| 104 | filter_upwards [nhdsWithin_le_nhds (isOpen_Iio.mem_nhds htc)] with x hx |
| 105 | rw [hVval, if_pos (le_of_lt hx)] |
| 106 | rw [hVt] |
| 107 | exact hd.congr_of_eventuallyEq hVeq hVt |
| 108 | · -- at the junction: take the union of the one-sided derivatives |
| 109 | subst htc |
| 110 | have hleft : HasDerivWithinAt V (A t (V t)) (Icc a t) t := by |
| 111 | have hd := h₁ t ⟨hac, le_rfl⟩ |
| 112 | rw [hVc] |
| 113 | exact hd.congr (fun y hy => by rw [hVval, if_pos hy.2]) (by rw [hVval, if_pos le_rfl]) |
| 114 | have hright : HasDerivWithinAt V (A t (V t)) (Icc t b) t := by |
| 115 | have hd := h₂ t ⟨le_rfl, hcb⟩ |
| 116 | rw [hVc, ← hjoin] |
| 117 | refine hd.congr (fun y hy => ?_) (by rw [hVval, if_pos le_rfl, hjoin]) |
| 118 | rcases le_or_gt y t with hyt | hyt |
| 119 | · rw [hVval, if_pos hyt, le_antisymm hyt hy.1, hjoin] |
| 120 | · rw [hVval, if_neg (not_le.mpr hyt)] |
| 121 | have hu := hleft.union hright |
| 122 | rwa [Set.Icc_union_Icc_eq_Icc hac hcb] at hu |
| 123 | · -- right of the junction: `V` agrees with `V₂` near `t` |
| 124 | have hVt : V t = V₂ t := by rw [hVval, if_neg (not_le.mpr htc)] |
| 125 | have hset : (Icc c b : Set ℝ) =ᶠ[𝓝 t] Icc a b := by |
| 126 | rw [Filter.eventuallyEq_set] |
| 127 | filter_upwards [isOpen_Ioi.mem_nhds htc] with x hx |
| 128 | simp only [Set.mem_Icc] |
| 129 | exact ⟨fun h => ⟨hac.trans h.1, h.2⟩, fun h => ⟨le_of_lt hx, h.2⟩⟩ |
| 130 | have hd := ((h₂ t ⟨le_of_lt htc, ht.2⟩).congr_set hset) |
| 131 | have hVeq : V =ᶠ[𝓝[Icc a b] t] V₂ := by |
| 132 | filter_upwards [nhdsWithin_le_nhds (isOpen_Ioi.mem_nhds htc)] with x hx |
| 133 | rw [hVval, if_neg (not_le.mpr hx)] |
| 134 | rw [hVt] |
| 135 | exact hd.congr_of_eventuallyEq hVeq hVt |
| 136 | |
| 137 | /-- **Global existence for a linear ODE with continuous bounded coefficient.** On *any* |
| 138 | compact interval `[a,b]`, for a coefficient `A : ℝ → (E →L[ℝ] E)` continuous and bounded by |
| 139 | `K`, and any initial value `x₀`, there is a curve `V` with `V a = x₀` solving |
| 140 | `V'(t) = A(t) V(t)` on `[a,b]`. The interval is cut into `⌈2(b-a)K⌉+1` short pieces, each |
| 141 | solved by `exists_hasDerivWithinAt_of_small`, and the pieces are glued with |
| 142 | `exists_hasDerivWithinAt_glue`. This is the global-existence half missing from mathlib's |
| 143 | (purely local) Picard–Lindelöf theory, and the existence half of parallel transport |
| 144 | (do Carmo Ch. 2, Prop. 2.6). -/ |
| 145 | theorem exists_hasDerivWithinAt_Icc {a b : ℝ} (hab : a ≤ b) (A : ℝ → E →L[ℝ] E) |
| 146 | (x₀ : E) {K : ℝ≥0} (hcont : ContinuousOn A (Icc a b)) |
| 147 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) : |
| 148 | ∃ V : ℝ → E, V a = x₀ ∧ |
| 149 | ∀ t ∈ Icc a b, HasDerivWithinAt V (A t (V t)) (Icc a b) t := by |
| 150 | have hba : (0 : ℝ) ≤ b - a := sub_nonneg.mpr hab |
| 151 | set N : ℕ := ⌈2 * (b - a) * (K : ℝ)⌉₊ + 1 with hNdef |
| 152 | have hN1 : 1 ≤ N := Nat.le_add_left 1 _ |
| 153 | have hNpos : (0 : ℝ) < N := by |
| 154 | have : 0 < N := by omega |
| 155 | exact_mod_cast this |
| 156 | set s : ℕ → ℝ := fun i => a + (i : ℝ) * (b - a) / N with hs |
| 157 | have hstep : (b - a) / N * (K : ℝ) ≤ 1 / 2 := by |
| 158 | have hle : 2 * (b - a) * (K : ℝ) ≤ N := by |
| 159 | rw [hNdef]; push_cast; linarith [Nat.le_ceil (2 * (b - a) * (K : ℝ))] |
| 160 | rw [div_mul_eq_mul_div, div_le_iff₀ hNpos] |
| 161 | nlinarith [hle] |
| 162 | have hsN : s N = b := by |
| 163 | simp only [hs]; field_simp; ring |
| 164 | have ha_le_s : ∀ i, a ≤ s i := fun i => by |
| 165 | simp only [hs] |
| 166 | have : (0 : ℝ) ≤ (i : ℝ) * (b - a) / N := |
| 167 | div_nonneg (mul_nonneg (Nat.cast_nonneg i) hba) hNpos.le |
| 168 | linarith |
| 169 | have hs_mono : ∀ i, s i ≤ s (i + 1) := fun i => by |
| 170 | have hd : s (i + 1) - s i = (b - a) / N := by simp only [hs]; push_cast; ring |
| 171 | have : (0 : ℝ) ≤ (b - a) / N := div_nonneg hba hNpos.le |
| 172 | linarith [hd, this] |
| 173 | have hs_le_b : ∀ i, i ≤ N → s i ≤ b := fun i hi => by |
| 174 | simp only [hs] |
| 175 | have key : (i : ℝ) * (b - a) / N ≤ b - a := by |
| 176 | rw [div_le_iff₀ hNpos] |
| 177 | calc (i : ℝ) * (b - a) ≤ (N : ℝ) * (b - a) := |
| 178 | mul_le_mul_of_nonneg_right (by exact_mod_cast hi) hba |
| 179 | _ = (b - a) * N := by ring |
| 180 | linarith |
| 181 | have hsmall_step : ∀ i, (s (i + 1) - s i) * (K : ℝ) ≤ 1 / 2 := fun i => by |
| 182 | have hd : s (i + 1) - s i = (b - a) / N := by simp only [hs]; push_cast; ring |
| 183 | rw [hd]; exact hstep |
| 184 | have aux : ∀ i, i ≤ N → ∃ V : ℝ → E, V a = x₀ ∧ |
| 185 | ∀ t ∈ Icc a (s i), HasDerivWithinAt V (A t (V t)) (Icc a (s i)) t := by |
| 186 | intro i |
| 187 | induction i with |
| 188 | | zero => |
| 189 | intro _ |
| 190 | have hs0 : s 0 = a := by simp [hs] |
| 191 | obtain ⟨V, hV0, hVd⟩ := exists_hasDerivWithinAt_of_small (le_of_eq hs0.symm) A x₀ |
| 192 | (hcont.mono (by rw [hs0]; exact Icc_subset_Icc le_rfl hab)) |
| 193 | (fun t ht => hK t (by rw [hs0] at ht; exact ⟨ht.1, ht.2.trans hab⟩)) |
| 194 | (by rw [hs0, sub_self, zero_mul]; norm_num) |
| 195 | exact ⟨V, hV0, hVd⟩ |
| 196 | | succ n ih => |
| 197 | intro hn |
| 198 | obtain ⟨V₁, hV₁0, hV₁d⟩ := ih (Nat.le_of_succ_le hn) |
| 199 | have hsub : Icc (s n) (s (n + 1)) ⊆ Icc a b := |
| 200 | Icc_subset_Icc (ha_le_s n) (hs_le_b (n + 1) hn) |
| 201 | obtain ⟨V₂, hV₂0, hV₂d⟩ := exists_hasDerivWithinAt_of_small (hs_mono n) A (V₁ (s n)) |
| 202 | (hcont.mono hsub) (fun t ht => hK t (hsub ht)) (hsmall_step n) |
| 203 | obtain ⟨V, hVa, hVd⟩ := exists_hasDerivWithinAt_glue (ha_le_s n) (hs_mono n) A |
| 204 | hV₁d hV₂d hV₂0 |
| 205 | exact ⟨V, hVa.trans hV₁0, hVd⟩ |
| 206 | obtain ⟨V, hV0, hVd⟩ := aux N le_rfl |
| 207 | rw [hsN] at hVd |
| 208 | exact ⟨V, hV0, hVd⟩ |
| 209 | |
| 210 | /-! ## Uniqueness, the linear flow map, and its invertibility |
| 211 | |
| 212 | The existence engine above produces *a* solution; for a *linear* ODE it is unique |
| 213 | (Grönwall) and the endpoint map `x₀ ↦ V(b)` is linear and — in finite dimension — |
| 214 | a linear isomorphism (its inverse runs the ODE backwards). This is the abstract |
| 215 | content behind do Carmo's parallel transport `P_c` (Ch. 2, Prop. 2.6). -/ |
| 216 | |
| 217 | /-- `V` **solves** the linear ODE `V' = A(t) V` on the compact interval `[a,b]`. -/ |
| 218 | def IsSolOn (A : ℝ → E →L[ℝ] E) (a b : ℝ) (V : ℝ → E) : Prop := |
| 219 | ∀ t ∈ Icc a b, HasDerivWithinAt V (A t (V t)) (Icc a b) t |
| 220 | |
| 221 | omit [CompleteSpace E] in |
| 222 | theorem IsSolOn.continuousOn {A : ℝ → E →L[ℝ] E} {a b : ℝ} {V : ℝ → E} |
| 223 | (h : IsSolOn A a b V) : ContinuousOn V (Icc a b) := |
| 224 | fun t ht => (h t ht).continuousWithinAt |
| 225 | |
| 226 | /-- The closed interval `[a,b]` is a right-neighborhood of any of its non-endpoint |
| 227 | left points `t ∈ [a,b)`. Lets us feed the `Icc`-native `HasDerivWithinAt` solutions of |
| 228 | `IsSolOn` to mathlib's `Ici`-based forward uniqueness theorem. -/ |
| 229 | theorem Icc_mem_nhdsWithin_Ici {a b t : ℝ} (ht : t ∈ Ico a b) : Icc a b ∈ 𝓝[≥] t := by |
| 230 | refine mem_nhdsWithin.mpr ⟨Iio b, isOpen_Iio, ht.2, ?_⟩ |
| 231 | rintro x ⟨hxb, hxt⟩ |
| 232 | exact ⟨le_trans ht.1 hxt, le_of_lt hxb⟩ |
| 233 | |
| 234 | /-- Dual of `Icc_mem_nhdsWithin_Ici`: `[a,b]` is a left-neighborhood of any right point |
| 235 | `t ∈ (a,b]`, feeding the backward (`Iic`) uniqueness theorem. -/ |
| 236 | theorem Icc_mem_nhdsWithin_Iic {a b t : ℝ} (ht : t ∈ Ioc a b) : Icc a b ∈ 𝓝[≤] t := by |
| 237 | refine mem_nhdsWithin.mpr ⟨Ioi a, isOpen_Ioi, ht.1, ?_⟩ |
| 238 | rintro x ⟨hxa, hxt⟩ |
| 239 | exact ⟨le_of_lt hxa, le_trans hxt ht.2⟩ |
| 240 | |
| 241 | omit [CompleteSpace E] in |
| 242 | /-- **Forward uniqueness.** Two solutions of `V' = A(t) V` on `[a,b]` that agree at the |
| 243 | left endpoint `a` agree on all of `[a,b]` (Grönwall via |
| 244 | `ODE_solution_unique_of_mem_Icc_right`; the Lipschitz constant of the RHS is the operator |
| 245 | norm bound `K` on `A`). -/ |
| 246 | theorem IsSolOn.eqOn_of_left {A : ℝ → E →L[ℝ] E} {a b : ℝ} {K : ℝ≥0} |
| 247 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) {V W : ℝ → E} |
| 248 | (hV : IsSolOn A a b V) (hW : IsSolOn A a b W) (ha : V a = W a) : |
| 249 | EqOn V W (Icc a b) := |
| 250 | ODE_solution_unique_of_mem_Icc_right |
| 251 | (v := fun t x => A t x) (s := fun _ => univ) |
| 252 | (fun t ht => ((A t).lipschitz.lipschitzOnWith).weaken (hK t ⟨ht.1, ht.2.le⟩)) |
| 253 | hV.continuousOn |
| 254 | (fun t ht => (hV t ⟨ht.1, ht.2.le⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsWithin_Ici ht)) |
| 255 | (fun _ _ => mem_univ _) |
| 256 | hW.continuousOn |
| 257 | (fun t ht => (hW t ⟨ht.1, ht.2.le⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsWithin_Ici ht)) |
| 258 | (fun _ _ => mem_univ _) ha |
| 259 | |
| 260 | omit [CompleteSpace E] in |
| 261 | /-- **Backward uniqueness.** Two solutions of `V' = A(t) V` on `[a,b]` that agree at the |
| 262 | right endpoint `b` agree on all of `[a,b]` (time-reversed Grönwall via |
| 263 | `ODE_solution_unique_of_mem_Icc_left`). This is what makes the endpoint flow injective. -/ |
| 264 | theorem IsSolOn.eqOn_of_right {A : ℝ → E →L[ℝ] E} {a b : ℝ} {K : ℝ≥0} |
| 265 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) {V W : ℝ → E} |
| 266 | (hV : IsSolOn A a b V) (hW : IsSolOn A a b W) (hb : V b = W b) : |
| 267 | EqOn V W (Icc a b) := |
| 268 | ODE_solution_unique_of_mem_Icc_left |
| 269 | (v := fun t x => A t x) (s := fun _ => univ) |
| 270 | (fun t ht => ((A t).lipschitz.lipschitzOnWith).weaken (hK t ⟨ht.1.le, ht.2⟩)) |
| 271 | hV.continuousOn |
| 272 | (fun t ht => (hV t ⟨ht.1.le, ht.2⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsWithin_Iic ht)) |
| 273 | (fun _ _ => mem_univ _) |
| 274 | hW.continuousOn |
| 275 | (fun t ht => (hW t ⟨ht.1.le, ht.2⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsWithin_Iic ht)) |
| 276 | (fun _ _ => mem_univ _) hb |
| 277 | |
| 278 | omit [CompleteSpace E] in |
| 279 | /-- Superposition: for a *linear* ODE the sum of two solutions is a solution (its value at |
| 280 | the left endpoint is the sum of the two initial values). -/ |
| 281 | theorem IsSolOn.add {A : ℝ → E →L[ℝ] E} {a b : ℝ} {V W : ℝ → E} |
| 282 | (hV : IsSolOn A a b V) (hW : IsSolOn A a b W) : IsSolOn A a b (V + W) := by |
| 283 | intro t ht |
| 284 | have h := (hV t ht).add (hW t ht) |
| 285 | simpa only [Pi.add_apply, map_add] using h |
| 286 | |
| 287 | omit [CompleteSpace E] in |
| 288 | /-- Superposition: a scalar multiple of a solution is a solution. -/ |
| 289 | theorem IsSolOn.const_smul {A : ℝ → E →L[ℝ] E} {a b : ℝ} (c : ℝ) {V : ℝ → E} |
| 290 | (hV : IsSolOn A a b V) : IsSolOn A a b (c • V) := by |
| 291 | intro t ht |
| 292 | have h := (hV t ht).const_smul c |
| 293 | simpa only [Pi.smul_apply, ContinuousLinearMap.map_smul] using h |
| 294 | |
| 295 | variable {A : ℝ → E →L[ℝ] E} {a b : ℝ} {K : ℝ≥0} |
| 296 | |
| 297 | /-- A chosen solution of `V' = A(t) V` on `[a,b]` with prescribed left-endpoint value `x₀`, |
| 298 | extracted from global existence (`exists_hasDerivWithinAt_Icc`). -/ |
| 299 | noncomputable def solOf (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 300 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) (x₀ : E) : ℝ → E := |
| 301 | Classical.choose (exists_hasDerivWithinAt_Icc hab A x₀ hcont hK) |
| 302 | |
| 303 | theorem solOf_left (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 304 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) (x₀ : E) : solOf hab hcont hK x₀ a = x₀ := |
| 305 | (Classical.choose_spec (exists_hasDerivWithinAt_Icc hab A x₀ hcont hK)).1 |
| 306 | |
| 307 | theorem solOf_isSolOn (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 308 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) (x₀ : E) : IsSolOn A a b (solOf hab hcont hK x₀) := |
| 309 | (Classical.choose_spec (exists_hasDerivWithinAt_Icc hab A x₀ hcont hK)).2 |
| 310 | |
| 311 | theorem solOf_add (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 312 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) (x y : E) {t : ℝ} (ht : t ∈ Icc a b) : |
| 313 | solOf hab hcont hK (x + y) t = solOf hab hcont hK x t + solOf hab hcont hK y t := by |
| 314 | have hinit : solOf hab hcont hK (x + y) a = |
| 315 | (solOf hab hcont hK x + solOf hab hcont hK y) a := by |
| 316 | simp [solOf_left] |
| 317 | have heq := IsSolOn.eqOn_of_left hK (solOf_isSolOn hab hcont hK (x + y)) |
| 318 | ((solOf_isSolOn hab hcont hK x).add (solOf_isSolOn hab hcont hK y)) hinit ht |
| 319 | simpa only [Pi.add_apply] using heq |
| 320 | |
| 321 | theorem solOf_smul (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 322 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) (c : ℝ) (x : E) {t : ℝ} (ht : t ∈ Icc a b) : |
| 323 | solOf hab hcont hK (c • x) t = c • solOf hab hcont hK x t := by |
| 324 | have hinit : solOf hab hcont hK (c • x) a = |
| 325 | (c • solOf hab hcont hK x) a := by |
| 326 | simp [solOf_left] |
| 327 | have heq := IsSolOn.eqOn_of_left hK (solOf_isSolOn hab hcont hK (c • x)) |
| 328 | ((solOf_isSolOn hab hcont hK x).const_smul c) hinit ht |
| 329 | simpa only [Pi.smul_apply] using heq |
| 330 | |
| 331 | /-- **The linear flow map** `x₀ ↦ V(b)` of `V' = A(t) V`: the value at the right endpoint of |
| 332 | the solution starting at `x₀`. It is `ℝ`-linear because the ODE is linear (superposition + |
| 333 | forward uniqueness). This is the abstract parallel transport operator. -/ |
| 334 | noncomputable def flowMap (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 335 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) : E →ₗ[ℝ] E where |
| 336 | toFun x₀ := solOf hab hcont hK x₀ b |
| 337 | map_add' x y := by |
| 338 | have hb : b ∈ Icc a b := ⟨hab, le_rfl⟩ |
| 339 | have hleft : solOf hab hcont hK (x + y) a |
| 340 | = (solOf hab hcont hK x + solOf hab hcont hK y) a := by |
| 341 | simp only [Pi.add_apply, solOf_left] |
| 342 | have heq := IsSolOn.eqOn_of_left hK (solOf_isSolOn hab hcont hK (x + y)) |
| 343 | ((solOf_isSolOn hab hcont hK x).add (solOf_isSolOn hab hcont hK y)) hleft hb |
| 344 | simpa only [Pi.add_apply] using heq |
| 345 | map_smul' c x := by |
| 346 | have hb : b ∈ Icc a b := ⟨hab, le_rfl⟩ |
| 347 | have hleft : solOf hab hcont hK (c • x) a = (c • solOf hab hcont hK x) a := by |
| 348 | simp only [Pi.smul_apply, solOf_left] |
| 349 | have heq := IsSolOn.eqOn_of_left hK (solOf_isSolOn hab hcont hK (c • x)) |
| 350 | ((solOf_isSolOn hab hcont hK x).const_smul c) hleft hb |
| 351 | simpa only [RingHom.id_apply, Pi.smul_apply] using heq |
| 352 | |
| 353 | @[simp] theorem flowMap_apply (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 354 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) (x₀ : E) : |
| 355 | flowMap hab hcont hK x₀ = solOf hab hcont hK x₀ b := rfl |
| 356 | |
| 357 | /-- **The flow map is injective.** If two solutions share their right-endpoint value they |
| 358 | share their left-endpoint value (backward uniqueness), so `x₀ ↦ V(b)` is injective. In |
| 359 | finite dimension this upgrades to a linear isomorphism (the parallel transport `P_c`). -/ |
| 360 | theorem flowMap_injective (hab : a ≤ b) (hcont : ContinuousOn A (Icc a b)) |
| 361 | (hK : ∀ t ∈ Icc a b, ‖A t‖₊ ≤ K) : Function.Injective (flowMap hab hcont hK) := by |
| 362 | intro x y hxy |
| 363 | have hb : solOf hab hcont hK x b = solOf hab hcont hK y b := by |
| 364 | simpa only [flowMap_apply] using hxy |
| 365 | have heq := IsSolOn.eqOn_of_right hK (solOf_isSolOn hab hcont hK x) |
| 366 | (solOf_isSolOn hab hcont hK y) hb |
| 367 | have ha := heq (show a ∈ Icc a b from ⟨le_rfl, hab⟩) |
| 368 | rwa [solOf_left, solOf_left] at ha |
| 369 | |
| 370 | end Poincare.ODE.Linear |