Calculus over finite fields $P(x,y,z)$ is a polynomial function on an algebraic surface $S$ in $F_{q}^{3}$. Suppose that the derivative of $P$ along any tangent vector of $S$ is zero. Can we say that $P$ is constant on $S$?
Here $q$ is a prime, and we assume the degrees of $P$ and $S$ are significantly smaller than $q$.  
 A: Personally, I think this problem is ill-posed.  What geometric properties would the OP like to assume about $S$?  What does "constant" mean -- constant on the set of rational points, or truly a constant polynomial?  Also, what precisely does $d$ "significantly smaller" than $q$ mean?  There are "surfaces" in $\mathbb{F}_q^3$ that have few rational points, e.g., the vanishing set of $x^2-x$ is a surface with only $q^2$ points.  Worse yet, a polynomial like $P(x,y,z) = [(x-1)^2-1]^2 = x^2(x-2)^2$ will vanish on all tangent vectors at these $q^2$ points.  Of course $S$ is reducible, but the OP says nothing about irreducibility.  I suspect that there are similar irreducible examples: the crucial point is that the (few) rational points (mostly) lie on a small number of curves cut out by low degree equations.
Edit. Vivek complains that my example $S$ above is disconnected.  However, one can use my second suggestion to easily produce connected counterexamples.  Start with a disconnected set of small size compared to $q$, e.g., $\{(0,0,0),(1,0,0)\}$, and a small number $d$ of low degree defining equations, e.g., $x^2-x=y=z=0$ and $d=3$.  Now take a normic form $g$ over $\mathbb{F}_q$ of degree $d$ in $d$ variables: these always exist over finite fields (cf. Lang's thesis). Now plug in the defining equations of your disconnected set for the variables of the normic form to get a new polynomial $h$, e.g., $h(x,y,z) = g(x^2-x,y,z)$.  Now the only rational points of the zero set of $h$ will be the points in the original disconnected set, e.g., $\{(0,0,0),(1,0,0)\}$.  Now you can use a polynomial $P$ such as my polynomial above.  Really this has NOTHING to do with $S$, and only to do with the (incredibly small) set of rational points of $S$.
A: In one variable, $x^q - x \equiv 0 $ for all $x \in \mathbb{F}_q$.
This function would not be constant over an algebraic extension $\mathbb{F}_{q^2}$, which can always be constructed
In 3 variables, $(x^q+y^q+z^q) - (x+y+z) \equiv 0 $ .
The notions of "algebraic surface" and "tangent vector" are shaky in finite characteristic.  I guess you could formally write the partial derivatives:
$$ a \partial_x P + b \partial_y P + c \partial_z P = 0 $$
Still not sure what it "tangent to $S$" means in finite characteristic.  
There may need to be some condition on $P,S$ even if the degrees are small.

In two variables, $S = \{ xy = 1: x,y \in \mathbb{F}_q\}$ and then $P(x,y) = x^k - y^{(q-1)-k}$ is identically zero.  We can check:
$$ x^k - y^{(q-1)-k} = x^k - x^{k-(q-1)} = x^k - x^k = 0$$
for any $x \in \mathbb{F}_q$.  The partial derivatives are $\partial_x P = k \,x^{k-1}$ and $\partial_yP = [(q-1)-k] \;y^{(q-2)-k}$ .   That... disproves the converse.

In one variable try $\fbox{$ p(x) = \frac{1}{q+1}x^{q+1} - \frac{1}{2} x^2$}$
Then $p'(x) = x^q - x \equiv 0$, the derivative is identically zero.  
This function is not constant $p(0)=0$ and $p(1) = 1 - \frac{1}{2} \neq 0$.

I've been thinking about what it means to be "tangent" to a surface $f(x,y,z)=0$ in finite characteristic.  In differential geometry we could consider a function $(x(t), y(t), z(t))$ and take the derivative of $P(x,y,z)$ in the "direction" of the line tangent going through the curve.
\[ \frac{df}{dt} = \frac{df}{dx} \frac{dx}{dt}  + \frac{df}{dy} \frac{dy}{dt}  + \frac{df}{dz} \frac{dz}{dt}  =
a \frac{df}{dx}  + b\frac{df}{dy}   + c\frac{df}{dz} = 0 \]
This is a linear equation to define which "directions" are "tangent".  In these directions we could define the derivative of our polynomial
\[ a \frac{dP}{dx}  + b\frac{dP}{dy}   + c\frac{dP}{dz}  \]
For varieties and schemes, there is a notion of Zariski Tangent Space when more intuitive geometric notions over $\mathbb{C}$ no longer hold.
We are really looking at residue classes of polynomials modulo functions that vanish identically on that surface.  $\mathbb{F}_q[x,y,z] / (f)$.  
The prime ideals $\mathfrak{p}$ in this ring are "points" on your surface.  You define a maximal ideal of "O(1)" functions $\mathfrak{m} = \mathfrak{p}A_{\mathfrak{p}}$. Your tangent space is (quite succinctly) $\mathfrak{m}/\mathfrak{m}^2$.
