Theorem: N.add_assoc (LeanTeaching/TD/TD02_sol.lean)

State before:
S : Type
image_zero : S
image_succ : N → S → S
n m a b c : N
⊢ a + b + c = a + (b + c)
Tactic:
induction c with
| zero =>
  change a + b + 0 = a + (b + 0)
  rw [add_zero, add_zero]
| succ c hrec =>
  rw [add_succ, add_succ, add_succ, hrec]
State after:
no goals

State before:
case zero
S : Type
image_zero : S
image_succ : N → S → S
n m a b c : N
⊢ a + b + zero = a + (b + zero)
Tactic:
change a + b + 0 = a + (b + 0)
State after:
case zero
S : Type
image_zero : S
image_succ : N → S → S
n m a b c : N
⊢ a + b + 0 = a + (b + 0)

State before:
case zero
S : Type
image_zero : S
image_succ : N → S → S
n m a b c : N
⊢ a + b + 0 = a + (b + 0)
Tactic:
rw [add_zero, add_zero]
State after:
no goals

State before:
case succ
S : Type
image_zero : S
image_succ : N → S → S
n m a b c✝ c : N
hrec : a + b + c = a + (b + c)
⊢ a + b + succ c = a + (b + succ c)
Tactic:
rw [add_succ, add_succ, add_succ, hrec]
State after:
no goals