Dimension of the State Space of an Ideal Gas

There is a subtle difference between space and dimension. A space can have any any number of dimensions, but a subset of that space can have any dimension less than the space itself.
In any case the dimension of a set is the number of numbers needed to define any element of the set.
Consider the set of points
$\{ (x,x^2) : x \in \mathbb{R} \}$
. This set defines the line
$y=x^2$
which is a curve in the plane. The plane is two dimensional but the curve is one dimensional since only one point
$x$
is needed to define each point on the curve.
This example shows how it is possible for a space to be embedded in a higher dimensional subspace.
The example is illustrative.
$x$
and
$y$
are coordinates on different axes. The coordinates are not independent if one coordinate is a function of the other, or if some coordinates are functions are some other coordinates. Some physical systems are defined by physics properties.
One such is a confined ideal gas. A gas is defined totally by its internal heat energy
$U$
, its temperature
$T$
, its pressure
$p$
and volume
$V$
.
These quantities are not independent however.
$U$
is directly related to
$T$
by the equation
$U= \frac{3}{2} kT$
and we can define
$T$
and hence
$U$
in terms of
$p$
and
$V$
by the equation
$pV=nRT$

where
$n$
is the number of mols and
$R=8.314 J/mol/K$
is the Universal molar gas constant.
$U$
and
$T$
are not needed to describe the state of a gas. We only need
$p$
and
$V$
- or in fact any two of
$U, \: T, |; p, V$
. The dimension of the state space of an ideal gas is 2 and we can plot any state of an ideal gas in the plane.