President Donald Trump and Elon Musk’s months-long alliance imploded in spectacular fashion Thursday as the world’s richest man and its most powerful engaged in a nasty, public back-and-forth on their respective social media platforms—just months after the two formed a friendship so close Musk sometimes slept at the White House.