Given a goal (a = b) → goal[b], creates a new goal goal[a], clearing b.
This is essentially intro h; subst h, but in the case that b is a free variable and has no
forward dependencies implements this without introducing the equality, which can make a difference
in terms of performance.
If substLHS = true, assume (a = b) → goal[a] and create goal goal[b], clearing a.
Also handles heterogeneous equalities in cases where eq_of_heq would apply.