$f:\mathbb{R}^4 \to \mathbb{R}$ is a Constant when $Xf = Yf = 0$ for Vector Fields $X,Y$ I'm preparing for some comprehensive exams and this is a question from a previous year that I've been trying to solve.
"On $\mathbb{R}^4$, equipped with coordinates $(x,y,z,t)$, let $X,Y$ be vector fields given by
$$X = \frac{\partial}{\partial x}+z \frac{\partial}{\partial y}, \hspace{5mm} Y=x \frac{\partial}{\partial z} + \frac{\partial}{\partial t}.$$
If $f: \mathbb{R}^4 \to \mathbb{R}$ is a smooth function satisfying $Xf = Yf = 0$, show that $f$ is constant."
Here's somethings I've tried.
By definition, $Xf:=df(X)$. Thus, we first write out $df$ generically. 
$$df = \frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y} dy + \frac{\partial f}{\partial z}dz + \frac{\partial f}{\partial t}dt.$$
We have that $df(X) = 0 = \frac{\partial f}{\partial x} + z \frac{\partial f}{\partial y}$ and $df(Y) = 0 = x \frac{\partial f}{\partial z} + \frac{\partial f}{\partial t}$.
Observe that $[X,Y] = \frac{\partial}{\partial z}-x \frac{\partial}{\partial y}$. Since we know that $df([X,Y]) = 0$ as well from the assumptions of $Xf = Yf = 0$, then $df([X,Y]) = 0 = \frac{\partial f}{\partial z} - x \frac{\partial f}{\partial y}$.
From here, I tried to use the three equations to show that each of the partial derivatives of $f$ are $0$, forcing $f$ to be constant. However, the relations aren't working out to show this so maybe I did some computations wrong though I've checked a few times...
Another idea is to consider the distribution $D = \ker df$ and then try and apply Frobenius' theorem in some way.
Any help is welcome! 
 A: The flow of $X$ is $f_u(x,y,z,t)=(x+u,y+uz,z,t)$ the flow of $Y$ is $g_u(x,y,z,t)=(x,y,z+ux,t+u)$. The flow of $[X,Y]$ is $h_u(x,y,z,t)=(x,y-ux,z+u.t)$
Let $(x,y,z,t)\in\mathbb{R}^4$, $f_{-x}(x,y,z,t)=(0,y-xz,z,t)$, $g_{-t}(0,y-xz,z,t)=(0,y-xz,z,0)$, $h_{-z}(0,y-xz,z,0)=(0,y-xz,0,0)$.
This impies that $f(x,y,z,t)=f(0,y-xz,0,0)$.
This implies that $\pmatrix{{{\partial f}\over{\partial x}} \cr{{\partial f}\over{\partial y}} \cr {{\partial f}\over{\partial z}} \cr {{\partial f}\over{\partial t}}}=$ $\pmatrix{{{\partial f}\over{\partial x}} &{{\partial f}\over{\partial y}} & {{\partial f}\over{\partial z}} & {{\partial f}\over{\partial t}}}$ $\pmatrix{0 &0&0&0\cr -z&1&-x&0\cr 0&0&0&0\cr 0&0&0&0}$
We deduce that${{\partial f}\over{\partial x}}=-z{{\partial f}\over{\partial y}}$
${{\partial f}\over{\partial z}}=-x{{\partial f}\over{\partial y}}$
and ${{\partial f}\over{\partial t}}=0$.
The fact that $x{{\partial f}\over{\partial z}}+{{\partial f}\over{\partial t}}=0$
implies that $x{{\partial f}\over{\partial z}}=0$ and ${{\partial f}\over{\partial z}}=0$
The fact that ${{\partial f}\over{\partial z}}-x{{\partial f}\over{\partial y}}=0$ implies that ${{\partial f}\over{\partial y}}=0$, similarly you deduce that ${{\partial f}\over{\partial x}}=0.$
A: For $X,Y$ vector fields given by
$$X = \frac{\partial}{\partial x}+z \frac{\partial}{\partial y}, \hspace{5mm} Y=x \frac{\partial}{\partial z} + \frac{\partial}{\partial t}.$$,
 where $X(f)=Y(f)=0$ we obtain two constraints on $f$. 
Then $[X,Y]=\partial_z-x\partial_y$ and $[X,[X,Y]]=-2\partial_y$. By definition $[X,Y](f)=XY(f)-YX(f)$ such that those two Lie brackets give us another two constraints. In total we now have:
\begin{align}
\frac{\partial f}{\partial x} + z \frac{\partial f}{\partial y} &=0,\\
x\frac{\partial f}{\partial z} + \frac{\partial f}{\partial t} &=0,\\
\frac{\partial f}{\partial z} - x \frac{\partial f}{\partial y} &=0,\\
-2\frac{\partial f}{\partial y} &=0.
\end{align}
Since $\frac{\partial f}{\partial y}=0$ and given the other relations, all partial derivatives must vanish and so $f$ is constant.
