Theorem: Finset.sum_condensed_le'
File: Mathlib/Analysis/PSeries.lean

tactic: induction' n with n ihn
state_before: M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
⊢ ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k

tactic: suffices 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k by
  rw [sum_range_succ, ← sum_Ico_consecutive]
  exacts [add_le_add ihn this,
    (add_le_add_right n.one_le_two_pow _ : 1 + 1 ≤ 2 ^ n + 1),
    add_le_add_right (Nat.pow_le_pow_of_le_right zero_lt_two n.le_succ) _]
state_before: case succ
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
⊢ ∑ k in range (Nat.succ n), 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ Nat.succ n + 1), f k

tactic: have : ∀ k ∈ Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f (2 ^ (n + 1)) ≤ f k := fun k hk =>
  hf (n.one_le_two_pow.trans_lt <| (Nat.lt_succ_of_le le_rfl).trans_le (mem_Ico.mp hk).1)
    (Nat.le_of_lt_succ <| (mem_Ico.mp hk).2)
state_before: case succ
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
⊢ 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k

tactic: convert sum_le_sum this
state_before: case succ
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
this : ∀ (k : ℕ), k ∈ Ico (2 ^ n + 1) (2 ^ (n + 1) + 1) → f (2 ^ (n + 1)) ≤ f k
⊢ 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k

tactic: simp [pow_succ, two_mul]
state_before: case h.e'_3
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
this : ∀ (k : ℕ), k ∈ Ico (2 ^ n + 1) (2 ^ (n + 1) + 1) → f (2 ^ (n + 1)) ≤ f k
⊢ 2 ^ n • f (2 ^ (n + 1)) = ∑ i in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f (2 ^ (n + 1))

tactic: simp
state_before: case zero
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
⊢ ∑ k in range Nat.zero, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ Nat.zero + 1), f k

tactic: rw [sum_range_succ, ← sum_Ico_consecutive]
state_before: M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
this : 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k
⊢ ∑ k in range (Nat.succ n), 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ Nat.succ n + 1), f k

tactic: exacts [add_le_add ihn this,
  (add_le_add_right n.one_le_two_pow _ : 1 + 1 ≤ 2 ^ n + 1),
  add_le_add_right (Nat.pow_le_pow_of_le_right zero_lt_two n.le_succ) _]
state_before: M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
this : 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k
⊢ ∑ x in range n, 2 ^ x • f (2 ^ (x + 1)) + 2 ^ n • f (2 ^ (n + 1)) ≤
    ∑ i in Ico 2 ?n, f i + ∑ i in Ico ?n (2 ^ Nat.succ n + 1), f i

case n
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
this : 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k
⊢ ℕ

case hmn
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
this : 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k
⊢ 2 ≤ ?n

case hnk
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in range n, 2 ^ k • f (2 ^ (k + 1)) ≤ ∑ k in Ico 2 (2 ^ n + 1), f k
this : 2 ^ n • f (2 ^ (n + 1)) ≤ ∑ k in Ico (2 ^ n + 1) (2 ^ (n + 1) + 1), f k
⊢ ?n ≤ 2 ^ Nat.succ n + 1