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

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
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
induction' n with n ihn
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
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
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) _]
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
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
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)
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))
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
convert sum_le_sum this
no goals
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))
simp [pow_succ, two_mul]
no goals
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
simp
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
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
rw [sum_range_succ, ← sum_Ico_consecutive]
no goals
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
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) _]