As pointed out in Vinz's answer, you can find the bijectivity theorem about plus
directly in the Coq standard library. You can also prove it directly using primitive tactics and mathematical induction on a
as follows.
Theorem plus_l_bij: forall a b c : nat, a + b = a + c -> b = c.
Proof.
induction a as [|a'].
intros b c H. apply H.
intros b c H. simpl plus in H. inversion H. apply IHa' in H1. apply H1.
Qed.
After induction a
, the base case a = 0
is trivial.
The proof for the second case a = S a'
, rearranges
S a' + b = S a' + c
to
S (a' + b) = S (a' + c)
and then removes the constructor S
using its bijectivity. Finally, the induction hypothesis can be applied to finish the proof.