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)

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)
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)
induction' n with n ihn
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)
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)
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]
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)
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)
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
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)
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)
convert sum_le_sum this
no goals
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)
simp [pow_succ, two_mul]
no goals
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)
simp
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
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)
rw [sum_range_succ, ← sum_Ico_consecutive]
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
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
exact add_le_add ihn this
no goals
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
exacts [n.one_le_two_pow, Nat.pow_le_pow_of_le_right zero_lt_two n.le_succ]