  The long-standing debate whether the phase transition in the Dicke model can
be realized with dipoles in electromagnetic fields is yet an unsettled one. The
well-known statement often referred to as the "no-go theorem", asserts that the
so-called A-square term, just in the vicinity of the critical point, becomes
relevant enough to prevent the system from undergoing a phase transition. At
variance with this common belief, in this paper we prove that the Dicke model
does give a consistent description of the interaction of light field with the
internal excitation of atoms, but in the dipole gauge of quantum
electrodynamics. The phase transition cannot be excluded by principle and a
spontaneous transverse-electric mean field may appear. We point out that the
single-mode approximation is crucial: the proper treatment has to be based on
cavity QED, wherefore we present a systematic derivation of the dipole gauge
inside a perfect Fabry-P\'erot cavity from first principles. Besides the impact
on the debate around the Dicke phase transition, such a cleanup of the
theoretical ground of cavity QED is important because currently there are many
emerging experimental approaches to reach strong or even ultrastrong coupling
between dipoles and photons, which demand a correct treatment of the Dicke
model parameters.
