import NavierStokes.BasePhaseGeometry import NavierStokes.LinearWaveBounds /-! # The actual primary material-phase defect The large axial term in the phase is cancelled by its actual material derivative before estimating any jets. Only the slow coordinate map and slot coordinate require polynomial bounds; the angular coordinate and the unstripped phase itself need no such bound. -/ noncomputable section namespace NavierStokes.PrimaryMaterialDefect open Set WeightedClasses LinearWaveBounds open scoped Topology ContDiff abbrev Slow := PhaseCalculus.Slow abbrev Slot := PhaseCalculus.Slot variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- First-order chart identities, including the direction annihilated by the physical radial graph derivative. No phase derivative is an input. -/ structure NativeCoordinates (s : StripData E) (d : GraphDirections E) (χ : ℕ → E → Slot) : Prop where differentiable : ∀ n x, x ∈ s.domain → DifferentiableAt ℝ (χ n) x radial : ∀ n x, x ∈ s.domain → fderiv ℝ (χ n) x d.radial = PhaseCalculus.eR auxiliary : ∀ n x, x ∈ s.domain → fderiv ℝ (χ n) x d.auxiliary = 0 angular : ∀ n x, x ∈ s.domain → fderiv ℝ (χ n) x d.angular = PhaseCalculus.eTheta axial : ∀ n x, x ∈ s.domain → fderiv ℝ (χ n) x d.axial = PhaseCalculus.eZ fast : ∀ n x, x ∈ s.domain → fderiv ℝ (χ n) x (d.fastField n x) = PhaseCalculus.eV slow : ∀ n x, x ∈ s.domain → fderiv ℝ (χ n) x d.slow = PhaseCalculus.eT namespace NativeCoordinates variable {s : StripData E} {d : GraphDirections E} {χ : ℕ → E → Slot} variable (hχ : NativeCoordinates s d χ) include hχ end NativeCoordinates section CommonPullback variable {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] /-- Differential matching for a change from a common chart to a native chart. It concerns the coordinate map, not the phase or its defect. -/ structure DirectionMatch (s : StripData E) (d : GraphDirections E) (s' : StripData E') (d' : GraphDirections E') (ψ : ℕ → E' → E) : Prop where maps : ∀ n, MapsTo (ψ n) s'.domain s.domain differentiable : ∀ n x, x ∈ s'.domain → DifferentiableAt ℝ (ψ n) x radial : ∀ n x, x ∈ s'.domain → fderiv ℝ (ψ n) x d'.radial = d.radial auxiliary : ∀ n x, x ∈ s'.domain → fderiv ℝ (ψ n) x d'.auxiliary = d.auxiliary angular : ∀ n x, x ∈ s'.domain → fderiv ℝ (ψ n) x d'.angular = d.angular axial : ∀ n x, x ∈ s'.domain → fderiv ℝ (ψ n) x d'.axial = d.axial fast : ∀ n x, x ∈ s'.domain → fderiv ℝ (ψ n) x (d'.fastField n x) = d.fastField n (ψ n x) slow : ∀ n x, x ∈ s'.domain → fderiv ℝ (ψ n) x d'.slow = d.slow theorem NativeCoordinates.comp {s : StripData E} {d : GraphDirections E} {χ : ℕ → E → Slot} (hχ : NativeCoordinates s d χ) {s' : StripData E'} {d' : GraphDirections E'} {ψ : ℕ → E' → E} (hψ : DirectionMatch s d s' d' ψ) : NativeCoordinates s' d' (fun n => χ n ∘ ψ n) := by have hd n x hx := fderiv_comp x (hχ.differentiable n (ψ n x) (hψ.maps n hx)) (hψ.differentiable n x hx) refine ⟨fun n x hx => (hχ.differentiable n (ψ n x) (hψ.maps n hx)).comp x (hψ.differentiable n x hx), ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro n x hx; rw [hd n x hx, ContinuousLinearMap.comp_apply, hψ.radial n x hx] exact hχ.radial n _ (hψ.maps n hx) · intro n x hx; rw [hd n x hx, ContinuousLinearMap.comp_apply, hψ.auxiliary n x hx] exact hχ.auxiliary n _ (hψ.maps n hx) · intro n x hx; rw [hd n x hx, ContinuousLinearMap.comp_apply, hψ.angular n x hx] exact hχ.angular n _ (hψ.maps n hx) · intro n x hx; rw [hd n x hx, ContinuousLinearMap.comp_apply, hψ.axial n x hx] exact hχ.axial n _ (hψ.maps n hx) · intro n x hx; rw [hd n x hx, ContinuousLinearMap.comp_apply, hψ.fast n x hx] exact hχ.fast n _ (hψ.maps n hx) · intro n x hx; rw [hd n x hx, ContinuousLinearMap.comp_apply, hψ.slow n x hx] exact hχ.slow n _ (hψ.maps n hx) end CommonPullback theorem differentiableAt_phase (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) (hF : DifferentiableAt ℝ F q.1) (hG : DifferentiableAt ℝ G q.1) : DifferentiableAt ℝ (PhaseCalculus.phase ε p pz x0 F G) q := by have hi : DifferentiableAt ℝ (fun z : Slot => z) q := differentiableAt_id have hFl := hF.comp q hi.fst have hGl := hG.comp q hi.fst exact (((hi.snd.fst.const_mul p).add (hi.fst.snd.fst.const_mul (pz / ε))).add (hi.fst.fst.const_mul x0)).sub (hi.snd.snd.mul ((hFl.const_mul p).add (hGl.const_mul pz))) /-- The algebraic expression after exact material cancellation. -/ noncomputable def expression (ε p pz x0 v b G FR GR FT GT FZ GZ : ℝ) : ℝ := b * x0 - v * (b * (p * FR + pz * GR) - ε * (p * FT + pz * GT) + ε * G * (p * FZ + pz * GZ)) section Primary variable {U : PhaseJetBounds.Domain ℕ Slow} noncomputable def pulledPhase (P : PrimaryPulseBounds.PhaseConstruction U) (χ : ℕ → E → Slot) (n : ℕ) (x : E) : ℝ := PhaseCalculus.phase (P.phase.epsilon n) (P.phase.p n) (P.phase.pz n) (P.phase.x0 n) (P.phase.F n) (P.phase.G n) (χ n x) /-- Canonical raw geometry with arbitrary amplitude/pressure. Those two fields do not enter the material defect. The angular base field here is the frequency `F`, as required by `LinearWaveResidual`, not `R*F`. -/ noncomputable def coefficients (P : PrimaryPulseBounds.PhaseConstruction U) (b : ℕ → Slow → ℝ) (χ : ℕ → E → Slot) (amplitude : ℕ → E → HarmonicCalculus.ComplexVector) (pressure : ℕ → E → ℂ) (frequency : ℕ → ℝ) : WaveCoefficients E where radius n x := (χ n x).1.1 radialBase n x := b n (χ n x).1 frequencyBase n x := P.phase.F n (χ n x).1 axialBase n x := P.phase.G n (χ n x).1 phase := pulledPhase P χ amplitude := amplitude pressure := pressure frequency := frequency end Primary end NavierStokes.PrimaryMaterialDefect