import Euler.OrdinaryH3Energy import Euler.OrdinaryWordConstraints import Euler.SmoothFieldSobolevTime import Euler.CylinderSobolevOperators import Mathlib.Analysis.InnerProductSpace.Calculus import Euler.SmoothEulerEvolution /-! Actual Euler evolutions and their genuine H³ difference-energy law. The record contains only the fields, their classical Euler equation, the Helmholtz constraints, and continuity of their ordinary L² jets. -/ /-! ## From `Euler/OrdinaryWordTime.lean` The text of `Euler/OrdinaryWordTime.lean`, folded into this file, which was its only importer. -/ section /-! Strong time differentiation of every actual ordinary L² word, derived from the pointwise evolution and continuous L² spatial jets. -/ noncomputable section namespace EulerOrdinarySobolev open Set MeasureTheory InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field EulerMeanOrdinaryLift EulerMeanSmoothRepresentative EulerCylinderSobolevSpace EulerLiftedGradientSpace EulerSmoothFieldSobolevTime EulerVolterraConvolution Finset open scoped ContDiff private local instance : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ def ordinaryWordOperator {n : ℕ} (w : Fin n → Fin 3) : SobolevSpace 1 n →L[ℝ] EulerMeanSolenoidal.L2 := ordinaryLift.toContinuousLinearMap.adjoint.comp (wordOperator 1 ⟨⟨n, Nat.lt_succ_self n⟩,fun i => (w i).succ⟩) theorem ordinaryWordOperator_apply (A : SmoothL2Field Space) {n : ℕ} (w : Fin n → Fin 3) : ordinaryWordOperator w (ordinarySobolev n A.toLp A.translation_contDiff)= (wordField A w).toLp := by change ordinaryLift.toContinuousLinearMap.adjoint ((ordinarySobolev n A.toLp A.translation_contDiff).val ⟨⟨n,Nat.lt_succ_self n⟩,fun i => (w i).succ⟩)=_ erw [ordinarySobolev_coordinate] have he (u : EulerMeanSolenoidal.L2) : ordinaryLift.toContinuousLinearMap.adjoint (ordinaryLift u)=u := congrArg (fun L : EulerMeanSolenoidal.L2 →L[ℝ] EulerMeanSolenoidal.L2 => L u) ordinaryLift.adjoint_comp_self rw [he,word_toLp_eq_orbit] have hc : coordinateTuple (fun i => (w i).succ)=(fun i => axis (w i)) := by funext i simp only [coordinateTuple,EulerCylinderSobolev.standardDirection_succ,axis] change iteratedFDeriv ℝ n (fun a => EulerMeanSolenoidal.translation a A.toLp) 0 (coordinateTuple (fun i => (w i).succ)) = _ rw [hc] rfl variable {K : Type*} [TopologicalSpace K] def ordinaryWordPath (A : K → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) {n : ℕ} (w : Fin n → Fin 3) : C(K,EulerMeanSolenoidal.L2) := ⟨fun t => ordinaryWordOperator w (sobolevPath A hA n t), (ordinaryWordOperator w).continuous.comp (sobolevPath A hA n).continuous⟩ @[simp] theorem ordinaryWordPath_apply (A : K → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) {n : ℕ} (w : Fin n → Fin 3) (t : K) : ordinaryWordPath A hA w t=(wordField (A t) w).toLp := ordinaryWordOperator_apply (A t) w theorem wordEnergy_continuous (A : K → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) (s : ℕ) : Continuous (fun t => wordEnergy s (A t)) := by apply continuous_finsetSum intro n _ apply continuous_finsetSum intro w _ have hc : Continuous (fun t => (wordField (A t) w).toLp) := by exact (ordinaryWordPath A hA w).continuous.congr (ordinaryWordPath_apply A hA w) exact hc.norm.pow 2 variable (T : ℝ) (hT : 0 ≤ T) (A B : Icc (0 : ℝ) T → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) (hB : ∀ n, Continuous (fun t => (B t).jetLp n)) (hd : ∀ t (ht : t ∈ Ioo 0 T) x, HasDerivAt (fun r => (A (projIcc 0 T hT r)).field x) ((B ⟨t,ht.1.le,ht.2.le⟩).field x) t) include hA hB hd in theorem ordinaryWord_hasDerivWithinAt {n : ℕ} (w : Fin n → Fin 3) (t : Icc (0 : ℝ) T) : HasDerivWithinAt (fun r => (wordField (A (projIcc 0 T hT r)) w).toLp) (wordField (B t) w).toLp (Icc (0 : ℝ) T) t := by have h := (ordinaryWordOperator w).hasFDerivAt.comp_hasDerivWithinAt (t : ℝ) (sobolevPath_hasDerivWithinAt T hT A B hA hB hd n t) simpa only [Function.comp_def,extendPath,sobolevPath,ContinuousMap.coe_mk, ordinaryWordOperator_apply] using h include hA hB hd in theorem wordEnergy_hasDerivWithinAt (s : ℕ) (t : Icc (0 : ℝ) T) : HasDerivWithinAt (fun r => wordEnergy s (A (projIcc 0 T hT r))) (2*(∑ n ∈ range (s+1), ∑ w : Fin n → Fin 3, ⟪(wordField (A t) w).toLp,(wordField (B t) w).toLp⟫_ℝ)) (Icc (0 : ℝ) T) t := by have hw (n : ℕ) (w : Fin n → Fin 3) := (ordinaryWord_hasDerivWithinAt T hT A B hA hB hd w t).norm_sq have hp : projIcc 0 T hT (t : ℝ)=t := projIcc_of_mem hT t.property simp only [hp] at hw have hs := HasDerivWithinAt.fun_sum (u := range (s+1)) (fun n _ => HasDerivWithinAt.fun_sum (u := univ) (fun w _ => hw n w)) simpa only [wordEnergy,← Finset.mul_sum] using hs end EulerOrdinarySobolev end end noncomputable section namespace EulerOrdinarySobolev open Set MeasureTheory InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field EulerMeanSolenoidal EulerMeanClassical EulerVolterraConvolution Finset open scoped ContDiff private local instance : NormedAddCommGroup Space := inferInstance private local instance : NormedSpace ℝ Space := inferInstance structure Evolution (T : ℝ) (hT : 0 ≤ T) where velocity : Icc (0 : ℝ) T → SmoothL2Field Space pressureForce : Icc (0 : ℝ) T → SmoothL2Field Space velocity_continuous : ∀ n, Continuous (fun t => (velocity t).jetLp n) pressure_continuous : ∀ n, Continuous (fun t => (pressureForce t).jetLp n) solenoidal : ∀ t, (velocity t).toLp ∈ solenoidalSpace gradient : ∀ t, (pressureForce t).toLp ∈ gradientSpace time_law : ∀ t (ht : t ∈ Ioo 0 T) x, HasDerivAt (fun r => (velocity (projIcc 0 T hT r)).field x) (-fderiv ℝ (velocity ⟨t,ht.1.le,ht.2.le⟩).field x ((velocity ⟨t,ht.1.le,ht.2.le⟩).field x)- (pressureForce ⟨t,ht.1.le,ht.2.le⟩).field x) t theorem continuous_jet_fieldSub {K : Type*} [TopologicalSpace K] (A B : K → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) (hB : ∀ n, Continuous (fun t => (B t).jetLp n)) (n : ℕ) : Continuous (fun t => (fieldSub (A t) (B t)).jetLp n) := continuous_jetLp_addField A (fun t => fieldNeg (B t)) hA (continuous_jetLp_mapField _ B hB) n namespace Evolution variable {T : ℝ} {hT : 0 ≤ T} def derivative (U : Evolution T hT) : Icc (0 : ℝ) T → SmoothL2Field Space := EulerSmoothEulerEvolution.rhs U.velocity U.velocity_continuous U.pressureForce theorem derivative_field (U : Evolution T hT) (t : Icc (0 : ℝ) T) (x : Space) : (U.derivative t).field x = -fderiv ℝ (U.velocity t).field x ((U.velocity t).field x)- (U.pressureForce t).field x := EulerSmoothEulerEvolution.rhs_field U.velocity U.velocity_continuous U.pressureForce t x theorem derivative_continuous (U : Evolution T hT) (n : ℕ) : Continuous (fun t => (U.derivative t).jetLp n) := EulerSmoothEulerEvolution.rhs_jet_continuous U.velocity U.velocity_continuous U.pressureForce U.pressure_continuous n def difference (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : SmoothL2Field Space := fieldSub (V.velocity t) (U.velocity t) def pressureDifference (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : SmoothL2Field Space := fieldSub (V.pressureForce t) (U.pressureForce t) def differenceDerivative (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : SmoothL2Field Space := fieldSub (V.derivative t) (U.derivative t) theorem difference_continuous (U V : Evolution T hT) (n : ℕ) : Continuous (fun t => (U.difference V t).jetLp n) := continuous_jet_fieldSub V.velocity U.velocity V.velocity_continuous U.velocity_continuous n theorem differenceDerivative_continuous (U V : Evolution T hT) (n : ℕ) : Continuous (fun t => (U.differenceDerivative V t).jetLp n) := continuous_jet_fieldSub V.derivative U.derivative V.derivative_continuous U.derivative_continuous n theorem differenceDerivative_eq (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : U.differenceDerivative V t = differenceRhs (U.velocity t) (U.difference V t) (U.pressureDifference V t) := by apply field_ext funext x have he : (U.difference V t).field=(V.velocity t).field-(U.velocity t).field := funext (fieldSub_field (V.velocity t) (U.velocity t)) rw [differenceRhs_field,he,fderiv_sub ((V.velocity t).smooth.differentiable (by simp) x) ((U.velocity t).smooth.differentiable (by simp) x)] simp only [differenceDerivative,pressureDifference,fieldSub_field, derivative_field,Pi.sub_apply,sub_apply,map_sub] abel_nf theorem difference_time_law (U V : Evolution T hT) : ∀ t (ht : t ∈ Ioo 0 T) x, HasDerivAt (fun r => (U.difference V (projIcc 0 T hT r)).field x) ((U.differenceDerivative V ⟨t,ht.1.le,ht.2.le⟩).field x) t := by intro t ht x have h := (V.time_law t ht x).sub (U.time_law t ht x) convert! h using 1 simp only [differenceDerivative,fieldSub_field,derivative_field] def energyPath (U V : Evolution T hT) : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => wordEnergy 3 (U.difference V t),wordEnergy_continuous _ (U.difference_continuous V) 3⟩ def energyDerivative (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : ℝ := energyProduction (U.difference V t) (U.differenceDerivative V t) theorem energy_hasDerivWithinAt (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : HasDerivWithinAt (extendPath T hT (U.energyPath V)) (U.energyDerivative V t) (Icc (0 : ℝ) T) t := wordEnergy_hasDerivWithinAt T hT (U.difference V) (U.differenceDerivative V) (U.difference_continuous V) (U.differenceDerivative_continuous V) (U.difference_time_law V) 3 t theorem energyDerivative_bound (U V : Evolution T hT) (M : ℝ) (hM : ∀ t, WordBound 4 M (U.velocity t)) (t : Icc (0 : ℝ) T) : U.energyDerivative V t ≤ 3600*h3ProductConstant*(M+Real.sqrt (U.energyPath V t))*U.energyPath V t := by rw [energyDerivative,differenceDerivative_eq] apply difference_energy_bound _ _ _ M (hM t) · have he : (addField (U.velocity t) (U.difference V t)).field=(V.velocity t).field := by funext x simp only [addField_field,difference,fieldSub_field] abel rw [he] exact solenoidal_representative_divergence _ (V.solenoidal t) _ (V.velocity t).smooth (V.velocity t).toLp_ae · rw [difference,toLp_fieldSub] exact solenoidalSpace.sub_mem (V.solenoidal t) (U.solenoidal t) · rw [pressureDifference,toLp_fieldSub] exact gradientSpace.sub_mem (V.gradient t) (U.gradient t) end Evolution end EulerOrdinarySobolev