Lovelock's theorem