  Density functional theory, when applied to systems with $T\neq 0$, is based
on the grand canonical extension of the Hohenberg-Kohn-Sham theorem due to
Mermin (HKSM theorem). While a straightforward canonical ensemble
generalization fails, work in nanopore systems could certainly benefit from
such extension. We show that, if the asymptotic behaviour of the canonical
distribution functions is taken into account, the HKSM theorem can be extended
to the canonical ensemble. We generate $N$-modified correlation and
distribution functions hierarchies and prove that, if they are employed, either
a modified external field or the density profiles can be indistinctly used as
independent variables. We also write down the $N$% -modified free energy
functional and prove that its minimum is reached when the equilibrium values of
the new hierarchy are used. This completes the extension of the HKSM theorem.
