import NavierStokes.ActualSignedPhysicalData /-! # Signed physical families with label-dependent phase domains Each active primary label retains its own phase domain, primary data, views, and state. Homogeneous singleton views permit reuse of the existing per-label constructors. Physical copies are then assembled before the locally finite sum is estimated; no maximum over infinitely many per-label constants occurs. -/ noncomputable section namespace NavierStokes.DependentSignedPhysicalFamily open Set Function Filter ProblemStatement PhysicalWaveSum PhysicalCopyBounds open WeightedClasses open scoped Topology ContDiff BigOperators abbrev NativeLabel := ActualSignedPhysicalData.NativeLabel /-- Only active labels carry primary data, and their phase domains may differ. -/ structure Family where active : Set BandLabel domain : NativeLabel active → PhaseJetBounds.Domain ℕ PhaseCalculus.Slow primary : (L : NativeLabel active) → PhysicalSignedWave.PrimaryData (domain L) view : (L : NativeLabel active) → (primary L).Views L.val.1 state : (L : NativeLabel active) → (view L).StateData column : NativeLabel active → Fin 2 namespace Family variable (f : Family) noncomputable def singletonLabel (L : NativeLabel f.active) : NativeLabel ({(L : BandLabel)} : Set BandLabel) := ⟨L.val, L.property, Set.mem_singleton _⟩ theorem singleton_label_val (L : NativeLabel f.active) (K : NativeLabel ({(L : BandLabel)} : Set BandLabel)) : K.val = L.val := congrArg Subtype.val (Set.mem_singleton_iff.mp K.mem) noncomputable def singletonPayload (L : NativeLabel f.active) (K : NativeLabel ({(L : BandLabel)} : Set BandLabel)) : Σ V : (f.primary L).Views K.val.1, V.StateData := by have hband : K.val.1 = L.val.1 := congrArg Prod.fst (f.singleton_label_val L K) rw [hband] exact ⟨f.view L, f.state L⟩ /-- Reuse the old homogeneous interface for exactly one actual label. There is no choice of data for an omitted label. -/ noncomputable def singleton (L : NativeLabel f.active) : ActualSignedPhysicalData.SignedFamily (f.domain L) where active := {(L : BandLabel)} primary _ := f.primary L view K := (f.singletonPayload L K).1 state K := (f.singletonPayload L K).2 column _ := f.column L @[simp] theorem singleton_active (L : NativeLabel f.active) : (f.singleton L).active = {(L : BandLabel)} := rfl @[simp] theorem singleton_primary (L : NativeLabel f.active) (K : NativeLabel (f.singleton L).active) : (f.singleton L).primary K = f.primary L := rfl @[simp] theorem singleton_view (L : NativeLabel f.active) : (f.singleton L).view (f.singletonLabel L) = f.view L := by rfl @[simp] theorem singleton_state (L : NativeLabel f.active) : (f.singleton L).state (f.singletonLabel L) = f.state L := by rfl @[simp] theorem singleton_column (L : NativeLabel f.active) (K : NativeLabel (f.singleton L).active) : (f.singleton L).column K = f.column L := rfl @[simp] theorem singleton_referenceRequest (L : NativeLabel f.active) : ((f.singleton L).state (f.singletonLabel L)).referenceRequest = (f.state L).referenceRequest := by rfl @[simp] theorem singleton_request (L : NativeLabel f.active) : ((f.singleton L).state (f.singletonLabel L)).request = (f.state L).request := by rfl /-- Extend actual values by zero without extending their primary data. -/ noncomputable def valueAt {V : Type*} [Zero V] (value : NativeLabel f.active → V) (L : BandLabel) : V := by classical exact if hL : L ∈ f.active then value ⟨L.val, L.property, hL⟩ else 0 @[simp] theorem valueAt_active {V : Type*} [Zero V] (value : NativeLabel f.active → V) (L : NativeLabel f.active) : f.valueAt value L = value L := by classical simp only [valueAt, dite_eq_left L.mem] theorem valueAt_inactive {V : Type*} [Zero V] (value : NativeLabel f.active → V) {L : BandLabel} (hL : L ∉ f.active) : f.valueAt value L = 0 := by classical simp only [valueAt, dite_eq_right hL] end Family /-! ## One physical copy family, selected label by label -/ variable {H : ℕ} {K : Type*} noncomputable def zeroCopies : CopyFamily H K where gap _ := 0 carrier _ _ := ⟨0, 0, 0, 0, 0, fun _ => 0, fun _ => 0⟩ amplitude _ _ _ := 0 @[simp] theorem zeroCopies_term (a h r0 : ℝ) (I : WaveIndex H) (k : K) : (zeroCopies : CopyFamily H K).term a h r0 I k = 0 := by funext w exact globalWave_eq_zero rfl noncomputable def zeroCells : SupportCells (zeroCopies : CopyFamily H K) where cells _ := { carrier := fun _ _ => ∅ closed := fun _ _ => isClosed_empty locallyFinite := fun _ _ => ⟨univ, univ_mem, by simp⟩ unique := fun _ _ _ _ hx _ => hx.elim } support _ _ _ hx := (hx rfl).elim theorem zeroSupport {a b h r0 Z : ℝ} {Δ : ℕ} : LocalPhysicalCopyBounds.SupportData (zeroCopies : CopyFamily H K) a b h r0 Z Δ where gap_le _ := Nat.zero_le _ gap_native _ := Nat.zero_le _ angular_integer _ _ := ⟨0, by simp [zeroCopies]⟩ geometry_support _ _ _ hx := (hx rfl).elim mask_support _ _ _ _ hx := (hx rfl).elim theorem zeroSmooth {a h r0 : ℝ} : LocalPhysicalCopyBounds.SmoothData (zeroCopies : CopyFamily H K) a h r0 where amplitude _ _ _ _ _ := ⟨univ, isOpen_univ, mem_univ _, contDiffOn_const⟩ profiles _ _ _ _ _ _ _ := ⟨⟨univ, isOpen_univ, mem_univ _, contDiffOn_const⟩, ⟨univ, isOpen_univ, mem_univ _, contDiffOn_const⟩⟩ noncomputable def diagonal (f : BandLabel → CopyFamily H K) : CopyFamily H K where gap L := (f L).gap L carrier k L := (f L).carrier k L amplitude k I := (f I.1).amplitude k I @[simp] theorem diagonal_gap (f : BandLabel → CopyFamily H K) (L : BandLabel) : (diagonal f).gap L = (f L).gap L := rfl @[simp] theorem diagonal_carrier (f : BandLabel → CopyFamily H K) (k : K) (L : BandLabel) : (diagonal f).carrier k L = (f L).carrier k L := rfl @[simp] theorem diagonal_amplitude (f : BandLabel → CopyFamily H K) (k : K) (I : WaveIndex H) : (diagonal f).amplitude k I = (f I.1).amplitude k I := rfl @[simp] theorem diagonal_term (f : BandLabel → CopyFamily H K) (a h r0 : ℝ) (I : WaveIndex H) (k : K) : (diagonal f).term a h r0 I k = (f I.1).term a h r0 I k := rfl @[simp] theorem diagonal_periodized (f : BandLabel → CopyFamily H K) (a h r0 : ℝ) (I : WaveIndex H) : (diagonal f).periodized a h r0 I = (f I.1).periodized a h r0 I := rfl noncomputable def diagonalCells (f : BandLabel → CopyFamily H K) (c : ∀ L, SupportCells (f L)) : SupportCells (diagonal f) where cells L := (c L).cells L support I k := (c I.1).support I k @[simp] theorem diagonalCells_cells (f : BandLabel → CopyFamily H K) (c : ∀ L, SupportCells (f L)) (L : BandLabel) : (diagonalCells f c).cells L = (c L).cells L := rfl theorem diagonalSupport (f : BandLabel → CopyFamily H K) {a b h r0 Z : ℝ} {Δ : ℕ} (s : ∀ L, LocalPhysicalCopyBounds.SupportData (f L) a b h r0 Z Δ) : LocalPhysicalCopyBounds.SupportData (diagonal f) a b h r0 Z Δ where gap_le L := (s L).gap_le L gap_native L := (s L).gap_native L angular_integer k L := (s L).angular_integer k L geometry_support k I := (s I.1).geometry_support k I mask_support k I := (s I.1).mask_support k I theorem diagonalSmooth (f : BandLabel → CopyFamily H K) {a h r0 : ℝ} (s : ∀ L, LocalPhysicalCopyBounds.SmoothData (f L) a h r0) : LocalPhysicalCopyBounds.SmoothData (diagonal f) a h r0 where amplitude k I := (s I.1).amplitude k I profiles k I := (s I.1).profiles k I namespace Family variable (f : Family) /-- The missing labels receive zero copies, never invented primary data. -/ noncomputable def copyAt (copies : NativeLabel f.active → CopyFamily H K) (L : BandLabel) : CopyFamily H K := by classical exact if hL : L ∈ f.active then copies ⟨L.val, L.property, hL⟩ else zeroCopies @[simp] theorem copyAt_active (copies : NativeLabel f.active → CopyFamily H K) (L : NativeLabel f.active) : f.copyAt copies L = copies L := by classical simp only [copyAt, dite_eq_left L.mem] theorem copyAt_inactive (copies : NativeLabel f.active → CopyFamily H K) {L : BandLabel} (hL : L ∉ f.active) : f.copyAt copies L = zeroCopies := by classical simp only [copyAt, dite_eq_right hL] noncomputable def assembled (copies : NativeLabel f.active → CopyFamily H K) : CopyFamily H K := diagonal (f.copyAt copies) noncomputable def branchCells (copies : NativeLabel f.active → CopyFamily H K) (c : ∀ L, SupportCells (copies L)) (L : BandLabel) : SupportCells (f.copyAt copies L) := by classical by_cases hL : L ∈ f.active · simp only [copyAt, dite_eq_left hL] exact c ⟨L.val, L.property, hL⟩ · rw [f.copyAt_inactive copies hL] exact zeroCells theorem branchSupport (copies : NativeLabel f.active → CopyFamily H K) {a b h r0 Z : ℝ} {Δ : ℕ} (s : ∀ L, LocalPhysicalCopyBounds.SupportData (copies L) a b h r0 Z Δ) (L : BandLabel) : LocalPhysicalCopyBounds.SupportData (f.copyAt copies L) a b h r0 Z Δ := by classical by_cases hL : L ∈ f.active · simp only [copyAt, dite_eq_left hL] exact s ⟨L.val, L.property, hL⟩ · rw [f.copyAt_inactive copies hL] exact zeroSupport theorem branchSmooth (copies : NativeLabel f.active → CopyFamily H K) {a h r0 : ℝ} (s : ∀ L, LocalPhysicalCopyBounds.SmoothData (copies L) a h r0) (L : BandLabel) : LocalPhysicalCopyBounds.SmoothData (f.copyAt copies L) a h r0 := by classical by_cases hL : L ∈ f.active · simp only [copyAt, dite_eq_left hL] exact s ⟨L.val, L.property, hL⟩ · rw [f.copyAt_inactive copies hL] exact zeroSmooth section SignedCopies variable {D h : ℝ} (sys : PartitionedCovariance.SlotSystem D h ActualSignedGeometry.radialVector ActualSignedGeometry.temporalVector) (hh : 0 ≤ h) /-- The exact native source belonging to a primary label. Uniform bounds must hold jointly over this label and the native source index. -/ noncomputable def potentialSource (L : BandLabel) : ActualSignedPhysicalData.SourceIndex → ℕ → ActualSignedPhysicalData.Native → HarmonicCalculus.ComplexVector := f.valueAt (fun L => ActualSignedPhysicalData.nativePotentialSource sys hh (f.singleton L)) L noncomputable def pressureSource (L : BandLabel) : ActualSignedPhysicalData.SourceIndex → ℕ → ActualSignedPhysicalData.Native → ℂ := f.valueAt (fun L => ActualSignedPhysicalData.nativePressureSource sys hh (f.singleton L)) L @[simp] theorem potentialSource_active (L : NativeLabel f.active) : f.potentialSource sys hh L = ActualSignedPhysicalData.nativePotentialSource sys hh (f.singleton L) := f.valueAt_active _ L @[simp] theorem pressureSource_active (L : NativeLabel f.active) : f.pressureSource sys hh L = ActualSignedPhysicalData.nativePressureSource sys hh (f.singleton L) := f.valueAt_active _ L noncomputable def potentialCopies (i : Fin 3) : CopyFamily 1 TorusInverse.Frequency := f.assembled (fun L => ActualSignedPhysicalData.potentialFamily sys hh (f.singleton L) i) noncomputable def pressureCopies : CopyFamily 1 TorusInverse.Frequency := f.assembled (fun L => ActualSignedPhysicalData.pressureFamily sys hh (f.singleton L)) /-- Native Cartesian rotation and the physical factor are retained exactly by the dependent assembly. -/ theorem potential_amplitude_eq_source (i : Fin 3) (k : TorusInverse.Frequency) (I : WaveIndex 1) (x : PhysicalGraphBounds.LiftPoint) : (f.potentialCopies sys hh i).amplitude k I x = (ChartScales.Q I.1.val.1 ^ (-h) : ℝ) • CartesianCopySource.rotatedSource (f.potentialSource sys hh I.1) (I, k) I.1.val.1 x i := by classical change (f.copyAt (fun L => ActualSignedPhysicalData.potentialFamily sys hh (f.singleton L) i) I.1).amplitude k I x = _ by_cases hL : I.1 ∈ f.active · simp only [copyAt, potentialSource, valueAt, dite_eq_left hL] exact ActualSignedPhysicalData.potential_amplitude_eq_source sys hh (f.singleton ⟨I.1.val, I.1.property, hL⟩) i k I x · simp [copyAt, potentialSource, valueAt, hL, zeroCopies, CartesianCopySource.rotatedSource] theorem pressure_amplitude_eq_source (k : TorusInverse.Frequency) (I : WaveIndex 1) (x : PhysicalGraphBounds.LiftPoint) : (f.pressureCopies sys hh).amplitude k I x = (ChartScales.Q I.1.val.1 ^ (-(2 * CoordinateAlgebra.A h)) : ℝ) • f.pressureSource sys hh I.1 (I, k) I.1.val.1 (PhysicalClassBounds.cylindricalMap x) := by classical change (f.copyAt (fun L => ActualSignedPhysicalData.pressureFamily sys hh (f.singleton L)) I.1).amplitude k I x = _ by_cases hL : I.1 ∈ f.active · simp only [copyAt, pressureSource, valueAt, dite_eq_left hL] exact ActualSignedPhysicalData.pressure_amplitude_eq_source sys hh (f.singleton ⟨I.1.val, I.1.property, hL⟩) k I x · simp [copyAt, pressureSource, valueAt, hL, zeroCopies] theorem potential_periodized_active (L : NativeLabel f.active) (i : Fin 3) (a r0 : ℝ) : (f.potentialCopies sys hh i).periodized a h r0 (ActualSignedPhysicalData.positiveIndex L) = (ActualSignedPhysicalData.potentialFamily sys hh (f.singleton L) i).periodized a h r0 (ActualSignedPhysicalData.positiveIndex L) := by change (diagonal (f.copyAt _)).periodized _ _ _ _ = _ rw [diagonal_periodized] simp only [ActualSignedPhysicalData.positiveIndex, copyAt_active] theorem pressure_periodized_active (L : NativeLabel f.active) (a r0 : ℝ) : (f.pressureCopies sys hh).periodized a h r0 (ActualSignedPhysicalData.positiveIndex L) = (ActualSignedPhysicalData.pressureFamily sys hh (f.singleton L)).periodized a h r0 (ActualSignedPhysicalData.positiveIndex L) := by change (diagonal (f.copyAt _)).periodized _ _ _ _ = _ rw [diagonal_periodized] simp only [ActualSignedPhysicalData.positiveIndex, copyAt_active] end SignedCopies end Family /-! ## Sources retain their label in a dependent index -/ variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] {ι : BandLabel → Type*} noncomputable def jointSource {V : Type*} (source : (L : BandLabel) → ι L → ℕ → E → V) : (Σ L, ι L) → ℕ → E → V := fun I => source I.1 I.2 /-! ## Native chart and carrier bounds are uniform before label selection -/ /-! ## One application of the physical-family estimate -/ section Assembly variable {J : Type*} {a b h r0 Z P0 α σ : ℝ} {Δ : ℕ} (s : StripData E) (f : J → BandLabel → CopyFamily H K) (c : ∀ i L, SupportCells (f i L)) (source : (L : BandLabel) → ι L → ℕ → E → ℂ) (weight : (L : BandLabel) → ι L → ℕ → E → ℝ) (hsource : LocalPhysicalCopyBounds.LocalSourceBounds s h α (jointSource weight) (jointSource source)) (ch : ∀ i L, LocalPhysicalCopyBounds.CommonChart (f i L) (c i L) a b h r0 σ (source L)) (hchart : ∀ i m, ∃ B : ℝ, 1 ≤ B ∧ ∃ q : ℕ, ∀ k I x, x ∈ (ch i I.1).domain k I → ∀ j, 1 ≤ j → j ≤ m → ‖iteratedFDeriv ℝ j ((ch i I.1).map k I) x‖ ≤ B * ChartScales.S I.1.val.1 ^ q) (hmap : ∀ i k I, MapsTo ((ch i I.1).map k I) ((ch i I.1).domain k I) s.domain) (bc : ∀ i L, CarrierBounds (f i L) (c i L) a b h r0) (hphase : ∀ i, PhaseJetBounds.PolynomialJets (copyBandDomain (fun k L => (bc i L).region k L) (fun k L => (bc i L).open_region k L)) (fun I x => (((f i I.2).carrier I.1 I.2).F x, ((f i I.2).carrier I.1 I.2).G x))) (hsupport : ∀ i L, LocalPhysicalCopyBounds.SupportData (f i L) a b h r0 Z Δ) (hsmooth : ∀ i L, LocalPhysicalCopyBounds.SmoothData (f i L) a h r0) (ha : 0 < a) (hr0 : 0 ≤ r0) (hZ : 0 ≤ Z) (hP : 1 ≤ P0) (hfrequency : ∀ i k L, |((f i L).carrier k L).angular| ≤ P0 ∧ |((f i L).carrier k L).axial| ≤ P0 ∧ |((f i L).carrier k L).radial| ≤ P0) end Assembly end NavierStokes.DependentSignedPhysicalFamily