introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.6 kB
import Mathlib
import OAI.Analysis.BiholderTransport.Calculus.TaylorBound
namespace OAI
noncomputable section
open Set Filter Asymptotics
open scoped Topology ContDiff
namespace WeakMTWTransport
variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F]
[NormedAddCommGroup G] [NormedSpace ℝ G]
def HasSecondTaylor (f : E β†’ ℝ) (l : E β†’L[ℝ] ℝ)
(B : E β†’L[ℝ] E β†’L[ℝ] ℝ) : Prop :=
(fun h => f h-f 0-l h-B h h/2) =o[𝓝 0] (fun h : E => β€–hβ€–^2)
lemma HasSecondTaylor.eventually {f : E β†’ ℝ} {l : E β†’L[ℝ] ℝ}
{B : E β†’L[ℝ] E β†’L[ℝ] ℝ} (hf : HasSecondTaylor f l B) {Ξ΅ : ℝ} (hΞ΅ : 0<Ξ΅) :
βˆ€αΆ  h in 𝓝 (0:E), |f h-f 0-l h-B h h/2|≀Ρ*β€–hβ€–^2 := by
simpa only [Real.norm_eq_abs,abs_pow,abs_norm] using hf.def hΞ΅
lemma hasSecondTaylor_of_contDiffAt {f : E β†’ ℝ} (hf : ContDiffAt ℝ 2 f 0) :
HasSecondTaylor f (fderiv ℝ f 0) (fderiv ℝ (fderiv ℝ f) 0) := by
apply Asymptotics.IsLittleO.of_bound
intro Ξ΅ hΞ΅
have hn := hf.eventually (by norm_num)
have hD := ((hf.fderiv_right (m := 1) (by norm_num)).fderiv_right
(m := 0) (by norm_num)).continuousAt
have he : βˆ€αΆ  z : E in 𝓝 0,
β€–fderiv ℝ (fderiv ℝ f) z-fderiv ℝ (fderiv ℝ f) 0β€–<Ξ΅ := by
exact Metric.tendsto_nhds.mp hD Ξ΅ hΞ΅ |>.mono (fun _ h => by simpa only [dist_eq_norm] using h)
obtain ⟨r,hr,hball⟩ := Metric.eventually_nhds_iff.mp (hn.and he)
filter_upwards [Metric.ball_mem_nhds (0:E) hr] with h hh
have H := second_order_remainder_bound_on_ball hr hΞ΅.le
(fun z hz => (hball hz).1) (fun z hz => (hball hz).2.le) hh
simpa only [Real.norm_eq_abs,abs_pow,abs_norm] using H
lemma bilinear_isBigO_norm_mul {Ξ± : Type*} (L : Filter Ξ±)
(B : E β†’L[ℝ] F β†’L[ℝ] G) (u : Ξ± β†’ E) (v : Ξ± β†’ F) :
(fun x => B (u x) (v x)) =O[L] (fun x => β€–u xβ€–*β€–v xβ€–) := by
apply Asymptotics.IsBigO.of_bound β€–Bβ€–
exact Filter.Eventually.of_forall (fun x => by
simpa only [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (norm_nonneg _) (norm_nonneg _)),
mul_assoc] using B.le_opNormβ‚‚ (u x) (v x))
lemma bilinear_remainder_of_hasFDerivAt {a : E β†’ F} {A : E β†’L[ℝ] F}
(ha : HasFDerivAt a A 0) (ha0 : a 0=0) (B : F β†’L[ℝ] F β†’L[ℝ] ℝ) :
(fun h => B (a h) (a h)-B (A h) (A h)) =o[𝓝 0] (fun h : E => β€–hβ€–^2) := by
have hR : (fun h => a h-A h) =o[𝓝 0] (fun h : E => h) := by
simpa only [zero_add,ha0,sub_zero] using hasFDerivAt_iff_isLittleO_nhds_zero.mp ha
have hO : a =O[𝓝 0] (fun h : E => h) := by
simpa only [ha0,sub_zero] using ha.isBigO_sub
have hA : (fun h : E => A h) =O[𝓝 0] (fun h => h) := A.isBigO_id _
have h1 := (bilinear_isBigO_norm_mul (𝓝 (0:E)) B (fun h => a h-A h) a).trans_isLittleO
(hR.norm_left.norm_right.mul_isBigO hO.norm_left.norm_right)
have h2 := (bilinear_isBigO_norm_mul (𝓝 (0:E)) B (fun h => A h) (fun h => a h-A h)).trans_isLittleO
(hA.norm_left.norm_right.mul_isLittleO hR.norm_left.norm_right)
have he : (fun h => B (a h) (a h)-B (A h) (A h)) =
(fun h => B (a h-A h) (a h)+B (A h) (a h-A h)) := by
funext h
simp only [map_sub,_root_.sub_apply]
ring
rw [he]
simpa only [pow_two] using h1.add h2
lemma HasSecondTaylor.comp_stationary {f : F β†’ ℝ}
{B : F β†’L[ℝ] F β†’L[ℝ] ℝ} (hf : HasSecondTaylor f 0 B)
{a : E β†’ F} {A : E β†’L[ℝ] F} (ha : HasFDerivAt a A 0) (ha0 : a 0=0) :
HasSecondTaylor (fun h => f (a h)) 0
(((ContinuousLinearMap.compL ℝ E F ℝ).flip A).comp (B.comp A)) := by
have hO : (fun h : E => β€–a hβ€–) =O[𝓝 0] (fun h => β€–hβ€–) := by
simpa only [ha0,sub_zero] using ha.isBigO_sub.norm_left.norm_right
have ht : Tendsto a (𝓝 0) (𝓝 0) := ha0 β–Έ ha.continuousAt
have h1 := (hf.comp_tendsto ht).trans_isBigO (hO.pow 2)
have h2 : (fun h => (B (a h) (a h)-B (A h) (A h))/2) =o[𝓝 0]
(fun h : E => β€–hβ€–^2) := by
simpa only [div_eq_mul_inv,mul_comm] using
(bilinear_remainder_of_hasFDerivAt ha ha0 B).const_mul_left (2:ℝ)⁻¹
unfold HasSecondTaylor
have he : (fun h => f (a h)-f (a 0)-(0 : E β†’L[ℝ] ℝ) h-
(((ContinuousLinearMap.compL ℝ E F ℝ).flip A).comp (B.comp A)) h h/2) =
(fun h => (f (a h)-f 0-(0 : F β†’L[ℝ] ℝ) (a h)-B (a h) (a h)/2)+
(B (a h) (a h)-B (A h) (A h))/2) := by
funext h
simp only [ha0,_root_.zero_apply,sub_zero,ContinuousLinearMap.comp_apply,
ContinuousLinearMap.compL_apply,ContinuousLinearMap.flip_apply]
ring
rw [he]
exact h1.add h2
lemma HasSecondTaylor.sub {f g : E β†’ ℝ} {l k : E β†’L[ℝ] ℝ}
{B C : E β†’L[ℝ] E β†’L[ℝ] ℝ} (hf : HasSecondTaylor f l B)
(hg : HasSecondTaylor g k C) : HasSecondTaylor (fun h => f h-g h) (l-k) (B-C) := by
unfold HasSecondTaylor at *
have he : (fun h => (f h-g h)-(f 0-g 0)-(l-k) h-(B-C) h h/2) =
(fun h => (f h-f 0-l h-B h h/2)-(g h-g 0-k h-C h h/2)) := by
funext h
simp only [_root_.sub_apply]
ring
rw [he]
exact Asymptotics.IsLittleO.sub hf hg
lemma HasSecondTaylor.add {f g : E β†’ ℝ} {l k : E β†’L[ℝ] ℝ}
{B C : E β†’L[ℝ] E β†’L[ℝ] ℝ} (hf : HasSecondTaylor f l B)
(hg : HasSecondTaylor g k C) : HasSecondTaylor (fun h => f h+g h) (l+k) (B+C) := by
unfold HasSecondTaylor at *
have he : (fun h => (f h+g h)-(f 0+g 0)-(l+k) h-(B+C) h h/2) =
(fun h => (f h-f 0-l h-B h h/2)+(g h-g 0-k h-C h h/2)) := by
funext h
simp only [_root_.add_apply]
ring
rw [he]
exact Asymptotics.IsLittleO.add hf hg
end WeakMTWTransport
end
end OAI