Coq beginner here.
I have the following silly theorems:
Theorem plus_same : forall a b c : nat,
a+b=a+c -> b=c.
Proof. Admitted.
Theorem advanced_commutivity:
forall x y z w : nat, x + y + (z+w) = x + z + (y + w).
Proof.
intros x y z w.
apply (plus_same x (y + (z+w)) (z + (y + w))).
However, when I try to run the apply
line, I get an error:
Unable to unify "y + (z + w) = z + (y + w)" with
"x + y + (z + w) = x + z + (y + w)".
Do I need to change my hypothesis here? How can I apply plus_same
here to the arguments in advanced_commutivity
proof?