import Euler.PacketSlicedResidual import Euler.PacketPointJets import Euler.FiniteGradeTriangular import Euler.PeriodicDerivativeMean /-! The well-founded profile recursion in (14), on literal time/space/angle fields. Every new mean is computed before the new high coefficient. The supplied linear inverse maps are the interface to the analytic source constructions; this file proves the recursion and its dependence only on earlier grades. -/ /-! ## From `Euler/PacketTriangular.lean` The text of `Euler/PacketTriangular.lean`, folded into this file, which was its only importer. -/ section /-! The actual nonlinear packet operators have the triangular dependence claimed in (14). -/ noncomputable section namespace EulerPacketPointJets open EulerSmoothLimit EulerFiniteGrades InnerProductSpace theorem fastAdvection_tangent_left (m : Space) (J K : VectorJet) (hJ : ⟪m, J.1⟫_ℝ=0) : fastAdvection m J K=0 := by simp [fastAdvection, hJ] theorem fastAdvection_angleConstant_right (m : Space) (J K : VectorJet) (hK : K.2 angleDirection=0) : fastAdvection m J K=0 := by simp [fastAdvection, hK] def nonlinearGrade (M p : ℕ) (FInv : Space →L[ℝ] Space) (m : Space) (u : ℕ → VectorJet) : Space := convolution M (slowAdvection FInv) u u p + convolution M (fastAdvection m) u u (p+1) /-- Changing the new high coefficient and mean coefficient leaves just the mean-primary interaction. -/ theorem nonlinearGrade_update (M p : ℕ) (hp : 2 ≤ p) (hMp : p+1 ≤ M) (FInv : Space →L[ℝ] Space) (m : Space) (u u' : ℕ → VectorJet) (A B : VectorJet) (hu0 : u 0=0) (hu : ∀ i < p, u' i=u i) (hnew : u' p=u p+(A+B)) (hprimary : ⟪m, (u 1).1⟫_ℝ=0) (hA : ⟪m, A.1⟫_ℝ=0) : nonlinearGrade M p FInv m u' = nonlinearGrade M p FInv m u + fastAdvection m B (u 1) := by unfold nonlinearGrade rw [convolution_strict_congr M p (by omega) (by omega) _ u u' hu0 hu, convolution_next_delta M p hp hMp _ u u' (A+B) hu0 hu hnew] rw [map_add, LinearMap.add_apply, fastAdvection_tangent_left m A (u 1) hA, fastAdvection_tangent_left m (u 1) (A+B) hprimary] simp only [zero_add, add_zero, add_assoc] end EulerPacketPointJets end end /-! ## From `Euler/PacketKnownGrade.lean` The text of `Euler/PacketKnownGrade.lean`, folded into this file, which was its only importer. -/ section /-! The known forcing at a recursive grade uses only previously constructed coefficients. -/ noncomputable section namespace EulerPacketPointJets open EulerSmoothLimit EulerFiniteGrades InnerProductSpace def history (p : ℕ) (u : ℕ → VectorJet) (previousCorrector : VectorJet) (i : ℕ) : VectorJet := if i

P⁻¹ • ∫ θ in 0..P, f (z.1,(z.2.1,θ)) /-- The stored coefficients determine the jets of V_i=A_i+B_i+C_{i-1}. -/ def velocityJet (s : Set ℝ) (a : ℕ → Profile) (z : Domain) (i : ℕ) : VectorJet := if i=0 then 0 else slicedJet s (a i).high z+slicedJet s (a i).mean z+ slicedJet s (a (i-1)).corrector z def knownJets (O : Operators) (p : ℕ) (a : ℕ → Profile) (z : Domain) : ℕ → VectorJet := history p (velocityJet O.interval a z) (slicedJet O.interval (a (p-1)).corrector z) /-- All terms of the grade-p forcing that are already determined. -/ def knownForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := fun z => -(linearPart (O.strain z) (slicedJet O.interval (a (p-1)).corrector z)+ slowPressure (O.inverseFrame z) (pressureJet (a (p-1)).highPressure z)+ nonlinearGrade (p+1) p (O.inverseFrame z) (O.normal z) (knownJets O p a z)) def meanForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := angleMean O.period (knownForce O p a) def meanResult (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField × ScalarField := O.meanSolve (meanForce O p a) /-- The sole new mean-primary interaction is added after solving the mean. -/ def highForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := fun z => knownForce O p a z-meanForce O p a z- fastAdvection (O.normal z) (slicedJet O.interval (meanResult O p a).1 z) (slicedJet O.interval (a 1).high z) def step (O : Operators) (p : ℕ) (a : ℕ → Profile) : Profile := let b := meanResult O p a let h := O.highSolve (highForce O p a) ⟨h.1,b.1,O.curlCorrector h.1,h.2,b.2⟩ theorem velocityJet_congr (s : Set ℝ) (p : ℕ) (a b : ℕ → Profile) (h : ∀ i velocityJet_congr O.interval p a b h z i hi) theorem knownForce_congr (O : Operators) (p : ℕ) (hp : 1 ≤ p) (a b : ℕ → Profile) (h : ∀ i if hi : i

profiles O primary i) := Nat.strongRec_eq (recursionStep O primary) p @[simp] theorem profiles_zero (O : Operators) (primary : Profile) : profiles O primary 0=0 := by rw [profiles_unfold] simp only [recursionStep, ite_true] @[simp] theorem profiles_one (O : Operators) (primary : Profile) : profiles O primary 1=primary := by rw [profiles_unfold] simp only [recursionStep, one_ne_zero, ite_false, ite_true] /-- This is an actual recursive construction, not an existence assumption on profiles. -/ theorem profiles_step (O : Operators) (primary : Profile) (p : ℕ) (hp : 2 ≤ p) : profiles O primary p=step O p (profiles O primary) := by rw [profiles_unfold] simp only [recursionStep, show p ≠ 0 by omega, show p ≠ 1 by omega, ite_false] apply step_congr O p hp intro i hi simp only [dite_eq_left hi] theorem profiles_mean (O : Operators) (primary : Profile) (p : ℕ) (hp : 2 ≤ p) : (profiles O primary p).mean=(meanResult O p (profiles O primary)).1 := by rw [profiles_step O primary p hp] rfl theorem profiles_corrector (O : Operators) (primary : Profile) (p : ℕ) (hp : 2 ≤ p) : (profiles O primary p).corrector=O.curlCorrector (profiles O primary p).high := by rw [profiles_step O primary p hp] rfl end EulerPacketProfileRecursion