Theorem: Nat.ofDigits_lt_base_pow_length'
File: Mathlib/Data/Nat/Digits.lean

tactic: induction' l with hd tl IH
state_before: n b : ℕ
l : List ℕ
hl : ∀ (x : ℕ), x ∈ l → x < b + 2
⊢ ofDigits (b + 2) l < (b + 2) ^ List.length l

tactic: simp [ofDigits]
state_before: case nil
n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hl : ∀ (x : ℕ), x ∈ [] → x < b + 2
⊢ ofDigits (b + 2) [] < (b + 2) ^ List.length []

tactic: rw [ofDigits, List.length_cons, pow_succ]
state_before: case cons
n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
⊢ ofDigits (b + 2) (hd :: tl) < (b + 2) ^ List.length (hd :: tl)

tactic: have : (ofDigits (b + 2) tl + 1) * (b + 2) ≤ (b + 2) ^ tl.length * (b + 2) :=
  mul_le_mul (IH fun x hx => hl _ (List.mem_cons_of_mem _ hx)) (by rfl) (by simp only [zero_le])
    (Nat.zero_le _)
state_before: case cons
n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
⊢ ↑hd + (b + 2) * ofDigits (b + 2) tl < (b + 2) ^ List.length tl * (b + 2)

tactic: suffices ↑hd < b + 2 by linarith
state_before: case cons
n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
this : (ofDigits (b + 2) tl + 1) * (b + 2) ≤ (b + 2) ^ List.length tl * (b + 2)
⊢ ↑hd + (b + 2) * ofDigits (b + 2) tl < (b + 2) ^ List.length tl * (b + 2)

tactic: norm_cast
state_before: case cons
n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
this : (ofDigits (b + 2) tl + 1) * (b + 2) ≤ (b + 2) ^ List.length tl * (b + 2)
⊢ hd < b + 2

tactic: exact hl hd (List.mem_cons_self _ _)
state_before: case cons
n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
this : (ofDigits (b + 2) tl + 1) * (b + 2) ≤ (b + 2) ^ List.length tl * (b + 2)
⊢ hd < b + 2

tactic: rfl
state_before: n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
⊢ b + 2 ≤ b + 2

tactic: simp only [zero_le]
state_before: n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
⊢ 0 ≤ b + 2

tactic: linarith
state_before: n b : ℕ
l : List ℕ
hl✝ : ∀ (x : ℕ), x ∈ l → x < b + 2
hd : ℕ
tl : List ℕ
IH : (∀ (x : ℕ), x ∈ tl → x < b + 2) → ofDigits (b + 2) tl < (b + 2) ^ List.length tl
hl : ∀ (x : ℕ), x ∈ hd :: tl → x < b + 2
this✝ : (ofDigits (b + 2) tl + 1) * (b + 2) ≤ (b + 2) ^ List.length tl * (b + 2)
this : hd < b + 2
⊢ ↑hd + (b + 2) * ofDigits (b + 2) tl < (b + 2) ^ List.length tl * (b + 2)