Theorem: Finset.le_sum_condensed'
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 : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
n : ℕ
⊢ ∑ k in Ico 1 (2 ^ n), f k ≤ ∑ k in range n, 2 ^ k • f (2 ^ k)

tactic: suffices (∑ k in Ico (2 ^ n) (2 ^ (n + 1)), f k) ≤ 2 ^ n • f (2 ^ n) by
  rw [sum_range_succ, ← sum_Ico_consecutive]
  exact add_le_add ihn this
  exacts [n.one_le_two_pow, 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 : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in Ico 1 (2 ^ n), f k ≤ ∑ k in range n, 2 ^ k • f (2 ^ k)
⊢ ∑ k in Ico 1 (2 ^ Nat.succ n), f k ≤ ∑ k in range (Nat.succ n), 2 ^ k • f (2 ^ k)

tactic: have : ∀ k ∈ Ico (2 ^ n) (2 ^ (n + 1)), f k ≤ f (2 ^ n) := fun k hk =>
  hf (pow_pos zero_lt_two _) (mem_Ico.mp hk).1
state_before: case succ
M : Type u_1
inst✝ : OrderedAddCommMonoid M
f : ℕ → M
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
n : ℕ
ihn : ∑ k in Ico 1 (2 ^ n), f k ≤ ∑ k in range n, 2 ^ k • f (2 ^ k)
⊢ ∑ k in Ico (2 ^ n) (2 ^ (n + 1)), f k ≤ 2 ^ n • f (2 ^ n)

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

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

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

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

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

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

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

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

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

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