Spin-polarization transition in the two-dimensional electron gas