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

tactic: apply Nat.strongInductionOn m
state_before: n b m : ℕ
⊢ ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
state_after: n b m : ℕ
⊢ ∀ (n : ℕ), (∀ m < n, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2) → ∀ {d : ℕ}, d ∈ (b + 2).digits n → d < b + 2

tactic: intro n IH d hd
state_before: n b m : ℕ
⊢ ∀ (n : ℕ), (∀ m < n, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2) → ∀ {d : ℕ}, d ∈ (b + 2).digits n → d < b + 2
state_after: n✝ b m n : ℕ
IH : ∀ m < n, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
d : ℕ
hd : d ∈ (b + 2).digits n
⊢ d < b + 2

tactic: cases' n with n
state_before: n✝ b m n : ℕ
IH : ∀ m < n, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
d : ℕ
hd : d ∈ (b + 2).digits n
⊢ d < b + 2
state_after: case zero
n b m d : ℕ
IH : ∀ m < 0, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ (b + 2).digits 0
⊢ d < b + 2

case succ
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ (b + 2).digits (n + 1)
⊢ d < b + 2

tactic: rw [digits_add_two_add_one] at hd
state_before: case succ
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ (b + 2).digits (n + 1)
⊢ d < b + 2
state_after: case succ
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ (n + 1) % (b + 2) :: (b + 2).digits ((n + 1) / (b + 2))
⊢ d < b + 2

tactic: cases hd
state_before: case succ
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ (n + 1) % (b + 2) :: (b + 2).digits ((n + 1) / (b + 2))
⊢ d < b + 2
state_after: case succ.head
n✝ b m n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
⊢ (n + 1) % (b + 2) < b + 2

case succ.tail
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
a✝ : List.Mem d ((b + 2).digits ((n + 1) / (b + 2)))
⊢ d < b + 2

tactic: rw [digits_zero] at hd
state_before: case zero
n b m d : ℕ
IH : ∀ m < 0, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ (b + 2).digits 0
⊢ d < b + 2
state_after: case zero
n b m d : ℕ
IH : ∀ m < 0, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ []
⊢ d < b + 2

tactic: cases hd
state_before: case zero
n b m d : ℕ
IH : ∀ m < 0, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
hd : d ∈ []
⊢ d < b + 2
state_after: no goals

tactic: exact n.succ.mod_lt (by simp)
state_before: case succ.head
n✝ b m n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
⊢ (n + 1) % (b + 2) < b + 2
state_after: no goals

tactic: simp
state_before: n✝ b m n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
⊢ b + 2 > 0
state_after: no goals

tactic: apply IH ((n + 1) / (b + 2))
state_before: case succ.tail
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
a✝ : List.Mem d ((b + 2).digits ((n + 1) / (b + 2)))
⊢ d < b + 2
state_after: case succ.tail.a
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
a✝ : List.Mem d ((b + 2).digits ((n + 1) / (b + 2)))
⊢ (n + 1) / (b + 2) < n + 1

case succ.tail.a
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
a✝ : List.Mem d ((b + 2).digits ((n + 1) / (b + 2)))
⊢ d ∈ (b + 2).digits ((n + 1) / (b + 2))

tactic: apply Nat.div_lt_self <;> omega
state_before: case succ.tail.a
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
a✝ : List.Mem d ((b + 2).digits ((n + 1) / (b + 2)))
⊢ (n + 1) / (b + 2) < n + 1
state_after: no goals

tactic: assumption
state_before: case succ.tail.a
n✝ b m d n : ℕ
IH : ∀ m < n + 1, ∀ {d : ℕ}, d ∈ (b + 2).digits m → d < b + 2
a✝ : List.Mem d ((b + 2).digits ((n + 1) / (b + 2)))
⊢ d ∈ (b + 2).digits ((n + 1) / (b + 2))
state_after: no goals