Getting started with Coq and "Software Foundation" problems, I run into the following example:
Theorem plus_O_n : forall n : nat, 0 + n = n.
Proof.
intros n. simpl. reflexivity. Qed.
Which is proved just fine. When however, I try the right-hand side equation;
Theorem plus_n_O : forall n, n = n + 0.
Proof.
intros n. simpl. (* Doesn't do anything! *)
And this in fact, is one of the excercises in the book, why does simpl
not work in that case. I was trying to be smart, so I reversed the equation using symmetry
.
Theorem plus_n_O : forall n, n = n + 0.
Proof.
intros n. simpl. symmetry. simpl. (* Doesn't do anything still!!! *)
But still no bueno. It's especially weird because symmetry
works as expected and brings my goal to the same form as plus_O_n
.