The tactic
FIRST_X_ASSUM SUBST_ALL_TAC
searches the assumptions for an equality and causes its
right hand side to be substituted for its left hand side throughout
the goal and assumptions. It also removes the equality from the
assumption list. Using FIRST_ASSUM above would leave an equality on
the assumption list of the form x = x. The tactic
FIRST_X_ASSUM MATCH_MP_TAC
searches the assumption list for an implication whose conclusion
matches the goal, reducing the goal to the antecedent of the corresponding
instance of this implication and removing the implication from the
assumption list.