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 NavierStokes.LinearWaveResidual |
| 2 | import NavierStokes.PhysicalGraphBounds |
| 3 | import NavierStokes.LiftedMeanResidual |
| 4 | import NavierStokes.MeanChartCompatibility |
| 5 | |
| 6 | /-! |
| 7 | # The physical residual of a scaled graph pullback |
| 8 | |
| 9 | This file keeps the cylindrical angle separate from the lifted slow and fast |
| 10 | variables. Every differential operator is an actual Frechet derivative. |
| 11 | -/ |
| 12 | |
| 13 | namespace NavierStokes.PhysicalResidualBridge |
| 14 | |
| 15 | open Set Filter Function |
| 16 | open scoped Topology ContDiff |
| 17 | open ProblemStatement HarmonicCalculus |
| 18 | |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 23 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 24 | |
| 25 | /-- The complete real graph-coordinate residual, including the quadratic |
| 26 | transport term and the cylindrical connection terms. -/ |
| 27 | noncomputable def graphResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) |
| 28 | (a : E → Fin 3 → ℝ) (p : E → ℝ) (x : E) : Fin 3 → ℝ := fun i => |
| 29 | along Vt (fun y => a y i) x + |
| 30 | LinearWaveResidual.realTransport R Vr Vθ Vz a a x i - |
| 31 | ε * LinearWaveResidual.realFrameLaplacian R Vr Vθ Vz a x i + |
| 32 | ![along Vr p x, (R x)⁻¹ * along Vθ p x, along Vz p x] i |
| 33 | |
| 34 | theorem along_scaled_pull {Γ : E → F} {V : E → E} {W : F → F} |
| 35 | {f : F → ℝ} {x : E} (c k : ℝ) |
| 36 | (hΓ : DifferentiableAt ℝ Γ x) (hf : DifferentiableAt ℝ f (Γ x)) |
| 37 | (hV : fderiv ℝ Γ x (V x) = k • W (Γ x)) : |
| 38 | along V (fun y => c * f (Γ y)) x = c * k * along W f (Γ x) := by |
| 39 | have hd := (hf.hasFDerivAt.comp x hΓ.hasFDerivAt).const_mul c |
| 40 | dsimp only [Function.comp_def] at hd |
| 41 | unfold along |
| 42 | rw [hd.fderiv] |
| 43 | simp only [_root_.smul_apply, ContinuousLinearMap.comp_apply, |
| 44 | hV, map_smul, smul_eq_mul] |
| 45 | ring |
| 46 | |
| 47 | /-- Repeating the genuine derivative differentiates the target direction |
| 48 | field as well. In particular this includes the radial-profile derivative. -/ |
| 49 | theorem along_twice_scaled_pull {Ω : Set E} {U : Set F} {Γ : E → F} |
| 50 | {V : E → E} {W : F → F} {f : F → ℝ} {x : E} (c k : ℝ) |
| 51 | (hΩ : IsOpen Ω) (hU : IsOpen U) (hΓ : ContDiffOn ℝ ∞ Γ Ω) |
| 52 | (hmap : MapsTo Γ Ω U) (hW : ContDiffOn ℝ ∞ W U) |
| 53 | (hf : ContDiffOn ℝ ∞ f U) |
| 54 | (hV : ∀ y ∈ Ω, fderiv ℝ Γ y (V y) = k • W (Γ y)) (hx : x ∈ Ω) : |
| 55 | along V (along V (fun y => c * f (Γ y))) x = |
| 56 | c * k ^ 2 * along W (along W f) (Γ x) := by |
| 57 | have he : EqOn (along V (fun y => c * f (Γ y))) |
| 58 | (fun y => (c * k) * along W f (Γ y)) Ω := by |
| 59 | intro y hy |
| 60 | exact along_scaled_pull c k |
| 61 | ((hΓ.contDiffAt (hΩ.mem_nhds hy)).differentiableAt (by simp)) |
| 62 | ((hf.contDiffAt (hU.mem_nhds (hmap hy))).differentiableAt (by simp)) (hV y hy) |
| 63 | rw [along_congr hΩ he hx] |
| 64 | rw [along_scaled_pull (c * k) k |
| 65 | ((hΓ.contDiffAt (hΩ.mem_nhds hx)).differentiableAt (by simp)) |
| 66 | (((contDiffOn_along hU hW hf).contDiffAt (hU.mem_nhds (hmap hx))).differentiableAt |
| 67 | (by simp)) (hV x hx)] |
| 68 | ring |
| 69 | |
| 70 | /-- Differential data used by the generic pullback calculation below. The |
| 71 | explicit physical graph later supplies every field of this structure. -/ |
| 72 | structure PullbackData (Ω : Set E) (U : Set F) (Γ : E → F) |
| 73 | (l v : ℝ) (R : F → ℝ) (Vr Vθ Vz Vt : F → F) |
| 74 | (Sr Sθ Sz St : E → E) (r : E → ℝ) : Prop where |
| 75 | source_open : IsOpen Ω |
| 76 | target_open : IsOpen U |
| 77 | smooth : ContDiffOn ℝ ∞ Γ Ω |
| 78 | mapsTo : MapsTo Γ Ω U |
| 79 | radial_smooth : ContDiffOn ℝ ∞ Vr U |
| 80 | angular_smooth : ContDiffOn ℝ ∞ Vθ U |
| 81 | axial_smooth : ContDiffOn ℝ ∞ Vz U |
| 82 | radial : ∀ x ∈ Ω, fderiv ℝ Γ x (Sr x) = l • Vr (Γ x) |
| 83 | angular : ∀ x ∈ Ω, fderiv ℝ Γ x (Sθ x) = Vθ (Γ x) |
| 84 | axial : ∀ x ∈ Ω, fderiv ℝ Γ x (Sz x) = l • Vz (Γ x) |
| 85 | temporal : ∀ x ∈ Ω, fderiv ℝ Γ x (St x) = (v * l) • Vt (Γ x) |
| 86 | radius : ∀ x ∈ Ω, R (Γ x) = l * r x |
| 87 | |
| 88 | theorem graphResidual_scaled_pull {Ω : Set E} {U : Set F} {Γ : E → F} |
| 89 | {l v ε : ℝ} {R : F → ℝ} {Vr Vθ Vz Vt : F → F} |
| 90 | {Sr Sθ Sz St : E → E} {r : E → ℝ} |
| 91 | (G : PullbackData Ω U Γ l v R Vr Vθ Vz Vt Sr Sθ Sz St r) |
| 92 | (hl : l ≠ 0) (hε : l = v * ε) |
| 93 | {a : F → Fin 3 → ℝ} {p : F → ℝ} |
| 94 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 95 | (hp : ContDiffOn ℝ ∞ p U) {x : E} (hx : x ∈ Ω) (hr : r x ≠ 0) (i : Fin 3) : |
| 96 | graphResidual 1 r Sr Sθ Sz St (fun y j => v * a (Γ y) j) |
| 97 | (fun y => v ^ 2 * p (Γ y)) x i = |
| 98 | v ^ 2 * l * graphResidual ε R Vr Vθ Vz Vt a p (Γ x) i := by |
| 99 | have hdΓ := (G.smooth.contDiffAt (G.source_open.mem_nhds hx)).differentiableAt |
| 100 | (by simp : (∞ : WithTop ℕ∞) ≠ 0) |
| 101 | have hda j := ((ha j).contDiffAt (G.target_open.mem_nhds (G.mapsTo hx))).differentiableAt |
| 102 | (by simp : (∞ : WithTop ℕ∞) ≠ 0) |
| 103 | have hdp := (hp.contDiffAt (G.target_open.mem_nhds (G.mapsTo hx))).differentiableAt |
| 104 | (by simp : (∞ : WithTop ℕ∞) ≠ 0) |
| 105 | have hθ (y : E) (hy : y ∈ Ω) : fderiv ℝ Γ y (Sθ y) = (1 : ℝ) • Vθ (Γ y) := by |
| 106 | simpa only [one_smul] using G.angular y hy |
| 107 | have hAr j c := along_scaled_pull c l hdΓ (hda j) (G.radial x hx) |
| 108 | have hAθ j c := along_scaled_pull c 1 hdΓ (hda j) (hθ x hx) |
| 109 | have hAz j c := along_scaled_pull c l hdΓ (hda j) (G.axial x hx) |
| 110 | have hAt j c := along_scaled_pull c (v * l) hdΓ (hda j) (G.temporal x hx) |
| 111 | have hArr j c := along_twice_scaled_pull c l G.source_open G.target_open G.smooth |
| 112 | G.mapsTo G.radial_smooth (ha j) G.radial hx |
| 113 | have hAθθ j c := along_twice_scaled_pull c 1 G.source_open G.target_open G.smooth |
| 114 | G.mapsTo G.angular_smooth (ha j) hθ hx |
| 115 | have hAzz j c := along_twice_scaled_pull c l G.source_open G.target_open G.smooth |
| 116 | G.mapsTo G.axial_smooth (ha j) G.axial hx |
| 117 | have hPr := along_scaled_pull (v ^ 2) l hdΓ hdp (G.radial x hx) |
| 118 | have hPθ := along_scaled_pull (v ^ 2) 1 hdΓ hdp (hθ x hx) |
| 119 | have hPz := along_scaled_pull (v ^ 2) l hdΓ hdp (G.axial x hx) |
| 120 | fin_cases i <;> |
| 121 | simp [graphResidual, LinearWaveResidual.realTransport, |
| 122 | LinearWaveResidual.realFrameLaplacian, LinearWaveResidual.realAngularGenerator, |
| 123 | cylindricalLaplacian, Matrix.cons_val_zero, Matrix.cons_val_one, |
| 124 | Matrix.cons_val_two, hAr, hAθ, hAz, hAt, hArr, hAθθ, hAzz, hPr, hPθ, hPz, |
| 125 | smul_eq_mul, G.radius x hx] <;> |
| 126 | field_simp [hl, hr] <;> rw [hε] <;> ring |
| 127 | |
| 128 | theorem graphResidual_eq_cylindrical {U : Set SpaceTime} |
| 129 | {a : VelocityField} {p : PressureField} {t : ℝ} {q : Space} |
| 130 | (hU : IsOpen U) (ha : ContDiffOn ℝ ∞ a U) |
| 131 | (hp : ContDiffOn ℝ ∞ p U) (hx : (t, q) ∈ U) : |
| 132 | graphResidual 1 LinearWaveResidual.coordinateRadius |
| 133 | (LinearWaveResidual.spaceDirection 0) (LinearWaveResidual.spaceDirection 1) |
| 134 | (LinearWaveResidual.spaceDirection 2) LinearWaveResidual.physicalTimeDirection |
| 135 | (fun z i => a z i) p (t, q) = |
| 136 | fun i => CylindricalResidual.cylindricalResidual a p t q i := by |
| 137 | have hAc (i : Fin 3) : ContDiffOn ℝ ∞ (fun z => a z i) U := |
| 138 | (AxisymmetricFields.projection i).contDiff.comp_contDiffOn ha |
| 139 | have had := (ha.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 140 | have hpd := (hp.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 141 | have has : ContDiffAt ℝ 2 (fun y : Space => a (t, y)) q := |
| 142 | ((ha.contDiffAt (hU.mem_nhds hx)).comp q (contDiffAt_const.prodMk contDiffAt_id)).of_le |
| 143 | (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2) |
| 144 | have hasd := has.differentiableAt (by norm_num) |
| 145 | have hfirst (i j : Fin 3) : |
| 146 | along (LinearWaveResidual.spaceDirection i) (fun z => a z j) (t, q) = |
| 147 | CylindricalResidual.dCoord i (fun y => a (t, y)) q j := by |
| 148 | rw [LinearWaveResidual.along_space_slice |
| 149 | (((hAc j).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp))] |
| 150 | exact CylindricalResidual.dCoord_map (AxisymmetricFields.projection j) hasd i |
| 151 | have hLap (j : Fin 3) : cylindricalLaplacian LinearWaveResidual.coordinateRadius |
| 152 | (LinearWaveResidual.spaceDirection 0) (LinearWaveResidual.spaceDirection 1) |
| 153 | (LinearWaveResidual.spaceDirection 2) (fun z => a z j) (t, q) = |
| 154 | CylindricalResidual.scalarLaplacian (fun y => a (t, y)) q j := by |
| 155 | rw [LinearWaveResidual.laplacian_space_slice hU (hAc j) hx] |
| 156 | exact CylindricalResidual.scalarLaplacian_component has j |
| 157 | have htime (j : Fin 3) : |
| 158 | along LinearWaveResidual.physicalTimeDirection (fun z => a z j) (t, q) = |
| 159 | temporalDerivative a t q j := by |
| 160 | calc |
| 161 | _ = (along LinearWaveResidual.physicalTimeDirection a (t, q)) j := |
| 162 | LinearWaveResidual.along_map (AxisymmetricFields.projection j) _ had |
| 163 | _ = _ := congrArg (fun v : Space => v j) (LinearWaveResidual.along_time_slice had) |
| 164 | ext i |
| 165 | fin_cases i <;> |
| 166 | simp [graphResidual, LinearWaveResidual.realTransport, |
| 167 | LinearWaveResidual.realFrameLaplacian, LinearWaveResidual.realAngularGenerator, |
| 168 | hfirst, hLap, htime, LinearWaveResidual.along_space_slice hpd, |
| 169 | LinearWaveResidual.coordinateRadius, CylindricalResidual.cylindricalResidual, |
| 170 | CylindricalResidual.vectorAdvection, CylindricalResidual.vectorLaplacian, |
| 171 | CylindricalResidual.scalarGradient, CylindricalResidual.connection_apply] <;> ring |
| 172 | |
| 173 | abbrev Plane := ℝ × ℝ |
| 174 | abbrev Lift := ℝ × (Plane × Plane) |
| 175 | abbrev Cylinder := Lift × ℝ |
| 176 | |
| 177 | /-- Numerical and directional data of one fixed chart. -/ |
| 178 | structure ScaledGraph where |
| 179 | radialScale : ℝ |
| 180 | velocityScale : ℝ |
| 181 | epsilon : ℝ |
| 182 | exponent : ℝ |
| 183 | frequency : ℝ |
| 184 | fastCoefficient : ℝ |
| 185 | radialVector : Plane |
| 186 | temporalVector : Plane |
| 187 | |
| 188 | namespace ScaledGraph |
| 189 | |
| 190 | noncomputable def map (G : ScaledGraph) (p : SpaceTime) : Cylinder := |
| 191 | ((G.radialScale * p.2 0, |
| 192 | ((G.radialScale * G.epsilon * p.2 2, |
| 193 | G.velocityScale * G.radialScale * G.epsilon * (1 - p.1)), |
| 194 | (G.frequency * (G.radialScale * p.2 0) ^ G.exponent) • G.radialVector + |
| 195 | (G.velocityScale * G.radialScale * G.fastCoefficient * p.1) • G.temporalVector)), |
| 196 | p.2 1) |
| 197 | |
| 198 | noncomputable def radius (x : Cylinder) : ℝ := x.1.1 |
| 199 | |
| 200 | noncomputable def radial (G : ScaledGraph) (x : Cylinder) : Cylinder := |
| 201 | ((1, ((0, 0), (G.frequency * GraphCalculus.radialSpeed G.exponent x.1.1) • |
| 202 | G.radialVector)), 0) |
| 203 | |
| 204 | noncomputable def angular (_x : Cylinder) : Cylinder := (0, 1) |
| 205 | |
| 206 | noncomputable def axial (G : ScaledGraph) (_x : Cylinder) : Cylinder := |
| 207 | ((0, ((G.epsilon, 0), 0)), 0) |
| 208 | |
| 209 | noncomputable def temporal (G : ScaledGraph) (_x : Cylinder) : Cylinder := |
| 210 | ((0, ((0, -G.epsilon), G.fastCoefficient • G.temporalVector)), 0) |
| 211 | |
| 212 | theorem map_smoothAt (G : ScaledGraph) {p : SpaceTime} |
| 213 | (hr : G.radialScale * p.2 0 ≠ 0) : ContDiffAt ℝ ∞ G.map p := by |
| 214 | have hP (j : Fin 3) : ContDiffAt ℝ ∞ (fun z : SpaceTime => z.2 j) p := |
| 215 | (PhysicalGraphBounds.coordinateProjection j).contDiff.contDiffAt |
| 216 | have hR : ContDiffAt ℝ ∞ (fun z : SpaceTime => G.radialScale * z.2 0) p := |
| 217 | contDiffAt_const.mul (hP 0) |
| 218 | have hY : ContDiffAt ℝ ∞ (fun z : SpaceTime => |
| 219 | (G.frequency * (G.radialScale * z.2 0) ^ G.exponent) • G.radialVector) p := |
| 220 | (contDiffAt_const.mul (hR.rpow_const_of_ne hr)).smul contDiffAt_const |
| 221 | have hT : ContDiffAt ℝ ∞ (fun z : SpaceTime => |
| 222 | (G.velocityScale * G.radialScale * G.fastCoefficient * z.1) • G.temporalVector) p := |
| 223 | (contDiffAt_const.mul contDiffAt_fst).smul contDiffAt_const |
| 224 | exact (hR.prodMk (((contDiffAt_const.mul (hP 2)).prodMk |
| 225 | (contDiffAt_const.mul (contDiffAt_const.sub contDiffAt_fst))).prodMk |
| 226 | (hY.add hT))).prodMk (hP 1) |
| 227 | |
| 228 | theorem fderiv_map_apply (G : ScaledGraph) {p : SpaceTime} |
| 229 | (hr : G.radialScale * p.2 0 ≠ 0) (w : SpaceTime) : |
| 230 | fderiv ℝ G.map p w = |
| 231 | ((G.radialScale * w.2 0, |
| 232 | ((G.radialScale * G.epsilon * w.2 2, |
| 233 | -(G.velocityScale * G.radialScale * G.epsilon) * w.1), |
| 234 | (G.frequency * GraphCalculus.radialSpeed G.exponent |
| 235 | (G.radialScale * p.2 0) * G.radialScale * w.2 0) • G.radialVector + |
| 236 | (G.velocityScale * G.radialScale * G.fastCoefficient * w.1) • G.temporalVector)), |
| 237 | w.2 1) := by |
| 238 | have hP (j : Fin 3) : HasFDerivAt (fun z : SpaceTime => z.2 j) |
| 239 | (PhysicalGraphBounds.coordinateProjection j) p := |
| 240 | (PhysicalGraphBounds.coordinateProjection j).hasFDerivAt |
| 241 | have htime : HasFDerivAt (fun z : SpaceTime => z.1) |
| 242 | (ContinuousLinearMap.fst ℝ ℝ Space) p := |
| 243 | (ContinuousLinearMap.fst ℝ ℝ Space).hasFDerivAt |
| 244 | have hR := (hP 0).const_mul G.radialScale |
| 245 | have hY := ((hR.rpow_const (p := G.exponent) (Or.inl hr)).const_mul G.frequency).smul_const |
| 246 | G.radialVector |
| 247 | have hT := (htime.const_mul (G.velocityScale * G.radialScale * G.fastCoefficient)).smul_const |
| 248 | G.temporalVector |
| 249 | have hτ : HasFDerivAt (fun z : SpaceTime => |
| 250 | (G.velocityScale * G.radialScale * G.epsilon) * (1 - z.1)) |
| 251 | ((G.velocityScale * G.radialScale * G.epsilon) • |
| 252 | (0 - ContinuousLinearMap.fst ℝ ℝ Space)) p := |
| 253 | ((hasFDerivAt_const (𝕜 := ℝ) (1 : ℝ) p).sub htime).const_mul _ |
| 254 | have hd := (hR.prodMk (((hP 2).const_mul (G.radialScale * G.epsilon)).prodMk hτ |>.prodMk |
| 255 | (hY.add hT))).prodMk (hP 1) |
| 256 | change HasFDerivAt G.map _ p at hd |
| 257 | rw [hd.fderiv] |
| 258 | ext <;> simp [ContinuousLinearMap.fst, GraphCalculus.radialSpeed, |
| 259 | smul_eq_mul] <;> ring_nf <;> simp |
| 260 | |
| 261 | theorem map_radial (G : ScaledGraph) {p : SpaceTime} |
| 262 | (hr : G.radialScale * p.2 0 ≠ 0) : |
| 263 | fderiv ℝ G.map p (LinearWaveResidual.spaceDirection 0 p) = |
| 264 | G.radialScale • G.radial (G.map p) := by |
| 265 | rw [G.fderiv_map_apply hr] |
| 266 | ext <;> simp [radial, map, LinearWaveResidual.spaceDirection, |
| 267 | coordinateVector, smul_eq_mul] <;> ring |
| 268 | |
| 269 | theorem map_angular (G : ScaledGraph) {p : SpaceTime} |
| 270 | (hr : G.radialScale * p.2 0 ≠ 0) : |
| 271 | fderiv ℝ G.map p (LinearWaveResidual.spaceDirection 1 p) = angular (G.map p) := by |
| 272 | rw [G.fderiv_map_apply hr] |
| 273 | ext <;> simp [angular, LinearWaveResidual.spaceDirection, |
| 274 | coordinateVector] |
| 275 | |
| 276 | theorem map_axial (G : ScaledGraph) {p : SpaceTime} |
| 277 | (hr : G.radialScale * p.2 0 ≠ 0) : |
| 278 | fderiv ℝ G.map p (LinearWaveResidual.spaceDirection 2 p) = |
| 279 | G.radialScale • G.axial (G.map p) := by |
| 280 | rw [G.fderiv_map_apply hr] |
| 281 | ext <;> simp [axial, LinearWaveResidual.spaceDirection, |
| 282 | coordinateVector, smul_eq_mul] |
| 283 | |
| 284 | /-- Forward physical time produces minus the slow-time direction. -/ |
| 285 | theorem map_temporal (G : ScaledGraph) {p : SpaceTime} |
| 286 | (hr : G.radialScale * p.2 0 ≠ 0) : |
| 287 | fderiv ℝ G.map p (LinearWaveResidual.physicalTimeDirection p) = |
| 288 | (G.velocityScale * G.radialScale) • G.temporal (G.map p) := by |
| 289 | rw [G.fderiv_map_apply hr] |
| 290 | ext <;> simp [temporal, LinearWaveResidual.physicalTimeDirection, smul_eq_mul] <;> ring |
| 291 | |
| 292 | theorem radial_smooth (G : ScaledGraph) {U : Set Cylinder} |
| 293 | (hR : ∀ x ∈ U, x.1.1 ≠ 0) : ContDiffOn ℝ ∞ G.radial U := by |
| 294 | intro x hx |
| 295 | apply ContDiffAt.contDiffWithinAt |
| 296 | have hr : ContDiffAt ℝ ∞ (fun y : Cylinder => y.1.1) x := contDiffAt_fst.fst |
| 297 | have hc : ContDiffAt ℝ ∞ (fun y : Cylinder => |
| 298 | (G.frequency * GraphCalculus.radialSpeed G.exponent y.1.1) • G.radialVector) x := |
| 299 | (contDiffAt_const.mul (contDiffAt_const.mul (hr.rpow_const_of_ne (hR x hx)))).smul |
| 300 | contDiffAt_const |
| 301 | exact (contDiffAt_const.prodMk (contDiffAt_const.prodMk hc)).prodMk contDiffAt_const |
| 302 | |
| 303 | noncomputable def source (G : ScaledGraph) (U : Set Cylinder) : Set SpaceTime := |
| 304 | {p | 0 < p.2 0} ∩ G.map ⁻¹' U |
| 305 | |
| 306 | theorem source_open (G : ScaledGraph) (hl : 0 < G.radialScale) |
| 307 | {U : Set Cylinder} (hU : IsOpen U) : IsOpen (G.source U) := by |
| 308 | have hc : ContinuousOn G.map {p : SpaceTime | 0 < p.2 0} := by |
| 309 | intro p hp |
| 310 | exact (G.map_smoothAt (mul_pos hl hp).ne').continuousAt.continuousWithinAt |
| 311 | exact hc.isOpen_inter_preimage |
| 312 | (isOpen_lt continuous_const (PhysicalGraphBounds.coordinateProjection 0).continuous) hU |
| 313 | |
| 314 | theorem pullbackData (G : ScaledGraph) (hl : 0 < G.radialScale) |
| 315 | {U : Set Cylinder} (hU : IsOpen U) (hR : ∀ x ∈ U, x.1.1 ≠ 0) : |
| 316 | PullbackData (G.source U) U G.map G.radialScale G.velocityScale radius |
| 317 | G.radial angular G.axial G.temporal |
| 318 | (LinearWaveResidual.spaceDirection 0) (LinearWaveResidual.spaceDirection 1) |
| 319 | (LinearWaveResidual.spaceDirection 2) LinearWaveResidual.physicalTimeDirection |
| 320 | LinearWaveResidual.coordinateRadius where |
| 321 | source_open := G.source_open hl hU |
| 322 | target_open := hU |
| 323 | smooth := fun _ hp => (G.map_smoothAt (mul_pos hl hp.1).ne').contDiffWithinAt |
| 324 | mapsTo := fun _ hp => hp.2 |
| 325 | radial_smooth := G.radial_smooth hR |
| 326 | angular_smooth := contDiffOn_const |
| 327 | axial_smooth := contDiffOn_const |
| 328 | radial := fun _ hp => G.map_radial (mul_pos hl hp.1).ne' |
| 329 | angular := fun _ hp => G.map_angular (mul_pos hl hp.1).ne' |
| 330 | axial := fun _ hp => G.map_axial (mul_pos hl hp.1).ne' |
| 331 | temporal := fun _ hp => G.map_temporal (mul_pos hl hp.1).ne' |
| 332 | radius := fun _ _ => rfl |
| 333 | |
| 334 | /-- Physical cylindrical velocity obtained from the actual graph. -/ |
| 335 | noncomputable def velocity (G : ScaledGraph) (a : Cylinder → Fin 3 → ℝ) : VelocityField := |
| 336 | fun p => AxisymmetricResidual.pack (G.velocityScale * a (G.map p) 0) |
| 337 | (G.velocityScale * a (G.map p) 1) (G.velocityScale * a (G.map p) 2) |
| 338 | |
| 339 | @[simp] theorem velocity_apply (G : ScaledGraph) (a : Cylinder → Fin 3 → ℝ) |
| 340 | (p : SpaceTime) (i : Fin 3) : G.velocity a p i = G.velocityScale * a (G.map p) i := by |
| 341 | fin_cases i <;> simp [velocity] |
| 342 | |
| 343 | noncomputable def pressure (G : ScaledGraph) (p : Cylinder → ℝ) : PressureField := |
| 344 | fun z => G.velocityScale ^ 2 * p (G.map z) |
| 345 | |
| 346 | theorem velocity_smooth (G : ScaledGraph) (hl : 0 < G.radialScale) |
| 347 | {U : Set Cylinder} {a : Cylinder → Fin 3 → ℝ} |
| 348 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun z => a z i) U) : |
| 349 | ContDiffOn ℝ ∞ (G.velocity a) (G.source U) := by |
| 350 | have hg : ContDiffOn ℝ ∞ G.map (G.source U) := |
| 351 | fun p hp => (G.map_smoothAt (mul_pos hl hp.1).ne').contDiffWithinAt |
| 352 | have hc (i : Fin 3) : ContDiffOn ℝ ∞ |
| 353 | (fun p => G.velocityScale * a (G.map p) i) (G.source U) := |
| 354 | contDiffOn_const.mul ((ha i).comp hg (fun _ hp => hp.2)) |
| 355 | exact (((hc 0).smul contDiffOn_const).add ((hc 1).smul contDiffOn_const)).add |
| 356 | ((hc 2).smul contDiffOn_const) |
| 357 | |
| 358 | theorem pressure_smooth (G : ScaledGraph) (hl : 0 < G.radialScale) |
| 359 | {U : Set Cylinder} {p : Cylinder → ℝ} (hp : ContDiffOn ℝ ∞ p U) : |
| 360 | ContDiffOn ℝ ∞ (G.pressure p) (G.source U) := |
| 361 | contDiffOn_const.mul (hp.comp |
| 362 | (fun _ hz => (G.map_smoothAt (mul_pos hl hz.1).ne').contDiffWithinAt) |
| 363 | (fun _ hz => hz.2)) |
| 364 | |
| 365 | theorem cylindricalResidual_eq (G : ScaledGraph) (hl : 0 < G.radialScale) |
| 366 | (hε : G.radialScale = G.velocityScale * G.epsilon) |
| 367 | {U : Set Cylinder} (hU : IsOpen U) (hR : ∀ x ∈ U, x.1.1 ≠ 0) |
| 368 | {a : Cylinder → Fin 3 → ℝ} {p : Cylinder → ℝ} |
| 369 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 370 | (hp : ContDiffOn ℝ ∞ p U) {z : SpaceTime} (hz : z ∈ G.source U) (i : Fin 3) : |
| 371 | CylindricalResidual.cylindricalResidual (G.velocity a) (G.pressure p) z.1 z.2 i = |
| 372 | G.velocityScale ^ 2 * G.radialScale * |
| 373 | graphResidual G.epsilon radius G.radial angular G.axial G.temporal a p (G.map z) i := by |
| 374 | rw [← congrFun (graphResidual_eq_cylindrical (G.source_open hl hU) |
| 375 | (G.velocity_smooth hl ha) (G.pressure_smooth hl hp) hz) i] |
| 376 | simp only [velocity_apply] |
| 377 | exact graphResidual_scaled_pull (G.pullbackData hl hU hR) hl.ne' hε ha hp hz hz.1.ne' i |
| 378 | |
| 379 | /-- Identification with the viscosity-one Cartesian PDE. The representation |
| 380 | premises concern only field values on a neighborhood. -/ |
| 381 | theorem physical_residual (G : ScaledGraph) (hl : 0 < G.radialScale) |
| 382 | (hε : G.radialScale = G.velocityScale * G.epsilon) |
| 383 | {U : Set Cylinder} (hU : IsOpen U) (hR : ∀ x ∈ U, x.1.1 ≠ 0) |
| 384 | {a : Cylinder → Fin 3 → ℝ} {p : Cylinder → ℝ} |
| 385 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 386 | (hp : ContDiffOn ℝ ∞ p U) {t : ℝ} {q : Space} (hz : (t, q) ∈ G.source U) |
| 387 | {u : VelocityField} {P : PressureField} |
| 388 | (hu : ContDiffAt ℝ 2 u (t, CylindricalResidual.chart q)) |
| 389 | (hP : DifferentiableAt ℝ P (t, CylindricalResidual.chart q)) |
| 390 | (hrep : (fun z : SpaceTime => u (z.1, CylindricalResidual.chart z.2)) =ᶠ[𝓝 (t, q)] |
| 391 | (fun z => CylindricalResidual.frame (z.2 1) (G.velocity a z))) |
| 392 | (hpRep : CylindricalResidual.pressurePullback P =ᶠ[𝓝 (t, q)] G.pressure p) |
| 393 | (i : Fin 3) : |
| 394 | CylindricalResidual.frame (-(q 1)) |
| 395 | (navierStokesResidual u P t (CylindricalResidual.chart q)) i = |
| 396 | G.velocityScale ^ 2 * G.radialScale * |
| 397 | graphResidual G.epsilon radius G.radial angular G.axial G.temporal a p (G.map (t, q)) i := by |
| 398 | rw [CylindricalResidual.navierStokesResidual_of_representation hu hP hz.1 hrep hpRep, |
| 399 | CylindricalResidual.frame_inverse] |
| 400 | exact G.cylindricalResidual_eq hl hε hU hR ha hp hz i |
| 401 | |
| 402 | end ScaledGraph |
| 403 | |
| 404 | /-- One arbitrary integer-cover chart; the index is not constrained to the |
| 405 | native band index. -/ |
| 406 | noncomputable def commonGraph (Q h : ℝ) (i : ℕ) : ScaledGraph where |
| 407 | radialScale := Q ^ (-(1 / 2 : ℝ)) |
| 408 | velocityScale := Q ^ (-CoordinateAlgebra.A h) |
| 409 | epsilon := Q ^ h |
| 410 | exponent := ChartScales.radialExponent h |
| 411 | frequency := ChartScales.Lambda ^ i * Q ^ (ChartScales.radialExponent h / 2) |
| 412 | fastCoefficient := ChartScales.Tg ^ i * Q ^ (1 + h) |
| 413 | radialVector := PhysicalGraphBounds.radialDirection |
| 414 | temporalVector := PhysicalGraphBounds.timeDirection |
| 415 | |
| 416 | theorem commonGraph_scale {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (i : ℕ) : |
| 417 | (commonGraph Q h i).radialScale = |
| 418 | (commonGraph Q h i).velocityScale * (commonGraph Q h i).epsilon := by |
| 419 | change Q ^ (-(1 / 2 : ℝ)) = Q ^ (-CoordinateAlgebra.A h) * Q ^ h |
| 420 | rw [← Real.rpow_add hQ] |
| 421 | congr 1 |
| 422 | unfold CoordinateAlgebra.A |
| 423 | ring |
| 424 | |
| 425 | theorem commonGraph_axialScale {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (i : ℕ) : |
| 426 | (commonGraph Q h i).radialScale * (commonGraph Q h i).epsilon = |
| 427 | Q ^ (-CoordinateAlgebra.D h) := by |
| 428 | change Q ^ (-(1 / 2 : ℝ)) * Q ^ h = Q ^ (-CoordinateAlgebra.D h) |
| 429 | rw [← Real.rpow_add hQ] |
| 430 | congr 1 |
| 431 | unfold CoordinateAlgebra.D |
| 432 | ring |
| 433 | |
| 434 | theorem commonGraph_slowTimeScale {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (i : ℕ) : |
| 435 | (commonGraph Q h i).velocityScale * (commonGraph Q h i).radialScale * |
| 436 | (commonGraph Q h i).epsilon = Q ^ (-1 : ℝ) := by |
| 437 | change Q ^ (-CoordinateAlgebra.A h) * Q ^ (-(1 / 2 : ℝ)) * Q ^ h = Q ^ (-1 : ℝ) |
| 438 | rw [← Real.rpow_add hQ, ← Real.rpow_add hQ] |
| 439 | congr 1 |
| 440 | unfold CoordinateAlgebra.A |
| 441 | ring |
| 442 | |
| 443 | theorem commonGraph_fastTimeScale {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (i : ℕ) : |
| 444 | (commonGraph Q h i).velocityScale * (commonGraph Q h i).radialScale * |
| 445 | (commonGraph Q h i).fastCoefficient = ChartScales.Tg ^ i := by |
| 446 | change Q ^ (-CoordinateAlgebra.A h) * Q ^ (-(1 / 2 : ℝ)) * |
| 447 | (ChartScales.Tg ^ i * Q ^ (1 + h)) = _ |
| 448 | rw [show Q ^ (-CoordinateAlgebra.A h) * Q ^ (-(1 / 2 : ℝ)) * |
| 449 | (ChartScales.Tg ^ i * Q ^ (1 + h)) = |
| 450 | ChartScales.Tg ^ i * (Q ^ (-CoordinateAlgebra.A h) * Q ^ (-(1 / 2 : ℝ)) * |
| 451 | Q ^ (1 + h)) by ring] |
| 452 | rw [← Real.rpow_add hQ, ← Real.rpow_add hQ] |
| 453 | have he : -CoordinateAlgebra.A h + -(1 / 2 : ℝ) + (1 + h) = 0 := by |
| 454 | unfold CoordinateAlgebra.A |
| 455 | ring |
| 456 | rw [he, Real.rpow_zero, mul_one] |
| 457 | |
| 458 | theorem commonGraph_radialScale {Q r : ℝ} (hQ : 0 < Q) (hr : 0 < r) |
| 459 | (h : ℝ) (i : ℕ) : |
| 460 | (commonGraph Q h i).frequency * ((commonGraph Q h i).radialScale * r) ^ |
| 461 | (commonGraph Q h i).exponent = ChartScales.Lambda ^ i * r ^ ChartScales.radialExponent h := by |
| 462 | change (ChartScales.Lambda ^ i * Q ^ (ChartScales.radialExponent h / 2)) * |
| 463 | (Q ^ (-(1 / 2 : ℝ)) * r) ^ ChartScales.radialExponent h = _ |
| 464 | rw [Real.mul_rpow (Real.rpow_pos_of_pos hQ _).le hr.le, |
| 465 | ← Real.rpow_mul hQ.le] |
| 466 | rw [show (ChartScales.Lambda ^ i * Q ^ (ChartScales.radialExponent h / 2)) * |
| 467 | (Q ^ (-(1 / 2 : ℝ) * ChartScales.radialExponent h) * r ^ ChartScales.radialExponent h) = |
| 468 | ChartScales.Lambda ^ i * |
| 469 | (Q ^ (ChartScales.radialExponent h / 2) * |
| 470 | Q ^ (-(1 / 2 : ℝ) * ChartScales.radialExponent h)) * |
| 471 | r ^ ChartScales.radialExponent h by ring] |
| 472 | rw [← Real.rpow_add hQ, |
| 473 | show ChartScales.radialExponent h / 2 + -(1 / 2 : ℝ) * ChartScales.radialExponent h = 0 by ring, |
| 474 | Real.rpow_zero, mul_one] |
| 475 | |
| 476 | theorem commonGraph_map {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (i : ℕ) |
| 477 | {p : SpaceTime} (hr : 0 < p.2 0) : |
| 478 | (commonGraph Q h i).map p = |
| 479 | ((Q ^ (-(1 / 2 : ℝ)) * p.2 0, |
| 480 | ((Q ^ (-CoordinateAlgebra.D h) * p.2 2, (1 - p.1) / Q), |
| 481 | (SlotGeometry.cover ^ i) |
| 482 | ((p.2 0) ^ ChartScales.radialExponent h • PhysicalGraphBounds.radialDirection + |
| 483 | p.1 • PhysicalGraphBounds.timeDirection))), p.2 1) := by |
| 484 | unfold ScaledGraph.map |
| 485 | rw [commonGraph_axialScale hQ, commonGraph_slowTimeScale hQ, |
| 486 | commonGraph_fastTimeScale hQ, commonGraph_radialScale hQ hr] |
| 487 | simp only [map_add, map_smul, PhysicalGraphBounds.cover_pow_radialDirection, |
| 488 | PhysicalGraphBounds.cover_pow_timeDirection, smul_smul, Real.rpow_neg_one] |
| 489 | simp [commonGraph, div_eq_mul_inv, mul_comm] |
| 490 | |
| 491 | theorem commonGraph_residualScale {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (i : ℕ) : |
| 492 | Q ^ (2 * CoordinateAlgebra.A h + 1 / 2) * |
| 493 | ((commonGraph Q h i).velocityScale ^ 2 * (commonGraph Q h i).radialScale) = 1 := by |
| 494 | change Q ^ (2 * CoordinateAlgebra.A h + 1 / 2) * |
| 495 | ((Q ^ (-CoordinateAlgebra.A h)) ^ 2 * Q ^ (-(1 / 2 : ℝ))) = 1 |
| 496 | rw [← Real.rpow_mul_natCast hQ.le, ← Real.rpow_add hQ, ← Real.rpow_add hQ] |
| 497 | convert! Real.rpow_zero Q using 1 |
| 498 | congr 1 |
| 499 | norm_num |
| 500 | ring |
| 501 | |
| 502 | /-- The exact power multiplying the physical viscosity-one residual. -/ |
| 503 | theorem commonGraph_physical_residual {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (k : ℕ) |
| 504 | {U : Set Cylinder} (hU : IsOpen U) (hR : ∀ x ∈ U, x.1.1 ≠ 0) |
| 505 | {a : Cylinder → Fin 3 → ℝ} {p : Cylinder → ℝ} |
| 506 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 507 | (hp : ContDiffOn ℝ ∞ p U) {t : ℝ} {q : Space} |
| 508 | (hz : (t, q) ∈ (commonGraph Q h k).source U) |
| 509 | {u : VelocityField} {P : PressureField} |
| 510 | (hu : ContDiffAt ℝ 2 u (t, CylindricalResidual.chart q)) |
| 511 | (hP : DifferentiableAt ℝ P (t, CylindricalResidual.chart q)) |
| 512 | (hrep : (fun z : SpaceTime => u (z.1, CylindricalResidual.chart z.2)) =ᶠ[𝓝 (t, q)] |
| 513 | (fun z => CylindricalResidual.frame (z.2 1) ((commonGraph Q h k).velocity a z))) |
| 514 | (hpRep : CylindricalResidual.pressurePullback P =ᶠ[𝓝 (t, q)] |
| 515 | (commonGraph Q h k).pressure p) (i : Fin 3) : |
| 516 | graphResidual (Q ^ h) ScaledGraph.radius (commonGraph Q h k).radial |
| 517 | ScaledGraph.angular (commonGraph Q h k).axial (commonGraph Q h k).temporal |
| 518 | a p ((commonGraph Q h k).map (t, q)) i = |
| 519 | Q ^ (2 * CoordinateAlgebra.A h + 1 / 2) * |
| 520 | CylindricalResidual.frame (-(q 1)) |
| 521 | (navierStokesResidual u P t (CylindricalResidual.chart q)) i := by |
| 522 | have he := (commonGraph Q h k).physical_residual (Real.rpow_pos_of_pos hQ _) |
| 523 | (commonGraph_scale hQ h k) hU hR ha hp hz hu hP hrep hpRep i |
| 524 | rw [he, ← mul_assoc, commonGraph_residualScale hQ, one_mul] |
| 525 | rfl |
| 526 | |
| 527 | /-! ## The actual linear-plus-quadratic correction expression -/ |
| 528 | |
| 529 | theorem twice_along_add {U : Set E} (hU : IsOpen U) {V : E → E} |
| 530 | (hV : ContDiffOn ℝ ∞ V U) {f g : E → ℝ} |
| 531 | (hf : ContDiffOn ℝ ∞ f U) (hg : ContDiffOn ℝ ∞ g U) {x : E} (hx : x ∈ U) : |
| 532 | along V (along V (fun y => f y + g y)) x = |
| 533 | along V (along V f) x + along V (along V g) x := by |
| 534 | have he : EqOn (along V (fun y => f y + g y)) |
| 535 | (fun y => along V f y + along V g y) U := by |
| 536 | intro y hy |
| 537 | exact along_add V ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) |
| 538 | ((hg.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) |
| 539 | rw [along_congr hU he hx] |
| 540 | exact along_add V |
| 541 | (((contDiffOn_along hU hV hf).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 542 | (((contDiffOn_along hU hV hg).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 543 | |
| 544 | theorem laplacian_add {U : Set E} (hU : IsOpen U) (R : E → ℝ) {Vr Vθ Vz : E → E} |
| 545 | (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) (hz : ContDiffOn ℝ ∞ Vz U) |
| 546 | {f g : E → ℝ} (hf : ContDiffOn ℝ ∞ f U) (hg : ContDiffOn ℝ ∞ g U) |
| 547 | {x : E} (hx : x ∈ U) : |
| 548 | cylindricalLaplacian R Vr Vθ Vz (fun y => f y + g y) x = |
| 549 | cylindricalLaplacian R Vr Vθ Vz f x + cylindricalLaplacian R Vr Vθ Vz g x := by |
| 550 | simp only [cylindricalLaplacian, twice_along_add hU hr hf hg hx, |
| 551 | twice_along_add hU hθ hf hg hx, twice_along_add hU hz hf hg hx, |
| 552 | along_add Vr ((hf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 553 | ((hg.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)), smul_eq_mul] |
| 554 | ring |
| 555 | |
| 556 | theorem graphResidual_add {U : Set E} (hU : IsOpen U) (ε : ℝ) (R : E → ℝ) |
| 557 | {Vr Vθ Vz : E → E} (Vt : E → E) |
| 558 | (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) (hz : ContDiffOn ℝ ∞ Vz U) |
| 559 | {B a : E → Fin 3 → ℝ} {p₀ p : E → ℝ} |
| 560 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun y => B y i) U) |
| 561 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 562 | (hp₀ : ContDiffOn ℝ ∞ p₀ U) (hp : ContDiffOn ℝ ∞ p U) {x : E} (hx : x ∈ U) |
| 563 | (i : Fin 3) : |
| 564 | graphResidual ε R Vr Vθ Vz Vt (fun y j => B y j + a y j) (fun y => p₀ y + p y) x i = |
| 565 | graphResidual ε R Vr Vθ Vz Vt B p₀ x i + |
| 566 | LinearWaveResidual.realComponentLinearResidual ε R Vr Vθ Vz Vt B a p x i + |
| 567 | LinearWaveResidual.realTransport R Vr Vθ Vz a a x i := by |
| 568 | have hfirst (V : E → E) (j : Fin 3) := along_add V |
| 569 | (((hB j).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 570 | (((ha j).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 571 | have hLap (j : Fin 3) := laplacian_add hU R hr hθ hz (hB j) (ha j) hx |
| 572 | have hP (V : E → E) := along_add V |
| 573 | ((hp₀.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 574 | ((hp.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 575 | fin_cases i <;> |
| 576 | simp [graphResidual, LinearWaveResidual.realComponentLinearResidual, |
| 577 | LinearWaveResidual.realTransport, LinearWaveResidual.realFrameLaplacian, |
| 578 | LinearWaveResidual.realAngularGenerator, Matrix.cons_val_zero, Matrix.cons_val_one, |
| 579 | Matrix.cons_val_two, hfirst, hLap, hP] <;> ring |
| 580 | |
| 581 | theorem transport_realLift (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 582 | {a : E → Fin 3 → ℝ} {x : E} |
| 583 | (ha : ∀ j, DifferentiableAt ℝ (fun y => a y j) x) (i : Fin 3) : |
| 584 | (LinearWaveResidual.transport R Vr Vθ Vz (LinearWaveResidual.realLift a) |
| 585 | (LinearWaveResidual.realLift a) x i).re = |
| 586 | LinearWaveResidual.realTransport R Vr Vθ Vz a a x i := by |
| 587 | have hD (V : E → E) (j : Fin 3) := along_ofReal V (ha j) |
| 588 | fin_cases i <;> |
| 589 | simp [LinearWaveResidual.transport, LinearWaveResidual.realTransport, |
| 590 | LinearWaveResidual.realLift, angularGenerator, LinearWaveResidual.realAngularGenerator, |
| 591 | hD, ← Complex.ofReal_div] |
| 592 | |
| 593 | noncomputable def complexIncrement (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) |
| 594 | (B a : E → Fin 3 → ℝ) (p : E → ℝ) (x : E) (i : Fin 3) : ℝ := |
| 595 | (LinearWaveResidual.linearResidual ε R Vr Vθ Vz Vt (LinearWaveResidual.realLift B) |
| 596 | (LinearWaveResidual.realLift a) (fun y => (p y : ℂ)) x i + |
| 597 | LinearWaveResidual.transport R Vr Vθ Vz (LinearWaveResidual.realLift a) |
| 598 | (LinearWaveResidual.realLift a) x i).re |
| 599 | |
| 600 | theorem complexIncrement_eq {U : Set E} (hU : IsOpen U) (ε : ℝ) (R : E → ℝ) |
| 601 | {Vr Vθ Vz : E → E} (Vt : E → E) |
| 602 | (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) (hz : ContDiffOn ℝ ∞ Vz U) |
| 603 | {B a : E → Fin 3 → ℝ} {p : E → ℝ} |
| 604 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun y => B y i) U) |
| 605 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 606 | (hp : ContDiffOn ℝ ∞ p U) {x : E} (hx : x ∈ U) (i : Fin 3) : |
| 607 | complexIncrement ε R Vr Vθ Vz Vt B a p x i = |
| 608 | LinearWaveResidual.realComponentLinearResidual ε R Vr Vθ Vz Vt B a p x i + |
| 609 | LinearWaveResidual.realTransport R Vr Vθ Vz a a x i := by |
| 610 | have haC j : ContDiffOn ℝ ∞ (fun y => (a y j : ℂ)) U := |
| 611 | Complex.ofRealCLM.contDiff.comp_contDiffOn (ha j) |
| 612 | have hpC : DifferentiableAt ℝ (fun y => (p y : ℂ)) x := |
| 613 | Complex.ofRealCLM.differentiableAt.comp x |
| 614 | ((hp.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 615 | have hl := congrFun (LinearWaveResidual.realMap_linearResidual Complex.reCLM ε R Vt |
| 616 | hU hr hθ hz haC |
| 617 | (fun j => ((hB j).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) hpC hx) i |
| 618 | have ht := transport_realLift R Vr Vθ Vz |
| 619 | (fun j => ((ha j).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) i |
| 620 | simp only [complexIncrement, Complex.add_re, ht] |
| 621 | have h := congrArg |
| 622 | (fun z : ℝ => z + LinearWaveResidual.realTransport R Vr Vθ Vz a a x i) hl |
| 623 | simp [] at h |
| 624 | exact congrArg (fun z : ℝ => z + LinearWaveResidual.realTransport R Vr Vθ Vz a a x i) h |
| 625 | |
| 626 | /-- The base equation supplies only the fixed base residual. All linear, |
| 627 | quadratic, pressure, and viscous increment terms are derived above. -/ |
| 628 | theorem fullResidual_eq_graph {U : Set E} (hU : IsOpen U) (ε : ℝ) (R : E → ℝ) |
| 629 | {Vr Vθ Vz : E → E} (Vt : E → E) |
| 630 | (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) (hz : ContDiffOn ℝ ∞ Vz U) |
| 631 | {B a : E → Fin 3 → ℝ} {p₀ p : E → ℝ} |
| 632 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun y => B y i) U) |
| 633 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 634 | (hp₀ : ContDiffOn ℝ ∞ p₀ U) (hp : ContDiffOn ℝ ∞ p U) {x : E} (hx : x ∈ U) |
| 635 | (virtual error : Fin 3 → ℝ) |
| 636 | (hbase : ∀ i, graphResidual ε R Vr Vθ Vz Vt B p₀ x i = virtual i + error i) |
| 637 | (i : Fin 3) : |
| 638 | complexIncrement ε R Vr Vθ Vz Vt B a p x i + virtual i + error i = |
| 639 | graphResidual ε R Vr Vθ Vz Vt (fun y j => B y j + a y j) |
| 640 | (fun y => p₀ y + p y) x i := by |
| 641 | rw [complexIncrement_eq hU ε R Vt hr hθ hz hB ha hp hx, |
| 642 | graphResidual_add hU ε R Vt hr hθ hz hB ha hp₀ hp hx, hbase] |
| 643 | ring |
| 644 | |
| 645 | /-- The absolute graph before choosing a band or an integer covering. -/ |
| 646 | noncomputable def absoluteLift (h : ℝ) (p : SpaceTime) : Lift := |
| 647 | (p.2 0, ((p.2 2, 1 - p.1), |
| 648 | (p.2 0) ^ ChartScales.radialExponent h • PhysicalGraphBounds.radialDirection + |
| 649 | p.1 • PhysicalGraphBounds.timeDirection)) |
| 650 | |
| 651 | theorem commonGraph_eq_physicalToChart (h : ℝ) (n k : ℕ) {p : SpaceTime} |
| 652 | (hr : 0 < p.2 0) : |
| 653 | (commonGraph (ChartScales.Q n) h k).map p = |
| 654 | (MeanChartCompatibility.physicalToChart h n k (absoluteLift h p), p.2 1) := by |
| 655 | rw [commonGraph_map (ChartScales.Q_pos n) h k hr, |
| 656 | MeanChartCompatibility.physicalToChart_apply, |
| 657 | MeanChartCompatibility.coverMap_eq_coverPower, CommonCoverSolve.coverPower_apply] |
| 658 | simp [absoluteLift, MeanChartCompatibility.chartScale, Real.rpow_neg_one, |
| 659 | div_eq_mul_inv, mul_comm] |
| 660 | |
| 661 | /-- Matching consists of the literal coefficient and direction data at one |
| 662 | band, with no assumption about a residual or a differential operator. -/ |
| 663 | structure MatchesAt (o : MeanIncrementBounds.Operators Lift) (G : ScaledGraph) (n : ℕ) : Prop where |
| 664 | epsilon : o.epsilon n = G.epsilon |
| 665 | frequency : o.radialFrequency n = G.frequency |
| 666 | fast : o.fastCoefficient n = G.fastCoefficient |
| 667 | radius : o.radius = Prod.fst |
| 668 | profile : o.radialProfile = fun x => GraphCalculus.radialSpeed G.exponent x.1 |
| 669 | eR : o.eR = (1, (0, 0)) |
| 670 | eZ : o.eZ = (0, ((1, 0), 0)) |
| 671 | eT : o.eT = (0, ((0, 1), 0)) |
| 672 | vR : o.vR = (0, (0, G.radialVector)) |
| 673 | vT : o.vT = (0, (0, G.temporalVector)) |
| 674 | |
| 675 | theorem matchesAt_graphOperators (r : CorrectionState.ReconstructionData) |
| 676 | (epsilon fast : ℕ → ℝ) (G : ScaledGraph) (n : ℕ) |
| 677 | (hε : epsilon n = G.epsilon) (hM : r.frequency n = G.frequency) |
| 678 | (hc : fast n = G.fastCoefficient) (hd : r.exponent = G.exponent) |
| 679 | (hv : r.radialDirection = G.radialVector) : |
| 680 | MatchesAt (CorrectionState.graphOperators r epsilon fast |
| 681 | (((1, 0) : Plane), (0 : Plane)) (((0, 1) : Plane), (0 : Plane)) G.temporalVector) G n := by |
| 682 | constructor |
| 683 | · exact hε |
| 684 | · exact hM |
| 685 | · exact hc |
| 686 | · rfl |
| 687 | · simp only [CorrectionState.graphOperators, hd, RadialPullback.radialJacobian, |
| 688 | GraphCalculus.radialSpeed] |
| 689 | · rfl |
| 690 | · rfl |
| 691 | · rfl |
| 692 | · simp only [CorrectionState.graphOperators, hv] |
| 693 | · rfl |
| 694 | |
| 695 | theorem MatchesAt.radialDirection {c : CorrectionState.Context Lift} {G : ScaledGraph} {n : ℕ} |
| 696 | (H : MatchesAt c.operators G n) : LiftedMeanResidual.radialDirection c n = G.radial := by |
| 697 | funext x |
| 698 | simp [LiftedMeanResidual.radialDirection, LiftedMeanResidual.liftDirection, |
| 699 | LiftedMeanResidual.radialVector, H.eR, H.frequency, H.profile, H.vR, |
| 700 | ScaledGraph.radial] |
| 701 | rfl |
| 702 | |
| 703 | theorem MatchesAt.axialDirection {c : CorrectionState.Context Lift} {G : ScaledGraph} {n : ℕ} |
| 704 | (H : MatchesAt c.operators G n) : LiftedMeanResidual.axialDirection c n = G.axial := by |
| 705 | funext x |
| 706 | simp [LiftedMeanResidual.axialDirection, LiftedMeanResidual.liftDirection, |
| 707 | LiftedMeanResidual.axialVector, H.epsilon, H.eZ, ScaledGraph.axial] |
| 708 | |
| 709 | theorem MatchesAt.timeDirection {c : CorrectionState.Context Lift} {G : ScaledGraph} {n : ℕ} |
| 710 | (H : MatchesAt c.operators G n) : LiftedMeanResidual.timeDirection c n = G.temporal := by |
| 711 | funext x |
| 712 | simp [LiftedMeanResidual.timeDirection, LiftedMeanResidual.liftDirection, |
| 713 | LiftedMeanResidual.temporalVector, H.epsilon, H.fast, H.vT, H.eT, ScaledGraph.temporal] |
| 714 | |
| 715 | noncomputable def baseComponents (c : CorrectionState.Context Lift) (n : ℕ) |
| 716 | (x : Cylinder) : Fin 3 → ℝ := |
| 717 | ![c.base.radial n x.1, c.base.angular n x.1, c.base.axial n x.1] |
| 718 | |
| 719 | noncomputable def incrementComponents (s : CorrectionState.State Lift) (n : ℕ) |
| 720 | (x : Cylinder) : Fin 3 → ℝ := |
| 721 | ![s.mean.radial n x.1 + s.oscillation n x 0, |
| 722 | s.mean.angular n x.1 + s.oscillation n x 1, |
| 723 | s.mean.axial n x.1 + s.oscillation n x 2] |
| 724 | |
| 725 | theorem context_fullResidual_formula {c : CorrectionState.Context Lift} |
| 726 | {G : ScaledGraph} {n : ℕ} (H : MatchesAt c.operators G n) |
| 727 | (s : CorrectionState.State Lift) (x : Cylinder) (i : Fin 3) : |
| 728 | LiftedMeanResidual.fullResidual c s n x i = |
| 729 | complexIncrement G.epsilon ScaledGraph.radius G.radial ScaledGraph.angular G.axial G.temporal |
| 730 | (baseComponents c n) (incrementComponents s n) (s.totalPressureIncrement n) x i + |
| 731 | LiftedMeanResidual.virtualDivergence c n x i + s.errors.base n x i := by |
| 732 | have hB : LiftedMeanResidual.complexBase c n = |
| 733 | LinearWaveResidual.realLift (baseComponents c n) := by |
| 734 | funext y j |
| 735 | fin_cases j <;> rfl |
| 736 | have ha : LiftedMeanResidual.complexPerturbation s n = |
| 737 | LinearWaveResidual.realLift (incrementComponents s n) := by |
| 738 | funext y j |
| 739 | fin_cases j <;> rfl |
| 740 | unfold LiftedMeanResidual.fullResidual LiftedMeanResidual.nonlinearResidual |
| 741 | rw [H.epsilon, H.radialDirection, H.axialDirection, H.timeDirection, H.radius, hB, ha] |
| 742 | rfl |
| 743 | |
| 744 | /-- Exact total-field residual for the actual correction state. The only |
| 745 | base premise is its independently verified fixed pressure/virtual-stress |
| 746 | equation, and the base error is included once. -/ |
| 747 | theorem context_fullResidual_eq_graph {c : CorrectionState.Context Lift} |
| 748 | {G : ScaledGraph} {n : ℕ} (H : MatchesAt c.operators G n) |
| 749 | (s : CorrectionState.State Lift) {U : Set Cylinder} |
| 750 | (hU : IsOpen U) (hR : ∀ x ∈ U, x.1.1 ≠ 0) {p₀ : Cylinder → ℝ} |
| 751 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun x => baseComponents c n x i) U) |
| 752 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun x => incrementComponents s n x i) U) |
| 753 | (hp₀ : ContDiffOn ℝ ∞ p₀ U) (hp : ContDiffOn ℝ ∞ (s.totalPressureIncrement n) U) |
| 754 | {x : Cylinder} (hx : x ∈ U) |
| 755 | (hbase : ∀ i, graphResidual G.epsilon ScaledGraph.radius G.radial ScaledGraph.angular |
| 756 | G.axial G.temporal (baseComponents c n) p₀ x i = |
| 757 | LiftedMeanResidual.virtualDivergence c n x i + s.errors.base n x i) (i : Fin 3) : |
| 758 | LiftedMeanResidual.fullResidual c s n x i = |
| 759 | graphResidual G.epsilon ScaledGraph.radius G.radial ScaledGraph.angular G.axial G.temporal |
| 760 | (fun y j => baseComponents c n y j + incrementComponents s n y j) |
| 761 | (fun y => p₀ y + s.totalPressureIncrement n y) x i := by |
| 762 | rw [context_fullResidual_formula H] |
| 763 | exact fullResidual_eq_graph hU G.epsilon ScaledGraph.radius G.temporal |
| 764 | (G.radial_smooth hR) contDiffOn_const contDiffOn_const hB ha hp₀ hp hx _ _ hbase i |
| 765 | |
| 766 | /-- The actual correction-state residual is the scaled Cartesian |
| 767 | Navier--Stokes residual on the physical graph. The cover index `k` is free. |
| 768 | The base pressure is fixed separately because a correction state stores only |
| 769 | pressure increments. -/ |
| 770 | theorem context_fullResidual_physical {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (k n : ℕ) |
| 771 | (c : CorrectionState.Context Lift) (s : CorrectionState.State Lift) |
| 772 | (H : MatchesAt c.operators (commonGraph Q h k) n) |
| 773 | {U : Set Cylinder} (hU : IsOpen U) (hR : ∀ x ∈ U, x.1.1 ≠ 0) |
| 774 | {p₀ : Cylinder → ℝ} |
| 775 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun x => baseComponents c n x i) U) |
| 776 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun x => incrementComponents s n x i) U) |
| 777 | (hp₀ : ContDiffOn ℝ ∞ p₀ U) (hp : ContDiffOn ℝ ∞ (s.totalPressureIncrement n) U) |
| 778 | {t : ℝ} {q : Space} (hz : (t, q) ∈ (commonGraph Q h k).source U) |
| 779 | (hbase : ∀ i, graphResidual (Q ^ h) ScaledGraph.radius (commonGraph Q h k).radial |
| 780 | ScaledGraph.angular (commonGraph Q h k).axial (commonGraph Q h k).temporal |
| 781 | (baseComponents c n) p₀ ((commonGraph Q h k).map (t, q)) i = |
| 782 | LiftedMeanResidual.virtualDivergence c n ((commonGraph Q h k).map (t, q)) i + |
| 783 | s.errors.base n ((commonGraph Q h k).map (t, q)) i) |
| 784 | {u : VelocityField} {P : PressureField} |
| 785 | (hu : ContDiffAt ℝ 2 u (t, CylindricalResidual.chart q)) |
| 786 | (hP : DifferentiableAt ℝ P (t, CylindricalResidual.chart q)) |
| 787 | (hrep : (fun z : SpaceTime => u (z.1, CylindricalResidual.chart z.2)) =ᶠ[𝓝 (t, q)] |
| 788 | (fun z => CylindricalResidual.frame (z.2 1) ((commonGraph Q h k).velocity |
| 789 | (fun y j => baseComponents c n y j + incrementComponents s n y j) z))) |
| 790 | (hpRep : CylindricalResidual.pressurePullback P =ᶠ[𝓝 (t, q)] (commonGraph Q h k).pressure |
| 791 | (fun y => p₀ y + s.totalPressureIncrement n y)) (i : Fin 3) : |
| 792 | LiftedMeanResidual.fullResidual c s n ((commonGraph Q h k).map (t, q)) i = |
| 793 | Q ^ (2 * CoordinateAlgebra.A h + 1 / 2) * |
| 794 | CylindricalResidual.frame (-(q 1)) |
| 795 | (navierStokesResidual u P t (CylindricalResidual.chart q)) i := by |
| 796 | rw [context_fullResidual_eq_graph H s hU hR hB ha hp₀ hp hz.2 hbase] |
| 797 | exact commonGraph_physical_residual hQ h k hU hR (fun j => (hB j).add (ha j)) |
| 798 | (hp₀.add hp) hz hu hP hrep hpRep i |
| 799 | |
| 800 | end |
| 801 | |
| 802 | end NavierStokes.PhysicalResidualBridge |