Artificiell intelligens en avgörande nyckel för teknikföretag i kampen för att sänka koldioxidutsläppen, anser it-jätten Apples vd Tim Cook.