How to "flip" an equality sentence in Coq?
If you are looking for one tactic, then the easytactic immediately processes this:
Coq < Parameter x y : nat.
x is assumed
y is assumed
Coq < Lemma sym : x = y -> y = x.
1 subgoal
============================
x = y -> y = x
sym < easy.
No more subgoals.
If you look at the proof that the tactics found, the easykey part is the application eq_sym:
sym < Show Proof.
(fun H : x = y => eq_sym H)
auto . , , symmetry ( intro):
sym < Restart.
1 subgoal
============================
x = y -> y = x
sym < symmetry.
1 subgoal
H : x = y
============================
x = y
sym < assumption.
No more subgoals.
sym < Show Proof.
(fun H : x = y => eq_sym H)