l3lab/ntp-mathlib huggingface dataset:
protected lemma neg {f : ℝ → ℝ} (hf : GrowsPolynomially f) : GrowsPolynomially (-f) := by
  intro b hb
  obtain ⟨c₁, hc₁_mem, c₂, hc₂_mem, hf⟩ := hf b hb
  refine ⟨c₂, hc₂_mem, c₁, hc₁_mem, ?_⟩
  filter_upwards [hf] with x hx
  

Proof state:
case h
f✝ f : ℝ → ℝ
hf✝ : GrowsPolynomially f
b : ℝ
hb : b ∈ Set.Ioo 0 1
c₁ : ℝ
hc₁_mem : c₁ > 0
c₂ : ℝ
hc₂_mem : c₂ > 0
hf : ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
x : ℝ
hx : ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
⊢ ∀ u ∈ Set.Icc (b * x) x, (-f) u ∈ Set.Icc (c₂ * (-f) x) (c₁ * (-f) x)

Next tactic:
intro u hu
protected lemma neg {f : ℝ → ℝ} (hf : GrowsPolynomially f) : GrowsPolynomially (-f) := by
  intro b hb
  obtain ⟨c₁, hc₁_mem, c₂, hc₂_mem, hf⟩ := hf b hb
  refine ⟨c₂, hc₂_mem, c₁, hc₁_mem, ?_⟩
  filter_upwards [hf] with x hx
  intro u hu
  

Proof state:
case h
f✝ f : ℝ → ℝ
hf✝ : GrowsPolynomially f
b : ℝ
hb : b ∈ Set.Ioo 0 1
c₁ : ℝ
hc₁_mem : c₁ > 0
c₂ : ℝ
hc₂_mem : c₂ > 0
hf : ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
x : ℝ
hx : ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
u : ℝ
hu : u ∈ Set.Icc (b * x) x
⊢ (-f) u ∈ Set.Icc (c₂ * (-f) x) (c₁ * (-f) x)

Next tactic:
simp only [Pi.neg_apply, Set.neg_mem_Icc_iff, neg_mul_eq_mul_neg, neg_neg]
protected lemma neg {f : ℝ → ℝ} (hf : GrowsPolynomially f) : GrowsPolynomially (-f) := by
  intro b hb
  obtain ⟨c₁, hc₁_mem, c₂, hc₂_mem, hf⟩ := hf b hb
  refine ⟨c₂, hc₂_mem, c₁, hc₁_mem, ?_⟩
  filter_upwards [hf] with x hx
  intro u hu
  simp only [Pi.neg_apply, Set.neg_mem_Icc_iff, neg_mul_eq_mul_neg, neg_neg]
  

Proof state:
case h
f✝ f : ℝ → ℝ
hf✝ : GrowsPolynomially f
b : ℝ
hb : b ∈ Set.Ioo 0 1
c₁ : ℝ
hc₁_mem : c₁ > 0
c₂ : ℝ
hc₂_mem : c₂ > 0
hf : ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
x : ℝ
hx : ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
u : ℝ
hu : u ∈ Set.Icc (b * x) x
⊢ f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)

Next tactic:
exact hx u hu
protected lemma neg_iff {f : ℝ → ℝ} : GrowsPolynomially f ↔ GrowsPolynomially (-f) :=
  ⟨fun hf => hf.neg, fun hf => by 

Proof state:
f✝ f : ℝ → ℝ
hf : GrowsPolynomially (-f)
⊢ GrowsPolynomially f

Next tactic:
rw [← neg_neg f]
protected lemma neg_iff {f : ℝ → ℝ} : GrowsPolynomially f ↔ GrowsPolynomially (-f) :=
  ⟨fun hf => hf.neg, fun hf => by rw [← neg_neg f]; 

Proof state:
f✝ f : ℝ → ℝ
hf : GrowsPolynomially (-f)
⊢ GrowsPolynomially (- -f)

Next tactic:
exact hf.neg
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  

Proof state:
case inl
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ GrowsPolynomially fun x => |f x|
case inr f : ℝ → ℝ hf : GrowsPolynomially f hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0 ⊢ GrowsPolynomially fun x => |f x|

Next tactic:
case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ f =ᶠ[atTop] fun x => |f x|

Next tactic:
filter_upwards [hf'] with x hx
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      

Proof state:
case h
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
x : ℝ
hx : 0 ≤ f x
⊢ f x = |f x|

Next tactic:
rw [abs_of_nonneg hx]
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hmain : f =ᶠ[atTop] fun x => |f x|
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
rw [← iff_eventuallyEq hmain]
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hmain : f =ᶠ[atTop] fun x => |f x|
⊢ GrowsPolynomially f

Next tactic:
exact hf
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
  

Proof state:
case inr
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
case inr =>
    have hmain : -f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      simp only [Pi.neg_apply, abs_of_nonpos hx]

    rw [← iff_eventuallyEq hmain]
    exact hf.neg
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
  

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
case inr =>
    have hmain : -f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      simp only [Pi.neg_apply, abs_of_nonpos hx]

    rw [← iff_eventuallyEq hmain]
    exact hf.neg
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
  case inr =>
    

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
have hmain : -f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      simp only [Pi.neg_apply, abs_of_nonpos hx]
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
  case inr =>
    have hmain : -f =ᶠ[atTop] fun x => |f x| := by
      

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
⊢ -f =ᶠ[atTop] fun x => |f x|

Next tactic:
filter_upwards [hf'] with x hx
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
  case inr =>
    have hmain : -f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      

Proof state:
case h
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
x : ℝ
hx : f x ≤ 0
⊢ (-f) x = |f x|

Next tactic:
simp only [Pi.neg_apply, abs_of_nonpos hx]
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
  case inr =>
    have hmain : -f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      simp only [Pi.neg_apply, abs_of_nonpos hx]

    

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
hmain : -f =ᶠ[atTop] fun x => |f x|
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
rw [← iff_eventuallyEq hmain]
protected lemma abs (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => |f x|) := by
  rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
  case inl =>
    have hmain : f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      rw [abs_of_nonneg hx]
    rw [← iff_eventuallyEq hmain]
    exact hf
  case inr =>
    have hmain : -f =ᶠ[atTop] fun x => |f x| := by
      filter_upwards [hf'] with x hx
      simp only [Pi.neg_apply, abs_of_nonpos hx]

    rw [← iff_eventuallyEq hmain]
    

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
hmain : -f =ᶠ[atTop] fun x => |f x|
⊢ GrowsPolynomially (-f)

Next tactic:
exact hf.neg
protected lemma norm (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => ‖f x‖) := by
  

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
⊢ GrowsPolynomially fun x => ‖f x‖

Next tactic:
simp only [norm_eq_abs]
protected lemma norm (hf : GrowsPolynomially f) : GrowsPolynomially (fun x => ‖f x‖) := by
  simp only [norm_eq_abs]
  

Proof state:
f : ℝ → ℝ
hf : GrowsPolynomially f
⊢ GrowsPolynomially fun x => |f x|

Next tactic:
exact hf.abs
lemma growsPolynomially_const {c : ℝ} : GrowsPolynomially (fun _ => c) := by
  

Proof state:
f : ℝ → ℝ
c : ℝ
⊢ GrowsPolynomially fun x => c

Next tactic:
refine fun _ _ => ⟨1, by norm_num, 1, by norm_num, ?_⟩
lemma growsPolynomially_const {c : ℝ} : GrowsPolynomially (fun _ => c) := by
  refine fun _ _ => ⟨1, by 

Proof state:
f : ℝ → ℝ
c x✝¹ : ℝ
x✝ : x✝¹ ∈ Set.Ioo 0 1
⊢ 1 > 0

Next tactic:
norm_num
lemma growsPolynomially_const {c : ℝ} : GrowsPolynomially (fun _ => c) := by
  refine fun _ _ => ⟨1, by norm_num, 1, by 

Proof state:
f : ℝ → ℝ
c x✝¹ : ℝ
x✝ : x✝¹ ∈ Set.Ioo 0 1
⊢ 1 > 0

Next tactic:
norm_num
lemma growsPolynomially_const {c : ℝ} : GrowsPolynomially (fun _ => c) := by
  refine fun _ _ => ⟨1, by norm_num, 1, by norm_num, ?_⟩
  

Proof state:
f : ℝ → ℝ
c x✝¹ : ℝ
x✝ : x✝¹ ∈ Set.Ioo 0 1
⊢ ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (x✝¹ * x) x, (fun x => c) u ∈ Set.Icc (1 * (fun x => c) x) (1 * (fun x => c) x)

Next tactic:
filter_upwards [] with x
lemma growsPolynomially_const {c : ℝ} : GrowsPolynomially (fun _ => c) := by
  refine fun _ _ => ⟨1, by norm_num, 1, by norm_num, ?_⟩
  filter_upwards [] with x
  

Proof state:
case h
f : ℝ → ℝ
c x✝¹ : ℝ
x✝ : x✝¹ ∈ Set.Ioo 0 1
x : ℝ
⊢ ∀ u ∈ Set.Icc (x✝¹ * x) x, c ∈ Set.Icc (1 * c) (1 * c)

Next tactic:
simp
lemma growsPolynomially_id : GrowsPolynomially (fun x => x) := by
  

Proof state:
f : ℝ → ℝ
⊢ GrowsPolynomially fun x => x

Next tactic:
intro b hb
lemma growsPolynomially_id : GrowsPolynomially (fun x => x) := by
  intro b hb
  

Proof state:
f : ℝ → ℝ
b : ℝ
hb : b ∈ Set.Ioo 0 1
⊢ ∃ c₁ > 0,
    ∃ c₂ > 0,
      ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, (fun x => x) u ∈ Set.Icc (c₁ * (fun x => x) x) (c₂ * (fun x => x) x)

Next tactic:
refine ⟨b, hb.1, ?_⟩
lemma growsPolynomially_id : GrowsPolynomially (fun x => x) := by
  intro b hb
  refine ⟨b, hb.1, ?_⟩
  

Proof state:
f : ℝ → ℝ
b : ℝ
hb : b ∈ Set.Ioo 0 1
⊢ ∃ c₂ > 0,
    ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, (fun x => x) u ∈ Set.Icc (b * (fun x => x) x) (c₂ * (fun x => x) x)

Next tactic:
refine ⟨1, by norm_num, ?_⟩
lemma growsPolynomially_id : GrowsPolynomially (fun x => x) := by
  intro b hb
  refine ⟨b, hb.1, ?_⟩
  refine ⟨1, by 

Proof state:
f : ℝ → ℝ
b : ℝ
hb : b ∈ Set.Ioo 0 1
⊢ 1 > 0

Next tactic:
norm_num
lemma growsPolynomially_id : GrowsPolynomially (fun x => x) := by
  intro b hb
  refine ⟨b, hb.1, ?_⟩
  refine ⟨1, by norm_num, ?_⟩
  

Proof state:
f : ℝ → ℝ
b : ℝ
hb : b ∈ Set.Ioo 0 1
⊢ ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, (fun x => x) u ∈ Set.Icc (b * (fun x => x) x) (1 * (fun x => x) x)

Next tactic:
refine eventually_of_forall fun x u hu => ?_
lemma growsPolynomially_id : GrowsPolynomially (fun x => x) := by
  intro b hb
  refine ⟨b, hb.1, ?_⟩
  refine ⟨1, by norm_num, ?_⟩
  refine eventually_of_forall fun x u hu => ?_
  

Proof state:
f : ℝ → ℝ
b : ℝ
hb : b ∈ Set.Ioo 0 1
x u : ℝ
hu : u ∈ Set.Icc (b * x) x
⊢ (fun x => x) u ∈ Set.Icc (b * (fun x => x) x) (1 * (fun x => x) x)

Next tactic:
simp only [one_mul, ge_iff_le, gt_iff_lt, not_le, Set.mem_Icc]
lemma growsPolynomially_id : GrowsPolynomially (fun x => x) := by
  intro b hb
  refine ⟨b, hb.1, ?_⟩
  refine ⟨1, by norm_num, ?_⟩
  refine eventually_of_forall fun x u hu => ?_
  simp only [one_mul, ge_iff_le, gt_iff_lt, not_le, Set.mem_Icc]
  

Proof state:
f : ℝ → ℝ
b : ℝ
hb : b ∈ Set.Ioo 0 1
x u : ℝ
hu : u ∈ Set.Icc (b * x) x
⊢ b * x ≤ u ∧ u ≤ x

Next tactic:
exact ⟨hu.1, hu.2⟩
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
suffices : GrowsPolynomially fun x => |f x| * |g x|
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · 

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    

Proof state:
case inl
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ GrowsPolynomially fun x => f x * g x
case inr
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≤ 0
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
        rwa [iff_eventuallyEq hmain]
      case inr =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => -|f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          simp [abs_of_nonneg hx₁, abs_of_nonpos hx₂]
        simp only [iff_eventuallyEq hmain, neg_mul]
        exact this.neg
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
        rwa [iff_eventuallyEq hmain]
      case inr =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => -|f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          simp [abs_of_nonneg hx₁, abs_of_nonpos hx₂]
        simp only [iff_eventuallyEq hmain, neg_mul]
        exact this.neg
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      

Proof state:
case inl
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ g x
⊢ GrowsPolynomially fun x => f x * g x
case inr
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, g x ≤ 0
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
        rwa [iff_eventuallyEq hmain]
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ g x
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
        rwa [iff_eventuallyEq hmain]
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      case inl =>
        

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ g x
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ g x
⊢ (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x|

Next tactic:
filter_upwards [hf', hg'] with x hx₁ hx₂
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          

Proof state:
case h
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ g x
x : ℝ
hx₁ : 0 ≤ f x
hx₂ : 0 ≤ g x
⊢ f x * g x = |f x| * |g x|

Next tactic:
rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
        

Proof state:
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ g x
hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x|
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
rwa [iff_eventuallyEq hmain]
protected lemma GrowsPolynomially.mul {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x * g x := by
  suffices : GrowsPolynomially fun x => |f x| * |g x|
  · rcases eventually_atTop_nonneg_or_nonpos hf with hf'|hf'
    case inl =>
      rcases eventually_atTop_nonneg_or_nonpos hg with hg'|hg'
      case inl =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => |f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          rw [abs_of_nonneg hx₁, abs_of_nonneg hx₂]
        rwa [iff_eventuallyEq hmain]
      

Proof state:
case inr
f✝ f g : ℝ → ℝ
hf : GrowsPolynomially f
hg : GrowsPolynomially g
this : GrowsPolynomially fun x => |f x| * |g x|
hf' : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
hg' : ∀ᶠ (x : ℝ) in atTop, g x ≤ 0
⊢ GrowsPolynomially fun x => f x * g x

Next tactic:
case inr =>
        have hmain : (fun x => f x * g x) =ᶠ[atTop] fun x => -|f x| * |g x| := by
          filter_upwards [hf', hg'] with x hx₁ hx₂
          simp [abs_of_nonneg hx₁, abs_of_nonpos hx₂]
        simp only [iff_eventuallyEq hmain, neg_mul]
        exact this.neg