Alphabet became the fourth company to reach a $4 trillion market cap after shares jumped on news Apple will use Google’s Gemini AI for future products.