l3lab/ntp-mathlib huggingface dataset:
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
⊢ (fun x => ‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖) =O[atBot] fun x => |x| ^ (-b)

Next tactic:
have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    ((fun x => |x| ^ (-b)) ∘ Neg.neg)
⊢ (fun x => ‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖) =O[atBot] fun x => |x| ^ (-b)

Next tactic:
have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    ((fun x => |x| ^ (-b)) ∘ Neg.neg)
⊢ (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)

Next tactic:
ext1 x
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; 

Proof state:
case h
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    ((fun x => |x| ^ (-b)) ∘ Neg.neg)
x : ℝ
⊢ ((fun x => |x| ^ (-b)) ∘ Neg.neg) x = |x| ^ (-b)

Next tactic:
simp only [Function.comp_apply, abs_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    ((fun x => |x| ^ (-b)) ∘ Neg.neg)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
⊢ (fun x => ‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖) =O[atBot] fun x => |x| ^ (-b)

Next tactic:
rw [this] at h2
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
⊢ (fun x => ‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖) =O[atBot] fun x => |x| ^ (-b)

Next tactic:
refine' (isBigO_of_le _ fun x => _).trans h2
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x : ℝ
⊢ ‖‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖‖ ≤
    ‖((fun x =>
            ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
          Neg.neg)
        x‖

Next tactic:
rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x : ℝ
⊢ ∀ (x_1 : ↑(Icc (x + R) (x + S))),
    ‖(ContinuousMap.restrict (Icc (x + R) (x + S)) f) x_1‖ ≤
      ‖ContinuousMap.restrict (Icc (-x + -S) (-x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖

Next tactic:
rintro ⟨x, hx⟩
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
  rintro ⟨x, hx⟩
  

Proof state:
case mk
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ ‖(ContinuousMap.restrict (Icc (x✝ + R) (x✝ + S)) f) { val := x, property := hx }‖ ≤
    ‖ContinuousMap.restrict (Icc (-x✝ + -S) (-x✝ + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖

Next tactic:
rw [ContinuousMap.restrict_apply_mk]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
  rintro ⟨x, hx⟩
  rw [ContinuousMap.restrict_apply_mk]
  

Proof state:
case mk
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ ‖f x‖ ≤ ‖ContinuousMap.restrict (Icc (-x✝ + -S) (-x✝ + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖

Next tactic:
refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
  rintro ⟨x, hx⟩
  rw [ContinuousMap.restrict_apply_mk]
  refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
  

Proof state:
case mk.refine'_1
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ ‖f x‖ =
    ‖(ContinuousMap.restrict (Icc (-x✝ + -S) (-x✝ + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a)))
        { val := -x, property := ?mk.refine'_2 }‖
case mk.refine'_2
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ -x ∈ Icc (-x✝ + -S) (-x✝ + -R)

Next tactic:
rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk,
    ContinuousMap.coe_mk, neg_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
  rintro ⟨x, hx⟩
  rw [ContinuousMap.restrict_apply_mk]
  refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
  rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk,
    ContinuousMap.coe_mk, neg_neg]
  

Proof state:
case mk.refine'_2
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ -x ∈ Icc (-x✝ + -S) (-x✝ + -R)
case mk.refine'_2
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ -x ∈ Icc (-x✝ + -S) (-x✝ + -R)

Next tactic:
exact ⟨by linarith [hx.2], by linarith [hx.1]⟩
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
  rintro ⟨x, hx⟩
  rw [ContinuousMap.restrict_apply_mk]
  refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
  rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk,
    ContinuousMap.coe_mk, neg_neg]
  exact ⟨by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ -x✝ + -S ≤ -x

Next tactic:
linarith [hx.2]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    IsBigO atBot (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) fun x : ℝ => |x| ^ (-b) := by
  have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
    convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
    ext1 x; simp only [Function.comp_apply, abs_neg]
  have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
  have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
    ext1 x; simp only [Function.comp_apply, abs_neg]
  rw [this] at h2
  refine' (isBigO_of_le _ fun x => _).trans h2
  -- equality holds, but less work to prove `≤` alone
  rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
  rintro ⟨x, hx⟩
  rw [ContinuousMap.restrict_apply_mk]
  refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
  rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk,
    ContinuousMap.coe_mk, neg_neg]
  exact ⟨by linarith [hx.2], by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x => ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))‖) ∘
      Neg.neg) =O[atBot]
    fun x => |x| ^ (-b)
this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
x✝ x : ℝ
hx : x ∈ Icc (x✝ + R) (x✝ + S)
⊢ -x ≤ -x✝ + -R

Next tactic:
linarith [hx.1]
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b)
    (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) :
    IsBigO (cocompact ℝ) (fun x => ‖(f.comp (ContinuousMap.addRight x)).restrict K‖) fun x =>
      |x| ^ (-b) := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b)
K : Compacts ℝ
⊢ (fun x => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))‖) =O[cocompact ℝ] fun x =>
    |x| ^ (-b)

Next tactic:
obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b)
    (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) :
    IsBigO (cocompact ℝ) (fun x => ‖(f.comp (ContinuousMap.addRight x)).restrict K‖) fun x =>
      |x| ^ (-b) := by
  obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0
  

Proof state:
case intro
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b)
K : Compacts ℝ
r : ℝ
hr : ↑K ⊆ Metric.closedBall 0 r
⊢ (fun x => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))‖) =O[cocompact ℝ] fun x =>
    |x| ^ (-b)

Next tactic:
rw [closedBall_eq_Icc, zero_add, zero_sub] at hr
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b)
    (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) :
    IsBigO (cocompact ℝ) (fun x => ‖(f.comp (ContinuousMap.addRight x)).restrict K‖) fun x =>
      |x| ^ (-b) := by
  obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0
  rw [closedBall_eq_Icc, zero_add, zero_sub] at hr
  

Proof state:
case intro
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b)
K : Compacts ℝ
r : ℝ
hr : ↑K ⊆ Icc (-r) r
⊢ (fun x => ‖ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))‖) =O[cocompact ℝ] fun x =>
    |x| ^ (-b)

Next tactic:
have :
    ∀ x : ℝ,
      ‖(f.comp (ContinuousMap.addRight x)).restrict K‖ ≤ ‖f.restrict (Icc (x - r) (x + r))‖ := by
    intro x
    rw [ContinuousMap.norm_le _ (norm_nonneg _)]
    rintro ⟨y, hy⟩
    refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩)
    · simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight]
    · exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩