I'm trying to prove the cancellation law for natural numbers. This is my proof so far:
Proposition add_cancellation : forall a b c : nat,
a + b = a + c -> b = c.
Proof.
intros a b c. induction a as [| a' IHa' ].
- (* a = 0 *)
simpl. symmetry. rewrite -> H. reflexivity.
- (* a = S n' *)
rewrite -> add_comm, S_assoc, add_comm.
assert (S a' + c = S (a' + c)) as H.
{
rewrite -> add_comm, S_assoc, add_comm. reflexivity.
}
rewrite -> H.
The current state of the proof is
a', b, c: nat
IHa': a' + b = a' + c -> b = c
H: S a' + c = S (a' + c)
---------------------------------
1/1
S (a' + b) = S (a' + c) -> b = c
This is largely following Terence Tao's proof for the law:
where Axiom 2.4 can be written as:
Theorem S_n_eq_S_m_if_n_eq_m : forall n m : nat,
(S n = S m) -> n = m.
It's clear how 2.4 is supposed to apply here: S(a' + b) = S(a' + c)
should simplify to a' + b = a' + c
. However it doesn't, and this is where I'm getting stuck. Why can't I apply axiom 2.4 here?