l3lab/ntp-mathlib huggingface dataset:
theorem quadratic_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) : 1 + x + x ^ 2 / 2 ≤ exp x :=
  calc
    1 + x + x ^ 2 / 2 = ∑ i in range 3, x ^ i / i ! := by
        simp only [sum_range_succ, range_one, sum_singleton, _root_.pow_zero, factorial, cast_one,
          ne_eq, one_ne_zero, not_false_eq_true, div_self, pow_one, mul_one, div_one, Nat.mul_one,
          cast_succ, add_right_inj]
        

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
⊢ 1 + x + x ^ 2 / 2 = 1 / (↑0 + 1) + x / (↑0 + 1) + x ^ 2 / (↑0 + 1 + 1)

Next tactic:
ring_nf
private theorem add_one_lt_exp_of_pos {x : ℝ} (hx : 0 < x) : x + 1 < exp x :=
  (by 

Proof state:
x✝ y x : ℝ
hx : 0 < x
⊢ x + 1 < 1 + x + x ^ 2 / 2

Next tactic:
nlinarith
private theorem add_one_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) : x + 1 ≤ exp x := by
  

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
⊢ x + 1 ≤ rexp x

Next tactic:
rcases eq_or_lt_of_le hx with (rfl | h)
private theorem add_one_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) : x + 1 ≤ exp x := by
  rcases eq_or_lt_of_le hx with (rfl | h)
  · 

Proof state:
case inl
x y : ℝ
hx : 0 ≤ 0
⊢ 0 + 1 ≤ rexp 0

Next tactic:
simp
private theorem add_one_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) : x + 1 ≤ exp x := by
  rcases eq_or_lt_of_le hx with (rfl | h)
  · simp
  

Proof state:
case inr
x✝ y x : ℝ
hx : 0 ≤ x
h : 0 < x
⊢ x + 1 ≤ rexp x

Next tactic:
exact (add_one_lt_exp_of_pos h).le
theorem one_le_exp {x : ℝ} (hx : 0 ≤ x) : 1 ≤ exp x := by 

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
⊢ 1 ≤ rexp x

Next tactic:
linarith [add_one_le_exp_of_nonneg hx]
theorem exp_pos (x : ℝ) : 0 < exp x :=
  (le_total 0 x).elim (lt_of_lt_of_le zero_lt_one ∘ one_le_exp) fun h => by
    

Proof state:
x✝ y x : ℝ
h : x ≤ 0
⊢ 0 < rexp x

Next tactic:
rw [← neg_neg x, Real.exp_neg]
theorem exp_pos (x : ℝ) : 0 < exp x :=
  (le_total 0 x).elim (lt_of_lt_of_le zero_lt_one ∘ one_le_exp) fun h => by
    rw [← neg_neg x, Real.exp_neg]
    

Proof state:
x✝ y x : ℝ
h : x ≤ 0
⊢ 0 < (rexp (-x))⁻¹

Next tactic:
exact inv_pos.2 (lt_of_lt_of_le zero_lt_one (one_le_exp (neg_nonneg.2 h)))
lemma exp_abs_le (x : ℝ) : exp |x| ≤ exp x + exp (-x) := by
  

Proof state:
x✝ y x : ℝ
⊢ rexp (abs' x) ≤ rexp x + rexp (-x)

Next tactic:
cases le_total x 0
lemma exp_abs_le (x : ℝ) : exp |x| ≤ exp x + exp (-x) := by
  cases le_total x 0 <;> 

Proof state:
case inl
x✝ y x : ℝ
h✝ : x ≤ 0
⊢ rexp (abs' x) ≤ rexp x + rexp (-x)

Next tactic:
simp [abs_of_nonpos, _root_.abs_of_nonneg, exp_nonneg, *]
lemma exp_abs_le (x : ℝ) : exp |x| ≤ exp x + exp (-x) := by
  cases le_total x 0 <;> 

Proof state:
case inr
x✝ y x : ℝ
h✝ : 0 ≤ x
⊢ rexp (abs' x) ≤ rexp x + rexp (-x)

Next tactic:
simp [abs_of_nonpos, _root_.abs_of_nonneg, exp_nonneg, *]
@[mono]
theorem exp_strictMono : StrictMono exp := fun x y h => by
  

Proof state:
x✝ y✝ x y : ℝ
h : x < y
⊢ rexp x < rexp y

Next tactic:
rw [← sub_add_cancel y x, Real.exp_add]
@[mono]
theorem exp_strictMono : StrictMono exp := fun x y h => by
  rw [← sub_add_cancel y x, Real.exp_add]
  

Proof state:
x✝ y✝ x y : ℝ
h : x < y
⊢ rexp x < rexp (y - x) * rexp x

Next tactic:
exact (lt_mul_iff_one_lt_left (exp_pos _)).2
      (lt_of_lt_of_le (by linarith) (add_one_le_exp_of_nonneg (by linarith)))
@[mono]
theorem exp_strictMono : StrictMono exp := fun x y h => by
  rw [← sub_add_cancel y x, Real.exp_add]
  exact (lt_mul_iff_one_lt_left (exp_pos _)).2
      (lt_of_lt_of_le (by 

Proof state:
x✝ y✝ x y : ℝ
h : x < y
⊢ 1 < y - x + 1

Next tactic:
linarith
@[mono]
theorem exp_strictMono : StrictMono exp := fun x y h => by
  rw [← sub_add_cancel y x, Real.exp_add]
  exact (lt_mul_iff_one_lt_left (exp_pos _)).2
      (lt_of_lt_of_le (by linarith) (add_one_le_exp_of_nonneg (by 

Proof state:
x✝ y✝ x y : ℝ
h : x < y
⊢ 0 ≤ y - x

Next tactic:
linarith
@[simp]
theorem one_lt_exp_iff {x : ℝ} : 1 < exp x ↔ 0 < x := by 

Proof state:
x✝ y x : ℝ
⊢ 1 < rexp x ↔ 0 < x

Next tactic:
rw [← exp_zero, exp_lt_exp]
@[simp]
theorem exp_lt_one_iff {x : ℝ} : exp x < 1 ↔ x < 0 := by 

Proof state:
x✝ y x : ℝ
⊢ rexp x < 1 ↔ x < 0

Next tactic:
rw [← exp_zero, exp_lt_exp]
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
m : ℕ
hm : m ∈ filter (fun k => n ≤ k) (range j)
⊢ n ≤ m

Next tactic:
simp at hm
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
m : ℕ
hm : m < j ∧ n ≤ m
⊢ n ≤ m

Next tactic:
tauto
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
m : ℕ
hm : m ∈ filter (fun k => n ≤ k) (range j)
⊢ m < j

Next tactic:
simp at hm
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
m : ℕ
hm : m < j ∧ n ≤ m
⊢ m < j

Next tactic:
tauto
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
m : ℕ
hm : m ∈ filter (fun k => n ≤ k) (range j)
⊢ 1 / ↑(Nat.factorial m) = 1 / ↑(Nat.factorial ((fun m x => m - n) m hm + n))

Next tactic:
rw [tsub_add_cancel_of_le]
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
m : ℕ
hm : m ∈ filter (fun k => n ≤ k) (range j)
⊢ n ≤ m

Next tactic:
simp at *
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
m : ℕ
hm : m < j ∧ n ≤ m
⊢ n ≤ m

Next tactic:
tauto
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
a₁ a₂ : ℕ
ha₁ : a₁ ∈ filter (fun k => n ≤ k) (range j)
ha₂ : a₂ ∈ filter (fun k => n ≤ k) (range j)
h : (fun m x => m - n) a₁ ha₁ = (fun m x => m - n) a₂ ha₂
⊢ a₁ = a₂

Next tactic:
rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
a₁ a₂ : ℕ
ha₁ : a₁ ∈ filter (fun k => n ≤ k) (range j)
ha₂ : a₂ ∈ filter (fun k => n ≤ k) (range j)
h : a₂ + n - n = a₁
⊢ n ≤ a₂ + n

Next tactic:
simp at *
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
a₁ a₂ : ℕ
ha₁ : a₁ ∈ filter (fun k => n ≤ k) (range j)
ha₂ : a₂ ∈ filter (fun k => n ≤ k) (range j)
h : a₁ = (fun m x => m - n) a₂ ha₂ + n
⊢ n ≤ a₂

Next tactic:
simp at *
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
a₁ a₂ : ℕ
ha₁ : a₁ ∈ filter (fun k => n ≤ k) (range j)
ha₂ : a₂ ∈ filter (fun k => n ≤ k) (range j)
h : (fun m x => m - n) a₁ ha₁ = (fun m x => m - n) a₂ ha₂
⊢ n ≤ a₁

Next tactic:
simp at *
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
a₁ a₂ : ℕ
ha₂ : a₂ ∈ filter (fun k => n ≤ k) (range j)
h : a₁ = a₂ - n + n
ha₁ : a₁ < j ∧ n ≤ a₁
⊢ n ≤ a₂

Next tactic:
aesop
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
a₁ a₂ : ℕ
ha₁ : a₁ ∈ filter (fun k => n ≤ k) (range j)
ha₂ : a₂ ∈ filter (fun k => n ≤ k) (range j)
h : a₁ - n = a₂ - n
⊢ n ≤ a₁

Next tactic:
aesop
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> aesop)
        fun b hb =>
        ⟨b + n,
          mem_filter.2 ⟨mem_range.2 <| lt_tsub_iff_right.mp (mem_range.1 hb), Nat.le_add_left _ _⟩,
          by 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
b : ℕ
hb : b ∈ range (j - n)
⊢ b = (fun m x => m - n) (b + n) (_ : b + n ∈ filter (fun k => n ≤ k) (range j))

Next tactic:
dsimp
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> aesop)
        fun b hb =>
        ⟨b + n,
          mem_filter.2 ⟨mem_range.2 <| lt_tsub_iff_right.mp (mem_range.1 hb), Nat.le_add_left _ _⟩,
          by dsimp; 

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
b : ℕ
hb : b ∈ range (j - n)
⊢ b = b + n - n

Next tactic:
rw [add_tsub_cancel_right]
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> aesop)
        fun b hb =>
        ⟨b + n,
          mem_filter.2 ⟨mem_range.2 <| lt_tsub_iff_right.mp (mem_range.1 hb), Nat.le_add_left _ _⟩,
          by dsimp; rw [add_tsub_cancel_right]⟩
    _ ≤ ∑ m in range (j - n), ((n.factorial : α) * (n.succ : α) ^ m)⁻¹ := by
      

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
⊢ ∑ m in range (j - n), 1 / ↑(Nat.factorial (m + n)) ≤ ∑ m in range (j - n), (↑(Nat.factorial n) * ↑(Nat.succ n) ^ m)⁻¹

Next tactic:
simp_rw [one_div]
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> aesop)
        fun b hb =>
        ⟨b + n,
          mem_filter.2 ⟨mem_range.2 <| lt_tsub_iff_right.mp (mem_range.1 hb), Nat.le_add_left _ _⟩,
          by dsimp; rw [add_tsub_cancel_right]⟩
    _ ≤ ∑ m in range (j - n), ((n.factorial : α) * (n.succ : α) ^ m)⁻¹ := by
      simp_rw [one_div]
      

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
⊢ ∑ x in range (j - n), (↑(Nat.factorial (x + n)))⁻¹ ≤ ∑ m in range (j - n), (↑(Nat.factorial n) * ↑(Nat.succ n) ^ m)⁻¹

Next tactic:
gcongr
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> aesop)
        fun b hb =>
        ⟨b + n,
          mem_filter.2 ⟨mem_range.2 <| lt_tsub_iff_right.mp (mem_range.1 hb), Nat.le_add_left _ _⟩,
          by dsimp; rw [add_tsub_cancel_right]⟩
    _ ≤ ∑ m in range (j - n), ((n.factorial : α) * (n.succ : α) ^ m)⁻¹ := by
      simp_rw [one_div]
      gcongr
      · 

Proof state:
case h.h
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
i✝ : ℕ
a✝ : i✝ ∈ range (j - n)
⊢ ↑(Nat.factorial n) * ↑(Nat.succ n) ^ i✝ ≤ ↑(Nat.factorial (i✝ + n))

Next tactic:
rw [← Nat.cast_pow, ← Nat.cast_mul, Nat.cast_le, add_comm]
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> aesop)
        fun b hb =>
        ⟨b + n,
          mem_filter.2 ⟨mem_range.2 <| lt_tsub_iff_right.mp (mem_range.1 hb), Nat.le_add_left _ _⟩,
          by dsimp; rw [add_tsub_cancel_right]⟩
    _ ≤ ∑ m in range (j - n), ((n.factorial : α) * (n.succ : α) ^ m)⁻¹ := by
      simp_rw [one_div]
      gcongr
      · rw [← Nat.cast_pow, ← Nat.cast_mul, Nat.cast_le, add_comm]
        

Proof state:
case h.h
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
i✝ : ℕ
a✝ : i✝ ∈ range (j - n)
⊢ Nat.factorial n * Nat.succ n ^ i✝ ≤ Nat.factorial (n + i✝)

Next tactic:
exact Nat.factorial_mul_pow_le_factorial
theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m in filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n) :=
  calc
    (∑ m in filter (fun k => n ≤ k) (range j), (1 / m.factorial : α)) =
        ∑ m in range (j - n), (1 / ((m + n).factorial : α)) :=
      sum_bij (fun m _ => m - n)
        (fun m hm =>
          mem_range.2 <|
            (tsub_lt_tsub_iff_right (by simp at hm; tauto)).2 (by simp at hm; tauto))
        (fun m hm => by rw [tsub_add_cancel_of_le]; simp at *; tauto)
        (fun a₁ a₂ ha₁ ha₂ h => by
          rwa [tsub_eq_iff_eq_add_of_le, tsub_add_eq_add_tsub, eq_comm, tsub_eq_iff_eq_add_of_le,
              add_left_inj, eq_comm] at h <;>
          simp at * <;> aesop)
        fun b hb =>
        ⟨b + n,
          mem_filter.2 ⟨mem_range.2 <| lt_tsub_iff_right.mp (mem_range.1 hb), Nat.le_add_left _ _⟩,
          by dsimp; rw [add_tsub_cancel_right]⟩
    _ ≤ ∑ m in range (j - n), ((n.factorial : α) * (n.succ : α) ^ m)⁻¹ := by
      simp_rw [one_div]
      gcongr
      · rw [← Nat.cast_pow, ← Nat.cast_mul, Nat.cast_le, add_comm]
        exact Nat.factorial_mul_pow_le_factorial
    _ = (n.factorial : α)⁻¹ * ∑ m in range (j - n), (n.succ : α)⁻¹ ^ m := by
      

Proof state:
α : Type u_1
inst✝ : LinearOrderedField α
n j : ℕ
hn : 0 < n
⊢ ∑ m in range (j - n), (↑(Nat.factorial n) * ↑(Nat.succ n) ^ m)⁻¹ =
    (↑(Nat.factorial n))⁻¹ * ∑ m in range (j - n), (↑(Nat.succ n))⁻¹ ^ m

Next tactic:
simp [mul_inv, mul_sum.symm, sum_mul.symm, mul_comm, inv_pow]