import Euler.TransversePacketLocalHistory import Euler.TransversePacketHistoryPressure import Euler.TransversePacketProvider /-! The actual time derivative and normalized pressure also match at the history/forward junction. -/ /-! ## From `Euler/TransversePacketMatching.lean` The text of `Euler/TransversePacketMatching.lean`, folded into this file, which was its only importer. -/ section /-! # The history trace matches the actual forward transverse solve The forward datum is the constructed history coordinate velocity. Both physical velocities therefore agree at the source time τ, with the same deformation frame on the two intervals. -/ noncomputable section namespace EulerTransversePacketJoin open Set ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficients EulerTimeIntervalRestriction EulerLiftedGradientSpace EulerLpCylinderTranslation EulerLpCylinderPaths EulerLpCylinderRectangular EulerCylinderSmoothOrbit EulerPacketProfileRecursion EulerCylinderAngleAverage EulerTransversePacketProvider open scoped ContDiff BoundedContinuousFunction variable {P : ℝ} [Fact (0 < P)] {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] {D : Data U} (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) (B : HistoryData (D.initial τ hτ hτT.le)) {raw : VectorField} (G : Forcing P D raw) def pastVelocity : C(Icc (0 : ℝ) τ,LiftL2 P) := B.velocityPath (G.initial τ hτ hτT.le) def futureVelocity : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := includePath P D.support D.support_measurable ((G.tail τ hτ.le hτT).velocityPath (forwardInitial τ hτ hτT B G)) def pastDerivative : C(Icc (0 : ℝ) τ,LiftL2 P) := B.derivativePath (G.initial τ hτ hτT.le) def futureDerivative : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := includePath P D.support D.support_measurable ((G.tail τ hτ.le hτT).derivativePath (forwardInitial τ hτ hτT B G)) def pastPressure : C(Icc (0 : ℝ) τ,CylinderL2 P ℝ) := B.pressurePath (G.initial τ hτ hτT.le) def futurePressure : C(Icc (0 : ℝ) (D.T-τ),CylinderL2 P ℝ) := (G.tail τ hτ.le hτT).pressurePath (forwardInitial τ hτ hτT B G) theorem pastVelocity_orbit : ContDiff ℝ ∞ (fun a => pathTranslate P a (pastVelocity τ hτ hτT B G)) := B.velocityPath_orbit (G.initial τ hτ hτT.le) theorem futureVelocity_orbit : ContDiff ℝ ∞ (fun a => pathTranslate P a (futureVelocity τ hτ hτT B G)) := (G.tail τ hτ.le hτT).velocityPath_orbit (forwardInitial τ hτ hτT B G) theorem pastDerivative_orbit : ContDiff ℝ ∞ (fun a => pathTranslate P a (pastDerivative τ hτ hτT B G)) := B.derivativePath_orbit (G.initial τ hτ hτT.le) theorem futureDerivative_orbit : ContDiff ℝ ∞ (fun a => pathTranslate P a (futureDerivative τ hτ hτT B G)) := (G.tail τ hτ.le hτT).derivativePath_orbit (forwardInitial τ hτ hτT B G) theorem pastPressure_orbit : ContDiff ℝ ∞ (fun a => pathTranslate P a (pastPressure τ hτ hτT B G)) := B.pressurePath_orbit (G.initial τ hτ hτT.le) theorem futurePressure_orbit : ContDiff ℝ ∞ (fun a => pathTranslate P a (futurePressure τ hτ hτT B G)) := (G.tail τ hτ.le hτT).pressurePath_orbit (forwardInitial τ hτ hτT B G) /-- The actual forward velocity starts from the actual history velocity. -/ theorem velocity_match : pastVelocity τ hτ hτT B G ⟨τ,hτ.le,le_rfl⟩ = futureVelocity τ hτ hτT B G ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ := by let th : Icc (0 : ℝ) (D.initial τ hτ hτT.le).T := ⟨τ,hτ.le,le_rfl⟩ let tf : Icc (0 : ℝ) (D.tail τ hτ.le hτT).T := ⟨0,le_rfl,(D.tail τ hτ.le hτT).T_pos.le⟩ have hQ : (D.initial τ hτ hτT.le).frame.field th = (D.tail τ hτ.le hτT).frame.field tf := by apply BoundedContinuousFunction.ext intro x apply ContinuousLinearMap.ext intro v change D.F.field ⟨τ,hτ.le,hτT.le⟩ x (D.R v : Space) = D.F.field ⟨τ+0,by linarith,by linarith⟩ x (D.R v : Space) simp only [add_zero] change fullOperatorMap P ((D.initial τ hτ hτT.le).frame.field th) (B.coordinatePath (G.initial τ hτ hτT.le) th) = fullOperatorMap P ((D.tail τ hτ.le hτT).frame.field tf) ((EulerSourceCylinderEquation.coordinates P D.support D.support_measurable (D.tail τ hτ.le hτT).T (D.tail τ hτ.le hτT).T_pos.le (D.tail τ hτ.le hτT).frame (D.tail τ hτ.le hτT).frameDerivative (D.tail τ hτ.le hτT).frameLower (D.tail τ hτ.le hτT).frameLower_pos (D.tail τ hτ.le hτT).frame_lower (G.tail τ hτ.le hτT).path (forwardInitial τ hτ hτT B G).value tf : Supported P U D.support D.support_measurable) : CylinderL2 P U) dsimp only [tf] erw [EulerSourceCylinderEquation.coordinates_initial,hQ] rfl end EulerTransversePacketJoin end end noncomputable section namespace EulerTransversePacketJoin open Set MeasureTheory ContinuousLinearMap InnerProductSpace EulerSmoothLimit EulerMeanCoefficients EulerTimeIntervalRestriction EulerLiftedGradientSpace EulerLpCylinderTranslation EulerLpCylinderPaths EulerLpCylinderRectangular EulerCylinderScalarPrimitive EulerSourceNormalCoefficient EulerPacketProfileRecursion EulerTransversePacketProvider open scoped ContDiff BoundedContinuousFunction variable {P : ℝ} [Fact (0 < P)] {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] {D : Data U} (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) (B : HistoryData (D.initial τ hτ hτT.le)) {raw : VectorField} (G : Forcing P D raw) omit [Fact (0 < P)] [CompleteSpace U] in theorem source_coefficient_match {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothCoefficientPath (Icc (0 : ℝ) D.T) V) : (A.comp (initialInclusion D.T τ hτT.le)).field ⟨τ,hτ.le,le_rfl⟩ = (A.comp (tailInclusion D.T τ hτ.le)).field ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ := by change A.field ⟨τ,hτ.le,hτT.le⟩ = A.field ⟨τ+0,by linarith,by linarith⟩ simp only [add_zero] omit [Fact (0 < P)] [CompleteSpace U] in theorem normal_match : (D.initial τ hτ hτT.le).normal.field ⟨τ,hτ.le,le_rfl⟩ = (D.tail τ hτ.le hτT).normal.field ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ := source_coefficient_match τ hτ hτT D.normal omit [CompleteSpace U] in theorem forcing_match : ((G.initial τ hτ hτT.le).path ⟨τ,hτ.le,le_rfl⟩ : CylinderL2 P Space) = ((G.tail τ hτ.le hτT).path ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ : CylinderL2 P Space) := by change (G.path ⟨τ,hτ.le,hτT.le⟩ : CylinderL2 P Space) = (G.path ⟨τ+0,by linarith,by linarith⟩ : CylinderL2 P Space) simp only [add_zero] /-- The same physical first-order equation determines the same derivative from the matching velocity and forcing. -/ theorem derivative_match : pastDerivative τ hτ hτT B G ⟨τ,hτ.le,le_rfl⟩ = futureDerivative τ hτ hτT B G ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ := by let Dh := D.initial τ hτ hτT.le let Df := D.tail τ hτ.le hτT let Gh := G.initial τ hτ hτT.le let Gf := G.tail τ hτ.le hτT let Bh := B let I := forwardInitial τ hτ hτT B G let th : Icc (0 : ℝ) τ := ⟨τ,hτ.le,le_rfl⟩ let tf : Icc (0 : ℝ) (D.T-τ) := ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ have hM : Dh.M.field th = Df.M.field tf := source_coefficient_match τ hτ hτT D.M have hm : Dh.normal.field th = Df.normal.field tf := normal_match τ hτ hτT have hforce : (Gh.path th : CylinderL2 P Space) = (Gf.path tf : CylinderL2 P Space) := forcing_match τ hτ hτT G have hv := velocity_match τ hτ hτT B G have hh := Bh.balance_ae Gh th have hf := EulerSourceCylinderEquation.velocity_balance_ae P D.support D.support_measurable Df.T Df.T_pos.le Df.frame Df.frameDerivative Df.frameLower Df.frameLower_pos Df.frame_lower Gf.path I.value (fun t x => Df.M.field t x) (fun t x => Df.normal.field t x) (HistoryData.normal_ne_zero (D := Df)) Df.frame_tangent Df.frame_range Df.frame_strain tf change ∀ᵐ x ∂liftMeasure P, pastDerivative τ hτ hτT B G th x+Dh.M.field th x.1 (pastVelocity τ hτ hτT B G th x)+ ((⟪Dh.normal.field th x.1,(Gh.path th : CylinderL2 P Space) x⟫_ℝ- 2*⟪Dh.normal.field th x.1,Dh.M.field th x.1 (pastVelocity τ hτ hτT B G th x)⟫_ℝ)/ ‖Dh.normal.field th x.1‖^2) • Dh.normal.field th x.1 = (Gh.path th : CylinderL2 P Space) x at hh change ∀ᵐ x ∂liftMeasure P, futureDerivative τ hτ hτT B G tf x+Df.M.field tf x.1 (futureVelocity τ hτ hτT B G tf x)+ ((⟪Df.normal.field tf x.1,(Gf.path tf : CylinderL2 P Space) x⟫_ℝ- 2*⟪Df.normal.field tf x.1,Df.M.field tf x.1 (futureVelocity τ hτ hτT B G tf x)⟫_ℝ)/ ‖Df.normal.field tf x.1‖^2) • Df.normal.field tf x.1 = (Gf.path tf : CylinderL2 P Space) x at hf rw [hM,hm,hforce,hv] at hh apply Lp.ext filter_upwards [hh,hf] with x hx hy exact add_right_cancel (add_right_cancel (hx.trans hy.symm)) /-- The normalized pressure integral has the same input scalar L² class on both sides of the junction. -/ theorem pressure_match : pastPressure τ hτ hτT B G ⟨τ,hτ.le,le_rfl⟩ = futurePressure τ hτ hτT B G ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ := by let Dh := D.initial τ hτ hτT.le let Df := D.tail τ hτ.le hτT let th : Icc (0 : ℝ) τ := ⟨τ,hτ.le,le_rfl⟩ let tf : Icc (0 : ℝ) (D.T-τ) := ⟨0,le_rfl,(sub_pos.mpr hτT).le⟩ have hM : Dh.M.field th = Df.M.field tf := source_coefficient_match τ hτ hτT D.M have hm : Dh.normal.field th = Df.normal.field tf := normal_match τ hτ hτT have hN : normalFunctional Dh.normal Dh.normalLower Dh.normalLower_pos Dh.normal_lower th = normalFunctional Df.normal Df.normalLower Df.normalLower_pos Df.normal_lower tf := by apply BoundedContinuousFunction.ext intro x apply ContinuousLinearMap.ext intro v erw [normalFunctional_apply,normalFunctional_apply,hm] change primitive P (fullOperatorMap P (normalFunctional Dh.normal Dh.normalLower Dh.normalLower_pos Dh.normal_lower th) (((G.initial τ hτ hτT.le).path th : CylinderL2 P Space)-(2 : ℝ) • fullOperatorMap P (Dh.M.field th) (pastVelocity τ hτ hτT B G th))) = primitive P (fullOperatorMap P (normalFunctional Df.normal Df.normalLower Df.normalLower_pos Df.normal_lower tf) (((G.tail τ hτ.le hτT).path tf : CylinderL2 P Space)-(2 : ℝ) • fullOperatorMap P (Df.M.field tf) (futureVelocity τ hτ hτT B G tf))) have hforce : ((G.initial τ hτ hτT.le).path th : CylinderL2 P Space) = ((G.tail τ hτ.le hτT).path tf : CylinderL2 P Space) := forcing_match τ hτ hτT G have hv : pastVelocity τ hτ hτT B G th = futureVelocity τ hτ hτT B G tf := velocity_match τ hτ hτT B G rw [hN,hM,hforce,hv] end EulerTransversePacketJoin