Products in discrete fibrations Let $B$ be a category with products and let $F:A\to B$ be a discrete opfibration.
Let $F^*:B\to \bf Set$ be the functor corresponding to $F$ under the Grothendieck correspondence.
The following proposition should be true and the proof is rather straightforward:

$F^*$ preserves products if and only if $A$ has products and $F$ preserves them.

Questions (supposing this is indeed true):

*

*Is this stated somewhere in the literature?

*Is it true for all limits?

*Is it a consequence of a more generale statement regarding (not necessarily discrete) opfibrations?

 A: I don't know about 1., but this is certainly true for all limits. One can easily generalize it to opfibrations with groupoid fibers and get the same result.
For general opfibrations, one direction (the "easy one", namely "$F^*$ preserves $I$-shaped limits implies $A$ has them and they are preserved by $F$") is still true (and relatively easy), but the converse is typically not. If $A$ has $I$-shaped limits and they are preserved by $F$, the canonical map $F^*(\lim_I X)\to \lim_I F^*(X)$ (where the second "$\lim_I$" is to be understood as a pseudolimit) is always a left adjoint, but it is generally neither fully faithful nor essentially surjective.
This is so, even if one adds the natural requirement that cocartesian edges be preserved by products (/$I$-shaped limits) in $A$. I don't know a very reasonable condition. Something like "in limit diagrams in $A$, the projection maps are $F$-cocartesian" (this says something about the co-unit of the afore-mentioned adjunction) seems to be on the right track but not quite enough. If we try to add more conditions, we get closer and closer to a very tautological statement.
A proof could go as follows. Globally, suppose $F$ is an opfibration.
1- Suppose $A$ has $I$-shaped limits, that are preserved by $F$, and let $X: I\to B$ be a diagram. We want to prove that the canonical map $f:F^*(\lim_I X)\to \lim_I F^*(X)$ is an equivalence of categories. We start by proving that it is fully faithful. For simplicity of notation, let $b:= \lim_I X$, and $p_i: b\to X_i$ the canonical projection maps.
For this, we note that if $a\in A_b$, then we have a diagram $a\to (p_i)_!a, i\in I$ in $A$. I claim that this is a limit diagram in $A$. Let's assume this for a moment.
Then, given $a_0,a_1\in A_b$, we find $$\hom_{A_b}(a_0,a_1)\cong \lim_I \hom_A(a_0,(p_i)_!a_1)\times_{\hom_B(b,X_i)}\{p_i\}\cong \lim_I\hom_A((p_i)_!a_0,(p_i)_!a_1)\cong \hom_{\lim_I F^*(X)}(f(a_0),f(a_1))$$ and it is easy to convince oneself that the composite is the map induced by $f$ (note that $A_b = F^*(b)= F^*(\lim_IX)$).
This proves fully faithfulness, given the statement that I mentioned. Ok, now, to prove that $a\to (p_i)_!a, i\in I$ is a limit diagram.
In a discrete fibration, or more generally, in an opfibration with groupoid fibers, this is easy : we note that because $F$ preserves $I$-shaped limits, the canonical map $a\to \lim_I (p_i)_!a$ is in $A_b$, and so, because $A_b$ is a groupoid, it must be an isomorphism.
In fact, this also proves essential surjectivity ! Let $(a_i)_{i\in I}$ be an object of $\lim_I F^*(X)$ (where I abuse notation and do not mention the isomorphisms $f_{ij}(a_j)\cong a_i$), and take its limit as a diagram in $A$, $a = \lim_I a_i$, living over $b=\lim_I X$, with canonical projection maps $a\to a_i$ living over $p_i: b\to X_i$. But these are all cocartesian, as $F$ has discrete fibers, so that $((p_i)_!a)_{i\in I}\cong (a_i)_{i\in I}$.
Now, if $F$ has non-groupoid fibers, both steps can fail (fully faithfulness and essential surjectivity). What you get instead is that the canonical map $F^*(\lim_I X)\to \lim_I F^*(X)$ is a left adjoint, with right adjoint given by "take limits". The above proof can easily be adapted to show this.
I believe the fibration $LFib\to Cat$ is a counterexample to both fully faithfulness and essential surjectivity: here, $LFib\subset Fun([1],Cat)$ is the full subcategory spanned by discrete opfibrations. It is clearly closed under products, and those are preserved by evaluation at $1$. Furthermore, this is clearly a fibration, and the pullback maps have left adjoints, so it's an opfibration too, with fiber $LFib_C\simeq Fun(C,Set)$ over $C$. Then the adjunction in question is $Fun(C \times D, Set)\rightleftarrows Fun(C,Set)\times Fun(D,Set)$ which is rarely fully faithful, and is not essentially surjective if $D= \emptyset$ for instance.
2- Conversely, suppose $F^*$ preserves $I$-shaped limits, and let $X: I\to A$ be a diagram. Let $b := \lim_I FX$ and consider the canonical map $F^*(b)\to \lim_I F^*(FX)$. In the right hand side, there is an object corresponding to $(FX_i)_i$, so if this canonical map is essentially surjective, we can lift it to some $Y\in F^*(b)$, coming with (because of the nature of the canonical map above) cocartesian projection maps $Y\to X_i$ lying over the projection maps $p_i:b\to FX_i$. The claim is that these $Y\to X_i$ form a limit diagram, which will prove that $A$ admits limits, and they are preserved by $F$.
So let $Z\in A$ be arbitrary. To prove that $\hom_A(Z,Y) \to \lim_I\hom_A(Z, X_i)$ is an equivalence, one takes the fibers over some $f\in \hom_B(FZ, b)\cong \lim_I\hom_B(FZ, FX_i)$, to get $\hom_{A_b}(f_!Z,Y)\to \lim_I \hom_{A_{FX_i}}((p_i)_!f_!Z,X_i)$. That this morphism is an isomorphism follows from the fact that the canonical map $F^*(b)\to \lim_I F^*(FX)$ is fully faithful.
This argument is elementary enough, but it gets a bit more complicated for $\infty$-categories, even if it's still true there. Probably the best is to phrase things in terms of cocartesian sections (in the groupoid-fiber case, just sections) of the pullback $I\times_B A\to I$, and its variant $I^\triangleleft \times_B A\to I^\triangleleft$.
Given a limit diagram $f:I^\triangleleft\to B$, there is a restriction map $A_{\lim_I f}\simeq \Gamma_{cocart}(I^\triangleleft,I^\triangleleft \times_B A)\to \Gamma_{cocart}(I,I \times_B A)\simeq \lim_I A_{f(i)}$, and the claim is then that the map $\Gamma_{cocart}(I,I\times_B A)\to Fun(I, A)\times_{Fun(I,B)}\{f\} \xrightarrow{\lim_I} A\times_B \{\lim_I f\}= A_{\lim_I f}$ is a right adjoint to the restriction map.
Once we have that, in the case of $\infty$-groupoid fibers, we are done as both terms are just $\infty$-groupoids, and any adjunction between such is an equivalence, and in the more general case we cannot say much more.
