  Early studies proposed a connection between cuprate superconductivity and
fractionalized spin liquid states. But the low temperature phase diagram is
dominated by states without fractionalization, with a competition between
superconductivity and charge-ordered states which break translational symmetry.
Our theory uncovers novel features associated with a particular spin-liquid
presumed to underlie the pseudogap metal, and shows that it has multiple
nearly-degenerate instabilities to confinement of fractionalized excitations,
leading to antiferromagnetism, $d$-wave superconductivity, and/or charge order.
Our theory provides routes to resolving a number of open puzzles on the cuprate
phase diagram.
  The spin liquid is described by a SU(2) gauge theory of $N_f=2$ massless
fundamental Dirac fermions, has an emergent SO(5)$_f$ global symmetry, and is
presumed to confine at low energies to the N\'eel state. At non-zero doping (or
smaller Hubbard repulsion at half-filling) we argue that confinement occurs via
the Higgs condensation of bosonic chargons carrying fundamental SU(2) gauge
charges moving in $\pi$ flux. At half-filling, the low energy Higgs sector has
$N_b=2$ relativistic bosons with a possible emergent SO(5)$_b$ global symmetry
describing rotations between a $d$-wave superconductor, period-2 charge
stripes, and the time-reversal breaking `$d$-density wave' state. We propose a
deconfined quantum critical point between a confining state which breaks
SO(5)$_f$ and a confining state which breaks SO(5)$_b$. The pattern of symmetry
breaking within both SO(5)s is determined by terms likely irrelevant at the
critical point, which can be chosen to obtain a transition between N\'eel order
and $d$-wave superconductivity. A similar theory applies at non-zero doping and
large $U$, with longer-range couplings of the chargons leading to charge order
with longer periods.
