First I have plus_assoc
ready.
Theorem plus_assoc : forall n m p : nat,
n + (m + p) = (n + m) + p.
for simplicity we omit the proof of plus_assoc
.
now I want to prove plus_swap
:
Theorem plus_swap : forall n m p : nat,
n + (m + p) = m + (n + p).
Proof. intros n m p. rewrite -> plus_assoc. ...
the equation was rewritten into n + m + p = m + ( n + p )
, rather than the expected (n + m) + p = m + (n + p)
. why?