Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | import Mathlib.Analysis.SpecialFunctions.Pow.Deriv |
| 2 | import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff |
| 3 | import Mathlib.Topology.Order.IntermediateValue |
| 4 | import Mathlib.Tactic.FieldSimp |
| 5 | import Mathlib.Tactic.Linarith |
| 6 | import Mathlib.Tactic.Ring |
| 7 | |
| 8 | /-! |
| 9 | # Analytic existence of the similarity coordinates |
| 10 | |
| 11 | Here `a = 2h`. We construct the unique positive solution of |
| 12 | `τ = q - z² q^a` for `0 < a < 1` and `τ > 0`. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Topology ContDiff |
| 19 | |
| 20 | namespace NavierStokes.SimilarityCoordinates |
| 21 | |
| 22 | def forwardScalar (a z q : ℝ) : ℝ := q - z ^ 2 * q ^ a |
| 23 | |
| 24 | theorem forwardScalar_factor {q : ℝ} (hq : 0 < q) (a z : ℝ) : |
| 25 | forwardScalar a z q = q ^ a * (q ^ (1 - a) - z ^ 2) := by |
| 26 | have hpow : q ^ a * q ^ (1 - a) = q := by |
| 27 | rw [← Real.rpow_add hq] |
| 28 | have he : a + (1 - a) = 1 := by ring |
| 29 | rw [he, Real.rpow_one] |
| 30 | unfold forwardScalar |
| 31 | rw [mul_sub, hpow] |
| 32 | ring |
| 33 | |
| 34 | /-- A positive solution exists. The proof uses the intermediate value |
| 35 | theorem after the change of variable `w = q^(1-a)`. -/ |
| 36 | theorem exists_positive_solution {a τ : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 37 | (hτ : 0 < τ) (z : ℝ) : ∃ q : ℝ, 0 < q ∧ forwardScalar a z q = τ := by |
| 38 | let p : ℝ := a / (1 - a) |
| 39 | have hd : 0 < 1 - a := sub_pos.mpr ha1 |
| 40 | have hp : 0 < p := div_pos ha hd |
| 41 | let w₁ : ℝ := z ^ 2 + τ + 1 |
| 42 | let g : ℝ → ℝ := fun w => w ^ p * (w - z ^ 2) |
| 43 | have hw₁ : 1 ≤ w₁ := by dsimp [w₁]; nlinarith [sq_nonneg z] |
| 44 | have hg : Continuous g := |
| 45 | (Real.continuous_rpow_const hp.le).mul (continuous_id.sub continuous_const) |
| 46 | have hg₀ : g (z ^ 2) = 0 := by simp [g] |
| 47 | have hg₁ : τ ≤ g w₁ := by |
| 48 | have hw : 1 ≤ w₁ ^ p := by |
| 49 | simpa only [Real.one_rpow] using |
| 50 | (Real.rpow_le_rpow (by norm_num : (0 : ℝ) ≤ 1) hw₁ hp.le) |
| 51 | dsimp [g, w₁] at * |
| 52 | nlinarith |
| 53 | have hab : z ^ 2 ≤ w₁ := by dsimp [w₁]; linarith |
| 54 | obtain ⟨w, hw, hgw⟩ := intermediate_value_Icc hab hg.continuousOn |
| 55 | (show τ ∈ Icc (g (z ^ 2)) (g w₁) by rw [hg₀]; exact ⟨hτ.le, hg₁⟩) |
| 56 | have hw₀ : 0 ≤ w := (sq_nonneg z).trans hw.1 |
| 57 | have hwpos : 0 < w := by |
| 58 | by_contra! hn |
| 59 | have hwzero : w = 0 := le_antisymm hn hw₀ |
| 60 | have : g w = 0 := by simp [g, hwzero, Real.zero_rpow hp.ne'] |
| 61 | linarith |
| 62 | let q : ℝ := w ^ (1 - a)⁻¹ |
| 63 | have hq : 0 < q := Real.rpow_pos_of_pos hwpos _ |
| 64 | have hqa : q ^ a = w ^ p := by |
| 65 | dsimp [q, p] |
| 66 | rw [← Real.rpow_mul hw₀] |
| 67 | congr 1 |
| 68 | ring |
| 69 | have hqe : q = w ^ p * w := by |
| 70 | dsimp [q] |
| 71 | have he : (1 - a)⁻¹ = p + 1 := by |
| 72 | dsimp [p] |
| 73 | field_simp; ring |
| 74 | rw [he, Real.rpow_add hwpos, Real.rpow_one] |
| 75 | refine ⟨q, hq, ?_⟩ |
| 76 | unfold forwardScalar |
| 77 | rw [hqa, hqe] |
| 78 | calc |
| 79 | w ^ p * w - z ^ 2 * w ^ p = g w := by dsimp [g]; ring |
| 80 | _ = τ := hgw |
| 81 | |
| 82 | /-- On the region where the scalar map is positive, it is strictly |
| 83 | increasing. No global monotonicity below the positive branch is asserted. -/ |
| 84 | theorem forwardScalar_lt {a z q₁ q₂ : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 85 | (hq₁ : 0 < q₁) (hqq : q₁ < q₂) (hf₁ : 0 < forwardScalar a z q₁) : |
| 86 | forwardScalar a z q₁ < forwardScalar a z q₂ := by |
| 87 | have hq₂ : 0 < q₂ := hq₁.trans hqq |
| 88 | have hp₁ : 0 < q₁ ^ a := Real.rpow_pos_of_pos hq₁ _ |
| 89 | have hp : q₁ ^ a ≤ q₂ ^ a := Real.rpow_le_rpow hq₁.le hqq.le ha.le |
| 90 | have hd : q₁ ^ (1 - a) - z ^ 2 < q₂ ^ (1 - a) - z ^ 2 := |
| 91 | sub_lt_sub_right (Real.rpow_lt_rpow hq₁.le hqq (sub_pos.mpr ha1)) _ |
| 92 | rw [forwardScalar_factor hq₁] at hf₁ ⊢ |
| 93 | rw [forwardScalar_factor hq₂] |
| 94 | have hd₁ : 0 < q₁ ^ (1 - a) - z ^ 2 := by |
| 95 | by_contra! hn |
| 96 | exact (not_lt_of_ge (mul_nonpos_of_nonneg_of_nonpos hp₁.le hn)) hf₁ |
| 97 | calc |
| 98 | q₁ ^ a * (q₁ ^ (1 - a) - z ^ 2) < |
| 99 | q₁ ^ a * (q₂ ^ (1 - a) - z ^ 2) := mul_lt_mul_of_pos_left hd hp₁ |
| 100 | _ ≤ q₂ ^ a * (q₂ ^ (1 - a) - z ^ 2) := |
| 101 | mul_le_mul_of_nonneg_right hp (hd₁.le.trans hd.le) |
| 102 | |
| 103 | theorem positive_solution_unique {a τ z q₁ q₂ : ℝ} |
| 104 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) |
| 105 | (hq₁ : 0 < q₁) (hq₂ : 0 < q₂) |
| 106 | (he₁ : forwardScalar a z q₁ = τ) (he₂ : forwardScalar a z q₂ = τ) : q₁ = q₂ := by |
| 107 | rcases lt_trichotomy q₁ q₂ with hlt | heq | hgt |
| 108 | · have := forwardScalar_lt ha ha1 hq₁ hlt (by rwa [he₁]) |
| 109 | rw [he₁, he₂] at this |
| 110 | exact (lt_irrefl τ this).elim |
| 111 | · exact heq |
| 112 | · have := forwardScalar_lt ha ha1 hq₂ hgt (by rwa [he₂]) |
| 113 | rw [he₁, he₂] at this |
| 114 | exact (lt_irrefl τ this).elim |
| 115 | |
| 116 | theorem existsUnique_positive_solution {a τ : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 117 | (hτ : 0 < τ) (z : ℝ) : ∃! q : ℝ, 0 < q ∧ forwardScalar a z q = τ := by |
| 118 | obtain ⟨q, hq, he⟩ := exists_positive_solution ha ha1 hτ z |
| 119 | exact ⟨q, ⟨hq, he⟩, fun q' hq' => |
| 120 | positive_solution_unique ha ha1 hτ hq'.1 hq hq'.2 he⟩ |
| 121 | |
| 122 | /-- The unique positive coordinate, with value `1` outside the intended |
| 123 | parameter domain. Only its restriction to that open domain is used. -/ |
| 124 | def coordinateQ (a : ℝ) (p : ℝ × ℝ) : ℝ := |
| 125 | if hp : 0 < a ∧ a < 1 ∧ 0 < p.1 then |
| 126 | Classical.choose (exists_positive_solution hp.1 hp.2.1 hp.2.2 p.2) |
| 127 | else 1 |
| 128 | |
| 129 | theorem coordinateQ_spec {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 130 | {p : ℝ × ℝ} (hp : 0 < p.1) : |
| 131 | 0 < coordinateQ a p ∧ forwardScalar a p.2 (coordinateQ a p) = p.1 := by |
| 132 | simp only [coordinateQ, dite_eq_left (show 0 < a ∧ a < 1 ∧ 0 < p.1 from ⟨ha, ha1, hp⟩)] |
| 133 | exact Classical.choose_spec (exists_positive_solution ha ha1 hp p.2) |
| 134 | |
| 135 | theorem eq_coordinateQ {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 136 | {p : ℝ × ℝ} (hp : 0 < p.1) {q : ℝ} (hq : 0 < q) |
| 137 | (he : forwardScalar a p.2 q = p.1) : q = coordinateQ a p := by |
| 138 | have hs := coordinateQ_spec ha ha1 hp |
| 139 | exact positive_solution_unique ha ha1 hp hq hs.1 he hs.2 |
| 140 | |
| 141 | def scalarSlope (a z q : ℝ) : ℝ := 1 - z ^ 2 * a * q ^ (a - 1) |
| 142 | |
| 143 | theorem scalarSlope_pos {a z q : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 144 | (hq : 0 < q) (hf : 0 < forwardScalar a z q) : 0 < scalarSlope a z q := by |
| 145 | have hsmall : z ^ 2 * q ^ a / q < 1 := by |
| 146 | apply (div_lt_one hq).mpr |
| 147 | dsimp [forwardScalar] at hf |
| 148 | linarith |
| 149 | have hprod := mul_nonneg ha.le (sub_nonneg.mpr hsmall.le) |
| 150 | have hpos : 0 < 1 - a * (z ^ 2 * q ^ a / q) := by nlinarith |
| 151 | unfold scalarSlope |
| 152 | rw [Real.rpow_sub_one hq.ne'] |
| 153 | convert! hpos using 1 |
| 154 | ring |
| 155 | |
| 156 | /-- The forward map whose inverse supplies smooth dependence on `(τ,z)`. -/ |
| 157 | def forwardMap (a : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := |
| 158 | (forwardScalar a p.2 p.1, p.2) |
| 159 | |
| 160 | /-- Explicit invertible triangular linear map used by the inverse theorem. -/ |
| 161 | def triangularEquiv (m b : ℝ) (hm : m ≠ 0) : (ℝ × ℝ) ≃L[ℝ] (ℝ × ℝ) where |
| 162 | toFun v := (m * v.1 + b * v.2, v.2) |
| 163 | invFun w := ((w.1 - b * w.2) / m, w.2) |
| 164 | left_inv := by |
| 165 | intro v |
| 166 | apply Prod.ext |
| 167 | · dsimp |
| 168 | field_simp; ring |
| 169 | · rfl |
| 170 | right_inv := by |
| 171 | intro v |
| 172 | apply Prod.ext |
| 173 | · dsimp |
| 174 | field_simp; ring |
| 175 | · rfl |
| 176 | map_add' := by |
| 177 | intro v w |
| 178 | apply Prod.ext |
| 179 | · dsimp |
| 180 | ring |
| 181 | · rfl |
| 182 | map_smul' := by |
| 183 | intro c v |
| 184 | apply Prod.ext |
| 185 | · simp only [Prod.smul_fst, Prod.smul_snd, smul_eq_mul, RingHom.id_apply] |
| 186 | ring |
| 187 | · rfl |
| 188 | continuous_toFun := |
| 189 | ((continuous_const.mul continuous_fst).add |
| 190 | (continuous_const.mul continuous_snd)).prodMk continuous_snd |
| 191 | continuous_invFun := |
| 192 | ((continuous_fst.sub (continuous_const.mul continuous_snd)).div_const m).prodMk |
| 193 | continuous_snd |
| 194 | |
| 195 | theorem forwardMap_smooth {a : ℝ} {p : ℝ × ℝ} (hp : p.1 ≠ 0) : |
| 196 | ContDiffAt ℝ ∞ (forwardMap a) p := by |
| 197 | exact (contDiffAt_fst.sub |
| 198 | ((contDiffAt_snd.pow 2).mul (contDiffAt_fst.rpow_const_of_ne hp))).prodMk |
| 199 | contDiffAt_snd |
| 200 | |
| 201 | theorem forwardMap_hasFDerivAt {a : ℝ} {p : ℝ × ℝ} (hp : p.1 ≠ 0) |
| 202 | (hm : scalarSlope a p.2 p.1 ≠ 0) : |
| 203 | HasFDerivAt (forwardMap a) |
| 204 | (triangularEquiv (scalarSlope a p.2 p.1) (-2 * p.2 * p.1 ^ a) hm : |
| 205 | (ℝ × ℝ) →L[ℝ] (ℝ × ℝ)) p := by |
| 206 | have hf : HasFDerivAt (fun v : ℝ × ℝ => v.1) |
| 207 | (ContinuousLinearMap.fst ℝ ℝ ℝ) p := hasFDerivAt_fst |
| 208 | have hz : HasFDerivAt (fun v : ℝ × ℝ => v.2) |
| 209 | (ContinuousLinearMap.snd ℝ ℝ ℝ) p := hasFDerivAt_snd |
| 210 | have hder := (hf.sub ((hz.mul hz).mul (hf.rpow_const (p := a) (Or.inl hp)))).prodMk hz |
| 211 | have hlin : |
| 212 | (triangularEquiv (scalarSlope a p.2 p.1) (-2 * p.2 * p.1 ^ a) hm : |
| 213 | (ℝ × ℝ) →L[ℝ] (ℝ × ℝ)) = |
| 214 | ((ContinuousLinearMap.fst ℝ ℝ ℝ - |
| 215 | ((p.2 * p.2) • ((a * p.1 ^ (a - 1)) • ContinuousLinearMap.fst ℝ ℝ ℝ) + |
| 216 | p.1 ^ a • (p.2 • ContinuousLinearMap.snd ℝ ℝ ℝ + |
| 217 | p.2 • ContinuousLinearMap.snd ℝ ℝ ℝ))).prod |
| 218 | (ContinuousLinearMap.snd ℝ ℝ ℝ)) := by |
| 219 | apply ContinuousLinearMap.ext |
| 220 | intro v |
| 221 | apply Prod.ext |
| 222 | · change (1 - p.2 ^ 2 * a * p.1 ^ (a - 1)) * v.1 + |
| 223 | (-2 * p.2 * p.1 ^ a) * v.2 = |
| 224 | v.1 - ((p.2 * p.2) * ((a * p.1 ^ (a - 1)) * v.1) + |
| 225 | p.1 ^ a * (p.2 * v.2 + p.2 * v.2)) |
| 226 | ring |
| 227 | · rfl |
| 228 | rw [hlin] |
| 229 | change HasFDerivAt (fun v : ℝ × ℝ => (v.1 - v.2 ^ 2 * v.1 ^ a, v.2)) _ p |
| 230 | simpa only [Pi.mul_apply, Pi.sub_apply, pow_two] using hder |
| 231 | |
| 232 | def inverseMap (a : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := (coordinateQ a p, p.2) |
| 233 | |
| 234 | theorem inverseMap_forwardMap {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 235 | {p : ℝ × ℝ} (hq : 0 < p.1) (hF : 0 < forwardScalar a p.2 p.1) : |
| 236 | inverseMap a (forwardMap a p) = p := by |
| 237 | apply Prod.ext |
| 238 | · exact (eq_coordinateQ ha ha1 hF hq rfl).symm |
| 239 | · rfl |
| 240 | |
| 241 | theorem eventually_inverseMap_forwardMap {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 242 | {p : ℝ × ℝ} (hq : 0 < p.1) (hF : 0 < forwardScalar a p.2 p.1) : |
| 243 | ∀ᶠ x in 𝓝 p, inverseMap a (forwardMap a x) = x := by |
| 244 | have hqev : ∀ᶠ x : ℝ × ℝ in 𝓝 p, 0 < x.1 := |
| 245 | continuousAt_fst.eventually (Ioi_mem_nhds hq) |
| 246 | have hFev : ∀ᶠ x : ℝ × ℝ in 𝓝 p, 0 < forwardScalar a x.2 x.1 := |
| 247 | (forwardMap_smooth hq.ne').continuousAt.fst.eventually (Ioi_mem_nhds hF) |
| 248 | filter_upwards [hqev, hFev] with x hqx hFx |
| 249 | exact inverseMap_forwardMap ha ha1 hqx hFx |
| 250 | |
| 251 | /-- The canonical inverse is smooth at every image point on the positive |
| 252 | branch, by the actual inverse function theorem. -/ |
| 253 | theorem inverseMap_smooth_at_image {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 254 | {p : ℝ × ℝ} (hq : 0 < p.1) (hF : 0 < forwardScalar a p.2 p.1) : |
| 255 | ContDiffAt ℝ ∞ (inverseMap a) (forwardMap a p) := by |
| 256 | have hm := (scalarSlope_pos ha ha1 hq hF).ne' |
| 257 | have hsm := forwardMap_smooth (a := a) hq.ne' |
| 258 | have hder := forwardMap_hasFDerivAt (a := a) hq.ne' hm |
| 259 | have horder : (∞ : WithTop ℕ∞) ≠ 0 := by simp |
| 260 | have hs := hsm.hasStrictFDerivAt' hder horder |
| 261 | have heq := hs.localInverse_unique (eventually_inverseMap_forwardMap ha ha1 hq hF) |
| 262 | exact (hsm.to_localInverse hder horder).congr_of_eventuallyEq heq |
| 263 | |
| 264 | theorem inverseMap_hasFDerivAt_image {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 265 | {p : ℝ × ℝ} (hq : 0 < p.1) (hF : 0 < forwardScalar a p.2 p.1) : |
| 266 | HasFDerivAt (inverseMap a) |
| 267 | ((triangularEquiv (scalarSlope a p.2 p.1) (-2 * p.2 * p.1 ^ a) |
| 268 | (scalarSlope_pos ha ha1 hq hF).ne').symm : (ℝ × ℝ) →L[ℝ] (ℝ × ℝ)) |
| 269 | (forwardMap a p) := by |
| 270 | have hsm := forwardMap_smooth (a := a) hq.ne' |
| 271 | have hder := forwardMap_hasFDerivAt (a := a) hq.ne' |
| 272 | (scalarSlope_pos ha ha1 hq hF).ne' |
| 273 | have hs := hsm.hasStrictFDerivAt' hder (by simp) |
| 274 | exact (hs.to_local_left_inverse |
| 275 | (eventually_inverseMap_forwardMap ha ha1 hq hF)).hasFDerivAt |
| 276 | |
| 277 | /-- Smooth dependence on both physical parameters `(τ,z)` for `τ>0`. -/ |
| 278 | theorem coordinateQ_smooth {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 279 | {p : ℝ × ℝ} (hp : 0 < p.1) : ContDiffAt ℝ ∞ (coordinateQ a) p := by |
| 280 | have hspec := coordinateQ_spec ha ha1 hp |
| 281 | have hF : 0 < forwardScalar a p.2 (coordinateQ a p) := by rwa [hspec.2] |
| 282 | have hsm := inverseMap_smooth_at_image ha ha1 (p := (coordinateQ a p, p.2)) hspec.1 hF |
| 283 | have himage : forwardMap a (coordinateQ a p, p.2) = p := by |
| 284 | exact Prod.ext hspec.2 rfl |
| 285 | rw [himage] at hsm |
| 286 | exact hsm.fst |
| 287 | |
| 288 | theorem coordinateQ_smoothOn {a : ℝ} (ha : 0 < a) (ha1 : a < 1) : |
| 289 | ContDiffOn ℝ ∞ (coordinateQ a) {p : ℝ × ℝ | 0 < p.1} := by |
| 290 | intro p hp |
| 291 | exact (coordinateQ_smooth ha ha1 hp).contDiffWithinAt |
| 292 | |
| 293 | /-- Full Fréchet derivative of the actual implicitly defined coordinate. -/ |
| 294 | theorem coordinateQ_fderiv_apply {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 295 | {p : ℝ × ℝ} (hp : 0 < p.1) (v : ℝ × ℝ) : |
| 296 | fderiv ℝ (coordinateQ a) p v = |
| 297 | (v.1 + 2 * p.2 * coordinateQ a p ^ a * v.2) / |
| 298 | scalarSlope a p.2 (coordinateQ a p) := by |
| 299 | have hspec := coordinateQ_spec ha ha1 hp |
| 300 | have hF : 0 < forwardScalar a p.2 (coordinateQ a p) := by rwa [hspec.2] |
| 301 | have hd := inverseMap_hasFDerivAt_image ha ha1 |
| 302 | (p := (coordinateQ a p, p.2)) hspec.1 hF |
| 303 | have himage : forwardMap a (coordinateQ a p, p.2) = p := Prod.ext hspec.2 rfl |
| 304 | rw [himage] at hd |
| 305 | change fderiv ℝ (fun x => (inverseMap a x).1) p v = _ |
| 306 | rw [hd.fst.fderiv] |
| 307 | change (v.1 - (-2 * p.2 * coordinateQ a p ^ a) * v.2) / |
| 308 | scalarSlope a p.2 (coordinateQ a p) = _ |
| 309 | ring |
| 310 | |
| 311 | theorem coordinateQ_hasDerivAt_tau {a τ z : ℝ} |
| 312 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 313 | HasDerivAt (fun t => coordinateQ a (t, z)) |
| 314 | (1 / scalarSlope a z (coordinateQ a (τ, z))) τ := by |
| 315 | have hd := ((coordinateQ_smooth ha ha1 (p := (τ, z)) hτ).differentiableAt (by simp)).hasFDerivAt |
| 316 | have hc := hd.comp_hasDerivAt τ ((hasDerivAt_id τ).prodMk (hasDerivAt_const τ z)) |
| 317 | rw [coordinateQ_fderiv_apply ha ha1 hτ] at hc |
| 318 | simpa only [Function.comp_def, id_eq, Prod.fst, Prod.snd, mul_zero, add_zero] using hc |
| 319 | |
| 320 | theorem coordinateQ_hasDerivAt_z {a τ z : ℝ} |
| 321 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 322 | HasDerivAt (fun x => coordinateQ a (τ, x)) |
| 323 | (2 * z * coordinateQ a (τ, z) ^ a / |
| 324 | scalarSlope a z (coordinateQ a (τ, z))) z := by |
| 325 | have hd := ((coordinateQ_smooth ha ha1 (p := (τ, z)) hτ).differentiableAt (by simp)).hasFDerivAt |
| 326 | have hc := hd.comp_hasDerivAt z ((hasDerivAt_const z τ).prodMk (hasDerivAt_id z)) |
| 327 | rw [coordinateQ_fderiv_apply ha ha1 hτ] at hc |
| 328 | simpa only [Function.comp_def, id_eq, Prod.fst, Prod.snd, mul_one, zero_add] using hc |
| 329 | |
| 330 | /-- The physical time is `t=1-τ`, giving the required negative sign. -/ |
| 331 | theorem coordinateQ_hasDerivAt_time {a t z : ℝ} |
| 332 | (ha : 0 < a) (ha1 : a < 1) (ht : t < 1) : |
| 333 | HasDerivAt (fun s => coordinateQ a (1 - s, z)) |
| 334 | (-1 / scalarSlope a z (coordinateQ a (1 - t, z))) t := by |
| 335 | have hc := (coordinateQ_hasDerivAt_tau (z := z) ha ha1 (sub_pos.mpr ht)).comp t |
| 336 | ((hasDerivAt_const t (1 : ℝ)).sub (hasDerivAt_id t)) |
| 337 | convert! hc using 1 |
| 338 | ring |
| 339 | |
| 340 | def coordinateEta (a : ℝ) (p : ℝ × ℝ) : ℝ := |
| 341 | p.2 / coordinateQ a p ^ ((1 - a) / 2) |
| 342 | |
| 343 | theorem coordinateEta_smooth {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 344 | {p : ℝ × ℝ} (hp : 0 < p.1) : ContDiffAt ℝ ∞ (coordinateEta a) p := by |
| 345 | have hq := (coordinateQ_spec ha ha1 hp).1 |
| 346 | exact contDiffAt_snd.div ((coordinateQ_smooth ha ha1 hp).rpow_const_of_ne hq.ne') |
| 347 | (Real.rpow_pos_of_pos hq _).ne' |
| 348 | |
| 349 | theorem coordinateEta_sq {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 350 | {p : ℝ × ℝ} (hp : 0 < p.1) : |
| 351 | coordinateEta a p ^ 2 = p.2 ^ 2 * coordinateQ a p ^ a / coordinateQ a p := by |
| 352 | have hq := (coordinateQ_spec ha ha1 hp).1 |
| 353 | have hpow := (Real.rpow_pos_of_pos hq a).ne' |
| 354 | unfold coordinateEta |
| 355 | rw [div_pow, ← Real.rpow_mul_natCast hq.le] |
| 356 | have he : ((1 - a) / 2) * (2 : ℕ) = 1 - a := by ring |
| 357 | rw [he, Real.rpow_sub hq, Real.rpow_one] |
| 358 | field_simp |
| 359 | |
| 360 | theorem coordinateEta_sq_lt_one {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 361 | {p : ℝ × ℝ} (hp : 0 < p.1) : coordinateEta a p ^ 2 < 1 := by |
| 362 | have hq := coordinateQ_spec ha ha1 hp |
| 363 | rw [coordinateEta_sq ha ha1 hp] |
| 364 | apply (div_lt_one hq.1).mpr |
| 365 | dsimp [forwardScalar] at hq |
| 366 | linarith [hq.2] |
| 367 | |
| 368 | theorem coordinateEta_abs_lt_one {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 369 | {p : ℝ × ℝ} (hp : 0 < p.1) : |coordinateEta a p| < 1 := by |
| 370 | have hs := coordinateEta_sq_lt_one ha ha1 hp |
| 371 | apply abs_lt.mpr |
| 372 | constructor <;> nlinarith |
| 373 | |
| 374 | /-- The branch lies strictly beyond the manuscript's threshold |
| 375 | `|z|^(1/D)`, where `D=(1-a)/2`. -/ |
| 376 | theorem coordinateQ_above_threshold {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 377 | {p : ℝ × ℝ} (hp : 0 < p.1) : |
| 378 | |p.2| ^ (((1 - a) / 2)⁻¹) < coordinateQ a p := by |
| 379 | have hq := (coordinateQ_spec ha ha1 hp).1 |
| 380 | have hd : 0 < (1 - a) / 2 := by linarith |
| 381 | have hpow : 0 < coordinateQ a p ^ ((1 - a) / 2) := Real.rpow_pos_of_pos hq _ |
| 382 | have hη := coordinateEta_abs_lt_one ha ha1 hp |
| 383 | unfold coordinateEta at hη |
| 384 | rw [abs_div, abs_of_pos hpow] at hη |
| 385 | exact (Real.rpow_inv_lt_iff_of_pos (abs_nonneg p.2) hq.le hd).mpr |
| 386 | ((div_lt_one hpow).mp hη) |
| 387 | |
| 388 | /-- Both implicit descriptions in equation (3) agree for the constructed |
| 389 | coordinates: `τ=q(1-η²)`. -/ |
| 390 | theorem tau_coordinate_identity {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 391 | {p : ℝ × ℝ} (hp : 0 < p.1) : |
| 392 | p.1 = coordinateQ a p * (1 - coordinateEta a p ^ 2) := by |
| 393 | have hq := coordinateQ_spec ha ha1 hp |
| 394 | calc |
| 395 | p.1 = coordinateQ a p - p.2 ^ 2 * coordinateQ a p ^ a := hq.2.symm |
| 396 | _ = _ := by |
| 397 | rw [coordinateEta_sq ha ha1 hp] |
| 398 | field_simp [hq.1.ne'] |
| 399 | |
| 400 | /-- The actual Jacobian denominator equals the manuscript's `L`. -/ |
| 401 | theorem scalarSlope_eq_L {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 402 | {p : ℝ × ℝ} (hp : 0 < p.1) : |
| 403 | scalarSlope a p.2 (coordinateQ a p) = 1 - a * coordinateEta a p ^ 2 := by |
| 404 | have hq := (coordinateQ_spec ha ha1 hp).1 |
| 405 | unfold scalarSlope |
| 406 | rw [Real.rpow_sub_one hq.ne', coordinateEta_sq ha ha1 hp] |
| 407 | ring |
| 408 | |
| 409 | theorem coordinateQ_hasDerivAt_tau_L {a τ z : ℝ} |
| 410 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 411 | HasDerivAt (fun t => coordinateQ a (t, z)) |
| 412 | (1 / (1 - a * coordinateEta a (τ, z) ^ 2)) τ := by |
| 413 | have hc := coordinateQ_hasDerivAt_tau (z := z) ha ha1 hτ |
| 414 | rwa [scalarSlope_eq_L ha ha1 (p := (τ, z)) hτ] at hc |
| 415 | |
| 416 | theorem coordinateQ_hasDerivAt_time_L {a t z : ℝ} |
| 417 | (ha : 0 < a) (ha1 : a < 1) (ht : t < 1) : |
| 418 | HasDerivAt (fun s => coordinateQ a (1 - s, z)) |
| 419 | (-1 / (1 - a * coordinateEta a (1 - t, z) ^ 2)) t := by |
| 420 | have hc := coordinateQ_hasDerivAt_time (z := z) ha ha1 ht |
| 421 | rwa [scalarSlope_eq_L ha ha1 (p := (1 - t, z)) (sub_pos.mpr ht)] at hc |
| 422 | |
| 423 | theorem coordinateEta_hasDerivAt_tau {a τ z : ℝ} |
| 424 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 425 | HasDerivAt (fun t => coordinateEta a (t, z)) |
| 426 | (-((1 - a) / 2) * coordinateEta a (τ, z) / |
| 427 | (coordinateQ a (τ, z) * scalarSlope a z (coordinateQ a (τ, z)))) τ := by |
| 428 | have hq := coordinateQ_spec ha ha1 (p := (τ, z)) hτ |
| 429 | have hm := (scalarSlope_pos ha ha1 hq.1 (by rwa [hq.2])).ne' |
| 430 | have hpow := (Real.rpow_pos_of_pos hq.1 ((1 - a) / 2)).ne' |
| 431 | have hc := (hasDerivAt_const τ z).div |
| 432 | ((coordinateQ_hasDerivAt_tau ha ha1 hτ).rpow_const |
| 433 | (p := (1 - a) / 2) (Or.inl hq.1.ne')) hpow |
| 434 | change HasDerivAt (fun t => z / coordinateQ a (t, z) ^ ((1 - a) / 2)) _ τ |
| 435 | convert! hc using 1 |
| 436 | unfold coordinateEta |
| 437 | rw [Real.rpow_sub_one hq.1.ne'] |
| 438 | field_simp [hq.1.ne', hpow, hm]; ring |
| 439 | |
| 440 | theorem coordinateEta_hasDerivAt_z {a τ z : ℝ} |
| 441 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 442 | HasDerivAt (fun x => coordinateEta a (τ, x)) |
| 443 | ((1 - coordinateEta a (τ, z) ^ 2) / |
| 444 | (coordinateQ a (τ, z) ^ ((1 - a) / 2) * |
| 445 | scalarSlope a z (coordinateQ a (τ, z)))) z := by |
| 446 | have hq := coordinateQ_spec ha ha1 (p := (τ, z)) hτ |
| 447 | have hm := (scalarSlope_pos ha ha1 hq.1 (by rwa [hq.2])).ne' |
| 448 | have hpow := (Real.rpow_pos_of_pos hq.1 ((1 - a) / 2)).ne' |
| 449 | have hc := (hasDerivAt_id z).div |
| 450 | ((coordinateQ_hasDerivAt_z ha ha1 hτ).rpow_const |
| 451 | (p := (1 - a) / 2) (Or.inl hq.1.ne')) hpow |
| 452 | change HasDerivAt (fun x => x / coordinateQ a (τ, x) ^ ((1 - a) / 2)) _ z |
| 453 | convert! hc using 1 |
| 454 | simp only [id_eq] |
| 455 | rw [coordinateEta_sq ha ha1 hτ, Real.rpow_sub_one hq.1.ne'] |
| 456 | field_simp [hq.1.ne', hpow, hm] |
| 457 | unfold scalarSlope |
| 458 | rw [Real.rpow_sub_one hq.1.ne'] |
| 459 | field_simp [hq.1.ne']; ring |
| 460 | |
| 461 | theorem coordinateEta_hasDerivAt_time {a t z : ℝ} |
| 462 | (ha : 0 < a) (ha1 : a < 1) (ht : t < 1) : |
| 463 | HasDerivAt (fun s => coordinateEta a (1 - s, z)) |
| 464 | (((1 - a) / 2) * coordinateEta a (1 - t, z) / |
| 465 | (coordinateQ a (1 - t, z) * |
| 466 | (1 - a * coordinateEta a (1 - t, z) ^ 2))) t := by |
| 467 | have hc := (coordinateEta_hasDerivAt_tau (z := z) ha ha1 (sub_pos.mpr ht)).comp t |
| 468 | ((hasDerivAt_const t (1 : ℝ)).sub (hasDerivAt_id t)) |
| 469 | rw [scalarSlope_eq_L ha ha1 (p := (1 - t, z)) (sub_pos.mpr ht)] at hc |
| 470 | convert! hc using 1 |
| 471 | ring |
| 472 | |
| 473 | theorem coordinateEta_hasDerivAt_z_L {a τ z : ℝ} |
| 474 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 475 | HasDerivAt (fun x => coordinateEta a (τ, x)) |
| 476 | ((1 - coordinateEta a (τ, z) ^ 2) / |
| 477 | (coordinateQ a (τ, z) ^ ((1 - a) / 2) * |
| 478 | (1 - a * coordinateEta a (τ, z) ^ 2))) z := by |
| 479 | have hc := coordinateEta_hasDerivAt_z (z := z) ha ha1 hτ |
| 480 | rwa [scalarSlope_eq_L ha ha1 (p := (τ, z)) hτ] at hc |
| 481 | |
| 482 | theorem coordinateQ_hasDerivAt_z_L {a τ z : ℝ} |
| 483 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 484 | HasDerivAt (fun x => coordinateQ a (τ, x)) |
| 485 | (2 * coordinateEta a (τ, z) * coordinateQ a (τ, z) ^ (1 - (1 - a) / 2) / |
| 486 | (1 - a * coordinateEta a (τ, z) ^ 2)) z := by |
| 487 | have hq := coordinateQ_spec ha ha1 (p := (τ, z)) hτ |
| 488 | have hpow := (Real.rpow_pos_of_pos hq.1 ((1 - a) / 2)).ne' |
| 489 | have hc := coordinateQ_hasDerivAt_z (z := z) ha ha1 hτ |
| 490 | rw [scalarSlope_eq_L ha ha1 (p := (τ, z)) hτ] at hc |
| 491 | have hnum : 2 * coordinateEta a (τ, z) * coordinateQ a (τ, z) ^ (1 - (1 - a) / 2) = |
| 492 | 2 * z * coordinateQ a (τ, z) ^ a := by |
| 493 | have he : 1 - (1 - a) / 2 = a + (1 - a) / 2 := by ring |
| 494 | rw [he, Real.rpow_add hq.1] |
| 495 | unfold coordinateEta |
| 496 | field_simp [hpow] |
| 497 | rw [hnum] |
| 498 | exact hc |
| 499 | |
| 500 | def coordinateX (a s : ℝ) (p : ℝ × ℝ) : ℝ := s / coordinateQ a p |
| 501 | |
| 502 | theorem coordinateX_smooth {a s : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 503 | {p : ℝ × ℝ} (hp : 0 < p.1) : ContDiffAt ℝ ∞ (coordinateX a s) p := by |
| 504 | exact contDiffAt_const.div (coordinateQ_smooth ha ha1 hp) |
| 505 | (coordinateQ_spec ha ha1 hp).1.ne' |
| 506 | |
| 507 | theorem coordinateX_hasDerivAt_time {a s t z : ℝ} |
| 508 | (ha : 0 < a) (ha1 : a < 1) (ht : t < 1) : |
| 509 | HasDerivAt (fun u => coordinateX a s (1 - u, z)) |
| 510 | (coordinateX a s (1 - t, z) / |
| 511 | (coordinateQ a (1 - t, z) * (1 - a * coordinateEta a (1 - t, z) ^ 2))) t := by |
| 512 | have hτ : 0 < 1 - t := sub_pos.mpr ht |
| 513 | have hq := coordinateQ_spec ha ha1 (p := (1 - t, z)) hτ |
| 514 | have hm : 1 - a * coordinateEta a (1 - t, z) ^ 2 ≠ 0 := by |
| 515 | rw [← scalarSlope_eq_L ha ha1 (sub_pos.mpr ht)] |
| 516 | exact (scalarSlope_pos ha ha1 hq.1 (by rwa [hq.2])).ne' |
| 517 | have hc := (hasDerivAt_const t s).div (coordinateQ_hasDerivAt_time_L ha ha1 ht) hq.1.ne' |
| 518 | change HasDerivAt (fun u => s / coordinateQ a (1 - u, z)) _ t |
| 519 | convert! hc using 1 |
| 520 | unfold coordinateX |
| 521 | field_simp [hq.1.ne', hm] |
| 522 | ring_nf |
| 523 | |
| 524 | theorem coordinateX_hasDerivAt_z {a s τ z : ℝ} |
| 525 | (ha : 0 < a) (ha1 : a < 1) (hτ : 0 < τ) : |
| 526 | HasDerivAt (fun x => coordinateX a s (τ, x)) |
| 527 | (-2 * coordinateEta a (τ, z) * coordinateX a s (τ, z) / |
| 528 | (coordinateQ a (τ, z) ^ ((1 - a) / 2) * |
| 529 | (1 - a * coordinateEta a (τ, z) ^ 2))) z := by |
| 530 | have hq := coordinateQ_spec ha ha1 (p := (τ, z)) hτ |
| 531 | have hpow := (Real.rpow_pos_of_pos hq.1 ((1 - a) / 2)).ne' |
| 532 | have hm : 1 - a * coordinateEta a (τ, z) ^ 2 ≠ 0 := by |
| 533 | rw [← scalarSlope_eq_L ha ha1 hτ] |
| 534 | exact (scalarSlope_pos ha ha1 hq.1 (by rwa [hq.2])).ne' |
| 535 | have hc := (hasDerivAt_const z s).div (coordinateQ_hasDerivAt_z_L ha ha1 hτ) hq.1.ne' |
| 536 | change HasDerivAt (fun x => s / coordinateQ a (τ, x)) _ z |
| 537 | convert! hc using 1 |
| 538 | rw [Real.rpow_sub hq.1, Real.rpow_one] |
| 539 | unfold coordinateX |
| 540 | field_simp [hq.1.ne', hpow, hm]; ring |
| 541 | |
| 542 | /-- Joint physical `(t,z)` smoothness of the actual coordinate functions. -/ |
| 543 | theorem physical_coordinates_smooth {a : ℝ} (ha : 0 < a) (ha1 : a < 1) |
| 544 | {p : ℝ × ℝ} (hp : p.1 < 1) : |
| 545 | ContDiffAt ℝ ∞ |
| 546 | (fun x : ℝ × ℝ => |
| 547 | (coordinateQ a (1 - x.1, x.2), coordinateEta a (1 - x.1, x.2))) p := by |
| 548 | have hm : ContDiffAt ℝ ∞ (fun x : ℝ × ℝ => (1 - x.1, x.2)) p := |
| 549 | (contDiffAt_const.sub contDiffAt_fst).prodMk contDiffAt_snd |
| 550 | exact ((coordinateQ_smooth ha ha1 (p := (1 - p.1, p.2)) (sub_pos.mpr hp)).prodMk |
| 551 | (coordinateEta_smooth ha ha1 (p := (1 - p.1, p.2)) (sub_pos.mpr hp))).comp p hm |
| 552 | |
| 553 | /-- Equation (3), with exactly the manuscript's exponent `2h`. -/ |
| 554 | theorem manuscript_coordinate_existsUnique {h τ : ℝ} (hh : 0 < h) |
| 555 | (hh1 : h < 1 / 2) (hτ : 0 < τ) (z : ℝ) : |
| 556 | ∃! q : ℝ, 0 < q ∧ q - z ^ 2 * q ^ (2 * h) = τ := by |
| 557 | exact existsUnique_positive_solution (by linarith) (by linarith) hτ z |
| 558 | |
| 559 | end NavierStokes.SimilarityCoordinates |