TITLE: Is there a general projection formula for morphisms of ringed topoi?
QUESTION [5 upvotes]: What's the general projection formula in algebraic geometry, for instance on the level of derived categories of ringed topoi? And what's the reference? I guess it might be in SGA 4, but couldn't find it. 
Two examples:

Zariski site, $D^b_{qcoh}$ on schemes. Let $f:X\to Y$ be a proper map of noetherian schemes (maybe there are some other mild conditions), and let $F\in D^b_{qcoh}(X)$ and $G\in D^b_{qcoh}(Y).$ Then $(Rf_*F)\otimes^L G=Rf_*(F\otimes^L Lf^*G)$. 
Etale site, say ringed by a torsion ring like $Z/n.$ Let $f:X\to Y$ be a (seperated; but this condition can be removed. See for instancde Laszlo and Olsson, The six operations on Artin stacks...) map of schemes of finite type over some base $S$ ($S$ may need to satisfy some assumptions, in order for the classical results in SGA 4/4.5 or Gabber's new results on finiteness of $f_*$ and dualizing complexes to work; but let's be sloppy). Let $F\in D^-_c(X,Z/n)$ and $G\in D^-_c(Y,Z/n).$ Then $Rf_!F\otimes^L G=Rf_!(F\otimes^L f^*G).$ 

We used $f_!$ in example 2 in order to allow $F$ and $G$ to be in $D^-_c$ rather than $D^b_c.$ If one restricts to $D^b_c,$ is it also true for $f_*?$

REPLY [4 votes]: In the context of sheaves of $\mathcal O_X$-modules,
there is the following reference: Prop. 3.9.4 in Lipman's
Notes on derived functors and Grothendieck duality.
A closely related result is in Neeman's paper The Grothendieck duality theorem ...; see Prop. 5.3.
I'm not sure that analogous results should be expected to hold in arbitrary generality;
for example, both references place a restriction on the base scheme, and require quasi-coherence assumptions.  (In some sense, one has to reduce to the locally free case,
where the statement is obvious.  Quasi-coherent sheaves then admit locally free resolutions.
The proofs of the cited results apply some form of this argument in rather subtle and sophisticated ways.)