import NavierStokes.ParticularWaveAssembly import NavierStokes.WaveEnvelopeTransport import NavierStokes.LabelSumBounds /-! # Whole-lift bounds from the actual native copies The copy meeting a point is allowed to depend on both the band and the point. Closed, locally finite support cells give a genuine zero germ on their complement, including all derivatives. Constants in the native estimates are chosen before the band, copy, and evaluation point. The Gaussian error is assembled as the sum of cutoff-derivative terms plus one uncovered-source term. In particular, the source is never summed once for every inactive copy. -/ noncomputable section namespace NavierStokes.PeriodizedWaveBounds open Set Function Filter WeightedClasses open scoped Topology ContDiff BigOperators section LocalGluing variable {D E : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] {I : Type*} /-- Closed support cells, with a unique cell at a point. Neither a finite index set nor one cell covering the whole strip is required. -/ structure Cells (D : Type*) [TopologicalSpace D] (I : Type*) where carrier : ℕ → I → Set D closed : ∀ n i, IsClosed (carrier n i) locallyFinite : ∀ n, LocallyFinite (carrier n) unique : ∀ n i j x, x ∈ carrier n i → x ∈ carrier n j → i = j /-- Native estimates on the actual functions. Smoothness is local at the closed support cell; no continuation of the uncut function around the torus is imposed. The weight is evaluated at the actual global point. -/ structure LocalJets (s : StripData D) (w : ℕ → D → ℝ) (α : ℝ) (K : ℕ → I → Set D) (f : ℕ → I → D → E) : Prop where smooth : ∀ n i x, x ∈ s.domain → x ∈ K n i → ContDiffAt ℝ ∞ (f n i) x bounds : ∀ m : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ n i x, x ∈ s.domain → x ∈ K n i → ∀ j : ℕ, j ≤ m → ‖iteratedFDeriv ℝ j (f n i) x‖ ≤ majorant s w α C p n x theorem jets_eq_of_germ {f g : D → E} {x : D} (h : f =ᶠ[𝓝 x] g) (m : ℕ) : iteratedFDeriv ℝ m f x = iteratedFDeriv ℝ m g x := by have hw : f =ᶠ[𝓝[univ] x] g := by simpa only [nhdsWithin_univ] using h simpa only [iteratedFDerivWithin_univ] using hw.iteratedFDerivWithin_eq h.self_of_nhds m /-- Gluing uses equality on neighborhoods, rather than equality of values or pointwise derivative limits. -/ theorem memClass_of_local_germs {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {K : ℕ → I → Set D} {f : ℕ → I → D → E} {F : ℕ → D → E} (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) (hlocal : LocalJets s w α K f) (hcover : ∀ n x, x ∈ s.domain → (∃ i, x ∈ K n i ∧ F n =ᶠ[𝓝 x] f n i) ∨ F n =ᶠ[𝓝 x] fun _ => 0) : MemClass s w α F := by refine ⟨hw, ?_, ?_⟩ · intro n apply s.isOpen_domain.contDiffOn_iff.mpr intro x hx rcases hcover n x hx with ⟨i, hxi, hg⟩ | hg · exact (hlocal.smooth n i x hx hxi).congr_of_eventuallyEq hg · exact contDiffAt_const.congr_of_eventuallyEq hg · intro m obtain ⟨C, hC, p, hB⟩ := hlocal.bounds m refine ⟨C, hC, p, ?_⟩ intro n x hx j hj rcases hcover n x hx with ⟨i, hxi, hg⟩ | hg · rw [jets_eq_of_germ hg j] exact hB n i x hx hxi j hj · simp only [jets_eq_of_germ hg j, iteratedFDeriv_fun_zero, Pi.zero_apply, norm_zero] exact majorant_nonneg s w α hC p n x (hw n x hx) /-- The actual locally finite copy sum. Local finiteness is proved from support cells below; it is not encoded by replacing the sum with a selector. -/ noncomputable def copySum (f : I → D → E) (x : D) : E := ∑' i, f i x omit [NormedSpace ℝ D] [NormedSpace ℝ E] in theorem zero_germ_of_support {K : Set D} (hK : IsClosed K) {f : D → E} (hf : support f ⊆ K) {x : D} (hx : x ∉ K) : f =ᶠ[𝓝 x] fun _ => 0 := by filter_upwards [hK.isOpen_compl.mem_nhds hx] with y hy by_contra hne exact hy (hf hne) omit [NormedSpace ℝ D] [NormedSpace ℝ E] in theorem copySum_germ (K : Cells D I) (n : ℕ) (f : I → D → E) (hs : ∀ i, support (f i) ⊆ K.carrier n i) {i : I} {x : D} (hx : x ∈ K.carrier n i) : copySum f =ᶠ[𝓝 x] f i := by classical have hn := (K.locallyFinite n).iInter_compl_mem_nhds (K.closed n) x filter_upwards [hn] with y hy apply tsum_eq_single i intro j hji have hxj : x ∉ K.carrier n j := fun hxj => hji (K.unique n j i x hxj hx) by_contra hne exact (mem_iInter₂.mp hy j hxj) (hs j hne) omit [NormedSpace ℝ D] [NormedSpace ℝ E] in theorem copySum_zero_germ (K : Cells D I) (n : ℕ) (f : I → D → E) (hs : ∀ i, support (f i) ⊆ K.carrier n i) {x : D} (hx : ∀ i, x ∉ K.carrier n i) : copySum f =ᶠ[𝓝 x] fun _ => 0 := by classical have hn := (K.locallyFinite n).iInter_compl_mem_nhds (K.closed n) x filter_upwards [hn] with y hy have hz : ∀ i, f i y = 0 := by intro i by_contra hne exact (mem_iInter₂.mp hy i (hx i)) (hs i hne) simp only [copySum, hz, tsum_zero] omit [NormedSpace ℝ D] [NormedSpace ℝ E] in theorem copySum_germ_cover (K : Cells D I) (n : ℕ) (f : I → D → E) (hs : ∀ i, support (f i) ⊆ K.carrier n i) (x : D) : (∃ i, x ∈ K.carrier n i ∧ copySum f =ᶠ[𝓝 x] f i) ∨ copySum f =ᶠ[𝓝 x] fun _ => 0 := by classical by_cases h : ∃ i, x ∈ K.carrier n i · obtain ⟨i, hi⟩ := h exact Or.inl ⟨i, hi, copySum_germ K n f hs hi⟩ · exact Or.inr (copySum_zero_germ K n f hs (not_exists.mp h)) theorem copySum_memClass {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} (K : Cells D I) {f : ℕ → I → D → E} (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) (hs : ∀ n i, support (f n i) ⊆ K.carrier n i) (hj : LocalJets s w α K.carrier f) : MemClass s w α (fun n => copySum (f n)) := memClass_of_local_germs hw hj (fun n x _ => copySum_germ_cover K n (f n) (hs n) x) omit [NormedSpace ℝ D] [NormedSpace ℝ E] in theorem copySum_eventually_finite (K : Cells D I) (n : ℕ) (f : I → D → E) (hs : ∀ i, support (f i) ⊆ K.carrier n i) (x : D) : ∃ J : Finset I, copySum f =ᶠ[𝓝 x] fun y => ∑ i ∈ J, f i y := by classical obtain ⟨U, hU, hfin⟩ := K.locallyFinite n x refine ⟨hfin.toFinset, ?_⟩ filter_upwards [hU] with y hy apply tsum_eq_sum intro i hi by_contra hne apply hi exact hfin.mem_toFinset.mpr ⟨y, hs i hne, hy⟩ omit [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedSpace ℝ E] in theorem copySum_translate (f : I → D → E) (T : D → D) (e : I ≃ I) (h : ∀ i x, f (e i) (T x) = f i x) (x : D) : copySum f (T x) = copySum f x := by unfold copySum calc _ = ∑' i, f (e i) (T x) := (e.tsum_eq (fun i => f i (T x))).symm _ = _ := tsum_congr (fun i => h i x) /-- Only the primitive source is estimated on the uncovered set. This is useful when coverage gives a small tail instead of an identically zero one. -/ structure ComplementJets (s : StripData D) (w : ℕ → D → ℝ) (α : ℝ) (K : ℕ → I → Set D) (f : ℕ → D → E) : Prop where smooth : ∀ n x, x ∈ s.domain → (∀ i, x ∉ K n i) → ContDiffAt ℝ ∞ (f n) x bounds : ∀ m : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ n x, x ∈ s.domain → (∀ i, x ∉ K n i) → ∀ j : ℕ, j ≤ m → ‖iteratedFDeriv ℝ j (f n) x‖ ≤ majorant s w α C p n x theorem majorant_mono_constant (s : StripData D) (w : ℕ → D → ℝ) (α : ℝ) {C B : ℝ} (hCB : C ≤ B) (p n : ℕ) (x : D) (hw : 0 ≤ w n x) : majorant s w α C p n x ≤ majorant s w α B p n x := by have hnonneg : 0 ≤ s.epsilon n ^ α * s.growth n x ^ p * w n x := mul_nonneg (mul_nonneg (Real.rpow_pos_of_pos (s.epsilon_pos n) α).le (pow_nonneg (s.growth_nonneg n x) p)) hw simpa only [majorant, mul_assoc] using mul_le_mul_of_nonneg_right hCB hnonneg theorem memClass_of_local_and_complement_germs {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {K : ℕ → I → Set D} {f : ℕ → I → D → E} {f₀ F : ℕ → D → E} (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) (hlocal : LocalJets s w α K f) (houtside : ComplementJets s w α K f₀) (hactive : ∀ n i x, x ∈ s.domain → x ∈ K n i → F n =ᶠ[𝓝 x] f n i) (hinactive : ∀ n x, x ∈ s.domain → (∀ i, x ∉ K n i) → F n =ᶠ[𝓝 x] f₀ n) : MemClass s w α F := by classical refine ⟨hw, ?_, ?_⟩ · intro n apply s.isOpen_domain.contDiffOn_iff.mpr intro x hx by_cases h : ∃ i, x ∈ K n i · obtain ⟨i, hi⟩ := h exact (hlocal.smooth n i x hx hi).congr_of_eventuallyEq (hactive n i x hx hi) · exact (houtside.smooth n x hx (not_exists.mp h)).congr_of_eventuallyEq (hinactive n x hx (not_exists.mp h)) · intro m obtain ⟨C, hC, p, hB⟩ := hlocal.bounds m obtain ⟨C₀, hC₀, p₀, hB₀⟩ := houtside.bounds m refine ⟨C + C₀, add_nonneg hC hC₀, max p p₀, ?_⟩ intro n x hx j hj by_cases h : ∃ i, x ∈ K n i · obtain ⟨i, hi⟩ := h rw [jets_eq_of_germ (hactive n i x hx hi) j] exact (hB n i x hx hi j hj).trans ((majorant_mono_degree s w α hC (le_max_left _ _) n x (hw n x hx)).trans (majorant_mono_constant s w α (le_add_of_nonneg_right hC₀) _ n x (hw n x hx))) · rw [jets_eq_of_germ (hinactive n x hx (not_exists.mp h)) j] exact (hB₀ n x hx (not_exists.mp h) j hj).trans ((majorant_mono_degree s w α hC₀ (le_max_right _ _) n x (hw n x hx)).trans (majorant_mono_constant s w α (le_add_of_nonneg_left hC) _ n x (hw n x hx))) end LocalGluing section UniformLabels variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {L I : Type*} /-- Native bounds uniform also in an external spatial label. The lattice copy remains a separate index, so overlap among different labels is not mistaken for disjointness of copies of one label. -/ structure UniformLocalJets (s : StripData D) (w : L → ℕ → D → ℝ) (α : ℝ) (K : L → ℕ → I → Set D) (f : L → ℕ → I → D → E) : Prop where smooth : ∀ l n i x, x ∈ s.domain → x ∈ K l n i → ContDiffAt ℝ ∞ (f l n i) x bounds : ∀ m : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ l n i x, x ∈ s.domain → x ∈ K l n i → ∀ j : ℕ, j ≤ m → ‖iteratedFDeriv ℝ j (f l n i) x‖ ≤ majorant s (w l) α C p n x theorem UniformLocalJets.each {s : StripData D} {w : L → ℕ → D → ℝ} {α : ℝ} {K : L → ℕ → I → Set D} {f : L → ℕ → I → D → E} (hf : UniformLocalJets s w α K f) (l : L) : LocalJets s (w l) α (K l) (f l) := by refine ⟨hf.smooth l, ?_⟩ intro m obtain ⟨C, hC, p, hb⟩ := hf.bounds m exact ⟨C, hC, p, hb l⟩ theorem uniformClass_of_local_germs {s : StripData D} {w : L → ℕ → D → ℝ} {α : ℝ} {K : L → ℕ → I → Set D} {f : L → ℕ → I → D → E} {F : L → ℕ → D → E} (hw : ∀ l n x, x ∈ s.domain → 0 ≤ w l n x) (hj : UniformLocalJets s w α K f) (hcover : ∀ l n x, x ∈ s.domain → (∃ i, x ∈ K l n i ∧ F l n =ᶠ[𝓝 x] f l n i) ∨ F l n =ᶠ[𝓝 x] fun _ => 0) : LabelSumBounds.UniformClass s w α F := by refine ⟨hw, fun l => (memClass_of_local_germs (hw l) (hj.each l) (hcover l)).smooth, ?_⟩ intro m obtain ⟨C, hC, p, hb⟩ := hj.bounds m refine ⟨C, hC, p, ?_⟩ intro l n x hx j hjm rcases hcover l n x hx with ⟨i, hi, hg⟩ | hg · rw [jets_eq_of_germ hg j] exact hb l n i x hx hi j hjm · simp only [jets_eq_of_germ hg j, iteratedFDeriv_fun_zero, Pi.zero_apply, norm_zero] exact majorant_nonneg s (w l) α hC p n x (hw l n x hx) theorem copySum_uniformClass {s : StripData D} {w : L → ℕ → D → ℝ} {α : ℝ} (K : L → Cells D I) {f : L → ℕ → I → D → E} (hw : ∀ l n x, x ∈ s.domain → 0 ≤ w l n x) (hs : ∀ l n i, support (f l n i) ⊆ (K l).carrier n i) (hj : UniformLocalJets s w α (fun l => (K l).carrier) f) : LabelSumBounds.UniformClass s w α (fun l n => copySum (f l n)) := uniformClass_of_local_germs hw hj (fun l n x _ => copySum_germ_cover (K l) n (f l n) (hs l n) x) end UniformLabels section NativeCells open CommonCoverSolve TorusInverse TorusAverages variable {P E : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup E] [NormedSpace ℝ E] noncomputable def nativeCell (g : Geometry) (K : Set Plane) (k : Frequency) : Set (P × Plane) := {z | g.coordinates k z.2 ∈ K} omit [NormedSpace ℝ P] in theorem nativeCell_closed (g : Geometry) {K : Set Plane} (hK : IsClosed K) (k : Frequency) : IsClosed (nativeCell (P := P) g K k) := hK.preimage ((g.coordinates_contDiff k).continuous.comp continuous_snd) omit [NormedSpace ℝ P] in /-- Compact native cells have a locally finite family of all lattice copies. This applies to a rectangle as well as the actual closed cutoff support. -/ theorem nativeCell_locallyFinite (g : Geometry) {K : Set Plane} (hK : IsCompact K) : LocallyFinite (nativeCell (P := P) g K) := by classical let κ : Plane → ℝ := K.indicator (fun _ => 1) have hκ : HasCompactSupport κ := HasCompactSupport.intro' (K := K) hK hK.isClosed (fun z hz => by simp [κ, hz]) intro z obtain ⟨s, hs⟩ := g.finite_copy_cutoffs hκ (‖z.2‖ + 1) refine ⟨{y : P × Plane | ‖y.2‖ < ‖z.2‖ + 1}, (isOpen_lt continuous_snd.norm continuous_const).mem_nhds (by simp), ?_⟩ apply s.finite_toSet.subset intro k hk obtain ⟨y, hy, hnorm⟩ := hk by_contra hnot have hh := hs y.2 hnorm.le k hnot change g.coordinates k y.2 ∈ K at hy simp [κ, hy] at hh noncomputable def nativeCells (g : ℕ → Geometry) (K : ℕ → Set Plane) (hK : ∀ n, IsCompact (K n)) (hinj : ∀ n, InjOn quotientPoint ((fun z => (g n).center + (g n).basis z) '' K n)) : Cells (P × Plane) Frequency where carrier n := nativeCell (g n) (K n) closed n := nativeCell_closed (g n) (hK n).isClosed locallyFinite n := nativeCell_locallyFinite (g n) (hK n) unique n _ _ _ hi hj := ParticularWaveAssembly.native_copy_unique (g n) (hinj n) hi hj omit [NormedAddCommGroup P] [NormedSpace ℝ P] in theorem native_cutoff_support (g : Geometry) {K : Set Plane} {κ : Plane → ℝ} (hκ : support κ ⊆ K) (k : Frequency) : support (fun z : P × Plane => κ (g.coordinates k z.2)) ⊆ nativeCell g K k := fun _ hx => hκ hx end NativeCells section NativeJetOperations variable {D E F G : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] {I : Type*} private theorem finite_le_infty (m : ℕ) : (m : WithTop ℕ∞) ≤ ∞ := WithTop.coe_le_coe.mpr le_top private theorem bilinear_jet_at (L : E →L[ℝ] F →L[ℝ] G) {u : D → E} {v : D → F} {x : D} (hu : ContDiffAt ℝ ∞ u x) (hv : ContDiffAt ℝ ∞ v x) {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) {m j : ℕ} (hj : j ≤ m) (hbu : ∀ k ≤ m, ‖iteratedFDeriv ℝ k u x‖ ≤ A) (hbv : ∀ k ≤ m, ‖iteratedFDeriv ℝ k v x‖ ≤ B) : ‖iteratedFDeriv ℝ j (fun y => L (u y) (v y)) x‖ ≤ ‖L‖ * (2 : ℝ) ^ m * A * B := by obtain ⟨U, hU, huU⟩ := hu.contDiffOn (finite_le_infty j) (by simp) obtain ⟨V, hV, hvV⟩ := hv.contDiffOn (finite_le_infty j) (by simp) obtain ⟨O, hOsub, hO, hxO⟩ := mem_nhds_iff.mp (inter_mem hU hV) have hle := JetBounds.norm_iteratedFDeriv_bilinear_le_on L hO (huU.mono (hOsub.trans inter_subset_left)) (hvV.mono (hOsub.trans inter_subset_right)) hxO (le_refl (j : WithTop ℕ∞)) have hsum : (∑ k ∈ Finset.range (j + 1), (j.choose k : ℝ) * ‖iteratedFDeriv ℝ k u x‖ * ‖iteratedFDeriv ℝ (j - k) v x‖) ≤ (2 : ℝ) ^ m * A * B := by calc _ ≤ ∑ k ∈ Finset.range (j + 1), (j.choose k : ℝ) * A * B := by apply Finset.sum_le_sum intro k hk have hkj : k ≤ j := Nat.le_of_lt_succ (Finset.mem_range.mp hk) exact mul_le_mul (mul_le_mul_of_nonneg_left (hbu k (hkj.trans hj)) (Nat.cast_nonneg _)) (hbv (j - k) ((Nat.sub_le _ _).trans hj)) (norm_nonneg _) (mul_nonneg (Nat.cast_nonneg _) hA) _ = (2 : ℝ) ^ j * A * B := by rw [← Finset.sum_mul, ← Finset.sum_mul] have hchoose : (∑ k ∈ Finset.range (j + 1), (j.choose k : ℝ)) = (2 : ℝ) ^ j := by exact_mod_cast Nat.sum_range_choose j rw [hchoose] _ ≤ _ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num) hj) hA) hB exact hle.trans (by calc _ ≤ ‖L‖ * ((2 : ℝ) ^ m * A * B) := mul_le_mul_of_nonneg_left hsum (norm_nonneg L) _ = _ := by ring) namespace LocalJets variable {s : StripData D} {w v : ℕ → D → ℝ} {α β : ℝ} {K : ℕ → I → Set D} {f g : ℕ → I → D → E} theorem of_memClass {f₀ : ℕ → D → E} (hf : MemClass s w α f₀) : LocalJets s w α K (fun n _ => f₀ n) := by refine ⟨fun n _ x hx _ => (hf.smooth n).contDiffAt (s.isOpen_domain.mem_nhds hx), ?_⟩ intro m obtain ⟨C, hC, p, hb⟩ := hf.bounds m exact ⟨C, hC, p, fun n _ x hx _ j hj => hb n x hx j hj⟩ theorem map (hf : LocalJets s w α K f) (L : E →L[ℝ] F) : LocalJets s w α K (fun n i x => L (f n i x)) := by refine ⟨fun n i x hx hi => L.contDiff.contDiffAt.comp x (hf.smooth n i x hx hi), ?_⟩ intro m obtain ⟨C, hC, p, hb⟩ := hf.bounds m refine ⟨‖L‖ * C, mul_nonneg (norm_nonneg _) hC, p, ?_⟩ intro n i x hx hi j hj change ‖iteratedFDeriv ℝ j (L ∘ f n i) x‖ ≤ _ rw [L.iteratedFDeriv_comp_left ((hf.smooth n i x hx hi).of_le (finite_le_infty j)) le_rfl] calc _ ≤ ‖L‖ * ‖iteratedFDeriv ℝ j (f n i) x‖ := L.norm_compContinuousMultilinearMap_le _ _ ≤ ‖L‖ * majorant s w α C p n x := mul_le_mul_of_nonneg_left (hb n i x hx hi j hj) (norm_nonneg _) _ = _ := by unfold majorant; ring theorem add (hf : LocalJets s w α K f) (hg : LocalJets s w α K g) (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) : LocalJets s w α K (fun n i x => f n i x + g n i x) := by refine ⟨fun n i x hx hi => (hf.smooth n i x hx hi).add (hg.smooth n i x hx hi), ?_⟩ intro m obtain ⟨A, hA, p, ha⟩ := hf.bounds m obtain ⟨B, hB, q, hb⟩ := hg.bounds m refine ⟨A + B, add_nonneg hA hB, p + q, ?_⟩ intro n i x hx hi j hj rw [fun_iteratedFDeriv_add_apply ((hf.smooth n i x hx hi).of_le (finite_le_infty j)) ((hg.smooth n i x hx hi).of_le (finite_le_infty j))] calc _ ≤ ‖iteratedFDeriv ℝ j (f n i) x‖ + ‖iteratedFDeriv ℝ j (g n i) x‖ := norm_add_le _ _ _ ≤ majorant s w α A p n x + majorant s w α B q n x := add_le_add (ha n i x hx hi j hj) (hb n i x hx hi j hj) _ ≤ majorant s w α A (p + q) n x + majorant s w α B (p + q) n x := add_le_add (majorant_mono_degree s w α hA (Nat.le_add_right _ _) n x (hw n x hx)) (majorant_mono_degree s w α hB (Nat.le_add_left _ _) n x (hw n x hx)) _ = _ := by unfold majorant; ring theorem bilinear {u : ℕ → I → D → F} (hf : LocalJets s w α K f) (hu : LocalJets s v β K u) (L : E →L[ℝ] F →L[ℝ] G) (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) (hv : ∀ n x, x ∈ s.domain → 0 ≤ v n x) : LocalJets s (fun n x => w n x * v n x) (α + β) K (fun n i x => L (f n i x) (u n i x)) := by refine ⟨fun n i x hx hi => (L.contDiff.contDiffAt.comp x (hf.smooth n i x hx hi)).clm_apply (hu.smooth n i x hx hi), ?_⟩ intro m obtain ⟨A, hA, p, ha⟩ := hf.bounds m obtain ⟨B, hB, q, hb⟩ := hu.bounds m refine ⟨‖L‖ * (2 : ℝ) ^ m * A * B, by positivity, p + q, ?_⟩ intro n i x hx hi j hj calc _ ≤ ‖L‖ * (2 : ℝ) ^ m * majorant s w α A p n x * majorant s v β B q n x := bilinear_jet_at L (hf.smooth n i x hx hi) (hu.smooth n i x hx hi) (majorant_nonneg s w α hA p n x (hw n x hx)) (majorant_nonneg s v β hB q n x (hv n x hx)) hj (fun k hk => ha n i x hx hi k hk) (fun k hk => hb n i x hx hi k hk) _ = (‖L‖ * (2 : ℝ) ^ m) * (majorant s w α A p n x * majorant s v β B q n x) := by ring _ = _ := by rw [majorant_mul]; unfold majorant; ring theorem smul {r : ℕ → I → D → ℝ} (hr : LocalJets s (fun _ _ => 1) 0 K r) (hf : LocalJets s w α K f) (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) : LocalJets s w α K (fun n i x => r n i x • f n i x) := by have h := hr.bilinear hf (ContinuousLinearMap.lsmul ℝ ℝ) (fun _ _ _ => zero_le_one) hw simp only [one_mul, zero_add] at h exact h end LocalJets end NativeJetOperations section NativeGaussianEstimates open GaussianTailFlat variable {D E : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] {I : Type*} end NativeGaussianEstimates section DifferentialGerms open HarmonicCalculus LinearWaveResidual open CurlClassBounds hiding ComplexVector open ParticularWaveAssembly variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] theorem principal_germ {a b : D → ComplexVector} {p q : D → ℂ} {x : D} (ha : a =ᶠ[𝓝 x] b) (hp : p =ᶠ[𝓝 x] q) (ε K : ℝ) (R F G Φ : D → ℝ) (Vr Vθ Vz Vf : D → D) : LinearWaveResidual.principal ε K R F G Vr Vθ Vz Vf Φ a p =ᶠ[𝓝 x] LinearWaveResidual.principal ε K R F G Vr Vθ Vz Vf Φ b q := by have ht (i : Fin 3) := along_germ (ha.fun_comp (fun v => v i)) Vf filter_upwards [ha, hp, Filter.eventually_all.mpr ht] with y hay hpy hty dsimp only [Function.comp_def] at hty funext i simp only [LinearWaveResidual.principal, shear, hty, hay, hpy] theorem remainder_germ {a b : D → ComplexVector} {p q : D → ℂ} {x : D} (ha : a =ᶠ[𝓝 x] b) (hp : p =ᶠ[𝓝 x] q) (ε K : ℝ) (R B F G Φ : D → ℝ) (Vr Vθ Vz Vf Vs : D → D) : LinearWaveResidual.remainder ε K R B F G Vr Vθ Vz Vf Vs Φ a p =ᶠ[𝓝 x] LinearWaveResidual.remainder ε K R B F G Vr Vθ Vz Vf Vs Φ b q := by have hr (i : Fin 3) := along_germ (ha.fun_comp (fun v => v i)) Vr have hz (i : Fin 3) := along_germ (ha.fun_comp (fun v => v i)) Vz have hs (i : Fin 3) := along_germ (ha.fun_comp (fun v => v i)) Vs have hrr (i : Fin 3) := along_germ (hr i) Vr have hzz (i : Fin 3) := along_germ (hz i) Vz filter_upwards [ha, Filter.eventually_all.mpr hr, Filter.eventually_all.mpr hz, Filter.eventually_all.mpr hs, Filter.eventually_all.mpr hrr, Filter.eventually_all.mpr hzz, along_germ hp Vr, along_germ hp Vz] with y hay hry hzy hsy hrry hzzy hpr hpz dsimp only [Function.comp_def] at hry hzy hsy hrry hzzy funext i simp only [LinearWaveResidual.remainder, slowTransport, baseDerivativeRemainder, strippedPressureGradient, viscousRemainder, hry, hzy, hsy, hrry, hzzy, hpr, hpz, hay] theorem curlCorrection_germ {a b : D → ComplexVector} {x : D} (ha : a =ᶠ[𝓝 x] b) (K : ℝ) (R Φ : D → ℝ) (Vr Vθ Vz : D → D) : curlRemainder K R Vr Vθ Vz (coefficient R Vr Vθ Vz Φ a) =ᶠ[𝓝 x] curlRemainder K R Vr Vθ Vz (coefficient R Vr Vθ Vz Φ b) := by have hc : coefficient R Vr Vθ Vz Φ a =ᶠ[𝓝 x] coefficient R Vr Vθ Vz Φ b := by filter_upwards [ha] with y hy simp only [coefficient, hy] filter_upwards [curl_germ hc R Vr Vθ Vz] with y hy simp only [curlRemainder, hy] theorem potential_germ {a b : D → ComplexVector} {x : D} (ha : a =ᶠ[𝓝 x] b) (K : ℝ) (R Φ : D → ℝ) (Vr Vθ Vz : D → D) : vectorPotential K R Vr Vθ Vz Φ a =ᶠ[𝓝 x] vectorPotential K R Vr Vθ Vz Φ b := by filter_upwards [ha] with y hy ext i simp only [vectorPotential, HarmonicCalculus.vectorMode, HarmonicCalculus.mode, coefficient, hy] theorem divergence_germ {a b : D → ComplexVector} {x : D} (ha : a =ᶠ[𝓝 x] b) (R : D → ℝ) (Vr Vθ Vz : D → D) : cylindricalDivergence R Vr Vθ Vz a =ᶠ[𝓝 x] cylindricalDivergence R Vr Vθ Vz b := by filter_upwards [ha, along_germ (ha.fun_comp (fun v => v 0)) Vr, along_germ (ha.fun_comp (fun v => v 1)) Vθ, along_germ (ha.fun_comp (fun v => v 2)) Vz] with y hy hr hθ hz dsimp only [Function.comp_def] at hr hθ hz simp only [cylindricalDivergence, hr, hθ, hz, hy] @[simp] theorem normalCoefficient_zero (N : RealVector) : normalCoefficient N 0 = 0 := by simp [normalCoefficient, normalCross] @[simp] theorem coefficient_zero (R Φ : D → ℝ) (Vr Vθ Vz : D → D) : coefficient R Vr Vθ Vz Φ (fun _ => 0) = fun _ => 0 := by funext x simp only [coefficient, normalCoefficient_zero] @[simp] theorem cylindricalCurl_zero (R : D → ℝ) (Vr Vθ Vz : D → D) : cylindricalCurl R Vr Vθ Vz (fun _ => 0) = fun _ => 0 := by funext x i fin_cases i <;> simp [cylindricalCurl, along] @[simp] theorem curlRemainder_zero (K : ℝ) (R : D → ℝ) (Vr Vθ Vz : D → D) : curlRemainder K R Vr Vθ Vz (fun _ => 0) = fun _ => 0 := by funext x simp only [curlRemainder, cylindricalCurl_zero, smul_zero] @[simp] theorem realizedCoefficient_zero (K : ℝ) (R Φ : D → ℝ) (Vr Vθ Vz : D → D) : realizedCoefficient K R Vr Vθ Vz Φ (fun _ => 0) = fun _ => 0 := by funext x simp only [realizedCoefficient, coefficient_zero, curlRemainder_zero, add_zero] @[simp] theorem vectorPotential_zero (K : ℝ) (R Φ : D → ℝ) (Vr Vθ Vz : D → D) : vectorPotential K R Vr Vθ Vz Φ (fun _ => 0) = fun _ => 0 := by funext x i simp [vectorPotential, coefficient_zero, vectorMode, mode] @[simp] theorem principal_zero (ε K : ℝ) (R F G Φ : D → ℝ) (Vr Vθ Vz Vf : D → D) : LinearWaveResidual.principal ε K R F G Vr Vθ Vz Vf Φ (fun _ => 0) (fun _ => 0) = fun _ => 0 := by funext x i fin_cases i <;> simp [LinearWaveResidual.principal, shear, along] @[simp] theorem along_zero (V : D → D) : along V (fun _ : D => (0 : ℂ)) = fun _ => 0 := by funext x simp [along] @[simp] theorem remainder_zero (ε K : ℝ) (R B F G Φ : D → ℝ) (Vr Vθ Vz Vf Vs : D → D) : LinearWaveResidual.remainder ε K R B F G Vr Vθ Vz Vf Vs Φ (fun _ => 0) (fun _ => 0) = fun _ => 0 := by funext x i fin_cases i <;> simp [LinearWaveResidual.remainder, slowTransport, baseDerivativeRemainder, strippedPressureGradient, viscousRemainder, angularGenerator, along_zero, along] @[simp] theorem linearResidual_zero (ε : ℝ) (R : D → ℝ) (Vr Vθ Vz Vt : D → D) (B : D → ComplexVector) : linearResidual ε R Vr Vθ Vz Vt B (fun _ => 0) (fun _ => 0) = fun _ => 0 := by funext x i fin_cases i <;> simp [linearResidual, transport, gradient, cylindricalVectorLaplacian, cylindricalLaplacian, angularGenerator, along_zero, along] @[simp] theorem cylindricalDivergence_zero (R : D → ℝ) (Vr Vθ Vz : D → D) : cylindricalDivergence R Vr Vθ Vz (fun _ => 0) = fun _ => 0 := by funext x simp [cylindricalDivergence, along] end DifferentialGerms section WaveData open HarmonicCalculus LinearWaveBounds open CurlClassBounds hiding ComplexVector open ParticularWaveAssembly variable {D I : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Local raw copies share one physical carrier and background. Their amplitudes and pressures may differ in every copy and need not be periodic. -/ structure CopyData (D I : Type) where background : WaveCoefficients D amplitude : ℕ → I → D → ComplexVector pressure : ℕ → I → D → ℂ cutoff : ℕ → I → D → ℝ source : ℕ → D → ComplexVector namespace CopyData variable (a : CopyData D I) noncomputable def raw (i : I) : WaveCoefficients D := { a.background with amplitude := fun n => a.amplitude n i pressure := fun n => a.pressure n i } noncomputable def localized (i : I) : WaveCoefficients D := (a.raw i).withCutoff (fun n => a.cutoff n i) noncomputable def corrected (s : StripData D) (d : GraphDirections D) (i : I) : WaveCoefficients D := (a.raw i).corrected s d (fun n => a.cutoff n i) noncomputable def localGood (s : StripData D) (d : GraphDirections D) (n : ℕ) (i : I) : D → ComplexVector := (a.raw i).constructedGood s d (fun n => a.cutoff n i) n noncomputable def localTail (d : GraphDirections D) (n : ℕ) (i : I) (x : D) : ComplexVector := d.Dfast (fun n => a.cutoff n i) n x • a.amplitude n i x noncomputable def localGaussian (d : GraphDirections D) (n : ℕ) (i : I) : D → ComplexVector := excludedSlotError d (fun n => a.cutoff n i) (fun n => a.amplitude n i) a.source n /-- The single native cutoff is applied before periodization and curl. -/ noncomputable def common : WaveCoefficients D := { a.background with amplitude := fun n => copySum (fun i => (a.localized i).amplitude n) pressure := fun n => copySum (fun i => (a.localized i).pressure n) } noncomputable def commonCorrected (s : StripData D) (d : GraphDirections D) : WaveCoefficients D := a.common.addAmplitude (a.common.curlCorrection s d) /-- An actual global good coefficient, assembled from the cutoff-and-curl formula on each native copy. -/ noncomputable def globalGood (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ComplexVector := copySum (a.localGood s d n) noncomputable def cutoffSum (n : ℕ) : D → ℝ := copySum (a.cutoff n) noncomputable def globalTail (d : GraphDirections D) (n : ℕ) : D → ComplexVector := copySum (a.localTail d n) /-- The shared source occurs once. This definition also makes sense off every native patch and preserves the uncovered-source term there. -/ noncomputable def globalGaussian (d : GraphDirections D) (n : ℕ) (x : D) : ComplexVector := a.globalTail d n x + (1 - a.cutoffSum n x) • a.source n x theorem localGaussian_eq (d : GraphDirections D) (n : ℕ) (i : I) (x : D) : a.localGaussian d n i x = a.localTail d n i x + (1 - a.cutoff n i x) • a.source n x := rfl omit [NormedSpace ℝ D] in theorem common_amplitude_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : a.common.amplitude n =ᶠ[𝓝 x] (a.localized i).amplitude n := by apply copySum_germ K n _ _ hx intro j y hy apply hs n j intro he exact hy (by simp [localized, raw, WaveCoefficients.withCutoff, he]) omit [NormedSpace ℝ D] in theorem common_pressure_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : a.common.pressure n =ᶠ[𝓝 x] (a.localized i).pressure n := by apply copySum_germ K n _ _ hx intro j y hy apply hs n j intro he exact hy (by simp [localized, raw, WaveCoefficients.withCutoff, he]) theorem commonCorrected_amplitude_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : (a.commonCorrected s d).amplitude n =ᶠ[𝓝 x] (a.corrected s d i).amplitude n := realizedCoefficient_germ (a.common_amplitude_germ K hs n hx) (a.background.frequency n) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (a.background.phase n) theorem commonCorrected_residual_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : (a.commonCorrected s d).harmonicResidual s d n =ᶠ[𝓝 x] (a.corrected s d i).harmonicResidual s d n := linearResidual_germ (vectorMode_germ (a.commonCorrected_amplitude_germ K hs s d n hx) (a.background.frequency n) (a.background.phase n)) (mode_germ (a.common_pressure_germ K hs n hx) (a.background.frequency n) (a.background.phase n)) (s.epsilon n) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (LinearWaveResidual.timeDirection (s.epsilon n) (d.fastField n) (fun _ => d.slow)) (LinearWaveResidual.complexBase (a.background.radius n) (a.background.radialBase n) (a.background.frequencyBase n) (a.background.axialBase n)) omit [NormedSpace ℝ D] in theorem localized_amplitude_support (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (n : ℕ) (i : I) : support ((a.localized i).amplitude n) ⊆ K.carrier n i := by intro x hx apply hs n i intro hz exact hx (by simp [localized, raw, WaveCoefficients.withCutoff, hz]) omit [NormedSpace ℝ D] in theorem localized_pressure_support (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (n : ℕ) (i : I) : support ((a.localized i).pressure n) ⊆ K.carrier n i := by intro x hx apply hs n i intro hz exact hx (by simp [localized, raw, WaveCoefficients.withCutoff, hz]) omit [NormedSpace ℝ D] in theorem localized_zero_germs {n : ℕ} {i : I} {x : D} (hψ : a.cutoff n i =ᶠ[𝓝 x] fun _ => 0) : (a.localized i).amplitude n =ᶠ[𝓝 x] (fun _ => 0) ∧ (a.localized i).pressure n =ᶠ[𝓝 x] (fun _ => 0) := by constructor <;> filter_upwards [hψ] with y hy <;> simp [localized, raw, WaveCoefficients.withCutoff, hy] theorem localized_correction_zero_germ (s : StripData D) (d : GraphDirections D) {n : ℕ} {i : I} {x : D} (hψ : a.cutoff n i =ᶠ[𝓝 x] fun _ => 0) : (a.localized i).curlCorrection s d n =ᶠ[𝓝 x] fun _ => 0 := by have h := curlCorrection_germ (a.localized_zero_germs hψ).1 (a.background.frequency n) (a.background.radius n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) simp only [coefficient_zero, curlRemainder_zero] at h exact h theorem corrected_zero_germ (s : StripData D) (d : GraphDirections D) {n : ℕ} {i : I} {x : D} (hψ : a.cutoff n i =ᶠ[𝓝 x] fun _ => 0) : (a.corrected s d i).amplitude n =ᶠ[𝓝 x] fun _ => 0 := by have h := realizedCoefficient_germ (a.localized_zero_germs hψ).1 (a.background.frequency n) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (a.background.phase n) simp only [realizedCoefficient_zero] at h exact h theorem localGood_zero_germ (s : StripData D) (d : GraphDirections D) {n : ℕ} {i : I} {x : D} (hψ : a.cutoff n i =ᶠ[𝓝 x] fun _ => 0) : a.localGood s d n i =ᶠ[𝓝 x] fun _ => 0 := by have hc := a.localized_correction_zero_germ s d hψ have hp := principal_germ hc (Filter.EventuallyEq.refl (𝓝 x) (fun _ : D => (0 : ℂ))) (s.epsilon n) (a.background.frequency n) (a.background.radius n) (a.background.frequencyBase n) (a.background.axialBase n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (d.fastField n) have hr := remainder_germ (a.corrected_zero_germ s d hψ) (a.localized_zero_germs hψ).2 (s.epsilon n) (a.background.frequency n) (a.background.radius n) (a.background.radialBase n) (a.background.frequencyBase n) (a.background.axialBase n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (d.fastField n) (fun _ => d.slow) simp only [principal_zero] at hp simp only [remainder_zero] at hr filter_upwards [hp, hr] with y hpy hry change (a.raw i).principalVelocity s d ((a.localized i).curlCorrection s d) n y + (a.corrected s d i).remainder s d n y = 0 change (a.raw i).principalVelocity s d ((a.localized i).curlCorrection s d) n y = 0 at hpy change (a.corrected s d i).remainder s d n y = 0 at hry rw [hpy, hry, add_zero] theorem localTail_zero_germ (d : GraphDirections D) {n : ℕ} {i : I} {x : D} (hψ : a.cutoff n i =ᶠ[𝓝 x] fun _ => 0) : a.localTail d n i =ᶠ[𝓝 x] fun _ => 0 := by have hD := along_germ hψ (d.fastField n) filter_upwards [hD] with y hy change along (d.fastField n) (a.cutoff n i) y • _ = 0 rw [hy] simp [HarmonicCalculus.along] theorem localGood_support (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (n : ℕ) (i : I) : support (a.localGood s d n i) ⊆ K.carrier n i := by intro x hx by_contra hn exact hx (a.localGood_zero_germ s d (zero_germ_of_support (K.closed n i) (hs n i) hn)).self_of_nhds theorem localTail_support (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (d : GraphDirections D) (n : ℕ) (i : I) : support (a.localTail d n i) ⊆ K.carrier n i := by intro x hx by_contra hn exact hx (a.localTail_zero_germ d (zero_germ_of_support (K.closed n i) (hs n i) hn)).self_of_nhds omit [NormedSpace ℝ D] in theorem common_zero_germs (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) {n : ℕ} {x : D} (hx : ∀ i, x ∉ K.carrier n i) : a.common.amplitude n =ᶠ[𝓝 x] (fun _ => 0) ∧ a.common.pressure n =ᶠ[𝓝 x] (fun _ => 0) := ⟨copySum_zero_germ K n _ (a.localized_amplitude_support K hs n) hx, copySum_zero_germ K n _ (a.localized_pressure_support K hs n) hx⟩ theorem commonCorrected_zero_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) {n : ℕ} {x : D} (hx : ∀ i, x ∉ K.carrier n i) : (a.commonCorrected s d).amplitude n =ᶠ[𝓝 x] fun _ => 0 := by have h := realizedCoefficient_germ (a.common_zero_germs K hs hx).1 (a.background.frequency n) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (a.background.phase n) simp only [realizedCoefficient_zero] at h exact h theorem commonResidual_zero_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) {n : ℕ} {x : D} (hx : ∀ i, x ∉ K.carrier n i) : (a.commonCorrected s d).harmonicResidual s d n =ᶠ[𝓝 x] fun _ => 0 := by have hu : vectorMode (a.background.frequency n) (a.background.phase n) ((a.commonCorrected s d).amplitude n) =ᶠ[𝓝 x] (fun _ => 0) := by filter_upwards [a.commonCorrected_zero_germ K hs s d hx] with y hy ext i simp only [vectorMode, mode, hy, Pi.zero_apply, zero_mul] have hp : mode (a.background.frequency n) (a.background.phase n) (a.common.pressure n) =ᶠ[𝓝 x] (fun _ => 0) := by filter_upwards [(a.common_zero_germs K hs hx).2] with y hy simp only [mode, hy, zero_mul] have h := linearResidual_germ hu hp (s.epsilon n) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (LinearWaveResidual.timeDirection (s.epsilon n) (d.fastField n) (fun _ => d.slow)) (LinearWaveResidual.complexBase (a.background.radius n) (a.background.radialBase n) (a.background.frequencyBase n) (a.background.axialBase n)) simp only [linearResidual_zero] at h exact h theorem globalGood_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : a.globalGood s d n =ᶠ[𝓝 x] a.localGood s d n i := copySum_germ K n _ (a.localGood_support K hs s d n) hx theorem globalGood_zero_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) {n : ℕ} {x : D} (hx : ∀ i, x ∉ K.carrier n i) : a.globalGood s d n =ᶠ[𝓝 x] fun _ => 0 := copySum_zero_germ K n _ (a.localGood_support K hs s d n) hx /-- The global Gaussian field has the full native error as its germ, with both terms and all cutoff derivatives unchanged. -/ theorem globalGaussian_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (d : GraphDirections D) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : a.globalGaussian d n =ᶠ[𝓝 x] a.localGaussian d n i := by have hT := copySum_germ K n _ (a.localTail_support K hs d n) hx have hψ := copySum_germ K n (a.cutoff n) (hs n) hx filter_upwards [hT, hψ] with y hTy hψy change copySum (a.localTail d n) y + (1 - copySum (a.cutoff n) y) • a.source n y = a.localTail d n i y + (1 - a.cutoff n i y) • a.source n y rw [hTy, hψy] /-- The exact uncovered-source term persists outside the cutoff cells. -/ theorem globalGaussian_uncovered_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (d : GraphDirections D) {n : ℕ} {x : D} (hx : ∀ i, x ∉ K.carrier n i) : a.globalGaussian d n =ᶠ[𝓝 x] a.source n := by have hT := copySum_zero_germ K n _ (a.localTail_support K hs d n) hx have hψ := copySum_zero_germ K n (a.cutoff n) (hs n) hx filter_upwards [hT, hψ] with y hTy hψy change copySum (a.localTail d n) y + (1 - copySum (a.cutoff n) y) • a.source n y = _ rw [hTy, hψy] simp only [sub_zero, one_smul, zero_add] /-- Local native cancellation implies cancellation everywhere on the whole lift. The source need not vanish on the uncovered complement. -/ theorem common_cancellation (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (hlocal : ∀ n i x, x ∈ s.domain → x ∈ K.carrier n i → (a.corrected s d i).harmonicResidual s d n x + (fun j => a.source n x j * carrier (a.background.frequency n) (a.background.phase n) x) = (fun j => (a.localGood s d n i x j + a.localGaussian d n i x j) * carrier (a.background.frequency n) (a.background.phase n) x)) (n : ℕ) {x : D} (hx : x ∈ s.domain) : (a.commonCorrected s d).harmonicResidual s d n x + (fun j => a.source n x j * carrier (a.background.frequency n) (a.background.phase n) x) = (fun j => (a.globalGood s d n x j + a.globalGaussian d n x j) * carrier (a.background.frequency n) (a.background.phase n) x) := by classical by_cases h : ∃ i, x ∈ K.carrier n i · obtain ⟨i, hi⟩ := h rw [(a.commonCorrected_residual_germ K hs s d n hi).self_of_nhds, (a.globalGood_germ K hs s d n hi).self_of_nhds, (a.globalGaussian_germ K hs d n hi).self_of_nhds] exact hlocal n i x hx hi · have hn := not_exists.mp h rw [(a.commonResidual_zero_germ K hs s d hn).self_of_nhds, (a.globalGood_zero_germ K hs s d hn).self_of_nhds, (a.globalGaussian_uncovered_germ K hs d hn).self_of_nhds] simp only [zero_add, Pi.zero_apply] /-- Global classes for the actually localized common velocity and pressure. The input fields need be smooth only at their own native support cells. -/ theorem common_classes (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) {s : StripData D} {w : ℕ → D → ℝ} {α β : ℝ} (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) (ha : LocalJets s w α K.carrier (fun n i => (a.localized i).amplitude n)) (hp : LocalJets s w β K.carrier (fun n i => (a.localized i).pressure n)) : MemClass s w α a.common.amplitude ∧ MemClass s w β a.common.pressure := ⟨copySum_memClass K hw (a.localized_amplitude_support K hs) ha, copySum_memClass K hw (a.localized_pressure_support K hs) hp⟩ theorem commonCorrected_class_of_native (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) {s : StripData D} (d : GraphDirections D) {w : ℕ → D → ℝ} {α : ℝ} (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) (ha : LocalJets s w α K.carrier (fun n i => (a.corrected s d i).amplitude n)) : MemClass s w α (a.commonCorrected s d).amplitude := by apply memClass_of_local_germs hw ha intro n x _ classical by_cases h : ∃ i, x ∈ K.carrier n i · obtain ⟨i, hi⟩ := h exact Or.inl ⟨i, hi, a.commonCorrected_amplitude_germ K hs s d n hi⟩ · exact Or.inr (a.commonCorrected_zero_germ K hs s d (not_exists.mp h)) theorem globalGood_class_of_native (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) {s : StripData D} (d : GraphDirections D) {w : ℕ → D → ℝ} {α : ℝ} (hw : ∀ n x, x ∈ s.domain → 0 ≤ w n x) (hg : LocalJets s w α K.carrier (a.localGood s d)) : MemClass s w α (a.globalGood s d) := copySum_memClass K hw (a.localGood_support K hs s d) hg /-- The global differential formula corresponding to the sum of native good terms. Its equality with that sum is proved from actual germs. -/ noncomputable def differentialGood (s : StripData D) (d : GraphDirections D) (n : ℕ) (x : D) : ComplexVector := a.common.principalVelocity s d (a.common.curlCorrection s d) n x + (a.commonCorrected s d).remainder s d n x theorem differentialGood_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : a.differentialGood s d n =ᶠ[𝓝 x] a.localGood s d n i := by have hc := curlCorrection_germ (a.common_amplitude_germ K hs n hx) (a.background.frequency n) (a.background.radius n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) have hp := principal_germ hc (Filter.EventuallyEq.refl (𝓝 x) (fun _ : D => (0 : ℂ))) (s.epsilon n) (a.background.frequency n) (a.background.radius n) (a.background.frequencyBase n) (a.background.axialBase n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (d.fastField n) have hr := remainder_germ (a.commonCorrected_amplitude_germ K hs s d n hx) (a.common_pressure_germ K hs n hx) (s.epsilon n) (a.background.frequency n) (a.background.radius n) (a.background.radialBase n) (a.background.frequencyBase n) (a.background.axialBase n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (d.fastField n) (fun _ => d.slow) filter_upwards [hp, hr] with y hpy hry exact congrArg₂ (· + ·) hpy hry theorem differentialGood_zero_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) {n : ℕ} {x : D} (hx : ∀ i, x ∉ K.carrier n i) : a.differentialGood s d n =ᶠ[𝓝 x] fun _ => 0 := by have hc := curlCorrection_germ (a.common_zero_germs K hs hx).1 (a.background.frequency n) (a.background.radius n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) simp only [coefficient_zero, curlRemainder_zero] at hc have hp := principal_germ hc (Filter.EventuallyEq.refl (𝓝 x) (fun _ : D => (0 : ℂ))) (s.epsilon n) (a.background.frequency n) (a.background.radius n) (a.background.frequencyBase n) (a.background.axialBase n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (d.fastField n) have hr := remainder_germ (a.commonCorrected_zero_germ K hs s d hx) (a.common_zero_germs K hs hx).2 (s.epsilon n) (a.background.frequency n) (a.background.radius n) (a.background.radialBase n) (a.background.frequencyBase n) (a.background.axialBase n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (d.fastField n) (fun _ => d.slow) simp only [principal_zero] at hp simp only [remainder_zero] at hr filter_upwards [hp, hr] with y hpy hry exact (congrArg₂ (· + ·) hpy hry).trans (zero_add 0) theorem globalGood_eq_differentialGood (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) : a.globalGood s d = a.differentialGood s d := by classical funext n x by_cases h : ∃ i, x ∈ K.carrier n i · obtain ⟨i, hi⟩ := h exact (a.globalGood_germ K hs s d n hi).self_of_nhds.trans (a.differentialGood_germ K hs s d n hi).self_of_nhds.symm · exact (a.globalGood_zero_germ K hs s d (not_exists.mp h)).self_of_nhds.trans (a.differentialGood_zero_germ K hs s d (not_exists.mp h)).self_of_nhds.symm /-- Only the carrier, geometry, and base fields of this coefficient are used in the background estimates. -/ noncomputable def backgroundOnly : WaveCoefficients D := { a.background with amplitude := fun _ _ => 0, pressure := fun _ _ => 0 } theorem common_inputBounds (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) {s : StripData D} {d : GraphDirections D} {W : ℕ → D → ℝ} {α κ : ℝ} (hb : InputBounds s W α κ d a.backgroundOnly) (ha : LocalJets s (fun n x => Real.sqrt (s.zeta x) * W n x) α K.carrier (fun n i => (a.localized i).amplitude n)) (hp : LocalJets s (fun n x => Real.sqrt (s.zeta x) * W n x) (α + 1 / 2) K.carrier (fun n i => (a.localized i).pressure n)) : InputBounds s W α κ d a.common := by obtain ⟨hva, hvp⟩ := a.common_classes K hs (hb.amplitude 0).weight_nonneg ha hp exact { hb with amplitude := fun i => hva.map (ContinuousLinearMap.proj i), pressure := hvp } /-- Primitive background estimates and native localized velocity/pressure jets imply the actual global curl correction and good-remainder classes. Neither a local nor a global remainder-class hypothesis is used. -/ theorem common_bounds_from_native (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) {s : StripData D} {d : GraphDirections D} {W : ℕ → D → ℝ} {α κ : ℝ} (hb : InputBounds s W α κ d a.backgroundOnly) (ha : LocalJets s (fun n x => Real.sqrt (s.zeta x) * W n x) α K.carrier (fun n i => (a.localized i).amplitude n)) (hp : LocalJets s (fun n x => Real.sqrt (s.zeta x) * W n x) (α + 1 / 2) K.carrier (fun n i => (a.localized i).pressure n)) (hκ : κ ≤ 1 / 2) {R : D → ℝ} (hR : a.background.radius = fun _ => R) (hN : PhaseJetBounds.PolynomialJets (phaseDomain s) (a.background.normal s d)) {b M : ℝ} (hpos : 0 < b) (hlower : ∀ n x, x ∈ s.domain → b ≤ ‖a.background.normal s d n x‖) (hupper : ∀ n x, x ∈ s.domain → ‖a.background.normal s d n x‖ ≤ M) (hK : BandBound s (1 / 2) (fun n => 1 / a.background.frequency n)) : WaveClass s W α a.common.amplitude ∧ WaveClass s W α (a.commonCorrected s d).amplitude ∧ WaveClass s W (α + 1 / 2) a.common.pressure ∧ WaveClass s W (α + 1 / 2 - κ) (a.common.curlCorrection s d) ∧ WaveClass s W (α + 1 / 2 - 3 * κ) (a.globalGood s d) := by have h := a.common_inputBounds K hs hb ha hp have hc := h.curlCorrection_class hR hN hpos hlower hupper hK have hci i := hc.map (ContinuousLinearMap.proj i) have hcorrected := h.add_curl_amplitude hκ hci refine ⟨component_classes h.amplitude, component_classes hcorrected.amplitude, h.pressure, hc, ?_⟩ rw [a.globalGood_eq_differentialGood K hs s d] exact (h.curl_principal_gain hci).add hcorrected.remainder_class theorem localGaussian_zero_of_cutoff_one (d : GraphDirections D) {n : ℕ} {i : I} {x : D} (hψ : a.cutoff n i =ᶠ[𝓝 x] fun _ => 1) : a.localGaussian d n i =ᶠ[𝓝 x] fun _ => 0 := by have hD := along_germ hψ (d.fastField n) filter_upwards [hψ, hD] with y hψy hDy change along (d.fastField n) (a.cutoff n i) y • _ + (1 - a.cutoff n i y) • _ = 0 rw [hDy, hψy] simp [along] theorem localGaussian_zero_of_fields (d : GraphDirections D) {n : ℕ} {i : I} {x : D} (hu : a.amplitude n i =ᶠ[𝓝 x] fun _ => 0) (hf : a.source n =ᶠ[𝓝 x] fun _ => 0) : a.localGaussian d n i =ᶠ[𝓝 x] fun _ => 0 := by filter_upwards [hu, hf] with y huy hfy simp only [localGaussian, excludedSlotError, huy, hfy, smul_zero, add_zero] theorem common_potential_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (n : ℕ) {i : I} {x : D} (hx : x ∈ K.carrier n i) : a.common.curlPotential s d n =ᶠ[𝓝 x] (a.localized i).curlPotential s d n := potential_germ (a.common_amplitude_germ K hs n hx) (a.background.frequency n) (a.background.radius n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) theorem common_potential_zero_germ (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) {n : ℕ} {x : D} (hx : ∀ i, x ∉ K.carrier n i) : a.common.curlPotential s d n =ᶠ[𝓝 x] fun _ => 0 := by have h := potential_germ (a.common_zero_germs K hs hx).1 (a.background.frequency n) (a.background.radius n) (a.background.phase n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) simp only [vectorPotential_zero] at h exact h /-- The globally assembled velocity is the actual curl of the globally assembled potential whenever the native construction has that identity. -/ theorem common_realizes_curl (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (hnative : ∀ n i x, x ∈ s.domain → x ∈ K.carrier n i → cylindricalCurl (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) ((a.localized i).curlPotential s d n) x = vectorMode (a.background.frequency n) (a.background.phase n) ((a.corrected s d i).amplitude n) x) (n : ℕ) {x : D} (hx : x ∈ s.domain) : cylindricalCurl (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (a.common.curlPotential s d n) x = vectorMode (a.background.frequency n) (a.background.phase n) ((a.commonCorrected s d).amplitude n) x := by classical by_cases h : ∃ i, x ∈ K.carrier n i · obtain ⟨i, hi⟩ := h rw [(curl_germ (a.common_potential_germ K hs s d n hi) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n)).self_of_nhds] rw [(vectorMode_germ (a.commonCorrected_amplitude_germ K hs s d n hi) (a.background.frequency n) (a.background.phase n)).self_of_nhds] exact hnative n i x hx hi · have hn := not_exists.mp h rw [(curl_germ (a.common_potential_zero_germ K hs s d hn) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n)).self_of_nhds] rw [(vectorMode_germ (a.commonCorrected_zero_germ K hs s d hn) (a.background.frequency n) (a.background.phase n)).self_of_nhds] ext i simp [cylindricalCurl_zero, HarmonicCalculus.vectorMode, HarmonicCalculus.mode] /-- A local differential identity is transported through full neighborhood germs, so the support boundary contributes no extra divergence. -/ theorem common_divergence_zero (K : Cells D I) (hs : ∀ n i, support (a.cutoff n i) ⊆ K.carrier n i) (s : StripData D) (d : GraphDirections D) (hnative : ∀ n i x, x ∈ s.domain → x ∈ K.carrier n i → cylindricalDivergence (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (vectorMode (a.background.frequency n) (a.background.phase n) ((a.corrected s d i).amplitude n)) x = 0) (n : ℕ) {x : D} (hx : x ∈ s.domain) : cylindricalDivergence (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (vectorMode (a.background.frequency n) (a.background.phase n) ((a.commonCorrected s d).amplitude n)) x = 0 := by classical by_cases h : ∃ i, x ∈ K.carrier n i · obtain ⟨i, hi⟩ := h have hg := divergence_germ (vectorMode_germ (a.commonCorrected_amplitude_germ K hs s d n hi) (a.background.frequency n) (a.background.phase n)) (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) exact hg.self_of_nhds.trans (hnative n i x hx hi) · have hu : vectorMode (a.background.frequency n) (a.background.phase n) ((a.commonCorrected s d).amplitude n) =ᶠ[𝓝 x] (fun _ => 0) := by filter_upwards [a.commonCorrected_zero_germ K hs s d (not_exists.mp h)] with y hy ext i simp only [HarmonicCalculus.vectorMode, HarmonicCalculus.mode, hy, Pi.zero_apply, zero_mul] have hg := divergence_germ hu (a.background.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) simpa only [cylindricalDivergence_zero] using hg.self_of_nhds open CopyAngularInvariance in theorem common_amplitude_invariant (v : D) (hψ : ∀ n i, Invariant v (a.cutoff n i)) (hu : ∀ n i, Invariant v (a.amplitude n i)) (n : ℕ) : Invariant v (a.common.amplitude n) := Invariant.tsum_invariant (fun i => (hψ n i).map₂ (hu n i) (fun r u => r • u)) open CopyAngularInvariance in theorem common_pressure_invariant (v : D) (hψ : ∀ n i, Invariant v (a.cutoff n i)) (hp : ∀ n i, Invariant v (a.pressure n i)) (n : ℕ) : Invariant v (a.common.pressure n) := Invariant.tsum_invariant (fun i => (hψ n i).map₂ (hp n i) (fun r p => (r : ℂ) * p)) open CopyAngularInvariance in theorem commonCorrected_invariant (s : StripData D) (d : GraphDirections D) (v : D) (hψ : ∀ n i, Invariant v (a.cutoff n i)) (hu : ∀ n i, Invariant v (a.amplitude n i)) (hR : ∀ n, Invariant v (a.background.radius n)) (hr : ∀ n, Invariant v (d.radialField n)) (hz : ∀ n, Invariant v (d.axialField s n)) (hΦ : ∀ n, ∃ m, AffinePhase v m (a.background.phase n)) (n : ℕ) : Invariant v ((a.commonCorrected s d).amplitude n) := by obtain ⟨m, hm⟩ := hΦ n exact realizedCoefficient_invariant (hR n) (hr n) (Invariant.const _) (hz n) hm (a.common_amplitude_invariant v hψ hu n) (a.background.frequency n) open CopyAngularInvariance in theorem globalGaussian_invariant (d : GraphDirections D) (v : D) (hψ : ∀ n i, Invariant v (a.cutoff n i)) (hu : ∀ n i, Invariant v (a.amplitude n i)) (hf : ∀ n, Invariant v (a.source n)) (n : ℕ) : Invariant v (a.globalGaussian d n) := by have hT : Invariant v (a.globalTail d n) := Invariant.tsum_invariant (fun i => ((hψ n i).along (Invariant.const _)).map₂ (hu n i) (fun r u => r • u)) have hS : Invariant v (a.cutoffSum n) := Invariant.tsum_invariant (hψ n) exact hT.map₂ (hS.map₂ (hf n) (fun r f => (1 - r) • f)) (fun u w => u + w) open CopyAngularInvariance in theorem globalGood_invariant (s : StripData D) (d : GraphDirections D) (hψ : ∀ n i, Invariant d.angular (a.cutoff n i)) (hu : ∀ n i, Invariant d.angular (a.amplitude n i)) (hp : ∀ n i, Invariant d.angular (a.pressure n i)) (hR : ∀ n, Invariant d.angular (a.background.radius n)) (hb : ∀ n, Invariant d.angular (a.background.radialBase n)) (hF : ∀ n, Invariant d.angular (a.background.frequencyBase n)) (hG : ∀ n, Invariant d.angular (a.background.axialBase n)) (hr : ∀ n, Invariant d.angular (d.radialField n)) (hz : ∀ n, Invariant d.angular (d.axialField s n)) (hΦ : ∀ n, ∃ m, AffinePhase d.angular m (a.background.phase n)) (n : ℕ) : Invariant d.angular (a.globalGood s d n) := Invariant.tsum_invariant (fun i => constructedGood_invariant (a := a.raw i) (fun n => a.cutoff n i) hR hb hF hG hr hz hΦ (fun n => hu n i) (fun n => hp n i) (fun n => hψ n i) n) end CopyData end WaveData section ActualParticularData open CommonCoverSolve TorusInverse TorusAverages ParticularWaveBounds open ParticularWaveAssembly HarmonicCalculus LinearWaveBounds open CorrectionState ErrorHarmonics variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Actual complex copy solves with arbitrary band-dependent entry/exit times. In particular, a transported clock may use `exit = length / clock`. The tangent coefficients, source, geometry, and frequency are the actual inputs of `complexCopyVelocity` and its projected pressure. -/ noncomputable def complexCopyData (base : WaveCoefficients (P × Plane)) (t : ℕ → TangentData P ProblemStatement.Space) (source : ℕ → P × Plane → ComplexVector) (g : ℕ → Geometry) (entry exit : ℕ → ℝ) (hab : ∀ n, entry n ≤ exit n) (κ : ℕ → Plane → ℝ) : CopyData (P × Plane) Frequency where background := base amplitude n k := complexCopyVelocity (t n) (source n) (g n) (hab n) k pressure n k := complexCopyPressure (t n) (source n) (g n) (hab n) k (base.frequency n) cutoff n k z := κ n ((g n).coordinates k z.2) source := source end ActualParticularData end NavierStokes.PeriodizedWaveBounds