  On a suitable category of formal schemes equipped with codimension functions
we construct a canonical pseudofunctor (-)^# taking values in the corresponding
categories of Cousin complexes. Cousin complexes on such a formal scheme X
functorially represent derived-category objects F by the local cohomologies
H_x^{codim(x)}(F) (x \in X) together with "residue maps" from the cohomology at
x to that at each immediate specialization of x; this representation is
faithful when restricted to F which are Cohen-Macaulay (CM), i.e., H_x^i(F)=0
unless i=codim(x). Formal schemes provide a framework for treating local and
global duality as aspects of a single theory. One motivation has been to gain a
better understanding of the close relation between local properties of residues
and global variance properties of dualizing complexes (which are CM). Our
construction, depending heavily on local phenomena, is inspired by, but
generalizes and makes more concrete, that of the classical pseudofunctor
(-)^\Delta taking values in residual complexes, on which the proof of
Grothendieck's (global) Duality Theorem in Hartshorne's "Residues and Duality"
is based. Indeed, it is shown in a subsequent paper by Sastry that (-)^# is a
good concrete approximation to the fundamental duality pseudofunctor (-)^!. The
pseudofunctor (-)^# takes residual complexes to residual complexes, so contains
a canonical representative of (-)^\Delta; and it generalizes as well several
other functorial (but not pseudofunctorial) constructions of residual complexes
which appeared in the 1990s.
