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.PrimaryPulseBounds |
| 2 | import NavierStokes.LinearWaveBounds |
| 3 | |
| 4 | /-! |
| 5 | # Assembly of the actual primary tangent field |
| 6 | |
| 7 | The native vector pulse, its integer periodization and covering, and its |
| 8 | complex harmonic use the same `PairData` as the covariance calculation. |
| 9 | The exact curl correction remains a separate field. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | namespace NavierStokes.PrimaryFieldAssembly |
| 15 | |
| 16 | open Set Function PartitionedCovariance HarmonicCalculus |
| 17 | open scoped BigOperators Topology |
| 18 | |
| 19 | abbrev Vector := Fin 3 → ℝ |
| 20 | abbrev SignedIndex := UnsignedLabel × Fin 2 |
| 21 | |
| 22 | /-- The three components of one literal native pulse. -/ |
| 23 | noncomputable def pulseVector (P : Pulse) (r : ℝ) (z : Plane) : Vector := |
| 24 | Fin.cases (P.radialProfile r z) (fun i => P.tangentProfile r i z) |
| 25 | |
| 26 | @[simp] theorem pulseVector_zero (P : Pulse) (r : ℝ) (z : Plane) : |
| 27 | pulseVector P r z 0 = P.radialProfile r z := rfl |
| 28 | |
| 29 | @[simp] theorem pulseVector_succ (P : Pulse) (r : ℝ) (z : Plane) (i : Fin 2) : |
| 30 | pulseVector P r z i.succ = P.tangentProfile r i z := rfl |
| 31 | |
| 32 | private theorem compact_vector {f : Plane → Vector} |
| 33 | (hf : ∀ i, HasCompactSupport (fun z => f z i)) : HasCompactSupport f := by |
| 34 | apply HasCompactSupport.intro (isCompact_iUnion (fun i => (hf i).isCompact)) |
| 35 | intro z hz |
| 36 | funext i |
| 37 | by_contra hi |
| 38 | apply hz |
| 39 | exact mem_iUnion.mpr ⟨i, subset_tsupport (fun z => f z i) hi⟩ |
| 40 | |
| 41 | variable {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} |
| 42 | |
| 43 | /-- The vector is placed at the actual signed slot center, with exactly the |
| 44 | native chart and transverse stretch used in `PairData.rawRadial`. -/ |
| 45 | noncomputable def nativeVector {U : UnsignedLabel} (P : PairData sys U) |
| 46 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : Plane → Vector := |
| 47 | TorusAverages.nativeField (TorusAverages.slotChart vr vt hdet) |
| 48 | (slotCenter h (signedLabel U j)) |
| 49 | (TorusAverages.transverseStretch (P.ci j) sys.radius |
| 50 | (pulseVector (P.pulses j) sys.radius)) |
| 51 | |
| 52 | @[simp] theorem nativeVector_zero {U : UnsignedLabel} (P : PairData sys U) |
| 53 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) (Y : Plane) : |
| 54 | nativeVector P hdet j Y 0 = P.rawRadial hdet j Y := rfl |
| 55 | |
| 56 | @[simp] theorem nativeVector_succ {U : UnsignedLabel} (P : PairData sys U) |
| 57 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) (Y : Plane) (i : Fin 2) : |
| 58 | nativeVector P hdet j Y i.succ = P.rawTangent hdet j i Y := rfl |
| 59 | |
| 60 | theorem nativeVector_compact {U : UnsignedLabel} (P : PairData sys U) |
| 61 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : |
| 62 | HasCompactSupport (nativeVector P hdet j) := by |
| 63 | apply compact_vector |
| 64 | intro i |
| 65 | refine Fin.cases ?_ (fun k => ?_) i |
| 66 | · exact P.rawRadial_compact hdet j |
| 67 | · exact P.rawTangent_compact hdet j k |
| 68 | |
| 69 | /-- Evaluation commutes with the actual lattice sum because its support is |
| 70 | finite at the evaluation point. -/ |
| 71 | theorem periodize_apply {f : Plane → Vector} (hf : HasCompactSupport f) |
| 72 | (Y : Plane) (i : Fin 3) : |
| 73 | TorusAverages.periodize f Y i = |
| 74 | TorusAverages.periodize (fun z => f z i) Y := by |
| 75 | obtain ⟨s, hs⟩ := TorusAverages.finite_translates_on_ball hf ‖Y‖ |
| 76 | have hv : TorusAverages.periodize f Y = |
| 77 | ∑ k ∈ s, f (TorusAverages.latticePoint k + Y) := |
| 78 | tsum_eq_sum (hs Y le_rfl) |
| 79 | have hi : TorusAverages.periodize (fun z => f z i) Y = |
| 80 | ∑ k ∈ s, f (TorusAverages.latticePoint k + Y) i := by |
| 81 | apply tsum_eq_sum |
| 82 | intro k hk |
| 83 | change f (TorusAverages.latticePoint k + Y) i = 0 |
| 84 | rw [hs Y le_rfl k hk] |
| 85 | rfl |
| 86 | rw [hv, hi] |
| 87 | simp only [Finset.sum_apply] |
| 88 | |
| 89 | /-- The covering is the same integer linear map as the slot construction. -/ |
| 90 | noncomputable def coveredVector {U : UnsignedLabel} (P : PairData sys U) |
| 91 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) (Y : Plane) : Vector := |
| 92 | TorusAverages.periodize (nativeVector P hdet j) |
| 93 | ((SlotGeometry.cover ^ SlotColoring.nativeIndex h U.1) Y) |
| 94 | |
| 95 | @[simp] theorem coveredVector_zero {U : UnsignedLabel} (P : PairData sys U) |
| 96 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) (Y : Plane) : |
| 97 | coveredVector P hdet j Y 0 = |
| 98 | covered (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) Y := by |
| 99 | unfold coveredVector covered |
| 100 | rw [periodize_apply (nativeVector_compact P hdet j), cover_power_eq_iterate] |
| 101 | rfl |
| 102 | |
| 103 | @[simp] theorem coveredVector_succ {U : UnsignedLabel} (P : PairData sys U) |
| 104 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) (Y : Plane) (i : Fin 2) : |
| 105 | coveredVector P hdet j Y i.succ = |
| 106 | covered (SlotColoring.nativeIndex h U.1) (P.rawTangent hdet j i) Y := by |
| 107 | unfold coveredVector covered |
| 108 | rw [periodize_apply (nativeVector_compact P hdet j), cover_power_eq_iterate] |
| 109 | rfl |
| 110 | |
| 111 | /-- The square roots, signed-label mask, and physical outer factor are |
| 112 | literal; no fresh choice of amplitudes is made when assembling the field. -/ |
| 113 | noncomputable def slotAmplitude {U : UnsignedLabel} (P : PairData sys U) |
| 114 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 115 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) : ComplexVector := |
| 116 | fun i => ((outer * amplitude ε (mask D U q x) P.matrix T j * |
| 117 | coveredVector P hdet j Y i : ℝ) : ℂ) |
| 118 | |
| 119 | noncomputable def slotPhase {U : UnsignedLabel} (P : PairData sys U) |
| 120 | (j : Fin 2) (z : Plane × ℝ) : ℝ := (P.modes j : ℝ) * z.2 + P.phases j z.1 |
| 121 | |
| 122 | /-- Real part of the actual complex harmonic carrying the periodized vector |
| 123 | pulse. Frequency one here records the full phase; `mode_identification` |
| 124 | below also accepts a frequency kept separately from its phase. -/ |
| 125 | noncomputable def slotVelocity {U : UnsignedLabel} (P : PairData sys U) |
| 126 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 127 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) : Vector := |
| 128 | fun i => (vectorMode 1 (slotPhase P j) |
| 129 | (fun z => slotAmplitude P hdet outer ε T q x j z.1) (Y, θ) i).re |
| 130 | |
| 131 | theorem real_vectorMode {X : Type*} (κ : ℝ) (Φ : X → ℝ) (a : X → Vector) |
| 132 | (x : X) (i : Fin 3) : |
| 133 | (vectorMode κ Φ (fun z j => (a z j : ℂ)) x i).re = |
| 134 | a x i * Real.cos (κ * Φ x) := by |
| 135 | simp [vectorMode, mode, carrier, phaseFactor, Complex.exp_re, |
| 136 | Complex.mul_re, Complex.mul_im] |
| 137 | |
| 138 | theorem slotVelocity_formula {U : UnsignedLabel} (P : PairData sys U) |
| 139 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 140 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) (i : Fin 3) : |
| 141 | slotVelocity P hdet outer ε T q x j Y θ i = |
| 142 | outer * amplitude ε (mask D U q x) P.matrix T j * |
| 143 | coveredVector P hdet j Y i * Real.cos ((P.modes j : ℝ) * θ + P.phases j Y) := by |
| 144 | unfold slotVelocity slotAmplitude |
| 145 | rw [real_vectorMode] |
| 146 | simp only [one_mul, slotPhase] |
| 147 | |
| 148 | @[simp] theorem slotVelocity_zero {U : UnsignedLabel} (P : PairData sys U) |
| 149 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 150 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) : |
| 151 | slotVelocity P hdet outer ε T q x j Y θ 0 = |
| 152 | P.radialWave hdet outer ε T q x j Y θ := by |
| 153 | rw [slotVelocity_formula, coveredVector_zero] |
| 154 | rfl |
| 155 | |
| 156 | @[simp] theorem slotVelocity_succ {U : UnsignedLabel} (P : PairData sys U) |
| 157 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 158 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) (i : Fin 2) : |
| 159 | slotVelocity P hdet outer ε T q x j Y θ i.succ = |
| 160 | P.tangentWave hdet outer ε T q x j i Y θ := by |
| 161 | rw [slotVelocity_formula, coveredVector_succ] |
| 162 | rfl |
| 163 | |
| 164 | theorem slotVelocity_mask_zero {U : UnsignedLabel} (P : PairData sys U) |
| 165 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 166 | (q : ℝ) (x : SlotColoring.Position) (hm : mask D U q x = 0) |
| 167 | (j : Fin 2) (Y : Plane) (θ : ℝ) : |
| 168 | slotVelocity P hdet outer ε T q x j Y θ = 0 := by |
| 169 | funext i |
| 170 | simp [slotVelocity_formula, amplitude, hm] |
| 171 | |
| 172 | /-- The same finite set of signed labels works for all auxiliary points |
| 173 | and all angles at a positive physical point. -/ |
| 174 | theorem finite_active_slots (D : ℝ) (N : ℕ) {q : ℝ} (hq : 0 < q) |
| 175 | (x : SlotColoring.Position) : |
| 176 | ∃ F : Finset SignedIndex, ∀ a : SignedIndex, a ∉ F → |
| 177 | mask D (tailLabel N a.1) q x = 0 := by |
| 178 | classical |
| 179 | let hs := finite_active_masks D N hq x |
| 180 | refine ⟨hs.toFinset.product Finset.univ, ?_⟩ |
| 181 | intro a ha |
| 182 | by_contra hm |
| 183 | exact ha (Finset.mem_product.mpr ⟨hs.mem_toFinset.mpr hm, Finset.mem_univ _⟩) |
| 184 | |
| 185 | private theorem finsum_vector_apply {ι : Type*} (f : ι → Vector) (s : Finset ι) |
| 186 | (hf : ∀ a, a ∉ s → f a = 0) (i : Fin 3) : |
| 187 | (∑ᶠ a, f a) i = ∑ᶠ a, f a i := by |
| 188 | classical |
| 189 | have hv : (∑ᶠ a, f a) = ∑ a ∈ s, f a := by |
| 190 | apply finsum_eq_sum_of_support_subset |
| 191 | intro a ha |
| 192 | by_contra hn |
| 193 | exact ha (hf a hn) |
| 194 | have hi : (∑ᶠ a, f a i) = ∑ a ∈ s, f a i := by |
| 195 | apply finsum_eq_sum_of_support_subset |
| 196 | intro a ha |
| 197 | by_contra hn |
| 198 | exact ha (by change f a i = 0; rw [hf a hn]; rfl) |
| 199 | rw [hv, hi] |
| 200 | simp only [Finset.sum_apply] |
| 201 | |
| 202 | noncomputable def principalField {N : ℕ} |
| 203 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 204 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 205 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 206 | (Y : Plane) (θ : ℝ) : Vector := |
| 207 | ∑ᶠ a : SignedIndex, |
| 208 | slotVelocity (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ |
| 209 | |
| 210 | theorem principalField_finite {N : ℕ} |
| 211 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 212 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 213 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) : |
| 214 | ∃ F : Finset SignedIndex, ∀ Y θ, |
| 215 | principalField P hdet outer ε T q x Y θ = |
| 216 | ∑ a ∈ F, slotVelocity (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ := by |
| 217 | classical |
| 218 | obtain ⟨F, hF⟩ := finite_active_slots D N hq x |
| 219 | refine ⟨F, ?_⟩ |
| 220 | intro Y θ |
| 221 | apply finsum_eq_sum_of_support_subset |
| 222 | intro a ha |
| 223 | by_contra hn |
| 224 | exact ha (slotVelocity_mask_zero (P a.1) hdet _ _ _ q x (hF a hn) _ Y θ) |
| 225 | |
| 226 | theorem principalField_apply {N : ℕ} |
| 227 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 228 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 229 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 230 | (Y : Plane) (θ : ℝ) (i : Fin 3) : |
| 231 | principalField P hdet outer ε T q x Y θ i = |
| 232 | ∑ᶠ a : SignedIndex, |
| 233 | slotVelocity (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ i := by |
| 234 | obtain ⟨F, hF⟩ := finite_active_slots D N hq x |
| 235 | exact finsum_vector_apply _ F |
| 236 | (fun a ha => slotVelocity_mask_zero (P a.1) hdet _ _ _ q x (hF a ha) _ Y θ) i |
| 237 | |
| 238 | theorem principalField_components {N : ℕ} |
| 239 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 240 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 241 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 242 | (Y : Plane) (θ : ℝ) : |
| 243 | principalField P hdet outer ε T q x Y θ 0 = |
| 244 | assembledRadial P hdet outer ε T q x Y θ ∧ |
| 245 | ∀ i : Fin 2, principalField P hdet outer ε T q x Y θ i.succ = |
| 246 | assembledTangent P hdet outer ε T q x i Y θ := by |
| 247 | constructor |
| 248 | · simp only [principalField_apply P hdet outer ε T hq x, slotVelocity_zero, |
| 249 | assembledRadial] |
| 250 | · intro i |
| 251 | simp only [principalField_apply P hdet outer ε T hq x, slotVelocity_succ, |
| 252 | assembledTangent] |
| 253 | |
| 254 | /-- The angular integral and torus-square integral of this actual vector |
| 255 | field give the physical target, with the original inverse square roots. -/ |
| 256 | theorem physical_principal_covariance (sys : SlotSystem D h vr vt) |
| 257 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 258 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 259 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (T0 : Vec2) |
| 260 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |
| 261 | SmoothCovariance.StrictCone (P U).matrix (chartTarget h q N T0 U)) (i : Fin 2) : |
| 262 | doubleAverage (fun Y θ => |
| 263 | principalField P hdet (physicalOuter h N) (physicalViscosity h N) |
| 264 | (chartTarget h q N T0) q x Y θ 0 * |
| 265 | principalField P hdet (physicalOuter h N) (physicalViscosity h N) |
| 266 | (chartTarget h q N T0) q x Y θ i.succ) = |
| 267 | q ^ (-velocityExponent h - 1 / 2) * T0 i := by |
| 268 | simp_rw [(principalField_components P hdet _ _ _ hq x _ _).1, |
| 269 | (principalField_components P hdet _ _ _ hq x _ _).2 i] |
| 270 | exact physical_primary_covariance sys hdet N hN P hq hqN x T0 hcone i |
| 271 | |
| 272 | /-! ## A single cutoff, before periodization -/ |
| 273 | |
| 274 | /-- Multiplication by a locally supported cutoff commutes with actual |
| 275 | periodization on an injective slot. No choice of a lattice copy is needed. -/ |
| 276 | theorem periodize_smul_of_injective_support {S : Set Plane} |
| 277 | (hS : InjOn TorusAverages.quotientPoint S) {ψ : Plane → ℝ} {a : Plane → Vector} |
| 278 | (hψ : support ψ ⊆ S) (ha : support a ⊆ S) (Y : Plane) : |
| 279 | TorusAverages.periodize ψ Y • TorusAverages.periodize a Y = |
| 280 | TorusAverages.periodize (fun z => ψ z • a z) Y := by |
| 281 | have hprod : support (fun z => ψ z • a z) ⊆ S := by |
| 282 | intro z hz |
| 283 | apply hψ |
| 284 | intro he |
| 285 | exact hz (by simp [he]) |
| 286 | by_cases hactive : ∃ k : TorusInverse.Frequency, ψ (TorusAverages.latticePoint k + Y) ≠ 0 |
| 287 | · obtain ⟨k, hk⟩ := hactive |
| 288 | rw [TorusAverages.periodize_eq_native_copy hS hψ (hψ hk), |
| 289 | TorusAverages.periodize_eq_native_copy hS ha (hψ hk), |
| 290 | TorusAverages.periodize_eq_native_copy hS hprod (hψ hk)] |
| 291 | · have hz : ∀ k : TorusInverse.Frequency, ψ (TorusAverages.latticePoint k + Y) = 0 := by |
| 292 | simpa only [not_exists, not_not] using hactive |
| 293 | simp [TorusAverages.periodize, hz] |
| 294 | |
| 295 | /-- Primitive local factorization suffices to identify the coefficient |
| 296 | after applying its single cutoff. This is not an assumed covariance or |
| 297 | assembled-field identity. -/ |
| 298 | theorem cutoff_periodized_coefficient {U : UnsignedLabel} (P : PairData sys U) |
| 299 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) |
| 300 | (ψ : Plane → ℝ) (a : Plane → Vector) |
| 301 | (hψ : support ψ ⊆ slotSet h sys.radius vr vt (signedLabel U j)) |
| 302 | (ha : support a ⊆ slotSet h sys.radius vr vt (signedLabel U j)) |
| 303 | (hlocal : ∀ z, ψ z • a z = nativeVector P hdet j z) |
| 304 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (Y : Plane) : |
| 305 | TorusAverages.periodize ψ ((SlotGeometry.cover ^ SlotColoring.nativeIndex h U.1) Y) • |
| 306 | (fun i => ((outer * amplitude ε (mask D U q x) P.matrix T j * |
| 307 | TorusAverages.periodize a |
| 308 | ((SlotGeometry.cover ^ SlotColoring.nativeIndex h U.1) Y) i : ℝ) : ℂ)) = |
| 309 | slotAmplitude P hdet outer ε T q x j Y := by |
| 310 | have hh := periodize_smul_of_injective_support (sys.injective (signedLabel U j)) hψ ha |
| 311 | ((SlotGeometry.cover ^ SlotColoring.nativeIndex h U.1) Y) |
| 312 | have he : (fun z => ψ z • a z) = nativeVector P hdet j := funext hlocal |
| 313 | rw [he] at hh |
| 314 | funext i |
| 315 | have hi := congrFun hh i |
| 316 | simp only [Pi.smul_apply, smul_eq_mul] at hi |
| 317 | simp only [Pi.smul_apply, Complex.real_smul, slotAmplitude, coveredVector] |
| 318 | rw [← hi] |
| 319 | push_cast |
| 320 | ring |
| 321 | |
| 322 | /-- Identification with any actual frequency/phase presentation of the |
| 323 | same harmonic, including the frequency convention of `WaveCoefficients`. -/ |
| 324 | theorem mode_identification {X : Type*} (κ : ℝ) (Φ : X → ℝ) |
| 325 | (a : X → ComplexVector) (z : X) {U : UnsignedLabel} (P : PairData sys U) |
| 326 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 327 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) |
| 328 | (ha : a z = slotAmplitude P hdet outer ε T q x j Y) |
| 329 | (hphase : κ * Φ z = slotPhase P j (Y, θ)) : |
| 330 | (fun i => (vectorMode κ Φ a z i).re) = |
| 331 | slotVelocity P hdet outer ε T q x j Y θ := by |
| 332 | funext i |
| 333 | have ha' := congrFun ha i |
| 334 | rw [slotVelocity_formula] |
| 335 | unfold vectorMode mode |
| 336 | dsimp only |
| 337 | rw [ha'] |
| 338 | change (((outer * amplitude ε (mask D U q x) P.matrix T j * |
| 339 | coveredVector P hdet j Y i : ℝ) : ℂ) * carrier κ Φ z).re = _ |
| 340 | have hr := real_vectorMode κ Φ |
| 341 | (fun _ => fun k => outer * amplitude ε (mask D U q x) P.matrix T j * |
| 342 | coveredVector P hdet j Y k) z i |
| 343 | change (((outer * amplitude ε (mask D U q x) P.matrix T j * |
| 344 | coveredVector P hdet j Y i : ℝ) : ℂ) * carrier κ Φ z).re = _ at hr |
| 345 | rw [hr, hphase] |
| 346 | rfl |
| 347 | |
| 348 | /-- The phase in the manuscript gives precisely the recorded integer |
| 349 | angular mode and the recorded slow phase remainder. -/ |
| 350 | theorem actual_phase_identification (k ε p pz x0 : ℝ) |
| 351 | (F G : PhaseCalculus.Slow → ℝ) (s : PhaseCalculus.Slow) |
| 352 | (v : Plane → ℝ) (m : ℤ) (hm : k * p = (m : ℝ)) (Y : Plane) (θ : ℝ) : |
| 353 | k * PhaseCalculus.phase ε p pz x0 F G (s, θ, v Y) = |
| 354 | (m : ℝ) * θ + k * ((pz / ε) * s.2.1 + x0 * s.1 - |
| 355 | v Y * (p * F s + pz * G s)) := by |
| 356 | unfold PhaseCalculus.phase |
| 357 | rw [← hm] |
| 358 | ring |
| 359 | |
| 360 | /-- The rounded angular frequency is the exact same nonzero integer as in |
| 361 | the pair data; this identity does not use an approximate rounding bound. -/ |
| 362 | theorem rounded_phase_identification (k ε target pz x0 : ℝ) (hk : k ≠ 0) |
| 363 | (F G : PhaseCalculus.Slow → ℝ) (s : PhaseCalculus.Slow) |
| 364 | (v : Plane → ℝ) (Y : Plane) (θ : ℝ) : |
| 365 | k * PhaseCalculus.phase ε (PhaseEstimates.roundedFrequency k target) pz x0 F G |
| 366 | (s, θ, v Y) = |
| 367 | (PhaseEstimates.nonzeroRound (k * target) : ℝ) * θ + |
| 368 | roundedPhaseRemainder k ε target pz x0 F G s v Y := |
| 369 | actual_phase_identification k ε _ pz x0 F G s v _ |
| 370 | (PhaseEstimates.roundedFrequency_integer hk target) Y θ |
| 371 | |
| 372 | /-! ## The exact curl retains its covariance error -/ |
| 373 | |
| 374 | section CurlCorrection |
| 375 | |
| 376 | open LinearWaveBounds WeightedClasses |
| 377 | |
| 378 | variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 379 | |
| 380 | noncomputable def cutoffVelocity (a : WaveCoefficients X) (ψ : ℕ → X → ℝ) |
| 381 | (n : ℕ) (x : X) : Vector := |
| 382 | fun i => (vectorMode (a.frequency n) (a.phase n) |
| 383 | ((a.withCutoff ψ).amplitude n) x i).re |
| 384 | |
| 385 | noncomputable def curlVelocity (a : WaveCoefficients X) (s : StripData X) |
| 386 | (d : GraphDirections X) (ψ : ℕ → X → ℝ) (n : ℕ) (x : X) : Vector := |
| 387 | fun i => (vectorMode (a.frequency n) (a.phase n) |
| 388 | ((a.withCutoff ψ).curlCorrection s d n) x i).re |
| 389 | |
| 390 | noncomputable def correctedVelocity (a : WaveCoefficients X) (s : StripData X) |
| 391 | (d : GraphDirections X) (ψ : ℕ → X → ℝ) (n : ℕ) (x : X) : Vector := |
| 392 | fun i => (vectorMode (a.frequency n) (a.phase n) |
| 393 | ((a.corrected s d ψ).amplitude n) x i).re |
| 394 | |
| 395 | theorem correctedVelocity_split (a : WaveCoefficients X) (s : StripData X) |
| 396 | (d : GraphDirections X) (ψ : ℕ → X → ℝ) (n : ℕ) (x : X) : |
| 397 | correctedVelocity a s d ψ n x = cutoffVelocity a ψ n x + curlVelocity a s d ψ n x := by |
| 398 | funext i |
| 399 | simp [correctedVelocity, cutoffVelocity, curlVelocity, WaveCoefficients.corrected, |
| 400 | WaveCoefficients.addAmplitude, vectorMode, mode, add_mul] |
| 401 | |
| 402 | omit [NormedAddCommGroup X] [NormedSpace ℝ X] in |
| 403 | theorem cutoffVelocity_identification (a : WaveCoefficients X) (ψ : ℕ → X → ℝ) |
| 404 | (n : ℕ) (z : X) {U : UnsignedLabel} (P : PairData sys U) |
| 405 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 406 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) |
| 407 | (ha : (a.withCutoff ψ).amplitude n z = slotAmplitude P hdet outer ε T q x j Y) |
| 408 | (hphase : a.frequency n * a.phase n z = slotPhase P j (Y, θ)) : |
| 409 | cutoffVelocity a ψ n z = slotVelocity P hdet outer ε T q x j Y θ := |
| 410 | mode_identification (a.frequency n) (a.phase n) ((a.withCutoff ψ).amplitude n) z |
| 411 | P hdet outer ε T q x j Y θ ha hphase |
| 412 | |
| 413 | end CurlCorrection |
| 414 | |
| 415 | noncomputable def covarianceError (V R : Plane → ℝ → Vector) (i : Fin 2) |
| 416 | (Y : Plane) (θ : ℝ) : ℝ := |
| 417 | V Y θ 0 * R Y θ i.succ + R Y θ 0 * V Y θ i.succ + R Y θ 0 * R Y θ i.succ |
| 418 | |
| 419 | theorem covariance_expansion (V R : Plane → ℝ → Vector) (i : Fin 2) (Y : Plane) (θ : ℝ) : |
| 420 | (V Y θ + R Y θ) 0 * (V Y θ + R Y θ) i.succ = |
| 421 | V Y θ 0 * V Y θ i.succ + covarianceError V R i Y θ := by |
| 422 | simp only [Pi.add_apply, covarianceError] |
| 423 | ring |
| 424 | |
| 425 | private theorem continuous_angularMean {f : Plane → ℝ → ℝ} |
| 426 | (hf : Continuous f.uncurry) : Continuous (fun Y => SmoothLoop.angularMean (f Y)) := |
| 427 | (intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' hf |
| 428 | 0 (2 * Real.pi)).div_const _ |
| 429 | |
| 430 | private theorem squareAverage_add {f g : Plane → ℝ} (hf : Continuous f) (hg : Continuous g) : |
| 431 | TorusAverages.squareAverage (fun Y => f Y + g Y) = |
| 432 | TorusAverages.squareAverage f + TorusAverages.squareAverage g := by |
| 433 | rw [TorusAverages.squareAverage_eq_setIntegral (hf.fun_add hg), |
| 434 | TorusAverages.squareAverage_eq_setIntegral hf, TorusAverages.squareAverage_eq_setIntegral hg] |
| 435 | apply MeasureTheory.integral_add |
| 436 | · exact (hf.continuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc)).mono_set |
| 437 | (Set.prod_mono Ico_subset_Icc_self Ico_subset_Icc_self) |
| 438 | · exact (hg.continuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc)).mono_set |
| 439 | (Set.prod_mono Ico_subset_Icc_self Ico_subset_Icc_self) |
| 440 | |
| 441 | theorem doubleAverage_add {f g : Plane → ℝ → ℝ} |
| 442 | (hf : Continuous f.uncurry) (hg : Continuous g.uncurry) : |
| 443 | doubleAverage (fun Y θ => f Y θ + g Y θ) = doubleAverage f + doubleAverage g := by |
| 444 | unfold doubleAverage |
| 445 | have he : (fun Y => SmoothLoop.angularMean (fun θ => f Y θ + g Y θ)) = |
| 446 | fun Y => SmoothLoop.angularMean (f Y) + SmoothLoop.angularMean (g Y) := by |
| 447 | funext Y |
| 448 | apply SmoothLoop.angularMean_add |
| 449 | · exact hf.comp (continuous_const.prodMk continuous_id) |
| 450 | · exact hg.comp (continuous_const.prodMk continuous_id) |
| 451 | rw [he] |
| 452 | exact squareAverage_add (continuous_angularMean hf) (continuous_angularMean hg) |
| 453 | |
| 454 | /-- The covariance of the exact curl has three explicitly retained error |
| 455 | products, rather than being identified with the principal covariance. -/ |
| 456 | theorem averaged_covariance_expansion (V R : Plane → ℝ → Vector) |
| 457 | (hV : Continuous V.uncurry) (hR : Continuous R.uncurry) (i : Fin 2) : |
| 458 | doubleAverage (fun Y θ => (V Y θ + R Y θ) 0 * (V Y θ + R Y θ) i.succ) = |
| 459 | doubleAverage (fun Y θ => V Y θ 0 * V Y θ i.succ) + |
| 460 | doubleAverage (covarianceError V R i) := by |
| 461 | simp_rw [covariance_expansion] |
| 462 | apply doubleAverage_add |
| 463 | · exact ((continuous_apply 0).comp hV).mul ((continuous_apply i.succ).comp hV) |
| 464 | · exact ((((continuous_apply 0).comp hV).mul ((continuous_apply i.succ).comp hR)).add |
| 465 | (((continuous_apply 0).comp hR).mul ((continuous_apply i.succ).comp hV))).add |
| 466 | (((continuous_apply 0).comp hR).mul ((continuous_apply i.succ).comp hR)) |
| 467 | |
| 468 | /-! ## Canonical source data: actual ODE pulses and the same matrix -/ |
| 469 | |
| 470 | section Source |
| 471 | |
| 472 | open PrimaryPulseBounds |
| 473 | |
| 474 | variable {Q : Type} [NormedAddCommGroup Q] |
| 475 | |
| 476 | /-- Primitive data for a signed pair of actual ODE pulses. No local field, |
| 477 | matrix, or covariance identity is a field of this structure. -/ |
| 478 | structure SourcePair (Q : Type) [NormedAddCommGroup Q] |
| 479 | {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) (U : UnsignedLabel) where |
| 480 | domain : Set Q |
| 481 | point : Q |
| 482 | point_mem : point ∈ domain |
| 483 | frame : Fin 2 → PrimaryODE.FrameData Q |
| 484 | lam : Fin 2 → ℝ |
| 485 | rate : Fin 2 → ℝ |
| 486 | length : Fin 2 → ℝ |
| 487 | length_pos : ∀ j, 0 < length j |
| 488 | coefficient_continuous : ∀ j, |
| 489 | ContinuousOn ((frame j).coefficient 1) (domain ×ˢ Icc 0 (length j)) |
| 490 | kinematics : ∀ j, (frame j).Kinematics point (Icc 0 (length j)) |
| 491 | stretch : Vec2 |
| 492 | stretch_pos : ∀ j, 0 < stretch j |
| 493 | fits : ∀ j, length j ≤ 2 * sys.radius / stretch j |
| 494 | mode : Fin 2 → ℤ |
| 495 | mode_ne : ∀ j, mode j ≠ 0 |
| 496 | phase : Fin 2 → Plane → ℝ |
| 497 | |
| 498 | namespace SourcePair |
| 499 | |
| 500 | variable {U : UnsignedLabel} (A : SourcePair Q sys U) |
| 501 | |
| 502 | noncomputable def pairData : PairData sys U where |
| 503 | pulses := fun j => canonicalPrimaryPulse (A.frame j) (A.lam j) (A.rate j) |
| 504 | (A.length_pos j) A.domain (A.coefficient_continuous j) A.point A.point_mem (A.kinematics j) |
| 505 | ci := A.stretch |
| 506 | ci_pos := A.stretch_pos |
| 507 | fits := by |
| 508 | intro j t ht |
| 509 | have hmem : t ∈ Icc 0 (A.length j) := by |
| 510 | by_contra hn |
| 511 | exact ht (slotCutoff_zero_of_not_mem_Icc (A.length_pos j) hn) |
| 512 | exact ⟨hmem.1, hmem.2.trans (A.fits j)⟩ |
| 513 | modes := A.mode |
| 514 | modes_ne := A.mode_ne |
| 515 | phases := A.phase |
| 516 | |
| 517 | /-- The matrix is computed directly from the normalized ODE fundamentals, |
| 518 | with the exact determinant, transverse scale, and slot-length prefactor. -/ |
| 519 | noncomputable def sourceMatrix : Mat2 := |
| 520 | primaryCovariance |
| 521 | (fun j (_ : Unit) => nativePrefactor vr vt sys.radius * A.stretch j * A.length j) |
| 522 | (fun j _ => A.frame j) (fun j _ => A.lam j) (fun j _ => A.rate j) |
| 523 | (fun j _ => A.length j) () A.point |
| 524 | |
| 525 | theorem sourceMatrix_eq : A.sourceMatrix = A.pairData.matrix := by |
| 526 | exact primaryCovariance_eq_canonicalPairMatrix _ _ _ _ _ () A.domain A.point A.point_mem |
| 527 | A.length_pos A.coefficient_continuous A.kinematics vr vt sys.radius A.stretch |
| 528 | (fun _ => rfl) |
| 529 | |
| 530 | theorem pulseVector_eq (j : Fin 2) (z : Plane) : |
| 531 | pulseVector (A.pairData.pulses j) sys.radius z = |
| 532 | fun i => localPrimaryProfile (A.frame j) (A.lam j) (A.rate j) |
| 533 | (A.length j) sys.radius A.point z i := by |
| 534 | funext i |
| 535 | refine Fin.cases ?_ (fun k => ?_) i |
| 536 | · exact canonicalPrimaryPulse_radialProfile (A.frame j) (A.lam j) (A.rate j) sys.radius |
| 537 | (A.length_pos j) A.domain (A.coefficient_continuous j) A.point A.point_mem (A.kinematics j) z |
| 538 | · exact canonicalPrimaryPulse_tangentProfile (A.frame j) (A.lam j) (A.rate j) sys.radius |
| 539 | (A.length_pos j) A.domain (A.coefficient_continuous j) A.point A.point_mem (A.kinematics j) z k |
| 540 | |
| 541 | /-- The source vector is evaluated from `cutoffPulse`, rather than from |
| 542 | arbitrarily supplied radial and tangent component functions. -/ |
| 543 | noncomputable def nativeSource (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 544 | (j : Fin 2) : Plane → Vector := |
| 545 | TorusAverages.nativeField (TorusAverages.slotChart vr vt hdet) |
| 546 | (slotCenter h (signedLabel U j)) |
| 547 | (TorusAverages.transverseStretch (A.stretch j) sys.radius |
| 548 | (fun z i => localPrimaryProfile (A.frame j) (A.lam j) (A.rate j) |
| 549 | (A.length j) sys.radius A.point z i)) |
| 550 | |
| 551 | theorem nativeSource_eq (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : |
| 552 | A.nativeSource hdet j = nativeVector A.pairData hdet j := by |
| 553 | funext Y |
| 554 | symm |
| 555 | exact A.pulseVector_eq j _ |
| 556 | |
| 557 | /-- The native complex coefficient has the literal inverse-square-root |
| 558 | amplitude and a single local Gaussian cutoff. -/ |
| 559 | noncomputable def nativeCoefficient (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 560 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 561 | (j : Fin 2) (Y : Plane) : ComplexVector := |
| 562 | fun i => ((outer * amplitude ε (mask D U q x) A.sourceMatrix T j * |
| 563 | A.nativeSource hdet j Y i : ℝ) : ℂ) |
| 564 | |
| 565 | noncomputable def actualAmplitude (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 566 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 567 | (j : Fin 2) (Y : Plane) : ComplexVector := |
| 568 | TorusAverages.periodize (A.nativeCoefficient hdet outer ε T q x j) |
| 569 | ((SlotGeometry.cover ^ SlotColoring.nativeIndex h U.1) Y) |
| 570 | |
| 571 | end SourcePair |
| 572 | |
| 573 | private theorem periodize_scaled_real_vector {f : Plane → Vector} |
| 574 | (hf : HasCompactSupport f) (c : ℝ) (Y : Plane) (i : Fin 3) : |
| 575 | TorusAverages.periodize (fun z => fun j => ((c * f z j : ℝ) : ℂ)) Y i = |
| 576 | ((c * TorusAverages.periodize f Y i : ℝ) : ℂ) := by |
| 577 | obtain ⟨s, hs⟩ := TorusAverages.finite_translates_on_ball hf ‖Y‖ |
| 578 | have hreal : TorusAverages.periodize f Y = |
| 579 | ∑ k ∈ s, f (TorusAverages.latticePoint k + Y) := tsum_eq_sum (hs Y le_rfl) |
| 580 | have hcomplex : TorusAverages.periodize (fun z => fun j => ((c * f z j : ℝ) : ℂ)) Y = |
| 581 | ∑ k ∈ s, fun j => ((c * f (TorusAverages.latticePoint k + Y) j : ℝ) : ℂ) := by |
| 582 | apply tsum_eq_sum |
| 583 | intro k hk |
| 584 | funext j |
| 585 | simp [hs Y le_rfl k hk] |
| 586 | rw [hreal, hcomplex] |
| 587 | simp [Finset.sum_apply, Finset.mul_sum] |
| 588 | |
| 589 | namespace SourcePair |
| 590 | |
| 591 | variable {U : UnsignedLabel} (A : SourcePair Q sys U) |
| 592 | |
| 593 | /-- The actual periodized complex coefficient equals the coefficient used |
| 594 | in the radial/tangent covariance assembly. -/ |
| 595 | theorem actualAmplitude_eq (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 596 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) : |
| 597 | A.actualAmplitude hdet outer ε T q x j Y = |
| 598 | slotAmplitude A.pairData hdet outer ε T q x j Y := by |
| 599 | unfold actualAmplitude nativeCoefficient |
| 600 | rw [A.sourceMatrix_eq, A.nativeSource_eq] |
| 601 | funext i |
| 602 | exact periodize_scaled_real_vector (nativeVector_compact A.pairData hdet j) _ _ i |
| 603 | |
| 604 | noncomputable def actualVelocity (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 605 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 606 | (j : Fin 2) (Y : Plane) (θ : ℝ) : Vector := |
| 607 | fun i => (vectorMode 1 (slotPhase A.pairData j) |
| 608 | (fun z => A.actualAmplitude hdet outer ε T q x j z.1) (Y, θ) i).re |
| 609 | |
| 610 | theorem actualVelocity_eq (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 611 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 612 | (j : Fin 2) (Y : Plane) (θ : ℝ) : |
| 613 | A.actualVelocity hdet outer ε T q x j Y θ = |
| 614 | slotVelocity A.pairData hdet outer ε T q x j Y θ := by |
| 615 | apply mode_identification 1 (slotPhase A.pairData j) |
| 616 | (fun z => A.actualAmplitude hdet outer ε T q x j z.1) (Y, θ) |
| 617 | · exact A.actualAmplitude_eq hdet outer ε T q x j Y |
| 618 | · simp |
| 619 | |
| 620 | end SourcePair |
| 621 | |
| 622 | noncomputable def sourceField {N : ℕ} |
| 623 | (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 624 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 625 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 626 | (Y : Plane) (θ : ℝ) : Vector := |
| 627 | ∑ᶠ a : SignedIndex, |
| 628 | (A a.1).actualVelocity hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ |
| 629 | |
| 630 | theorem sourceField_eq {N : ℕ} |
| 631 | (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 632 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 633 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 634 | (Y : Plane) (θ : ℝ) : |
| 635 | sourceField A hdet outer ε T q x Y θ = |
| 636 | principalField (fun U => (A U).pairData) hdet outer ε T q x Y θ := by |
| 637 | unfold sourceField principalField |
| 638 | apply finsum_congr |
| 639 | intro a |
| 640 | exact (A a.1).actualVelocity_eq hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ |
| 641 | |
| 642 | /-- End-to-end principal covariance for the actual ODE/source coefficient. |
| 643 | The assumed cone concerns its actual normalized ODE integral matrix. -/ |
| 644 | theorem physical_source_covariance (sys : SlotSystem D h vr vt) |
| 645 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 646 | (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 647 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (T0 : Vec2) |
| 648 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |
| 649 | SmoothCovariance.StrictCone (A U).sourceMatrix (chartTarget h q N T0 U)) (i : Fin 2) : |
| 650 | doubleAverage (fun Y θ => |
| 651 | sourceField A hdet (physicalOuter h N) (physicalViscosity h N) |
| 652 | (chartTarget h q N T0) q x Y θ 0 * |
| 653 | sourceField A hdet (physicalOuter h N) (physicalViscosity h N) |
| 654 | (chartTarget h q N T0) q x Y θ i.succ) = |
| 655 | q ^ (-velocityExponent h - 1 / 2) * T0 i := by |
| 656 | simp_rw [sourceField_eq] |
| 657 | apply physical_principal_covariance sys hdet N hN _ hq hqN x T0 _ i |
| 658 | intro U hU |
| 659 | rw [← (A U).sourceMatrix_eq] |
| 660 | exact hcone U hU |
| 661 | |
| 662 | end Source |
| 663 | |
| 664 | /-! ## Adapter to the actual `WaveCoefficients.withCutoff` field -/ |
| 665 | |
| 666 | section CoefficientAssembly |
| 667 | |
| 668 | open LinearWaveBounds |
| 669 | |
| 670 | variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 671 | variable {Q : Type} [NormedAddCommGroup Q] |
| 672 | |
| 673 | noncomputable def cutoffModeField (a : SignedIndex → WaveCoefficients X) |
| 674 | (ψ : SignedIndex → ℕ → X → ℝ) (band : SignedIndex → ℕ) |
| 675 | (point : SignedIndex → Plane → ℝ → X) (Y : Plane) (θ : ℝ) : Vector := |
| 676 | ∑ᶠ b : SignedIndex, cutoffVelocity (a b) (ψ b) (band b) (point b Y θ) |
| 677 | |
| 678 | omit [NormedAddCommGroup X] [NormedSpace ℝ X] in |
| 679 | /-- The only bindings are the constructed coefficient and phase. The field |
| 680 | and its assembled covariance are conclusions of this adapter. -/ |
| 681 | theorem cutoffModeField_eq_source {N : ℕ} |
| 682 | (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 683 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 684 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 685 | (a : SignedIndex → WaveCoefficients X) (ψ : SignedIndex → ℕ → X → ℝ) |
| 686 | (band : SignedIndex → ℕ) (point : SignedIndex → Plane → ℝ → X) |
| 687 | (hcoeff : ∀ b Y θ, ((a b).withCutoff (ψ b)).amplitude (band b) (point b Y θ) = |
| 688 | (A b.1).actualAmplitude hdet (outer b.1) (ε b.1) (T b.1) q x b.2 Y) |
| 689 | (hphase : ∀ b Y θ, (a b).frequency (band b) * (a b).phase (band b) (point b Y θ) = |
| 690 | slotPhase (A b.1).pairData b.2 (Y, θ)) (Y : Plane) (θ : ℝ) : |
| 691 | cutoffModeField a ψ band point Y θ = sourceField A hdet outer ε T q x Y θ := by |
| 692 | unfold cutoffModeField sourceField |
| 693 | apply finsum_congr |
| 694 | intro b |
| 695 | rw [(A b.1).actualVelocity_eq] |
| 696 | exact cutoffVelocity_identification (a b) (ψ b) (band b) (point b Y θ) |
| 697 | (A b.1).pairData hdet (outer b.1) (ε b.1) (T b.1) q x b.2 Y θ |
| 698 | ((hcoeff b Y θ).trans ((A b.1).actualAmplitude_eq hdet _ _ _ q x b.2 Y)) |
| 699 | (hphase b Y θ) |
| 700 | |
| 701 | omit [NormedAddCommGroup X] [NormedSpace ℝ X] in |
| 702 | theorem cutoffModeField_physical_covariance (sys : SlotSystem D h vr vt) |
| 703 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 704 | (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 705 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (T0 : Vec2) |
| 706 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |
| 707 | SmoothCovariance.StrictCone (A U).sourceMatrix (chartTarget h q N T0 U)) |
| 708 | (a : SignedIndex → WaveCoefficients X) (ψ : SignedIndex → ℕ → X → ℝ) |
| 709 | (band : SignedIndex → ℕ) (point : SignedIndex → Plane → ℝ → X) |
| 710 | (hcoeff : ∀ b Y θ, ((a b).withCutoff (ψ b)).amplitude (band b) (point b Y θ) = |
| 711 | (A b.1).actualAmplitude hdet (physicalOuter h N b.1) (physicalViscosity h N b.1) |
| 712 | (chartTarget h q N T0 b.1) q x b.2 Y) |
| 713 | (hphase : ∀ b Y θ, (a b).frequency (band b) * (a b).phase (band b) (point b Y θ) = |
| 714 | slotPhase (A b.1).pairData b.2 (Y, θ)) (i : Fin 2) : |
| 715 | doubleAverage (fun Y θ => cutoffModeField a ψ band point Y θ 0 * |
| 716 | cutoffModeField a ψ band point Y θ i.succ) = |
| 717 | q ^ (-velocityExponent h - 1 / 2) * T0 i := by |
| 718 | simp_rw [cutoffModeField_eq_source A hdet _ _ _ q x a ψ band point hcoeff hphase] |
| 719 | exact physical_source_covariance sys hdet N hN A hq hqN x T0 hcone i |
| 720 | |
| 721 | /-- A finite exact-curl assembly retains the sum of its actual curl |
| 722 | corrections. This applies before any covariance estimate is made. -/ |
| 723 | theorem finite_corrected_field_split {ι : Type*} (F : Finset ι) |
| 724 | (a : ι → WaveCoefficients X) (s : ι → WeightedClasses.StripData X) |
| 725 | (d : ι → GraphDirections X) (ψ : ι → ℕ → X → ℝ) |
| 726 | (band : ι → ℕ) (point : ι → X) : |
| 727 | (∑ b ∈ F, correctedVelocity (a b) (s b) (d b) (ψ b) (band b) (point b)) = |
| 728 | (∑ b ∈ F, cutoffVelocity (a b) (ψ b) (band b) (point b)) + |
| 729 | ∑ b ∈ F, curlVelocity (a b) (s b) (d b) (ψ b) (band b) (point b) := by |
| 730 | simp_rw [correctedVelocity_split] |
| 731 | exact Finset.sum_add_distrib |
| 732 | |
| 733 | end CoefficientAssembly |
| 734 | |
| 735 | /-! ## The angular covariance is a genuine function on the auxiliary torus -/ |
| 736 | |
| 737 | private noncomputable def latticeCover (k : TorusInverse.Frequency) : TorusInverse.Frequency := |
| 738 | (3 * k.1 + k.2, k.1 + 5 * k.2) |
| 739 | |
| 740 | private theorem covering_add_lattice (Y : Plane) (k : TorusInverse.Frequency) : |
| 741 | TorusAverages.covering (Y + TorusAverages.latticePoint k) = |
| 742 | TorusAverages.covering Y + TorusAverages.latticePoint (latticeCover k) := by |
| 743 | ext <;> simp [TorusAverages.covering, TorusAverages.latticePoint, latticeCover] <;> ring |
| 744 | |
| 745 | private theorem covering_iterate_add_lattice (n : ℕ) (Y : Plane) (k : TorusInverse.Frequency) : |
| 746 | TorusAverages.covering^[n] (Y + TorusAverages.latticePoint k) = |
| 747 | TorusAverages.covering^[n] Y + TorusAverages.latticePoint (latticeCover^[n] k) := by |
| 748 | induction n with |
| 749 | | zero => rfl |
| 750 | | succ n ih => |
| 751 | rw [Function.iterate_succ_apply', ih, covering_add_lattice, |
| 752 | Function.iterate_succ_apply', Function.iterate_succ_apply'] |
| 753 | |
| 754 | theorem covered_periodic (n : ℕ) (f : Plane → ℝ) (Y : Plane) (k : TorusInverse.Frequency) : |
| 755 | covered n f (Y + TorusAverages.latticePoint k) = covered n f Y := by |
| 756 | unfold covered |
| 757 | rw [covering_iterate_add_lattice, TorusAverages.periodize_periodic] |
| 758 | |
| 759 | theorem slot_cross_zero {N : ℕ} (hN : 1 ≤ N) |
| 760 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 761 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 762 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 763 | {a b : SignedIndex} (hab : a ≠ b) (Y : Plane) (θ : ℝ) (i : Fin 2) : |
| 764 | slotVelocity (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ 0 * |
| 765 | slotVelocity (P b.1) hdet (outer b.1) (ε b.1) (T b.1) q x b.2 Y θ i.succ = 0 := by |
| 766 | have hlevel (c : SignedIndex) : 1 ≤ (signedTailLabel N c).1 := by |
| 767 | change 1 ≤ c.1.1 + N |
| 768 | omega |
| 769 | have hne : signedTailLabel N a ≠ signedTailLabel N b := |
| 770 | fun he => hab ((signedTailLabel_injective N) he) |
| 771 | have hz := sys.wave_cross_zero (hlevel a) (hlevel b) hne |
| 772 | ((P a.1).rawRadial_support hdet a.2) ((P b.1).rawTangent_support hdet b.2 i) hq x Y θ |
| 773 | (outer a.1 * Real.sqrt (ε a.1) * SmoothCovariance.amplitudes (P a.1).matrix (T a.1) a.2) |
| 774 | (outer b.1 * Real.sqrt (ε b.1) * SmoothCovariance.amplitudes (P b.1).matrix (T b.1) b.2) |
| 775 | ((P a.1).modes a.2) ((P b.1).modes b.2) ((P a.1).phases a.2) ((P b.1).phases b.2) |
| 776 | simp only [slotVelocity_zero, slotVelocity_succ, PairData.radialWave, PairData.tangentWave, |
| 777 | signedTailLabel, physicalMask_signedLabel, amplitude, mul_assoc] at hz ⊢ |
| 778 | exact hz |
| 779 | |
| 780 | noncomputable def diagonalCovariance {N : ℕ} |
| 781 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 782 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 783 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 784 | (a : SignedIndex) (i : Fin 2) (Y : Plane) : ℝ := |
| 785 | (outer a.1 * amplitude (ε a.1) (mask D (tailLabel N a.1) q x) (P a.1).matrix (T a.1) a.2) ^ 2 * |
| 786 | covered (SlotColoring.nativeIndex h (tailLabel N a.1).1) ((P a.1).rawRadial hdet a.2) Y * |
| 787 | covered (SlotColoring.nativeIndex h (tailLabel N a.1).1) ((P a.1).rawTangent hdet a.2 i) Y * (1 / 2) |
| 788 | |
| 789 | /-- Both off-diagonal elimination and angular integration are performed |
| 790 | on the actual finite active family, before descending to the torus. -/ |
| 791 | theorem angular_principal_finite {N : ℕ} (hN : 1 ≤ N) |
| 792 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 793 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 794 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) (i : Fin 2) : |
| 795 | ∃ F : Finset SignedIndex, ∀ Y, |
| 796 | SmoothLoop.angularMean (fun θ => principalField P hdet outer ε T q x Y θ 0 * |
| 797 | principalField P hdet outer ε T q x Y θ i.succ) = |
| 798 | ∑ a ∈ F, diagonalCovariance P hdet outer ε T q x a i Y := by |
| 799 | classical |
| 800 | obtain ⟨F, hF⟩ := principalField_finite P hdet outer ε T hq x |
| 801 | refine ⟨F, ?_⟩ |
| 802 | intro Y |
| 803 | have hprod (θ : ℝ) : principalField P hdet outer ε T q x Y θ 0 * |
| 804 | principalField P hdet outer ε T q x Y θ i.succ = |
| 805 | ∑ a ∈ F, slotVelocity (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ 0 * |
| 806 | slotVelocity (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ i.succ := by |
| 807 | simp only [hF Y θ, Finset.sum_apply] |
| 808 | apply sum_product_diagonal |
| 809 | intro a _ b _ hab |
| 810 | exact slot_cross_zero hN P hdet outer ε T hq x hab Y θ i |
| 811 | simp_rw [hprod] |
| 812 | rw [angularMean_sum F] |
| 813 | · apply Finset.sum_congr rfl |
| 814 | intro a _ |
| 815 | simp only [slotVelocity_zero, slotVelocity_succ, PairData.radialWave, PairData.tangentWave] |
| 816 | exact angularMean_wave_product _ _ _ _ _ ((P a.1).modes_ne a.2) _ _ |
| 817 | · intro a _ |
| 818 | simp only [slotVelocity_zero, slotVelocity_succ, PairData.radialWave, PairData.tangentWave] |
| 819 | exact (wave_continuous_theta _ _ _ _ _ _).mul (wave_continuous_theta _ _ _ _ _ _) |
| 820 | |
| 821 | theorem angular_principal_regular {N : ℕ} (hN : 1 ≤ N) |
| 822 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 823 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 824 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) (i : Fin 2) : |
| 825 | let f := fun Y => SmoothLoop.angularMean (fun θ => |
| 826 | principalField P hdet outer ε T q x Y θ 0 * principalField P hdet outer ε T q x Y θ i.succ) |
| 827 | Continuous f ∧ ∀ Y k, f (Y + TorusAverages.latticePoint k) = f Y := by |
| 828 | dsimp only |
| 829 | obtain ⟨F, hF⟩ := angular_principal_finite hN P hdet outer ε T hq x i |
| 830 | constructor |
| 831 | · simp_rw [hF] |
| 832 | apply continuous_finsetSum |
| 833 | intro a _ |
| 834 | exact ((continuous_const.mul |
| 835 | (covered_continuous ((P a.1).rawRadial_continuous hdet a.2) |
| 836 | ((P a.1).rawRadial_compact hdet a.2) _)).mul |
| 837 | (covered_continuous ((P a.1).rawTangent_continuous hdet a.2 i) |
| 838 | ((P a.1).rawTangent_compact hdet a.2 i) _)).mul continuous_const |
| 839 | · intro Y k |
| 840 | rw [hF, hF] |
| 841 | apply Finset.sum_congr rfl |
| 842 | intro a _ |
| 843 | unfold diagonalCovariance |
| 844 | rw [covered_periodic, covered_periodic] |
| 845 | |
| 846 | /-- The square average is exactly the Haar integral of the angular |
| 847 | covariance's continuous descent to the auxiliary torus. -/ |
| 848 | theorem principal_torus_average {N : ℕ} (hN : 1 ≤ N) |
| 849 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 850 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 851 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) (i : Fin 2) : |
| 852 | ∃ g : C(TorusInverse.Torus, ℂ), |
| 853 | (∀ Y, g (TorusAverages.quotientPoint Y) = |
| 854 | ((SmoothLoop.angularMean (fun θ => principalField P hdet outer ε T q x Y θ 0 * |
| 855 | principalField P hdet outer ε T q x Y θ i.succ) : ℝ) : ℂ)) ∧ |
| 856 | (∫ z, g z ∂TorusInverse.torusMeasure) = |
| 857 | ((doubleAverage (fun Y θ => principalField P hdet outer ε T q x Y θ 0 * |
| 858 | principalField P hdet outer ε T q x Y θ i.succ) : ℝ) : ℂ) := by |
| 859 | obtain ⟨hc, hp⟩ := angular_principal_regular hN P hdet outer ε T hq x i |
| 860 | let f : Plane → ℝ := fun Y => SmoothLoop.angularMean (fun θ => |
| 861 | principalField P hdet outer ε T q x Y θ 0 * principalField P hdet outer ε T q x Y θ i.succ) |
| 862 | have hcc : Continuous (fun Y => (f Y : ℂ)) := Complex.continuous_ofReal.comp hc |
| 863 | have hpc : SmoothFourierData.UnitPeriodic (fun Y => (f Y : ℂ)) := by |
| 864 | intro Y k |
| 865 | exact congrArg Complex.ofReal (hp Y k) |
| 866 | let g := SmoothFourierData.descendContinuous (fun Y => (f Y : ℂ)) hcc hpc |
| 867 | refine ⟨g, fun _ => rfl, ?_⟩ |
| 868 | rw [← TorusAverages.squareAverage_torusLift g] |
| 869 | change TorusAverages.squareAverage (fun Y => (f Y : ℂ)) = |
| 870 | ((TorusAverages.squareAverage f : ℝ) : ℂ) |
| 871 | simp only [TorusAverages.squareAverage, ← intervalIntegral.integral_ofReal] |
| 872 | |
| 873 | theorem physical_source_torus_covariance {Q : Type} [NormedAddCommGroup Q] |
| 874 | (sys : SlotSystem D h vr vt) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 875 | (N : ℕ) (hN : 1 ≤ N) (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 876 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (T0 : Vec2) |
| 877 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |
| 878 | SmoothCovariance.StrictCone (A U).sourceMatrix (chartTarget h q N T0 U)) (i : Fin 2) : |
| 879 | ∃ g : C(TorusInverse.Torus, ℂ), |
| 880 | (∀ Y, g (TorusAverages.quotientPoint Y) = |
| 881 | ((SmoothLoop.angularMean (fun θ => |
| 882 | sourceField A hdet (physicalOuter h N) (physicalViscosity h N) |
| 883 | (chartTarget h q N T0) q x Y θ 0 * |
| 884 | sourceField A hdet (physicalOuter h N) (physicalViscosity h N) |
| 885 | (chartTarget h q N T0) q x Y θ i.succ) : ℝ) : ℂ)) ∧ |
| 886 | (∫ z, g z ∂TorusInverse.torusMeasure) = |
| 887 | ((q ^ (-velocityExponent h - 1 / 2) * T0 i : ℝ) : ℂ) := by |
| 888 | obtain ⟨g, hg, hint⟩ := principal_torus_average hN (fun U => (A U).pairData) hdet |
| 889 | (physicalOuter h N) (physicalViscosity h N) (chartTarget h q N T0) hq x i |
| 890 | refine ⟨g, ?_, ?_⟩ |
| 891 | · simpa only [sourceField_eq] using hg |
| 892 | · have hphys := physical_source_covariance sys hdet N hN A hq hqN x T0 hcone i |
| 893 | simp only [sourceField_eq] at hphys |
| 894 | rw [hphys] at hint |
| 895 | exact hint |
| 896 | |
| 897 | theorem nativeVector_continuous {U : UnsignedLabel} (P : PairData sys U) |
| 898 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : |
| 899 | Continuous (nativeVector P hdet j) := by |
| 900 | apply continuous_pi |
| 901 | intro i |
| 902 | refine Fin.cases ?_ (fun k => ?_) i |
| 903 | · exact P.rawRadial_continuous hdet j |
| 904 | · exact P.rawTangent_continuous hdet j k |
| 905 | |
| 906 | theorem slotVelocity_continuous {U : UnsignedLabel} (P : PairData sys U) |
| 907 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 908 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (hphase : Continuous (P.phases j)) : |
| 909 | Continuous (fun z : Plane × ℝ => slotVelocity P hdet outer ε T q x j z.1 z.2) := by |
| 910 | have hcov : Continuous (coveredVector P hdet j) := |
| 911 | (TorusAverages.periodize_continuous (nativeVector_continuous P hdet j) |
| 912 | (nativeVector_compact P hdet j)).comp (SlotGeometry.cover ^ SlotColoring.nativeIndex h U.1).continuous |
| 913 | apply continuous_pi |
| 914 | intro i |
| 915 | simp only [slotVelocity_formula] |
| 916 | exact (continuous_const.mul (((continuous_apply i).comp hcov).comp continuous_fst)).mul |
| 917 | (Real.continuous_cos.comp ((continuous_const.mul continuous_snd).add (hphase.comp continuous_fst))) |
| 918 | |
| 919 | theorem principalField_continuous {N : ℕ} |
| 920 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 921 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 922 | (T : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 923 | (hphase : ∀ U j, Continuous ((P U).phases j)) : |
| 924 | Continuous (fun z : Plane × ℝ => principalField P hdet outer ε T q x z.1 z.2) := by |
| 925 | obtain ⟨F, hF⟩ := principalField_finite P hdet outer ε T hq x |
| 926 | have he : (fun z : Plane × ℝ => principalField P hdet outer ε T q x z.1 z.2) = |
| 927 | fun z => ∑ a ∈ F, slotVelocity (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 z.1 z.2 := by |
| 928 | funext z |
| 929 | exact hF z.1 z.2 |
| 930 | rw [he] |
| 931 | exact continuous_finsetSum F (fun a _ => |
| 932 | slotVelocity_continuous (P a.1) hdet (outer a.1) (ε a.1) (T a.1) q x a.2 (hphase a.1 a.2)) |
| 933 | |
| 934 | /-- The physical covariance target belongs to the principal field. Adding |
| 935 | the actual curl remainder preserves all three covariance error terms. -/ |
| 936 | theorem physical_source_plus_remainder {Q : Type} [NormedAddCommGroup Q] |
| 937 | (sys : SlotSystem D h vr vt) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 938 | (N : ℕ) (hN : 1 ≤ N) (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 939 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (T0 : Vec2) |
| 940 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |
| 941 | SmoothCovariance.StrictCone (A U).sourceMatrix (chartTarget h q N T0 U)) |
| 942 | (hphase : ∀ U j, Continuous ((A U).phase j)) |
| 943 | (R : Plane → ℝ → Vector) (hR : Continuous R.uncurry) (i : Fin 2) : |
| 944 | let V := sourceField A hdet (physicalOuter h N) (physicalViscosity h N) (chartTarget h q N T0) q x |
| 945 | doubleAverage (fun Y θ => (V Y θ + R Y θ) 0 * (V Y θ + R Y θ) i.succ) = |
| 946 | q ^ (-velocityExponent h - 1 / 2) * T0 i + doubleAverage (covarianceError V R i) := by |
| 947 | dsimp only |
| 948 | have hV : Continuous (sourceField A hdet (physicalOuter h N) (physicalViscosity h N) |
| 949 | (chartTarget h q N T0) q x).uncurry := by |
| 950 | change Continuous (fun z : Plane × ℝ => sourceField A hdet (physicalOuter h N) |
| 951 | (physicalViscosity h N) (chartTarget h q N T0) q x z.1 z.2) |
| 952 | simp_rw [sourceField_eq] |
| 953 | exact principalField_continuous (fun U => (A U).pairData) hdet _ _ _ hq x hphase |
| 954 | rw [averaged_covariance_expansion _ R hV hR i, |
| 955 | physical_source_covariance sys hdet N hN A hq hqN x T0 hcone i] |
| 956 | |
| 957 | /-- Integer angular modes give actual full-turn periodicity. -/ |
| 958 | theorem slotVelocity_angular_periodic {U : UnsignedLabel} (P : PairData sys U) |
| 959 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 960 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) : |
| 961 | slotVelocity P hdet outer ε T q x j Y (θ + 2 * Real.pi) = |
| 962 | slotVelocity P hdet outer ε T q x j Y θ := by |
| 963 | funext i |
| 964 | simp only [slotVelocity_formula] |
| 965 | congr 1 |
| 966 | rw [show (P.modes j : ℝ) * (θ + 2 * Real.pi) + P.phases j Y = |
| 967 | ((P.modes j : ℝ) * θ + P.phases j Y) + (P.modes j : ℝ) * (2 * Real.pi) by ring] |
| 968 | exact Real.cos_add_int_mul_two_pi _ _ |
| 969 | |
| 970 | theorem principalField_angular_periodic {N : ℕ} |
| 971 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 972 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 973 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) (Y : Plane) (θ : ℝ) : |
| 974 | principalField P hdet outer ε T q x Y (θ + 2 * Real.pi) = |
| 975 | principalField P hdet outer ε T q x Y θ := by |
| 976 | unfold principalField |
| 977 | apply finsum_congr |
| 978 | intro a |
| 979 | exact slotVelocity_angular_periodic (P a.1) hdet _ _ _ q x a.2 Y θ |
| 980 | |
| 981 | /-- Full-field auxiliary periodicity uses the source phase convention. |
| 982 | The angular covariance's periodicity above needed no such hypothesis. -/ |
| 983 | theorem principalField_auxiliary_periodic {N : ℕ} |
| 984 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 985 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 986 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 987 | (hphase : ∀ U j Y k, (P U).phases j (Y + TorusAverages.latticePoint k) = (P U).phases j Y) |
| 988 | (Y : Plane) (θ : ℝ) (k : TorusInverse.Frequency) : |
| 989 | principalField P hdet outer ε T q x (Y + TorusAverages.latticePoint k) θ = |
| 990 | principalField P hdet outer ε T q x Y θ := by |
| 991 | unfold principalField |
| 992 | apply finsum_congr |
| 993 | intro a |
| 994 | have hcov : coveredVector (P a.1) hdet a.2 (Y + TorusAverages.latticePoint k) = |
| 995 | coveredVector (P a.1) hdet a.2 Y := by |
| 996 | funext i |
| 997 | refine Fin.cases ?_ (fun l => ?_) i |
| 998 | · simp only [coveredVector_zero, covered_periodic] |
| 999 | · simp only [coveredVector_succ, covered_periodic] |
| 1000 | funext i |
| 1001 | simp only [slotVelocity_formula, hcov, hphase] |
| 1002 | |
| 1003 | /-! ## Explicit conversion from chart velocity to physical velocity -/ |
| 1004 | |
| 1005 | theorem slotVelocity_outer_scale {U : UnsignedLabel} (P : PairData sys U) |
| 1006 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 1007 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) : |
| 1008 | slotVelocity P hdet outer ε T q x j Y θ = outer • slotVelocity P hdet 1 ε T q x j Y θ := by |
| 1009 | funext i |
| 1010 | simp only [Pi.smul_apply, smul_eq_mul, slotVelocity_formula] |
| 1011 | ring |
| 1012 | |
| 1013 | theorem SourcePair.actualVelocity_outer_scale {Q : Type} [NormedAddCommGroup Q] |
| 1014 | {U : UnsignedLabel} (A : SourcePair Q sys U) |
| 1015 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) |
| 1016 | (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) : |
| 1017 | A.actualVelocity hdet outer ε T q x j Y θ = outer • A.actualVelocity hdet 1 ε T q x j Y θ := by |
| 1018 | rw [A.actualVelocity_eq, A.actualVelocity_eq] |
| 1019 | exact slotVelocity_outer_scale A.pairData hdet outer ε T q x j Y θ |
| 1020 | |
| 1021 | section PhysicalCoefficientAssembly |
| 1022 | |
| 1023 | open LinearWaveBounds |
| 1024 | |
| 1025 | variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 1026 | variable {Q : Type} [NormedAddCommGroup Q] |
| 1027 | |
| 1028 | /-- Chart velocity is converted to physical velocity outside the chart |
| 1029 | coefficient. The weighted class of the original coefficient is unchanged. -/ |
| 1030 | noncomputable def scaledCutoffModeField (outer : UnsignedLabel → ℝ) |
| 1031 | (a : SignedIndex → WaveCoefficients X) (ψ : SignedIndex → ℕ → X → ℝ) |
| 1032 | (band : SignedIndex → ℕ) (point : SignedIndex → Plane → ℝ → X) |
| 1033 | (Y : Plane) (θ : ℝ) : Vector := |
| 1034 | ∑ᶠ b : SignedIndex, outer b.1 • cutoffVelocity (a b) (ψ b) (band b) (point b Y θ) |
| 1035 | |
| 1036 | omit [NormedAddCommGroup X] [NormedSpace ℝ X] in |
| 1037 | theorem scaledCutoffModeField_eq_source {N : ℕ} |
| 1038 | (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 1039 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 1040 | (T : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) |
| 1041 | (a : SignedIndex → WaveCoefficients X) (ψ : SignedIndex → ℕ → X → ℝ) |
| 1042 | (band : SignedIndex → ℕ) (point : SignedIndex → Plane → ℝ → X) |
| 1043 | (hcoeff : ∀ b Y θ, ((a b).withCutoff (ψ b)).amplitude (band b) (point b Y θ) = |
| 1044 | (A b.1).actualAmplitude hdet 1 (ε b.1) (T b.1) q x b.2 Y) |
| 1045 | (hphase : ∀ b Y θ, (a b).frequency (band b) * (a b).phase (band b) (point b Y θ) = |
| 1046 | slotPhase (A b.1).pairData b.2 (Y, θ)) (Y : Plane) (θ : ℝ) : |
| 1047 | scaledCutoffModeField outer a ψ band point Y θ = sourceField A hdet outer ε T q x Y θ := by |
| 1048 | unfold scaledCutoffModeField sourceField |
| 1049 | apply finsum_congr |
| 1050 | intro b |
| 1051 | rw [(A b.1).actualVelocity_outer_scale] |
| 1052 | congr 1 |
| 1053 | rw [(A b.1).actualVelocity_eq] |
| 1054 | exact cutoffVelocity_identification (a b) (ψ b) (band b) (point b Y θ) |
| 1055 | (A b.1).pairData hdet 1 (ε b.1) (T b.1) q x b.2 Y θ |
| 1056 | ((hcoeff b Y θ).trans ((A b.1).actualAmplitude_eq hdet 1 _ _ q x b.2 Y)) |
| 1057 | (hphase b Y θ) |
| 1058 | |
| 1059 | omit [NormedAddCommGroup X] [NormedSpace ℝ X] in |
| 1060 | /-- The physical factor is exactly `Q^(-A)` applied to each chart field. |
| 1061 | It is not inserted into the coefficient before the chart wave estimates. -/ |
| 1062 | theorem scaledCutoffModeField_physical_covariance (sys : SlotSystem D h vr vt) |
| 1063 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 1064 | (A : (U : UnsignedLabel) → SourcePair Q sys (tailLabel N U)) |
| 1065 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (T0 : Vec2) |
| 1066 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |
| 1067 | SmoothCovariance.StrictCone (A U).sourceMatrix (chartTarget h q N T0 U)) |
| 1068 | (a : SignedIndex → WaveCoefficients X) (ψ : SignedIndex → ℕ → X → ℝ) |
| 1069 | (band : SignedIndex → ℕ) (point : SignedIndex → Plane → ℝ → X) |
| 1070 | (hcoeff : ∀ b Y θ, ((a b).withCutoff (ψ b)).amplitude (band b) (point b Y θ) = |
| 1071 | (A b.1).actualAmplitude hdet 1 (physicalViscosity h N b.1) |
| 1072 | (chartTarget h q N T0 b.1) q x b.2 Y) |
| 1073 | (hphase : ∀ b Y θ, (a b).frequency (band b) * (a b).phase (band b) (point b Y θ) = |
| 1074 | slotPhase (A b.1).pairData b.2 (Y, θ)) (i : Fin 2) : |
| 1075 | doubleAverage (fun Y θ => scaledCutoffModeField (physicalOuter h N) a ψ band point Y θ 0 * |
| 1076 | scaledCutoffModeField (physicalOuter h N) a ψ band point Y θ i.succ) = |
| 1077 | q ^ (-velocityExponent h - 1 / 2) * T0 i := by |
| 1078 | simp_rw [scaledCutoffModeField_eq_source A hdet _ _ _ q x a ψ band point hcoeff hphase] |
| 1079 | exact physical_source_covariance sys hdet N hN A hq hqN x T0 hcone i |
| 1080 | |
| 1081 | theorem finite_scaled_corrected_field_split {ι : Type*} (F : Finset ι) (outer : ι → ℝ) |
| 1082 | (a : ι → WaveCoefficients X) (s : ι → WeightedClasses.StripData X) |
| 1083 | (d : ι → GraphDirections X) (ψ : ι → ℕ → X → ℝ) |
| 1084 | (band : ι → ℕ) (point : ι → X) : |
| 1085 | (∑ b ∈ F, outer b • correctedVelocity (a b) (s b) (d b) (ψ b) (band b) (point b)) = |
| 1086 | (∑ b ∈ F, outer b • cutoffVelocity (a b) (ψ b) (band b) (point b)) + |
| 1087 | ∑ b ∈ F, outer b • curlVelocity (a b) (s b) (d b) (ψ b) (band b) (point b) := by |
| 1088 | simp_rw [correctedVelocity_split, smul_add] |
| 1089 | exact Finset.sum_add_distrib |
| 1090 | |
| 1091 | end PhysicalCoefficientAssembly |
| 1092 | |
| 1093 | end NavierStokes.PrimaryFieldAssembly |