Mamdani's victory is a case study in modern coalition-building.