Reasoning about Optimal Stable Matchings