l3lab/ntp-mathlib huggingface dataset:
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
⊢ Tendsto (fun p => ∑ i : α, a i * b i ^ p) atTop (𝓝 (∑ x : α, 0))

Next tactic:
refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
⊢ Tendsto (fun p => a i * b i ^ p) atTop (𝓝 0)

Next tactic:
have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by simp
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
⊢ 0 = a i * 0

Next tactic:
simp
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by simp
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
h₂ : 0 = a i * 0
⊢ Tendsto (fun p => a i * b i ^ p) atTop (𝓝 0)

Next tactic:
show Tendsto (fun z => (a i : ℝ) * b i ^ z) atTop (𝓝 0)
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by simp
  show Tendsto (fun z => (a i : ℝ) * b i ^ z) atTop (𝓝 0)
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
h₂ : 0 = a i * 0
⊢ Tendsto (fun z => a i * b i ^ z) atTop (𝓝 0)

Next tactic:
rw [h₂]
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by simp
  show Tendsto (fun z => (a i : ℝ) * b i ^ z) atTop (𝓝 0)
  rw [h₂]
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
h₂ : 0 = a i * 0
⊢ Tendsto (fun z => a i * b i ^ z) atTop (𝓝 (a i * 0))

Next tactic:
refine Tendsto.mul (by simp) <| tendsto_rpow_atTop_of_base_lt_one _ ?_ (R.b_lt_one i)
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by simp
  show Tendsto (fun z => (a i : ℝ) * b i ^ z) atTop (𝓝 0)
  rw [h₂]
  refine Tendsto.mul (by 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
h₂ : 0 = a i * 0
⊢ Tendsto (fun z => a i) atTop (𝓝 (a i))

Next tactic:
simp
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by simp
  show Tendsto (fun z => (a i : ℝ) * b i ^ z) atTop (𝓝 0)
  rw [h₂]
  refine Tendsto.mul (by simp) <| tendsto_rpow_atTop_of_base_lt_one _ ?_ (R.b_lt_one i)
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
h₂ : 0 = a i * 0
⊢ -1 < b i

Next tactic:
have := R.b_pos i
lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0) := by
  have h₁ : Finset.univ.sum (fun _ : α => (0:ℝ)) = 0 := by simp
  rw [← h₁]
  refine tendsto_finset_sum  (univ : Finset α) (fun i _ => ?_)
  have h₂ : (0:ℝ) = (a i : ℝ) * 0 := by simp
  show Tendsto (fun z => (a i : ℝ) * b i ^ z) atTop (𝓝 0)
  rw [h₂]
  refine Tendsto.mul (by simp) <| tendsto_rpow_atTop_of_base_lt_one _ ?_ (R.b_lt_one i)
  have := R.b_pos i
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : ∑ x : α, 0 = 0
i : α
x✝ : i ∈ univ
h₂ : 0 = a i * 0
this : 0 < b i
⊢ -1 < b i

Next tactic:
linarith
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ Tendsto (fun p => ∑ i : α, a i * b i ^ p) atBot atTop

Next tactic:
have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ Tendsto (fun p => a (max_bi b)) atBot (𝓝 (a (max_bi b)))

Next tactic:
simp
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ 0 < b (max_bi b)

Next tactic:
have := R.b_pos (max_bi b)
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
this : 0 < b (max_bi b)
⊢ 0 < b (max_bi b)

Next tactic:
linarith
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : Tendsto (fun p => a (max_bi b) * b (max_bi b) ^ p) atBot atTop
⊢ Tendsto (fun p => ∑ i : α, a i * b i ^ p) atBot atTop

Next tactic:
refine tendsto_atTop_mono (fun p => ?_) h₁
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
  refine tendsto_atTop_mono (fun p => ?_) h₁
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : Tendsto (fun p => a (max_bi b) * b (max_bi b) ^ p) atBot atTop
p : ℝ
⊢ a (max_bi b) * b (max_bi b) ^ p ≤ ∑ i : α, a i * b i ^ p

Next tactic:
let f := fun i => (a i : ℝ) * b i ^ p
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
  refine tendsto_atTop_mono (fun p => ?_) h₁
  let f := fun i => (a i : ℝ) * b i ^ p
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : Tendsto (fun p => a (max_bi b) * b (max_bi b) ^ p) atBot atTop
p : ℝ
f : α → ℝ := fun i => a i * b i ^ p
⊢ a (max_bi b) * b (max_bi b) ^ p ≤ ∑ i : α, a i * b i ^ p

Next tactic:
show f (max_bi b) ≤ Finset.univ.sum f
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
  refine tendsto_atTop_mono (fun p => ?_) h₁
  let f := fun i => (a i : ℝ) * b i ^ p
  show f (max_bi b) ≤ Finset.univ.sum f
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : Tendsto (fun p => a (max_bi b) * b (max_bi b) ^ p) atBot atTop
p : ℝ
f : α → ℝ := fun i => a i * b i ^ p
⊢ f (max_bi b) ≤ Finset.sum univ f

Next tactic:
refine Finset.single_le_sum (fun i _ => ?_) (mem_univ _)
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
  refine tendsto_atTop_mono (fun p => ?_) h₁
  let f := fun i => (a i : ℝ) * b i ^ p
  show f (max_bi b) ≤ Finset.univ.sum f
  refine Finset.single_le_sum (fun i _ => ?_) (mem_univ _)
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁ : Tendsto (fun p => a (max_bi b) * b (max_bi b) ^ p) atBot atTop
p : ℝ
f : α → ℝ := fun i => a i * b i ^ p
i : α
x✝ : i ∈ univ
⊢ 0 ≤ f i

Next tactic:
have h₁ : 0 < a i := R.a_pos i
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
  refine tendsto_atTop_mono (fun p => ?_) h₁
  let f := fun i => (a i : ℝ) * b i ^ p
  show f (max_bi b) ≤ Finset.univ.sum f
  refine Finset.single_le_sum (fun i _ => ?_) (mem_univ _)
  have h₁ : 0 < a i := R.a_pos i
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁✝ : Tendsto (fun p => a (max_bi b) * b (max_bi b) ^ p) atBot atTop
p : ℝ
f : α → ℝ := fun i => a i * b i ^ p
i : α
x✝ : i ∈ univ
h₁ : 0 < a i
⊢ 0 ≤ f i

Next tactic:
have h₂ : 0 < b i := R.b_pos i
lemma tendsto_atTop_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atBot atTop := by
  have h₁ : Tendsto (fun p => (a (max_bi b) : ℝ) * b (max_bi b) ^ p) atBot atTop :=
    Tendsto.mul_atTop (R.a_pos (max_bi b)) (by simp)
      <| tendsto_rpow_atBot_of_base_lt_one _
      (by have := R.b_pos (max_bi b); linarith) (R.b_lt_one _)
  refine tendsto_atTop_mono (fun p => ?_) h₁
  let f := fun i => (a i : ℝ) * b i ^ p
  show f (max_bi b) ≤ Finset.univ.sum f
  refine Finset.single_le_sum (fun i _ => ?_) (mem_univ _)
  have h₁ : 0 < a i := R.a_pos i
  have h₂ : 0 < b i := R.b_pos i
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
h₁✝ : Tendsto (fun p => a (max_bi b) * b (max_bi b) ^ p) atBot atTop
p : ℝ
f : α → ℝ := fun i => a i * b i ^ p
i : α
x✝ : i ∈ univ
h₁ : 0 < a i
h₂ : 0 < b i
⊢ 0 ≤ f i

Next tactic:
positivity
lemma one_mem_range_sumCoeffsExp : 1 ∈ Set.range (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ 1 ∈ Set.range fun p => ∑ i : α, a i * b i ^ p

Next tactic:
refine mem_range_of_exists_le_of_exists_ge R.continuous_sumCoeffsExp ?le_one ?ge_one
lemma one_mem_range_sumCoeffsExp : 1 ∈ Set.range (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) := by
  refine mem_range_of_exists_le_of_exists_ge R.continuous_sumCoeffsExp ?le_one ?ge_one
  

Proof state:
case le_one
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ a_1, ∑ i : α, a i * b i ^ a_1 ≤ 1
case ge_one
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ b_1, 1 ≤ ∑ i : α, a i * b i ^ b_1

Next tactic:
case le_one =>
    exact Eventually.exists <| eventually_le_of_tendsto_lt zero_lt_one R.tendsto_zero_sumCoeffsExp
lemma one_mem_range_sumCoeffsExp : 1 ∈ Set.range (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) := by
  refine mem_range_of_exists_le_of_exists_ge R.continuous_sumCoeffsExp ?le_one ?ge_one
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ a_1, ∑ i : α, a i * b i ^ a_1 ≤ 1

Next tactic:
case le_one =>
    exact Eventually.exists <| eventually_le_of_tendsto_lt zero_lt_one R.tendsto_zero_sumCoeffsExp
lemma one_mem_range_sumCoeffsExp : 1 ∈ Set.range (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) := by
  refine mem_range_of_exists_le_of_exists_ge R.continuous_sumCoeffsExp ?le_one ?ge_one
  case le_one =>
    

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ a_1, ∑ i : α, a i * b i ^ a_1 ≤ 1

Next tactic:
exact Eventually.exists <| eventually_le_of_tendsto_lt zero_lt_one R.tendsto_zero_sumCoeffsExp
lemma one_mem_range_sumCoeffsExp : 1 ∈ Set.range (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) := by
  refine mem_range_of_exists_le_of_exists_ge R.continuous_sumCoeffsExp ?le_one ?ge_one
  case le_one =>
    exact Eventually.exists <| eventually_le_of_tendsto_lt zero_lt_one R.tendsto_zero_sumCoeffsExp
  

Proof state:
case ge_one
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ b_1, 1 ≤ ∑ i : α, a i * b i ^ b_1

Next tactic:
case ge_one =>
    exact Eventually.exists <| R.tendsto_atTop_sumCoeffsExp.eventually_ge_atTop _
lemma one_mem_range_sumCoeffsExp : 1 ∈ Set.range (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) := by
  refine mem_range_of_exists_le_of_exists_ge R.continuous_sumCoeffsExp ?le_one ?ge_one
  case le_one =>
    exact Eventually.exists <| eventually_le_of_tendsto_lt zero_lt_one R.tendsto_zero_sumCoeffsExp
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ b_1, 1 ≤ ∑ i : α, a i * b i ^ b_1

Next tactic:
case ge_one =>
    exact Eventually.exists <| R.tendsto_atTop_sumCoeffsExp.eventually_ge_atTop _
lemma one_mem_range_sumCoeffsExp : 1 ∈ Set.range (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) := by
  refine mem_range_of_exists_le_of_exists_ge R.continuous_sumCoeffsExp ?le_one ?ge_one
  case le_one =>
    exact Eventually.exists <| eventually_le_of_tendsto_lt zero_lt_one R.tendsto_zero_sumCoeffsExp
  case ge_one =>
    

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ b_1, 1 ≤ ∑ i : α, a i * b i ^ b_1

Next tactic:
exact Eventually.exists <| R.tendsto_atTop_sumCoeffsExp.eventually_ge_atTop _
@[simp]
lemma sumCoeffsExp_p_eq_one : ∑ i, a i * (b i) ^ p a b = 1 := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∑ i : α, a i * b i ^ p a b = 1

Next tactic:
simp only [p]
@[simp]
lemma sumCoeffsExp_p_eq_one : ∑ i, a i * (b i) ^ p a b = 1 := by
  simp only [p]
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∑ x : α, a x * b x ^ Function.invFun (fun p => ∑ i : α, a i * b i ^ p) 1 = 1

Next tactic:
exact Function.invFun_eq (by rw [← Set.mem_range]; exact R.one_mem_range_sumCoeffsExp)
@[simp]
lemma sumCoeffsExp_p_eq_one : ∑ i, a i * (b i) ^ p a b = 1 := by
  simp only [p]
  exact Function.invFun_eq (by 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∃ a, ?m.689999 a = ?m.690000

Next tactic:
rw [← Set.mem_range]
@[simp]
lemma sumCoeffsExp_p_eq_one : ∑ i, a i * (b i) ^ p a b = 1 := by
  simp only [p]
  exact Function.invFun_eq (by rw [← Set.mem_range]; 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ?m.690530 ∈ Set.range ?m.690529
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ Sort ?u.690526
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ Type ?u.690525
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ?m.690528 → ?m.690527
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ?m.690527

Next tactic:
exact R.one_mem_range_sumCoeffsExp
lemma asympBound_def' {n : ℕ} :
    asympBound g a b n = n ^ p a b * (1 + (∑ u in range n, g u / u ^ (p a b + 1))) := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
⊢ asympBound g a b n = ↑n ^ p a b * (1 + ∑ u in range n, g ↑u / ↑u ^ (p a b + 1))

Next tactic:
simp [asympBound_def, sumTransform, mul_add, mul_one, Finset.sum_Ico_eq_sum_range]
lemma asympBound_pos (n : ℕ) (hn : 0 < n) : 0 < asympBound g a b n := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
hn : 0 < n
⊢ 0 < asympBound g a b n

Next tactic:
calc 0 < (n:ℝ) ^ p a b * (1 + 0)    := by aesop (add safe Real.rpow_pos_of_pos)
       _ ≤ asympBound g a b n    := by
                    simp only [asympBound_def']
                    gcongr n^p a b * (1 + ?_)
                    have := R.g_nonneg
                    aesop (add safe Real.rpow_nonneg_of_nonneg,
                               safe div_nonneg,
                               safe Finset.sum_nonneg)
lemma asympBound_pos (n : ℕ) (hn : 0 < n) : 0 < asympBound g a b n := by
  calc 0 < (n:ℝ) ^ p a b * (1 + 0)    := by 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
hn : 0 < n
⊢ 0 < ↑n ^ p a b * (1 + 0)

Next tactic:
aesop (add safe Real.rpow_pos_of_pos)
lemma asympBound_pos (n : ℕ) (hn : 0 < n) : 0 < asympBound g a b n := by
  calc 0 < (n:ℝ) ^ p a b * (1 + 0)    := by aesop (add safe Real.rpow_pos_of_pos)
       _ ≤ asympBound g a b n    := by
                    

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
hn : 0 < n
⊢ ↑n ^ p a b * (1 + 0) ≤ asympBound g a b n

Next tactic:
simp only [asympBound_def']
lemma asympBound_pos (n : ℕ) (hn : 0 < n) : 0 < asympBound g a b n := by
  calc 0 < (n:ℝ) ^ p a b * (1 + 0)    := by aesop (add safe Real.rpow_pos_of_pos)
       _ ≤ asympBound g a b n    := by
                    simp only [asympBound_def']
                    

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
hn : 0 < n
⊢ ↑n ^ p a b * (1 + 0) ≤ ↑n ^ p a b * (1 + ∑ u in range n, g ↑u / ↑u ^ (p a b + 1))

Next tactic:
gcongr n^p a b * (1 + ?_)
lemma asympBound_pos (n : ℕ) (hn : 0 < n) : 0 < asympBound g a b n := by
  calc 0 < (n:ℝ) ^ p a b * (1 + 0)    := by aesop (add safe Real.rpow_pos_of_pos)
       _ ≤ asympBound g a b n    := by
                    simp only [asympBound_def']
                    gcongr n^p a b * (1 + ?_)
                    

Proof state:
case h.bc
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
hn : 0 < n
⊢ 0 ≤ ∑ u in range n, g ↑u / ↑u ^ (p a b + 1)

Next tactic:
have := R.g_nonneg
lemma asympBound_pos (n : ℕ) (hn : 0 < n) : 0 < asympBound g a b n := by
  calc 0 < (n:ℝ) ^ p a b * (1 + 0)    := by aesop (add safe Real.rpow_pos_of_pos)
       _ ≤ asympBound g a b n    := by
                    simp only [asympBound_def']
                    gcongr n^p a b * (1 + ?_)
                    have := R.g_nonneg
                    

Proof state:
case h.bc
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
hn : 0 < n
this : ∀ x ≥ 0, 0 ≤ g x
⊢ 0 ≤ ∑ u in range n, g ↑u / ↑u ^ (p a b + 1)

Next tactic:
aesop (add safe Real.rpow_nonneg_of_nonneg,
                               safe div_nonneg,
                               safe Finset.sum_nonneg)
lemma eventually_asympBound_pos : ∀ᶠ (n:ℕ) in atTop, 0 < asympBound g a b n := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∀ᶠ (n : ℕ) in atTop, 0 < asympBound g a b n

Next tactic:
filter_upwards [eventually_gt_atTop 0] with n hn
lemma eventually_asympBound_pos : ∀ᶠ (n:ℕ) in atTop, 0 < asympBound g a b n := by
  filter_upwards [eventually_gt_atTop 0] with n hn
  

Proof state:
case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
n : ℕ
hn : 0 < n
⊢ 0 < asympBound g a b n

Next tactic:
exact R.asympBound_pos n hn
lemma eventually_asympBound_r_pos : ∀ᶠ (n:ℕ) in atTop, ∀ i, 0 < asympBound g a b (r i n) := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∀ᶠ (n : ℕ) in atTop, ∀ (i : α), 0 < asympBound g a b (r i n)

Next tactic:
rw [Filter.eventually_all]
lemma eventually_asympBound_r_pos : ∀ᶠ (n:ℕ) in atTop, ∀ i, 0 < asympBound g a b (r i n) := by
  rw [Filter.eventually_all]
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
⊢ ∀ (i : α), ∀ᶠ (x : ℕ) in atTop, 0 < asympBound g a b (r i x)

Next tactic:
exact fun i => (R.tendsto_atTop_r i).eventually R.eventually_asympBound_pos