but that doesn't mean that it can't come from nothing. According to the uncertainty principle, particles (and therefore energy) pop in and out of existence all the time. These virtual particles are always created in pairs such that the total energy is zero and cosmologists have found....
Because if you add up the total energy of a flat universe, the result is precisely zero. How can this be? When you include the effects of gravity, energy comes in two forms. Mass corresponds to positive energy, but the gravitational attraction between massive objects can correspond to negative energy. If the positive energy and the negative gravitational energy of the universe cancel out, we end up in a flat universe.
Think about it: If our universe arose spontaneously from nothing at all, one might predict that its total energy should be zero. And when we measure the total energy of the universe, which could have been anything, the answer turns out to be the only one consistent with this possibility.
Our Spontaneous Universe