Let $\pi :X\,\to \,S$ be a finite type morphism of noetherian schemes. A smooth formal embedding of $X$ (over $S$) is a bijective closed immersion $X\,\subset \,\mathfrak{X}$ , where $\mathfrak{X}$ is a noetherian formal scheme, formally smooth over $S$. An example of such an embedding is the formal completion $\mathfrak{X}={{Y}_{/X}}$ where $X\,\subset \,Y$ is an algebraic embedding. Smooth formal embeddings can be used to calculate algebraic De Rham(co)homology.
Our main application is an explicit construction of the Grothendieck residue complex when $S$ is a regular scheme. By definition the residue complex is the Cousin complex of ${{\pi }^{!}}{{O}_{S}}$, as in $[\text{RD}]$. We start with $\text{I-C}$. Huang's theory of pseudofunctors on modules with 0-dimensional support, which provides a graded sheaf
${{\oplus }_{q}}K_{X/S}^{q}.$
We then use smooth formal embeddings to obtain the coboundary operator
$\delta :K_{X/S}^{q}\to K_{X/S}^{q+1}.$
We exhibit a canonical isomorphism between the complex $K_{X/S}^{\cdot },\delta $ and the residue complex of $[\text{RD}]$. When $\pi $ is equidimensional of dimension $n$ and generically smooth we show that ${{\text{H}}^{-n}}K_{X/S}^{\cdot }$ is canonically isomorphic to to the sheaf of regular differentials of Kunz-Waldi $[\text{KW}]$.
Another issue we discuss is Grothendieck Duality on a noetherian formal scheme $\mathfrak{X}$ . Our results on duality are used in the construction of $K_{X/S}^{\cdot }$.