TITLE: A criterion for $F,U$ to be adjoint
QUESTION [5 upvotes]: I'm trying to prove the following statement:

Let $F\dashv U\colon {\cal C}\leftrightarrows {\cal D}$ be an adjunction, and $G \colon {\cal C}^\text{op}\times{\cal D}\to \cal E$ a functor; then there is an isomorphism
  $$\tag{$\star$}
\int_{C\in\cal C} G(C,FC) \cong \int_{D\in\cal D} G(UD,D)
$$

This is somewhat surprising, but in retrospective kind of obvious (it follows from the synergy between dinaturality and the zig-zag identities of the adjunction $F\dashv U$). What I want to prove is a converse of this statement:

In the notation above, if for every functor $G : {\cal C}^\text{op}\times {\cal D}\to \cal E$ there is an isomorphism like $(\star)$ then $F\dashv U$ form an adjoint pair. 

Any clue? The strategy is to build two candidates for unit and counit using $(\star)$ and then prove that they satisfy the zig-zag identities; is it possible to do it in a simple (and possibly nifty) way?

REPLY [7 votes]: Yes, this is true if we assume that the isomorphisms are natural in $G$. We may even restrict to $\mathcal{E}=\mathsf{Set}$. Here is a sketch of the proof.
Consider $G=\mathrm{Hom}_{\mathcal{D}}(F(-),-) : \mathcal{C}^{op} \times \mathcal{D} \to \mathsf{Set}$. Then
$$\int_x G(x,Fx) = \int_x \mathrm{Hom}_{\mathcal{D}}(Fx,Fx) = \mathrm{Hom}(F,F)$$
contains the identity $\mathrm{id}_F$, which gets mapped to an element of
$$\int_y G(Uy,y) = \int_y \mathrm{Hom}_{\mathcal{D}}(FUy,y) = \mathrm{Hom}(FU,\mathrm{id}_{\mathcal{D}}).$$
This is our counit. In the same way, using $G' =\mathrm{Hom}_{\mathcal{C}}(-,U(-)) : \mathcal{C}^{op} \times \mathcal{D} \to \mathsf{Set}$, we construct our unit. Then the assumed naturality should imply the zig-zag-identities, namely with respect to the morphism $G \to G'$ induced by the the unit and the morphism $G' \to G$ induced by the counit (I haven't checked the details).
Details: Let $$\alpha_G : \int_x G(x,Fx) \to \int_y G(Uy,y)$$
be an isomorphism which is natural in $G : \mathcal{C}^{op} \times \mathcal{D} \to \mathsf{Set}$.
Then $\varepsilon_y : F(U(y)) \to y$ is by definition $\alpha_G(\mathrm{id}_F)_y$ for $G=\mathrm{Hom}_{\mathcal{D}}(F(-),-)$, and $\eta_x : x \to U(F(x))$ is by definition $\alpha^{-1}_{G'}(\mathrm{id}_U)_x$ for $G'=\mathrm{Hom}_{\mathcal{C}}(-,U(-))$. We have a morphism $h : G \to G'$ defined by mapping $f:F(x) \to y$ to $U(f)\circ \eta_x : x \to U(F(y))$. By naturality we have $\int_y h_{Uy,y} \circ \alpha_G = \alpha_{G'} \circ \int_x h_{x,Fx}$ as morphisms $\int_x G(x,Fx) \to \int_y G'(Uy,y)$, resp. $\mathrm{Hom}(F,F) \to \mathrm{Hom}(U,U)$. Evaluation at $\mathrm{id}_F$ and some $y \in \mathcal{D}$ yields $U(\varepsilon_y) \circ \eta_{U(y)} = \alpha_{G'}(\eta)_y=\mathrm{id}_{U(y)}$, which is the first zig-zag-identity. The other is proven similarly.