import Euler.ClassicalBridge import Euler.CurlTimeDerivative import Euler.CurlTransportAlgebra import Euler.VorticityTransport /-! The ordinary vorticity equation of a Comparator solution follows from its scalar-pressure, unforced Euler equation. -/ noncomputable section open Set InnerProductSpace EulerSmoothLimit EulerMeanCutoffCurl open scoped ContDiff Topology namespace Euler.EulerExistenceAndSmoothnessR3 variable {u₀ : Space → Space} {v : Space → ℝ → Space} {p : Space → ℝ → ℝ} (h : EulerExistenceAndSmoothnessR3 u₀ v p) include h /-- The reference's joint smoothness in time-first coordinates. -/ theorem velocity_joint_contDiffAt (t : ℝ) (ht : 0 < t) (x : Space) : ContDiffAt ℝ ∞ (fun z : ℝ × Space => v z.2 z.1) (t, x) := by have hc : ContDiffAt ℝ ∞ (Function.uncurry v) (x, t) := h.velocity_smooth.contDiffAt (prod_mem_nhds Filter.univ_mem (Ici_mem_nhds ht)) exact hc.comp (t, x) (contDiffAt_snd.prodMk contDiffAt_fst) /-- The actual time derivative of vorticity, obtained by taking curl of the scalar-pressure Euler equation and commuting the ordinary derivatives. -/ theorem vorticity_hasDerivAt (t : ℝ) (ht : 0 < t) (x : Space) : HasDerivAt (fun r => vectorCurl (v · r) x) (fderiv ℝ (v · t) x (vectorCurl (v · t) x) - fderiv ℝ (vectorCurl (v · t)) x (v x t)) t := by have hc := ComparatorBridge.vectorCurl_hasDerivAt ((h.velocity_joint_contDiffAt t ht x).of_le (by simp)) have heq : (fun y => deriv (v y ·) t) = (fun y => -fderiv ℝ (v · t) y (v y t) - gradient (p · t) y) := by funext y exact (h.pointwise_euler y t ht).deriv have hdiv : EulerSmoothLimit.divergence (v · t) x = 0 := h.div_free x t ht.le rw [heq, EulerComparatorCurlTransport.vectorCurl_euler_rhs (v · t) (p · t) (h.velocity_contDiff t ht.le) (h.pressure_contDiff t ht.le) x hdiv] at hc exact hc /-- The full spacetime derivative of ordinary curl satisfies the vorticity stretching law in the material direction `(1,v)`. -/ theorem vorticity_material_derivative (t : ℝ) (ht : 0 < t) (x : Space) : fderiv ℝ (fun z : ℝ × Space => vectorCurl (v · z.1) z.2) (t, x) (1, v x t) = fderiv ℝ (v · t) x (vectorCurl (v · t) x) := by rw [ComparatorBridge.joint_vectorCurl_fderiv_apply (h.velocity_joint_contDiffAt t ht x)] have hcurl : vectorCurl (fun y => deriv (v y ·) t) x = fderiv ℝ (v · t) x (vectorCurl (v · t) x) - fderiv ℝ (vectorCurl (v · t)) x (v x t) := by exact (ComparatorBridge.vectorCurl_hasDerivAt ((h.velocity_joint_contDiffAt t ht x).of_le (by simp))).unique (h.vorticity_hasDerivAt t ht x) rw [hcurl] abel /-- Joint smoothness in time-first coordinates, including the initial time. -/ theorem velocity_joint_contDiffOn : ContDiffOn ℝ ∞ (fun z : ℝ × Space => v z.2 z.1) (Ici 0 ×ˢ (univ : Set Space)) := h.velocity_smooth.comp (contDiff_snd.prodMk contDiff_fst).contDiffOn (fun _z hz => ⟨mem_univ _, hz.1⟩) /-- Ordinary spatial derivatives remain jointly continuous at time zero. -/ theorem velocity_spatial_fderiv_continuousOn : ContinuousOn (fun z : ℝ × Space => fderiv ℝ (v · z.1) z.2) (Ici 0 ×ˢ (univ : Set Space)) := (ComparatorBridge.joint_spatial_fderiv_contDiffOn h.velocity_joint_contDiffOn).continuousOn /-- Vorticity is jointly continuous through the initial time. -/ theorem vorticity_continuousOn : ContinuousOn (fun z : ℝ × Space => vectorCurl (v · z.1) z.2) (Ici 0 ×ˢ (univ : Set Space)) := (ComparatorBridge.joint_vectorCurl_contDiffOn h.velocity_joint_contDiffOn).continuousOn /-- Zero vorticity is preserved on any genuine particle trajectory that exists on the whole compact time interval. -/ theorem vorticity_eq_zero_along_trajectory (X : ℝ → Space) (T : ℝ) (hX : ContinuousOn X (Icc 0 T)) (hXd : ∀ r ∈ Ioo 0 T, HasDerivAt X (v (X r) r) r) (hz : vectorCurl (v · 0) (X 0) = 0) (t : ℝ) (ht : t ∈ Icc 0 T) : vectorCurl (v · t) (X t) = 0 := by apply ComparatorBridge.transport_eq_zero_along_trajectory (fun z : ℝ × Space => vectorCurl (v · z.1) z.2) (fun z : ℝ × Space => v z.2 z.1) X T · exact h.vorticity_continuousOn.mono (by intro z hz; exact ⟨hz.1.1, hz.2⟩) · exact hX · exact h.velocity_spatial_fderiv_continuousOn.comp (continuousOn_id.prodMk hX) (fun r hr => ⟨hr.1, mem_univ _⟩) · intro r hr exact (ComparatorBridge.joint_vectorCurl_contDiffAt (h.velocity_joint_contDiffAt r hr.1 (X r))).differentiableAt (by simp) · intro r hr exact h.vorticity_material_derivative r hr.1 (X r) · exact hXd · exact hz · exact ht end Euler.EulerExistenceAndSmoothnessR3