-- Mathlib/Analysis/Fourier/PoissonSummation.lean
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : f =O[atBot] fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) =O[atBot] fun x : ℝ => |x| ^ (-b)

Proof state:
case h.e'_8
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
⊢ (fun x => |x| ^ (-b)) = (fun x => |x| ^ (-b)) ∘ Neg.neg

Tactic:
ext1 x

Result:
case h.e'_8.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 x : ℝ
⊢ |x| ^ (-b) = ((fun x => |x| ^ (-b)) ∘ Neg.neg) x

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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)

Tactic:
exact ⟨by linarith [hx.2], by linarith [hx.1]⟩

Result:
no goals

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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)

Tactic:
have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
  ext1 x; simp only [Function.comp_apply, abs_neg]

Result:
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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)

Proof state:
case h.e'_8.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 x : ℝ
⊢ |x| ^ (-b) = ((fun x => |x| ^ (-b)) ∘ Neg.neg) x

Tactic:
simp only [Function.comp_apply, abs_neg]

Result:
no goals

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 : ℝ
⊢ ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)

Tactic:
convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1

Result:
case h.e'_8
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
b : ℝ
hb : 0 < b
hf : ⇑f =O[atBot] fun x => |x| ^ (-b)
R S : ℝ
⊢ (fun x => |x| ^ (-b)) = (fun x => |x| ^ (-b)) ∘ Neg.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 : ℝ
⊢ (fun x => ‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖) =O[atBot] fun x => |x| ^ (-b)

Tactic:
have h1 : (f.comp (ContinuousMap.mk _ continuous_neg)) =O[atTop] fun x : ℝ => |x| ^ (-b) := by
  convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
  ext1 x; simp only [Function.comp_apply, abs_neg]

Result:
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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
⊢ (fun x => ‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖) =O[atBot] fun x => |x| ^ (-b)

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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
⊢ (fun x => ‖ContinuousMap.restrict (Icc (x + R) (x + S)) f‖) =O[atBot] fun x => |x| ^ (-b)

Tactic:
have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop

Result:
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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)

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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      Neg.neg) =O[atBot]
    ((fun x => |x| ^ (-b)) ∘ Neg.neg)
x : ℝ
⊢ ((fun x => |x| ^ (-b)) ∘ Neg.neg) x = |x| ^ (-b)

Tactic:
simp only [Function.comp_apply, abs_neg]

Result:
no goals

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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)

Tactic:
rw [this] at h2

Result:
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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)

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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)

Tactic:
refine (isBigO_of_le _ fun x => ?_).trans h2

Result:
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 : ⇑(f.comp { toFun := fun a => -a, continuous_toFun := ⋯ }) =O[atTop] fun x => |x| ^ (-b)
h2 :
  ((fun x =>
        ‖ContinuousMap.restrict (Icc (x + -S) (x + -R)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
      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)) (f.comp { toFun := fun a => -a, continuous_toFun := ⋯ })‖) ∘
          Neg.neg)
        x‖