I was wondering if there is an inversion-like tactic in Coq that works on the goal instead of on one of the hypotheses? That is, if there is some tactic that can invert identical constructors in equalities on the goal.
For a silly example,
Goal forall x :nat, 2 + x + 3 = x + 5.
intros. simpl.
, which gives
S ( S (x + 3) ) = S ( S ( S ( ... x)...)
I wanted to invert the first two S, so that what remains to prove is
x + 3 = 3 + x
My questions are
Is this "inversion" of constructors sound?
If the logic is sound, is there a tactic in Coq to do it?