# "Pushforward" over flat morphisms of functions which are constant on fibers

I believe the following should be true, but I'm not sure where to find the required commutative algebra to prove it:

If $\mathrm{Spec}\,A \rightarrow \mathrm{Spec}\,B$ is a flat morphism of algebraic varieties over a field $k$ with reduced scheme-theoretic fibers and $a\in A$ is constant on each fiber, then there exists $b\in B$ mapping to $a$.

(So $A$ and $B$ are reduced, finitely generated $k$-algebras, where $k$ is some field. Evaluating a function $a\in A$ at a closed point $p\in \mathrm{Spec}\,A$ gives an element of $k$.)

Edit: What if $k$ is an algebraically closed field?

• What does it mean that "$a\in A$ is constant on these fibers" ? Commented Jan 16, 2015 at 21:48
• Edited, hope this helps. Let me know if otherwise. Commented Jan 16, 2015 at 21:55
• It is not true that evaluating a function $a\in A$ at a closed point $p\in \mathrm{Spec}\,A$ gives an element of $k$. Commented Jan 16, 2015 at 22:05
• Sorry, meant $k$ to be algebraically closed. Commented Jan 16, 2015 at 22:12

Consider the inclusion of fields $k=B=\mathbb R\hookrightarrow \mathbb C=A$.
Then any complex unreal number $a\in \mathbb C\setminus \mathbb R$ gives a counterexample.
The result is still not true if $k$ is algebraically closed (as asked in the edited question):
Take the inclusion $\phi: B=k[T]\hookrightarrow A=k[T,T^{-1}]$ yielding the flat open immersion $f:\mathbb G_m \hookrightarrow \mathbb A^1_k$ where $\mathbb G_m$ is the complement of the origin in the affine line.
The function $a=T^{-1}\in A=\Gamma(\mathbb G_m,\mathcal O)$ is constant on the fibers of $f$ (since these fibers have zero or one element !) but nevertheless $a$ cannot be written as $\phi(b)$ with $b\in B=k[T]$.