[math-fun] Marriage theorem generalization