import Euler.SmoothCoefficientPath import Euler.ContinuousPathCalculus /-! Smooth bounded fields on a general real normed domain, with actual spatial jets continuous in the uniform time-path norm. This extends the ordinary-space coefficient interface to the lifted four-dimensional flow. -/ /-! ## From `Euler/SmoothPathSuperposition.lean` The text of `Euler/SmoothPathSuperposition.lean`, folded into this file, which was its only importer. -/ section /-! # Smooth substitution of a continuous path into a smooth coefficient field The derivative is the actual pointwise derivative multiplier. A uniform second-derivative remainder proves Fréchet differentiability in the path sup norm, and iteration gives smoothness at every order. -/ noncomputable section open scoped ContDiff BoundedContinuousFunction Topology namespace EulerMeanCoefficients.SmoothCoefficientPath open EulerSmoothLimit EulerContinuousTimeIntegral EulerContinuousPathCalculus universe u v variable {K : Type u} [TopologicalSpace K] [CompactSpace K] {V : Type v} [NormedAddCommGroup V] [NormedSpace ℝ V] private local instance (n : ℕ) : NormedAddCommGroup (Space [×n]→L[ℝ] V) := inferInstance private local instance (n : ℕ) : NormedSpace ℝ (Space [×n]→L[ℝ] V) := inferInstance private local instance (n : ℕ) : NormedAddCommGroup (Space →ᵇ (Space [×n]→L[ℝ] V)) := inferInstance private local instance (n : ℕ) : NormedSpace ℝ (Space →ᵇ (Space [×n]→L[ℝ] V)) := inferInstance private local instance (n : ℕ) : NormedAddCommGroup C(K, Space →ᵇ (Space [×n]→L[ℝ] V)) := inferInstance private local instance (n : ℕ) : NormedSpace ℝ C(K, Space →ᵇ (Space [×n]→L[ℝ] V)) := inferInstance def superposition (A : SmoothCoefficientPath K V) (u : C(K, Space)) : C(K,V) where toFun t := A.field t (u t) continuous_toFun := by fun_prop @[simp] theorem superposition_apply (A : SmoothCoefficientPath K V) (u : C(K,Space)) (t : K) : A.superposition u t = A.field t (u t) := rfl def superpositionDerivative (A : SmoothCoefficientPath K V) (u : C(K,Space)) : C(K,Space) →L[ℝ] C(K,V) := EulerContinuousTimeIntegral.multiplier (A.derivative.superposition u) theorem superpositionDerivative_apply (A : SmoothCoefficientPath K V) (u h : C(K,Space)) (t : K) : A.superpositionDerivative u h t = fderiv ℝ (A.field t : Space → V) (u t) (h t) := by change A.derivativeField t (u t) (h t) = _ rw [A.derivativeField_eq] theorem superposition_taylor_bound (A : SmoothCoefficientPath K V) (u v : C(K,Space)) : ‖A.superposition v - A.superposition u - A.superpositionDerivative u (v-u)‖ ≤ ‖A.jet 2‖ * ‖v-u‖^2 := by apply (ContinuousMap.norm_le _ (by positivity)).2 intro t change ‖A.field t (v t) - A.field t (u t) - A.superpositionDerivative u (v-u) t‖ ≤ _ rw [A.superpositionDerivative_apply] have h₂ (x : Space) : ‖fderiv ℝ (fderiv ℝ (A.field t : Space → V)) x‖ ≤ ‖A.jet 2‖ := by rw [← norm_iteratedFDeriv_one, norm_iteratedFDeriv_fderiv, ← A.jet_eq] exact ((A.jet 2 t).norm_coe_le_norm x).trans ((A.jet 2).norm_coe_le_norm t) have h := EulerMeanBoundary.norm_linearization_remainder_le (A.field t : Space → V) (A.smooth t) ‖A.jet 2‖ (norm_nonneg _) h₂ (u t) (v t-u t) have he : u t + (v t-u t) = v t := by abel rw [he] at h have hv : ‖v t-u t‖ ≤ ‖v-u‖ := (v-u).norm_coe_le_norm t exact h.trans (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) hv 2) (norm_nonneg _)) theorem superposition_hasFDerivAt (A : SmoothCoefficientPath K V) (u : C(K,Space)) : HasFDerivAt A.superposition (A.superpositionDerivative u) u := by apply hasFDerivAt_iff_tendsto.mpr apply squeeze_zero (fun v => mul_nonneg (inv_nonneg.mpr (norm_nonneg (v-u))) (norm_nonneg _)) (g := fun v : C(K,Space) => ‖A.jet 2‖ * ‖v-u‖) · intro v calc _ ≤ ‖v-u‖⁻¹ * (‖A.jet 2‖ * ‖v-u‖^2) := mul_le_mul_of_nonneg_left (A.superposition_taylor_bound u v) (inv_nonneg.mpr (norm_nonneg _)) _ = _ := by by_cases h : ‖v-u‖ = 0 · simp only [h, inv_zero, zero_mul, mul_zero] · field_simp · have hc : Continuous (fun v : C(K,Space) => ‖A.jet 2‖ * ‖v-u‖) := by fun_prop simpa only [sub_self, norm_zero, mul_zero] using hc.tendsto u theorem superposition_fderiv (A : SmoothCoefficientPath K V) : fderiv ℝ A.superposition = A.superpositionDerivative := funext (fun u => (A.superposition_hasFDerivAt u).fderiv) private theorem superposition_contDiff_nat (n : ℕ) : ∀ (V : Type v) [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothCoefficientPath K V), ContDiff ℝ n A.superposition := by induction n with | zero => intro V _ _ A exact contDiff_zero.mpr (continuous_iff_continuousAt.mpr (fun u => (A.superposition_hasFDerivAt u).continuousAt)) | succ n ih => intro V _ _ A rw [Nat.cast_add, Nat.cast_one, contDiff_succ_iff_fderiv] refine ⟨fun u => (A.superposition_hasFDerivAt u).differentiableAt, by simp, ?_⟩ rw [A.superposition_fderiv] exact contDiff_multiplier A.derivative.superposition (ih (Space →L[ℝ] V) A.derivative) end EulerMeanCoefficients.SmoothCoefficientPath end end noncomputable section open scoped ContDiff BoundedContinuousFunction universe u structure SmoothTimeField (K E V : Type u) [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup V] [NormedSpace ℝ V] where field : C(K, E →ᵇ V) smooth : ∀ t, ContDiff ℝ ∞ (field t : E → V) jet : (n : ℕ) → C(K, E →ᵇ (E [×n]→L[ℝ] V)) jet_eq : ∀ n t x, jet n t x = iteratedFDeriv ℝ n (field t : E → V) x namespace SmoothTimeField variable {K E V W : Type u} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup W] [NormedSpace ℝ W] private local instance : NormedAddCommGroup (E →ᵇ V) := inferInstance private local instance : NormedSpace ℝ (E →ᵇ V) := inferInstance private local instance : NormedAddCommGroup (E →ᵇ W) := inferInstance private local instance : NormedSpace ℝ (E →ᵇ W) := inferInstance private local instance : NormedAddCommGroup (E →ᵇ (E →L[ℝ] V)) := inferInstance private local instance : NormedSpace ℝ (E →ᵇ (E →L[ℝ] V)) := inferInstance private local instance (n : ℕ) : NormedAddCommGroup (E →ᵇ (E [×n]→L[ℝ] V)) := inferInstance private local instance (n : ℕ) : NormedSpace ℝ (E →ᵇ (E [×n]→L[ℝ] V)) := inferInstance def mapPath (L : V →L[ℝ] W) : C(K,E →ᵇ V) →L[ℝ] C(K,E →ᵇ W) := (L.compLeftContinuousBounded E).compLeftContinuous ℝ K def derivativeField (A : SmoothTimeField K E V) : C(K,E →ᵇ (E →L[ℝ] V)) := mapPath (continuousMultilinearCurryFin1 ℝ E V).toContinuousLinearEquiv.toContinuousLinearMap (A.jet 1) theorem derivativeField_eq (A : SmoothTimeField K E V) (t : K) (x : E) : A.derivativeField t x = fderiv ℝ (A.field t : E → V) x := by change continuousMultilinearCurryFin1 ℝ E V (A.jet 1 t x) = _ rw [A.jet_eq] apply ContinuousLinearMap.ext intro a rw [continuousMultilinearCurryFin1_apply, iteratedFDeriv_one_apply] simp def derivativeJet (A : SmoothTimeField K E V) (n : ℕ) : C(K,E →ᵇ (E [×n]→L[ℝ] (E →L[ℝ] V))) := mapPath (K := K) (V := E [×(n+1)]→L[ℝ] V) (W := E [×n]→L[ℝ] (E →L[ℝ] V)) (continuousMultilinearCurryRightEquiv' ℝ n E V).toContinuousLinearEquiv.toContinuousLinearMap (A.jet (n+1)) theorem derivativeJet_eq (A : SmoothTimeField K E V) (n : ℕ) (t : K) (x : E) : A.derivativeJet n t x = iteratedFDeriv ℝ n (fderiv ℝ (A.field t : E → V)) x := by change continuousMultilinearCurryRightEquiv' ℝ n E V (A.jet (n+1) t x) = _ rw [A.jet_eq, iteratedFDeriv_succ_eq_comp_right] exact (continuousMultilinearCurryRightEquiv' ℝ n E V).apply_symm_apply _ def derivative (A : SmoothTimeField K E V) : SmoothTimeField K E (E →L[ℝ] V) where field := A.derivativeField smooth t := by have he : (A.derivativeField t : E → E →L[ℝ] V) = fderiv ℝ (A.field t : E → V) := funext (A.derivativeField_eq t) rw [he] exact (A.smooth t).fderiv_right (m := ∞) (by simp) jet := A.derivativeJet jet_eq n t x := by have he : (A.derivativeField t : E → E →L[ℝ] V) = fderiv ℝ (A.field t : E → V) := funext (A.derivativeField_eq t) rw [he] exact A.derivativeJet_eq n t x end SmoothTimeField namespace EulerMeanCoefficients.SmoothCoefficientPath open EulerSmoothLimit def toSmoothTimeField {K V : Type} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothCoefficientPath K V) : SmoothTimeField K Space V := ⟨A.field, A.smooth, A.jet, A.jet_eq⟩ @[simp] theorem toSmoothTimeField_field {K V : Type} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothCoefficientPath K V) : A.toSmoothTimeField.field = A.field := rfl end EulerMeanCoefficients.SmoothCoefficientPath