import Euler.MildEquationBridge import Euler.DuhamelPasting /-! Pasting actual high-order viscous mild solutions preserves the derivative-gaining Duhamel formula. -/ /-! ## From `Euler/GainedMildFormula.lean` The text of `Euler/GainedMildFormula.lean`, folded into this file, which was its only importer. -/ section /-! Equivalence between genuine gained-derivative and ordinary heat-Duhamel solution formulas. -/ noncomputable section namespace EulerGainedMildFormula open MeasureTheory Set EulerCylinderSobolevSpace EulerSobolevHeat EulerSobolevHeatGenerator EulerVolterraConvolution EulerDuhamelDifferentiation EulerMildEquationBridge open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- Forgetting a top derivative is injective on the actual compatible Sobolev arrays. -/ theorem truncate_injective (q : ℕ) : Function.Injective (truncateOperator period q) := by intro u v h apply value_injective period exact congrArg (value period (q := q)) h /-- The genuine heat-plus-gained-Duhamel construction as an actual continuous Sobolev path. -/ def mildPath (q : ℕ) (ν : ℝ) (hν : 0 < ν) (T : ℝ) (hT : 0 ≤ T) (u₀ : SobolevSpace period (q+1)) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) : C(Icc (0 : ℝ) T, SobolevSpace period (q+1)) := freeHeatPath period (q+1) ν T u₀ + convolution T hT (heatKernel period q ν hν) (parabolicKernelBound ν) (heatKernel_joint_continuous period q ν hν) (parabolicKernelBound_integrable ν T hT) (fun r hr => parabolicKernelBound_nonneg ν r hr.1) (fun r hr y => heatKernel_bound period q ν hν r hr.1 y) f /-- The actual gained mild path has the original singular-kernel integral formula. -/ theorem mildPath_apply (q : ℕ) (ν : ℝ) (hν : 0 < ν) (T : ℝ) (hT : 0 ≤ T) (u₀ : SobolevSpace period (q+1)) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) (t : Icc (0 : ℝ) T) : mildPath period q ν hν T hT u₀ f t = heatOperator period (q+1) (2*ν*t.val).toNNReal u₀+ ∫ r in (0 : ℝ)..t.val, heatKernel period q ν hν r (extendPath T hT f (t.val-r)) := by change heatOperator period (q+1) (2*ν*t.val).toNNReal u₀+_ = _ rw [convolution_eq_interval T hT (heatKernel period q ν hν) (parabolicKernelBound ν) (heatKernel_joint_continuous period q ν hν) (parabolicKernelBound_integrable ν T hT) (fun r hr => parabolicKernelBound_nonneg ν r hr.1) (fun r hr y => heatKernel_bound period q ν hν r hr.1 y) f t] /-- The lower Sobolev restriction of the genuine gained path is precisely ordinary Duhamel evolution. -/ theorem mildPath_truncate (q : ℕ) (ν : ℝ) (hν : 0 < ν) (T : ℝ) (hT : 0 ≤ T) (u₀ : SobolevSpace period (q+1)) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) (t : Icc (0 : ℝ) T) : truncateOperator period q (mildPath period q ν hν T hT u₀ f t) = heatFlow period q ν t.val (truncateOperator period q u₀)+duhamel period ν T hT f t.val := by change truncateOperator period q (heatOperator period (q+1) (2*ν*t.val).toNNReal u₀+_) = _ rw [map_add,truncate_heatOperator,truncate_heatConvolution] rfl /-- The actual complete high-order path satisfies the singular mild formula exactly when its restriction satisfies ordinary Duhamel. -/ theorem gained_mild_iff (q : ℕ) (ν : ℝ) (hν : 0 < ν) (T : ℝ) (hT : 0 ≤ T) (u₀ : SobolevSpace period (q+1)) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q+1))) : (∀ t : Icc (0 : ℝ) T, u t = heatOperator period (q+1) (2*ν*t.val).toNNReal u₀+ ∫ r in (0 : ℝ)..t.val, heatKernel period q ν hν r (extendPath T hT f (t.val-r))) ↔ (∀ t : Icc (0 : ℝ) T, truncateOperator period q (u t) = heatFlow period q ν t.val (truncateOperator period q u₀)+duhamel period ν T hT f t.val) := by constructor · intro h t have he : u t = mildPath period q ν hν T hT u₀ f t := (h t).trans (mildPath_apply period q ν hν T hT u₀ f t).symm exact (congrArg (truncateOperator period q) he).trans (mildPath_truncate period q ν hν T hT u₀ f t) · intro h t have he : u t = mildPath period q ν hν T hT u₀ f t := truncate_injective period q ((h t).trans (mildPath_truncate period q ν hν T hT u₀ f t).symm) exact he.trans (mildPath_apply period q ν hν T hT u₀ f t) end EulerGainedMildFormula end end noncomputable section namespace EulerGainedMildPasting open MeasureTheory Set EulerCylinderSobolevSpace EulerSobolevHeat EulerSobolevHeatGenerator EulerVolterraConvolution EulerDuhamelDifferentiation EulerTimePathGluing EulerDuhamelPasting EulerGainedMildFormula open scoped Topology /-- Applying an actual bounded spatial map commutes with matching-endpoint time pasting. -/ theorem gluePath_map_apply {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] (A : E →L[ℝ] F) (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (u : C(Icc (0 : ℝ) a, E)) (v : C(Icc (0 : ℝ) b, E)) (hmatch : u ⟨a,ha,le_rfl⟩ = v ⟨0,le_rfl,hb⟩) (t : Icc (0 : ℝ) (a+b)) : A (gluePath a b ha hb u v hmatch t) = gluePath a b ha hb (A.compLeftContinuous ℝ (Icc (0 : ℝ) a) u) (A.compLeftContinuous ℝ (Icc (0 : ℝ) b) v) (congrArg A hmatch) t := by change A (if t.val ≤ a then extendPath a ha u t.val else extendPath b hb v (t.val-a)) = if t.val ≤ a then A (extendPath a ha u t.val) else A (extendPath b hb v (t.val-a)) split <;> rfl variable (period : ℝ) [Fact (0 < period)] /-- Matching actual solutions on adjacent intervals give a genuine gained-derivative mild solution on the union. -/ theorem glue_gained_mild {q : ℕ} (ν : ℝ) (hν : 0 < ν) (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (u : C(Icc (0 : ℝ) a, SobolevSpace period (q+1))) (v : C(Icc (0 : ℝ) b, SobolevSpace period (q+1))) (hmatch : u ⟨a,ha,le_rfl⟩ = v ⟨0,le_rfl,hb⟩) (f : C(Icc (0 : ℝ) (a+b), SobolevSpace period q)) (f1 : C(Icc (0 : ℝ) a, SobolevSpace period q)) (f2 : C(Icc (0 : ℝ) b, SobolevSpace period q)) (u₀ : SobolevSpace period (q+1)) (hF1 : ∀ r ∈ Icc 0 a, extendPath (a+b) (add_nonneg ha hb) f r = extendPath a ha f1 r) (hF2 : ∀ r ∈ Icc 0 b, extendPath (a+b) (add_nonneg ha hb) f (a+r) = extendPath b hb f2 r) (hsolu : ∀ t : Icc (0 : ℝ) a, u t = heatOperator period (q+1) (2*ν*t.val).toNNReal u₀+ ∫ r in (0 : ℝ)..t.val, heatKernel period q ν hν r (extendPath a ha f1 (t.val-r))) (hsolv : ∀ t : Icc (0 : ℝ) b, v t = heatOperator period (q+1) (2*ν*t.val).toNNReal (u ⟨a,ha,le_rfl⟩)+ ∫ r in (0 : ℝ)..t.val, heatKernel period q ν hν r (extendPath b hb f2 (t.val-r))) : ∀ t : Icc (0 : ℝ) (a+b), gluePath a b ha hb u v hmatch t = heatOperator period (q+1) (2*ν*t.val).toNNReal u₀+ ∫ r in (0 : ℝ)..t.val, heatKernel period q ν hν r (extendPath (a+b) (add_nonneg ha hb) f (t.val-r)) := by let ul := (truncateOperator period q).compLeftContinuous ℝ (Icc (0 : ℝ) a) u let vl := (truncateOperator period q).compLeftContinuous ℝ (Icc (0 : ℝ) b) v have hml : ul ⟨a,ha,le_rfl⟩ = vl ⟨0,le_rfl,hb⟩ := congrArg (truncateOperator period q) hmatch have hul := (gained_mild_iff period q ν hν a ha u₀ f1 u).mp hsolu have hvl := (gained_mild_iff period q ν hν b hb (u ⟨a,ha,le_rfl⟩) f2 v).mp hsolv have h := glue_ordinary_mild period ν hν.le a b ha hb ul vl hml f f1 f2 (truncateOperator period q u₀) hF1 hF2 hul hvl apply (gained_mild_iff period q ν hν (a+b) (add_nonneg ha hb) u₀ f (gluePath a b ha hb u v hmatch)).mpr intro t exact (gluePath_map_apply (truncateOperator period q) a b ha hb u v hmatch t).trans (h t) end EulerGainedMildPasting