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.Frame.Transport |
| 2 | import PoincareLib.Analysis.ODE.LocalFlow.ParametricLinearODE |
| 3 | import Mathlib.Analysis.SpecialFunctions.Trigonometric.InverseDeriv |
| 4 | import PoincareLib.Analysis.Calculus.WithinProduct |
| 5 | |
| 6 | /-! |
| 7 | # Spatial regularity of compact linear transport |
| 8 | |
| 9 | The smooth parameter-dependent operator solution agrees, by uniqueness, with |
| 10 | the compact-time transport. A cosine change of time stays within the compact |
| 11 | interval and proves spatial smoothness at both endpoints without extending |
| 12 | the coefficient. The product derivative formula then proves joint C1 |
| 13 | regularity up to those endpoints. |
| 14 | |
| 15 | This is the local coordinate regularity step in Morgan--Tian (2007), equation |
| 16 | (3.9) and Claim 3.16, p. 42. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option maxHeartbeats 800000 |
| 21 | |
| 22 | open Set |
| 23 | open scoped ContDiff NNReal |
| 24 | |
| 25 | noncomputable section |
| 26 | |
| 27 | namespace PoincareMT.RicciFlow.Frame |
| 28 | |
| 29 | variable {P V : Type*} |
| 30 | [NormedAddCommGroup P] [NormedSpace ℝ P] [FiniteDimensional ℝ P] |
| 31 | [NormedAddCommGroup V] [InnerProductSpace ℝ V] |
| 32 | [CompleteSpace V] [FiniteDimensional ℝ V] |
| 33 | |
| 34 | noncomputable local instance transportEndoNormedAddCommGroup : |
| 35 | NormedAddCommGroup (V →L[ℝ] V) := ContinuousLinearMap.toNormedAddCommGroup |
| 36 | |
| 37 | noncomputable local instance transportEndoNormedSpace : |
| 38 | NormedSpace ℝ (V →L[ℝ] V) := ContinuousLinearMap.toNormedSpace |
| 39 | |
| 40 | noncomputable local instance transportEndoEndoNormedAddCommGroup : |
| 41 | NormedAddCommGroup ((V →L[ℝ] V) →L[ℝ] V →L[ℝ] V) := |
| 42 | ContinuousLinearMap.toNormedAddCommGroup |
| 43 | |
| 44 | noncomputable local instance transportEndoEndoNormedSpace : |
| 45 | NormedSpace ℝ ((V →L[ℝ] V) →L[ℝ] V →L[ℝ] V) := |
| 46 | ContinuousLinearMap.toNormedSpace |
| 47 | |
| 48 | /-- Smooth coefficient families give jointly smooth compact-time transport, |
| 49 | including both compact endpoints, on any surrounding open time interval. -/ |
| 50 | theorem transportCurveOn_contDiffOn |
| 51 | (A : P → ℝ → V →L[ℝ] V) {a b c d : ℝ} (hab : a ≤ b) |
| 52 | (hca : c < a) (hbd : b < d) {U : Set P} (hU : IsOpen U) |
| 53 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Ioo c d)) |
| 54 | (hcont : ∀ p, ContinuousOn (A p) (Icc a b)) {K : P → ℝ≥0} |
| 55 | (hK : ∀ p, ∀ t ∈ Icc a b, ‖A p t‖₊ ≤ K p) : |
| 56 | ContDiffOn ℝ ∞ |
| 57 | (fun q : P × ℝ => transportCurveOn (A q.1) hab (hcont q.1) (hK q.1) q.2) |
| 58 | (U ×ˢ Icc a b) := by |
| 59 | let B : P → ℝ → (V →L[ℝ] V) →L[ℝ] (V →L[ℝ] V) := |
| 60 | fun p t => ContinuousLinearMap.compL ℝ V V V (A p t) |
| 61 | let Ψ := Poincare.ODE.LocalFlow.linearODESolution B c d a |
| 62 | (fun _ : P => ContinuousLinearMap.id ℝ V) |
| 63 | have ha : a ∈ Ioo c d := ⟨hca, hab.trans_lt hbd⟩ |
| 64 | have hsub : Icc a b ⊆ Ioo c d := fun t ht => |
| 65 | ⟨hca.trans_le ht.1, ht.2.trans_lt hbd⟩ |
| 66 | have hB : ContDiffOn ℝ ∞ (Function.uncurry B) (U ×ˢ Ioo c d) := |
| 67 | (ContinuousLinearMap.compL ℝ V V V).contDiff.comp_contDiffOn hA |
| 68 | have hΨ : ContDiffOn ℝ ∞ (Function.uncurry Ψ) (U ×ˢ Ioo c d) := |
| 69 | Poincare.ODE.LocalFlow.linearODESolution_contDiffOn_top ha hU hB contDiffOn_const |
| 70 | have heq : ∀ p ∈ U, |
| 71 | EqOn (transportCurveOn (A p) hab (hcont p) (hK p)) (Ψ p) (Icc a b) := by |
| 72 | intro p hp |
| 73 | apply transportCurveOn_eqOn (A p) hab (hcont p) (hK p) |
| 74 | · exact Poincare.ODE.LocalFlow.linearODESolution_init _ _ _ _ _ _ |
| 75 | · intro t ht |
| 76 | exact (Poincare.ODE.LocalFlow.linearODESolution_hasDerivAt |
| 77 | ha hB.continuousOn hp (hsub ht)).hasDerivWithinAt |
| 78 | exact (hΨ.mono (prod_mono Subset.rfl hsub)).congr |
| 79 | (fun q hq => heq q.1 hq.1 hq.2) |
| 80 | |
| 81 | private def cosineClock (a b s : ℝ) : ℝ := a + (b - a) * (1 - Real.cos s) / 2 |
| 82 | |
| 83 | private theorem cosineClock_mem {a b : ℝ} (hab : a ≤ b) (s : ℝ) : |
| 84 | cosineClock a b s ∈ Icc a b := by |
| 85 | have hc₁ := Real.neg_one_le_cos s |
| 86 | have hc₂ := Real.cos_le_one s |
| 87 | dsimp [cosineClock] |
| 88 | constructor <;> nlinarith |
| 89 | |
| 90 | private theorem cosineClock_hasDerivAt (a b s : ℝ) : |
| 91 | HasDerivAt (cosineClock a b) ((b - a) * Real.sin s / 2) s := by |
| 92 | have hd : HasDerivAt (fun r => a + (b - a) * (1 - Real.cos r) / 2) |
| 93 | ((b - a) * (0 - -Real.sin s) / 2) s := |
| 94 | (((((hasDerivAt_const s (1 : ℝ)).sub (Real.hasDerivAt_cos s)).const_mul |
| 95 | (b - a)).div_const 2).const_add a) |
| 96 | convert hd using 1 <;> first | rfl | ring |
| 97 | |
| 98 | private theorem cosineClock_contDiff (a b : ℝ) : ContDiff ℝ ∞ (cosineClock a b) := by |
| 99 | exact contDiff_const.add |
| 100 | ((contDiff_const.mul (contDiff_const.sub Real.contDiff_cos)).div_const 2) |
| 101 | |
| 102 | private def cosineClockInv (a b t : ℝ) : ℝ := |
| 103 | Real.arccos (1 - 2 * (t - a) / (b - a)) |
| 104 | |
| 105 | private theorem cosineClockInv_continuous (a b : ℝ) : Continuous (cosineClockInv a b) := by |
| 106 | exact Real.continuous_arccos.comp |
| 107 | (continuous_const.sub ((continuous_const.mul (continuous_id.sub continuous_const)).div_const _)) |
| 108 | |
| 109 | private theorem cosineClockInv_mem (a b t : ℝ) : |
| 110 | cosineClockInv a b t ∈ Ioo (-1) (Real.pi + 1) := by |
| 111 | constructor <;> dsimp [cosineClockInv] <;> |
| 112 | linarith [Real.arccos_nonneg (1 - 2 * (t - a) / (b - a)), |
| 113 | Real.arccos_le_pi (1 - 2 * (t - a) / (b - a))] |
| 114 | |
| 115 | private theorem cosineClock_inv {a b t : ℝ} (hab : a < b) (ht : t ∈ Icc a b) : |
| 116 | cosineClock a b (cosineClockInv a b t) = t := by |
| 117 | have hr₁ : -1 ≤ 1 - 2 * (t - a) / (b - a) := by |
| 118 | have hdiv : 2 * (t - a) / (b - a) ≤ 2 := |
| 119 | (div_le_iff₀ (sub_pos.mpr hab)).mpr (by linarith [ht.2]) |
| 120 | linarith |
| 121 | have hr₂ : 1 - 2 * (t - a) / (b - a) ≤ 1 := by |
| 122 | have := div_nonneg (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) |
| 123 | (sub_nonneg.mpr ht.1)) (sub_nonneg.mpr hab.le) |
| 124 | linarith |
| 125 | dsimp [cosineClock, cosineClockInv] |
| 126 | rw [Real.cos_arccos hr₁ hr₂] |
| 127 | field_simp [ne_of_gt (sub_pos.mpr hab)] |
| 128 | ring |
| 129 | |
| 130 | private theorem cosineClockInv_contDiffOn (a b : ℝ) : |
| 131 | ContDiffOn ℝ ∞ (cosineClockInv a b) (Ioo a b) := by |
| 132 | intro t ht |
| 133 | have hab : 0 < b - a := sub_pos.mpr (ht.1.trans ht.2) |
| 134 | have h₁ : -1 < 1 - 2 * (t - a) / (b - a) := by |
| 135 | have hdiv : 2 * (t - a) / (b - a) < 2 := |
| 136 | (div_lt_iff₀ hab).mpr (by linarith [ht.2]) |
| 137 | linarith |
| 138 | have h₂ : 1 - 2 * (t - a) / (b - a) < 1 := by |
| 139 | have hdiv := div_pos (mul_pos (by norm_num : (0 : ℝ) < 2) |
| 140 | (sub_pos.mpr ht.1)) hab |
| 141 | linarith |
| 142 | have haff : ContDiff ℝ ∞ (fun t : ℝ => 1 - 2 * (t - a) / (b - a)) := |
| 143 | contDiff_const.sub ((contDiff_const.mul (contDiff_id.sub contDiff_const)).div_const _) |
| 144 | exact ((Real.contDiffAt_arccos (ne_of_gt h₁) (ne_of_lt h₂)).comp t |
| 145 | haff.contDiffAt).contDiffWithinAt |
| 146 | |
| 147 | /-- A smooth bounded change of time lifts a coefficient smooth on a closed |
| 148 | interval to an equation on an open interval. Its solution is the original |
| 149 | transport composed with that change of time. -/ |
| 150 | private theorem linearODE_cosine_contDiffOn |
| 151 | {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 152 | (A : P → ℝ → G →L[ℝ] G) {a b : ℝ} (hab : a ≤ b) |
| 153 | {U : Set P} (hU : IsOpen U) |
| 154 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 155 | (Φ : P → ℝ → G) (hinit : ContDiffOn ℝ ∞ (fun p => Φ p a) U) |
| 156 | (hsol : ∀ p ∈ U, ∀ t ∈ Icc a b, |
| 157 | HasDerivWithinAt (Φ p) (A p t (Φ p t)) (Icc a b) t) : |
| 158 | ContDiffOn ℝ ∞ |
| 159 | (fun q : P × ℝ => Φ q.1 (cosineClock a b q.2)) |
| 160 | (U ×ˢ Ioo (-1) (Real.pi + 1)) := by |
| 161 | let : NormedAddCommGroup (G →L[ℝ] G) := ContinuousLinearMap.toNormedAddCommGroup |
| 162 | let : NormedSpace ℝ (G →L[ℝ] G) := ContinuousLinearMap.toNormedSpace |
| 163 | let B : P → ℝ → G →L[ℝ] G := fun p s => |
| 164 | ((b - a) * Real.sin s / 2) • A p (cosineClock a b s) |
| 165 | let Ψ := Poincare.ODE.LocalFlow.linearODESolution B (-1) (Real.pi + 1) 0 |
| 166 | (fun p => Φ p a) |
| 167 | have hzero : (0 : ℝ) ∈ Ioo (-1) (Real.pi + 1) := by |
| 168 | constructor <;> linarith [Real.pi_pos] |
| 169 | have harg : ContDiff ℝ ∞ (fun q : P × ℝ => (q.1, cosineClock a b q.2)) := |
| 170 | contDiff_fst.prodMk ((cosineClock_contDiff a b).comp contDiff_snd) |
| 171 | have hcoeff : ContDiffOn ℝ ∞ (fun q : P × ℝ => A q.1 (cosineClock a b q.2)) |
| 172 | (U ×ˢ Ioo (-1) (Real.pi + 1)) := |
| 173 | hA.comp harg.contDiffOn (fun q hq => ⟨hq.1, cosineClock_mem hab q.2⟩) |
| 174 | have hB : ContDiffOn ℝ ∞ (Function.uncurry B) |
| 175 | (U ×ˢ Ioo (-1) (Real.pi + 1)) := |
| 176 | ((contDiffOn_const.mul (Real.contDiff_sin.comp contDiff_snd).contDiffOn).div_const 2).smul |
| 177 | hcoeff |
| 178 | have hΨ : ContDiffOn ℝ ∞ (Function.uncurry Ψ) |
| 179 | (U ×ˢ Ioo (-1) (Real.pi + 1)) := |
| 180 | Poincare.ODE.LocalFlow.linearODESolution_contDiffOn_top hzero hU hB hinit |
| 181 | apply hΨ.congr |
| 182 | intro q hq |
| 183 | have hBc : ContinuousOn (B q.1) (Ioo (-1) (Real.pi + 1)) := by |
| 184 | change ContinuousOn (Function.uncurry B ∘ (fun s : ℝ => (q.1, s))) _ |
| 185 | exact hB.continuousOn.comp |
| 186 | ((continuous_const.prodMk continuous_id).continuousOn) |
| 187 | (fun _ hs => ⟨hq.1, hs⟩) |
| 188 | have hΦ : ∀ s ∈ Ioo (-1) (Real.pi + 1), |
| 189 | HasDerivAt (fun r => Φ q.1 (cosineClock a b r)) |
| 190 | (B q.1 s (Φ q.1 (cosineClock a b s))) s := by |
| 191 | intro s _ |
| 192 | change HasDerivAt (fun r => Φ q.1 (cosineClock a b r)) |
| 193 | (((b - a) * Real.sin s / 2) • |
| 194 | (A q.1 (cosineClock a b s) (Φ q.1 (cosineClock a b s)))) s |
| 195 | exact (hsol q.1 hq.1 _ (cosineClock_mem hab s)).scomp_hasDerivAt s |
| 196 | (cosineClock_hasDerivAt a b s) (cosineClock_mem hab) |
| 197 | have heq := Poincare.ODE.LocalFlow.linearODE_unique_on_Ioo hzero hBc hΦ |
| 198 | (fun s hs => Poincare.ODE.LocalFlow.linearODESolution_hasDerivAt |
| 199 | hzero hB.continuousOn hq.1 hs) |
| 200 | (by |
| 201 | change Φ q.1 (cosineClock a b 0) = Ψ q.1 0 |
| 202 | rw [show cosineClock a b 0 = a by simp [cosineClock]] |
| 203 | exact (Poincare.ODE.LocalFlow.linearODESolution_init B (-1) (Real.pi + 1) 0 |
| 204 | (fun p => Φ p a) q.1).symm) |
| 205 | exact heq hq.2 |
| 206 | |
| 207 | /-- At every time in the closed interval, the constructed transport is smooth |
| 208 | in its spatial parameters. No extension of the coefficient across an endpoint |
| 209 | is needed. -/ |
| 210 | theorem linearODE_contDiffOn_spatial |
| 211 | {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 212 | (A : P → ℝ → G →L[ℝ] G) {a b : ℝ} (hab : a ≤ b) |
| 213 | {U : Set P} (hU : IsOpen U) |
| 214 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 215 | (Φ : P → ℝ → G) (hinit : ContDiffOn ℝ ∞ (fun p => Φ p a) U) |
| 216 | (hsol : ∀ p ∈ U, ∀ t ∈ Icc a b, |
| 217 | HasDerivWithinAt (Φ p) (A p t (Φ p t)) (Icc a b) t) |
| 218 | {t : ℝ} (ht : t ∈ Icc a b) : |
| 219 | ContDiffOn ℝ ∞ (fun p => Φ p t) U := by |
| 220 | rcases eq_or_lt_of_le hab with heq | hlt |
| 221 | · have hta : t = a := by obtain ⟨ht₁, ht₂⟩ := ht; linarith |
| 222 | simpa only [hta] using hinit |
| 223 | let s := cosineClockInv a b t |
| 224 | have hs : s ∈ Ioo (-1) (Real.pi + 1) := cosineClockInv_mem a b t |
| 225 | have hclock : cosineClock a b s = t := cosineClock_inv hlt ht |
| 226 | have harg : ContDiffOn ℝ ∞ (fun p : P => (p, s)) U := |
| 227 | contDiffOn_id.prodMk contDiffOn_const |
| 228 | have hh : ContDiffOn ℝ ∞ |
| 229 | (fun p => Φ p (cosineClock a b s)) U := |
| 230 | (linearODE_cosine_contDiffOn A hab hU hA Φ hinit hsol).comp |
| 231 | harg (fun _ hp => ⟨hp, hs⟩) |
| 232 | simpa only [hclock] using hh |
| 233 | |
| 234 | /-- The compact transport is spatially smooth under a jointly smooth |
| 235 | coefficient, including the two endpoints of the compact time interval. -/ |
| 236 | theorem transportCurveOn_contDiffOn_spatial |
| 237 | (A : P → ℝ → V →L[ℝ] V) {a b : ℝ} (hab : a ≤ b) |
| 238 | {U : Set P} (hU : IsOpen U) |
| 239 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 240 | (hcont : ∀ p, ContinuousOn (A p) (Icc a b)) {K : P → ℝ≥0} |
| 241 | (hK : ∀ p, ∀ t ∈ Icc a b, ‖A p t‖₊ ≤ K p) |
| 242 | {t : ℝ} (ht : t ∈ Icc a b) : |
| 243 | ContDiffOn ℝ ∞ |
| 244 | (fun p => transportCurveOn (A p) hab (hcont p) (hK p) t) U := by |
| 245 | apply linearODE_contDiffOn_spatial |
| 246 | (fun p s => ContinuousLinearMap.compL ℝ V V V (A p s)) hab hU |
| 247 | ((ContinuousLinearMap.compL ℝ V V V).contDiff.comp_contDiffOn hA) |
| 248 | (fun p s => transportCurveOn (A p) hab (hcont p) (hK p) s) ?_ ?_ ht |
| 249 | · apply (contDiffOn_const : |
| 250 | ContDiffOn ℝ ∞ (fun _ : P => ContinuousLinearMap.id ℝ V) U).congr |
| 251 | intro p hp |
| 252 | rw [transportCurveOn_left] |
| 253 | · intro p hp s hs |
| 254 | exact transportCurveOn_hasDerivWithinAt (A p) hab (hcont p) (hK p) hs |
| 255 | |
| 256 | /-- A smooth parameter family of linear equations has jointly continuous |
| 257 | solutions on the closed time interval, including the initial endpoint. -/ |
| 258 | theorem linearODE_continuousOn |
| 259 | {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 260 | (A : P → ℝ → G →L[ℝ] G) {a b : ℝ} (hab : a ≤ b) |
| 261 | {U : Set P} (hU : IsOpen U) |
| 262 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 263 | (Φ : P → ℝ → G) (hinit : ContDiffOn ℝ ∞ (fun p => Φ p a) U) |
| 264 | (hsol : ∀ p ∈ U, ∀ t ∈ Icc a b, |
| 265 | HasDerivWithinAt (Φ p) (A p t (Φ p t)) (Icc a b) t) : |
| 266 | ContinuousOn (Function.uncurry Φ) (U ×ˢ Icc a b) := by |
| 267 | rcases eq_or_lt_of_le hab with heq | hlt |
| 268 | · have h0 : ContinuousOn (fun q : P × ℝ => Φ q.1 a) (U ×ˢ Icc a b) := |
| 269 | hinit.continuousOn.comp continuousOn_fst (fun q hq => hq.1) |
| 270 | apply h0.congr |
| 271 | intro q hq |
| 272 | have ht : q.2 = a := by obtain ⟨ht₁, ht₂⟩ := hq.2; linarith |
| 273 | simp only [Function.uncurry, ht] |
| 274 | have harg : Continuous (fun q : P × ℝ => (q.1, cosineClockInv a b q.2)) := |
| 275 | continuous_fst.prodMk ((cosineClockInv_continuous a b).comp continuous_snd) |
| 276 | have hc : ContinuousOn |
| 277 | (fun q : P × ℝ => Φ q.1 (cosineClock a b (cosineClockInv a b q.2))) |
| 278 | (U ×ˢ Icc a b) := |
| 279 | (linearODE_cosine_contDiffOn A hab hU hA Φ hinit hsol).continuousOn.comp |
| 280 | harg.continuousOn (fun q hq => ⟨hq.1, cosineClockInv_mem a b q.2⟩) |
| 281 | exact hc.congr (fun q hq => by |
| 282 | change Φ q.1 q.2 = Φ q.1 (cosineClock a b (cosineClockInv a b q.2)) |
| 283 | rw [cosineClock_inv hlt hq.2]) |
| 284 | |
| 285 | /-- The spatial derivative of a smooth linear-equation family is jointly |
| 286 | continuous up to the endpoints of the time interval. -/ |
| 287 | theorem linearODE_continuousOn_fderiv_param |
| 288 | {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 289 | (A : P → ℝ → G →L[ℝ] G) {a b : ℝ} (hab : a ≤ b) |
| 290 | {U : Set P} (hU : IsOpen U) |
| 291 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 292 | (Φ : P → ℝ → G) (hinit : ContDiffOn ℝ ∞ (fun p => Φ p a) U) |
| 293 | (hsol : ∀ p ∈ U, ∀ t ∈ Icc a b, |
| 294 | HasDerivWithinAt (Φ p) (A p t (Φ p t)) (Icc a b) t) : |
| 295 | ContinuousOn (fun q : P × ℝ => fderiv ℝ (fun p => Φ p q.2) q.1) (U ×ˢ Icc a b) := by |
| 296 | rcases eq_or_lt_of_le hab with heq | hlt |
| 297 | · have h0 : ContinuousOn (fun q : P × ℝ => fderiv ℝ (fun p => Φ p a) q.1) |
| 298 | (U ×ˢ Icc a b) := |
| 299 | (hinit.fderiv_of_isOpen hU (m := 0) (by simp)).continuousOn.comp |
| 300 | continuousOn_fst (fun q hq => hq.1) |
| 301 | apply h0.congr |
| 302 | intro q hq |
| 303 | have ht : q.2 = a := by obtain ⟨ht₁, ht₂⟩ := hq.2; linarith |
| 304 | change fderiv ℝ (fun p => Φ p q.2) q.1 = fderiv ℝ (fun p => Φ p a) q.1 |
| 305 | rw [ht] |
| 306 | let Ψ : P × ℝ → G := fun q => Φ q.1 (cosineClock a b q.2) |
| 307 | have hΨ : ContDiffOn ℝ ∞ Ψ (U ×ˢ Ioo (-1) (Real.pi + 1)) := |
| 308 | linearODE_cosine_contDiffOn A hab hU hA Φ hinit hsol |
| 309 | have hopen : IsOpen (U ×ˢ Ioo (-1) (Real.pi + 1)) := hU.prod isOpen_Ioo |
| 310 | have hD : ContinuousOn |
| 311 | (fun q => (fderiv ℝ Ψ q).comp (ContinuousLinearMap.inl ℝ P ℝ)) |
| 312 | (U ×ˢ Ioo (-1) (Real.pi + 1)) := |
| 313 | (hΨ.fderiv_of_isOpen hopen (m := 0) (by simp)).continuousOn.clm_comp |
| 314 | continuousOn_const |
| 315 | have harg : Continuous (fun q : P × ℝ => (q.1, cosineClockInv a b q.2)) := |
| 316 | continuous_fst.prodMk ((cosineClockInv_continuous a b).comp continuous_snd) |
| 317 | apply (hD.comp harg.continuousOn |
| 318 | (fun q hq => ⟨hq.1, cosineClockInv_mem a b q.2⟩)).congr |
| 319 | intro q hq |
| 320 | have hpt : (q.1, cosineClockInv a b q.2) ∈ U ×ˢ Ioo (-1) (Real.pi + 1) := |
| 321 | ⟨hq.1, cosineClockInv_mem a b q.2⟩ |
| 322 | have hd := ((hΨ _ hpt).contDiffAt (hopen.mem_nhds hpt)).differentiableAt |
| 323 | (by simp) |
| 324 | have hc := hd.hasFDerivAt.comp q.1 |
| 325 | (hasFDerivAt_prodMk_left (𝕜 := ℝ) q.1 (cosineClockInv a b q.2)) |
| 326 | have heq : Ψ ∘ (fun p : P => (p, cosineClockInv a b q.2)) = fun p => Φ p q.2 := by |
| 327 | funext p |
| 328 | change Φ p (cosineClock a b (cosineClockInv a b q.2)) = Φ p q.2 |
| 329 | rw [cosineClock_inv hlt hq.2] |
| 330 | rw [heq] at hc |
| 331 | exact hc.fderiv |
| 332 | |
| 333 | /-- Joint smoothness on the interior of the closed time interval. -/ |
| 334 | theorem linearODE_contDiffOn_interior |
| 335 | {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 336 | (A : P → ℝ → G →L[ℝ] G) {a b : ℝ} (hab : a ≤ b) |
| 337 | {U : Set P} (hU : IsOpen U) |
| 338 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 339 | (Φ : P → ℝ → G) (hinit : ContDiffOn ℝ ∞ (fun p => Φ p a) U) |
| 340 | (hsol : ∀ p ∈ U, ∀ t ∈ Icc a b, |
| 341 | HasDerivWithinAt (Φ p) (A p t (Φ p t)) (Icc a b) t) : |
| 342 | ContDiffOn ℝ ∞ (Function.uncurry Φ) (U ×ˢ Ioo a b) := by |
| 343 | have harg : ContDiffOn ℝ ∞ |
| 344 | (fun q : P × ℝ => (q.1, cosineClockInv a b q.2)) (U ×ˢ Ioo a b) := |
| 345 | contDiffOn_fst.prodMk ((cosineClockInv_contDiffOn a b).comp contDiffOn_snd |
| 346 | (fun _ hq => hq.2)) |
| 347 | have hc : ContDiffOn ℝ ∞ |
| 348 | (fun q : P × ℝ => Φ q.1 (cosineClock a b (cosineClockInv a b q.2))) |
| 349 | (U ×ˢ Ioo a b) := |
| 350 | (linearODE_cosine_contDiffOn A hab hU hA Φ hinit hsol).comp harg |
| 351 | (fun q hq => ⟨hq.1, cosineClockInv_mem a b q.2⟩) |
| 352 | apply hc.congr |
| 353 | intro q hq |
| 354 | change Φ q.1 q.2 = Φ q.1 (cosineClock a b (cosineClockInv a b q.2)) |
| 355 | rw [cosineClock_inv (hq.2.1.trans hq.2.2) ⟨hq.2.1.le, hq.2.2.le⟩] |
| 356 | |
| 357 | /-- Joint C1 regularity on the closed interval, obtained from the spatial |
| 358 | derivative and the ODE time derivative by the product differentiation lemma. -/ |
| 359 | theorem linearODE_contDiffOn_one |
| 360 | {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 361 | (A : P → ℝ → G →L[ℝ] G) {a b : ℝ} (hab : a ≤ b) |
| 362 | {U : Set P} (hU : IsOpen U) |
| 363 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 364 | (Φ : P → ℝ → G) (hinit : ContDiffOn ℝ ∞ (fun p => Φ p a) U) |
| 365 | (hsol : ∀ p ∈ U, ∀ t ∈ Icc a b, |
| 366 | HasDerivWithinAt (Φ p) (A p t (Φ p t)) (Icc a b) t) : |
| 367 | ContDiffOn ℝ 1 (Function.uncurry Φ) (U ×ˢ Icc a b) := by |
| 368 | rcases eq_or_lt_of_le hab with heq | hlt |
| 369 | · have h0 : ContDiffOn ℝ 1 (fun q : P × ℝ => Φ q.1 a) (U ×ˢ Icc a b) := |
| 370 | (hinit.of_le (by simp)).comp contDiffOn_fst (fun _ hq => hq.1) |
| 371 | apply h0.congr |
| 372 | intro q hq |
| 373 | have ht : q.2 = a := by obtain ⟨ht₁, ht₂⟩ := hq.2; linarith |
| 374 | simp only [Function.uncurry, ht] |
| 375 | let Dx : P × ℝ → P →L[ℝ] G := fun q => fderiv ℝ (fun p => Φ p q.2) q.1 |
| 376 | let Dt : P × ℝ → G := fun q => A q.1 q.2 (Φ q.1 q.2) |
| 377 | have hDx : ContinuousOn Dx (U ×ˢ Icc a b) := |
| 378 | linearODE_continuousOn_fderiv_param A hab hU hA Φ hinit hsol |
| 379 | have hDt : ContinuousOn Dt (U ×ˢ Icc a b) := |
| 380 | hA.continuousOn.clm_apply (linearODE_continuousOn A hab hU hA Φ hinit hsol) |
| 381 | have hDtL : ContinuousOn (fun q => ContinuousLinearMap.toSpanSingleton ℝ (Dt q)) |
| 382 | (U ×ˢ Icc a b) := |
| 383 | ContinuousLinearMap.toSpanSingletonCLE.continuous.comp_continuousOn hDt |
| 384 | let D : P × ℝ → (P × ℝ) →L[ℝ] G := fun q => |
| 385 | (Dx q).coprod (ContinuousLinearMap.toSpanSingleton ℝ (Dt q)) |
| 386 | have hD : ContinuousOn D (U ×ˢ Icc a b) := |
| 387 | (ContinuousLinearMap.coprodEquivL ℝ (E := P) (F := ℝ) (G := G)).continuous.comp_continuousOn |
| 388 | (hDx.prodMk hDtL) |
| 389 | have hder : ∀ q ∈ U ×ˢ Icc a b, |
| 390 | HasFDerivWithinAt (Function.uncurry Φ) (D q) (U ×ˢ Icc a b) q := by |
| 391 | intro q hq |
| 392 | have hs := linearODE_contDiffOn_spatial A hab hU hA Φ hinit hsol hq.2 |
| 393 | have hx : HasFDerivAt (fun p => Φ p q.2) (Dx q) q.1 := |
| 394 | (((hs q.1 hq.1).contDiffAt (hU.mem_nhds hq.1)).differentiableAt (by simp)).hasFDerivAt |
| 395 | exact Poincare.hasFDerivWithinAt_prod_of_continuous_partial (convex_Icc a b) hq hx |
| 396 | (fun r hr => (hsol r.1 hr.1 r.2 hr.2).hasFDerivWithinAt) (hDtL q hq) |
| 397 | have hud : UniqueDiffOn ℝ (U ×ˢ Icc a b) := hU.uniqueDiffOn.prod (uniqueDiffOn_Icc hlt) |
| 398 | change ContDiffOn ℝ ((0 : WithTop ℕ∞) + 1) (Function.uncurry Φ) (U ×ˢ Icc a b) |
| 399 | exact (contDiffOn_succ_iff_hasFDerivWithinAt_of_uniqueDiffOn hud).mpr |
| 400 | ⟨by simp, D, contDiffOn_zero.mpr hD, hder⟩ |
| 401 | |
| 402 | omit [FiniteDimensional ℝ P] in |
| 403 | /-- Taking spatial derivatives preserves joint smoothness on an open spatial |
| 404 | set times a compact time interval. -/ |
| 405 | theorem contDiffOn_fderiv_param_Icc |
| 406 | {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 407 | {a b : ℝ} (hab : a < b) {U : Set P} (hU : IsOpen U) |
| 408 | {f : P × ℝ → G} (hf : ContDiffOn ℝ ∞ f (U ×ˢ Icc a b)) : |
| 409 | ContDiffOn ℝ ∞ (fun q : P × ℝ => fderiv ℝ (fun p => f (p, q.2)) q.1) |
| 410 | (U ×ˢ Icc a b) := by |
| 411 | have hud : UniqueDiffOn ℝ (U ×ˢ Icc a b) := hU.uniqueDiffOn.prod (uniqueDiffOn_Icc hab) |
| 412 | have hD : ContDiffOn ℝ ∞ |
| 413 | (fun q => (fderivWithin ℝ f (U ×ˢ Icc a b) q).comp (ContinuousLinearMap.inl ℝ P ℝ)) |
| 414 | (U ×ˢ Icc a b) := |
| 415 | (hf.fderivWithin hud (m := ∞) (by simp)).clm_comp contDiffOn_const |
| 416 | apply hD.congr |
| 417 | intro q hq |
| 418 | have hprod := (hf.differentiableOn (by simp) q hq).hasFDerivWithinAt |
| 419 | have hp := hprod.comp q.1 |
| 420 | (hasFDerivAt_prodMk_left (𝕜 := ℝ) q.1 q.2).hasFDerivWithinAt |
| 421 | (fun p hp => (show (p, q.2) ∈ U ×ˢ Icc a b from ⟨hp, hq.2⟩)) |
| 422 | exact (hp.hasFDerivAt (hU.mem_nhds hq.1)).fderiv |
| 423 | |
| 424 | end PoincareMT.RicciFlow.Frame |
| 425 | |
| 426 | end |