  The long-time behavior of weakly interacting bosons moving in a
two-dimensional optical lattice and coupled to a lossy cavity is investigated
numerically in the regime of high particle filling. The truncated Wigner
representation allows us to take into full account the dynamics of the cavity
mode, quantum fluctuations, and self-organization of individual runs. We
observe metastability at very long times and superfluid quasi-long range order,
in sharp contrast with the true long range order found in the ground state of
the approximate Bose-Hubbard model with extended interactions, obtained by
adiabatically eliminating the cavity field. As the strength of the light-matter
coupling increases, the system first becomes supersolid at the Dicke
superradiant transition and then turns into a charge-density wave via the
Berezinskii-Kosterlitz-Thouless mechanism. The two phase transitions are
characterized via an accurate finite-size scaling.
