  Extensions of the Hartree-Fock-Bogoliubov theory are worked out which are
tailored for, (i) the consistent evaluation of fluctuations and correlations
and (ii) the restoration through projection of broken symmetries. For both
purposes we rely on a single variational principle which optimizes the
characteristic function. The Bloch equation is used as a constraint to define
the equilibrium state, and the trial quantities are a density operator and a
Lagrangian multiplier matrix which is akin to an observable. The conditions of
stationarity are respectively a Schr\"odinger-like equation and a Heisenberg--
like equation with an imaginary time running backwards. General conditions for
the trial spaces are stated that warrant the preservation of thermodynamic
relations. When the trial spaces are chosen to be of the
independent-quasi-particle type, the ensuing coupled equations provide an
extension of the Hartree-Fock-Bogoliubov approximation, which optimizes the
characteristic function. Variational expressions for thermodynamic quantities
or characteristic functions are also obtained with projected trial states,
whether an invariance symmetry is broken or not. In particular, the projection
on even or odd particle number is worked out for a pairing Hamiltonian, which
leads to new equations replacing the BCS ones. Qualitative differences between
even and odd systems, depending on the temperature $T$, the level density and
the strength of the pairing force, are investigated analytically and
numerically.
