  For a connected Noetherian unstable algebra $R$ over the mod $p$ Steenrod
algebra, we prove versions of theorems of Duflot and Carlson on the depth of
$R$, originally proved when $R$ is the mod $p$ cohomology ring of a finite
group. This recovers the aforementioned results, and also proves versions of
them when $R$ is the mod $p$ cohomology ring of a compact Lie group, a
profinite group with Noetherian cohomology, a Kac--Moody group, a discrete
group of finite virtual cohomological dimension, as well as for certain other
discrete groups. More generally, our results apply to certain finitely
generated unstable $R$-modules. Moreover, we explain the results in the case of
the $p$-local compact groups of Broto, Levi, and Oliver, as well as in the
modular invariant theory of finite groups.
