I was trying to get a "Cauchy-Riemann" conditions for a quaternion function $f:\Bbb H\to\Bbb H$, $f(q)=m(q)+n(q)i+o(q)j+p(q)k$ and $m, n, o, p:\Bbb H\to\Bbb R$. Defining the quaternion derivative as
$${df\over dq}=\lim_{\Delta q\to 0}{f(q+\Delta q)-f(q)\over\Delta q}=\lim_{\Delta q\to 0}{\Delta f\over\Delta q}$$
Given that $\Bbb H$ is not a commutative algebra, I think that $\Delta f/\Delta q=(\Delta q)^{-1}\Delta f=\Delta f(\Delta q)^{-1}$ for being independent of the path choosen. Defining $\vec v$ the vector part of $f$, $\vec u$ and $w$ be the vector part and scalar part of $q$, then:
$$\lim_{\Delta q\to 0}{\Delta f\over\Delta q}=\lim_{\Delta q\to 0}(\Delta q)^{-1}\Delta f=\lim_{\Delta q\to 0}\Delta f(\Delta q)^{-1}$$
$${\Delta w-\Delta\vec u\over\Vert \Delta q\Vert^2}(\Delta m+\Delta\vec v)=(\Delta m+\Delta\vec v){\Delta w-\Delta\vec u\over\Vert \Delta q\Vert^2}$$
$${\Delta w\Delta m +\Delta\vec v\cdot\Delta\vec u+\Delta w\Delta\vec v-\Delta m\Delta\vec u+\Delta\vec v\times\Delta\vec u\over\Vert \Delta q\Vert^2}={\Delta w\Delta m +\Delta\vec v\cdot\Delta\vec u+\Delta w\Delta\vec v-\Delta m\Delta\vec u-\Delta\vec v\times\Delta\vec u\over\Vert\Delta q\Vert^2}$$
I think a first strong condition is $\Delta\vec v\times\Delta\vec u=0$, because if that is true, then the LHS is equal to the RHS and $(\Delta q)^{-1}$ commutes with $\Delta f$
$$\lim_{\Delta q\to 0}{\Delta\vec v\times\Delta\vec u\over\Vert \Delta q\Vert^2}$$
$$=\lim_{(\Delta w,\Delta x,\Delta y,\Delta z)\to(0,0,0,0)}{(\Delta o\Delta z-\Delta p\Delta y)i+(\Delta p\Delta x-\Delta n\Delta z)j+(\Delta n\Delta y-\Delta o\Delta x)k\over (\Delta w)^2+(\Delta x)^2+(\Delta y)^2+(\Delta z)^2}$$
$$=\lim_{(\Delta x,\Delta y,\Delta z)\to(0,0,0)}{(\Delta o\Delta z-\Delta p\Delta y)i+(\Delta p\Delta x-\Delta n\Delta z)j+(\Delta n\Delta y-\Delta o\Delta x)k\over(\Delta x)^2+(\Delta y)^2+(\Delta z)^2}=\mathbf 0$$
Evaluating the limit alternating the order in which is take for the coordinates in $\Bbb H$ gives the follow equality of PDE:
$${\partial o\over \partial z}={\partial p\over \partial y}={\partial p\over \partial x}={\partial n\over \partial z}={\partial n\over \partial y}={\partial o\over \partial x}=0$$
Now evaluating the vector part of the defining limit of $df/dq$...
$$\lim_{(\Delta w,\Delta x,\Delta y,\Delta z)\to(0,0,0,0)}{\Delta w(\Delta n\ i+\Delta o\ j+\Delta p\ k)-\Delta m(\Delta x\ i+\Delta y\ j+\Delta z\ k)\over (\Delta w)^2+(\Delta x)^2+(\Delta y)^2+(\Delta z)^2}$$
taking first $\Delta x,\Delta y,\Delta z\to 0$ in limit above...
$$\lim_{\Delta w\to 0}{\Delta w(\Delta n\ i+\Delta o\ j+\Delta p\ k)\over (\Delta w)^2}={\partial n\over \partial w}i+{\partial o\over \partial w}j+{\partial p\over \partial w}k$$
Now evaluating first $\Delta w\to 0$
$$\lim_{(\Delta x,\Delta y,\Delta z)\to(0,0,0)}-\Delta m{\Delta x\ i+\Delta y\ j+\Delta z\ k\over (\Delta x)^2+(\Delta y)^2+(\Delta z)^2}$$
And then alternating the order of the coordinate taking gives
$$-{\partial m\over \partial x}i=-{\partial m\over \partial y}j=-{\partial m\over \partial z}k $$
and so
$${\partial n\over \partial w}=-{\partial m\over \partial x}\quad{\partial o\over \partial w}=-{\partial m\over \partial y}\quad{\partial p\over \partial w}=-{\partial m\over \partial z}$$
this is the part that I'm not sure, but I'd assume is right. And for last, the scalar part of the limit:
$$\lim_{(\Delta w,\Delta x,\Delta y,\Delta z)\to(0,0,0,0)}{\Delta m\Delta w+\Delta n\Delta x+\Delta o\Delta y+\Delta p\Delta z\over (\Delta w)^2+(\Delta x)^2+(\Delta y)^2+(\Delta z)^2}={\partial m\over \partial w}={\partial n\over \partial x}={\partial o\over \partial y}={\partial p\over \partial z}$$
Given the above, this tentative conditions for a system of five PEDs:
$${\partial m\over \partial w}={\partial n\over \partial x}={\partial o\over \partial y}={\partial p\over \partial z}$$
$${\partial n\over \partial w}=-{\partial m\over \partial x}\quad{\partial o\over \partial w}=-{\partial m\over \partial y}\quad{\partial p\over \partial w}=-{\partial m\over \partial z}$$
$${\partial o\over \partial z}={\partial p\over \partial y}={\partial p\over \partial x}={\partial n\over \partial z}={\partial n\over \partial y}={\partial o\over \partial x}=0$$
Testing this conditions with $f(q)=q^2$:
$$q^2=w^2-x^2-y^2-z^2+(2wx)i+(2wy)j+(2wz)k$$
For the first condition:
$${\partial (w^2-x^2-y^2-z^2)\over \partial w}={\partial (2wx)\over \partial x}={\partial (2wy)\over \partial y}={\partial (2wz)\over \partial z}=2w$$
For the second, third and fourth condition:
$${\partial (2wx)\over \partial w}=-{\partial (w^2-x^2-y^2-z^2)\over \partial x}=2x$$
$${\partial (2wy)\over \partial w}=-{\partial (w^2-x^2-y^2-z^2)\over \partial y}=2y$$
$${\partial (2wz)\over \partial w}=-{\partial (w^2-x^2-y^2-z^2)\over \partial z}=2z$$
and for the fifth condition is also satisfied:
Now, approaching to $q$ for the $w$-axis:
$${df\over dq}={\partial (w^2-x^2-y^2-z^2)\over \partial w}+{\partial (2wx)\over \partial w}i+{\partial (2wy)\over \partial w}j+{\partial (2wz)\over \partial w}k$$
$$=2w+2xi+2yj+2zk=2q$$
... approaching for the $xi$-axis:
$${df\over dq}={\partial (2wx)\over \partial x}-{\partial (w^2-x^2-y^2-z^2)\over \partial x}i=2w+2x$$
and we see that what have been define as "path independent" is not true. I think my error was the third, fourth and fifth conditions because the partial derivatives I think it also had to be set equal to $0$, but if this is true, then the only diffrentiable functions with respect to a quaternion are the set of function with vector part equal to $0$ i.e $f:\Bbb H\to\Bbb R$.
What can it be postulate as the correct conditions?
The only functions that are "quaternion analytic" on an open domain in $\mathbb H$ are $z\mapsto \alpha z + \beta$ for constants $\alpha, \beta \in \mathbb H$, (if you interpret $\frac{\Delta f}{\Delta q}$ as $\Delta f(\Delta q)^{-1}$.)
If you take $\frac{\Delta f}{\Delta q}$ as $(\Delta q)^{-1}\Delta f$, then the only such functions are $z\mapsto z \alpha + \beta$.
If you demand that the limits of both quantities exist, then $\alpha$ must be real.
I will try to come back later and write up a full decent demonstration of why, but as foreshadowing, the Cauchy-Reimann equations are best understood as requiring that the $2\times 2$ matrix $\frac {\partial (u,v)}{\partial (x,y)}$ be of the same form as the map of $ z \mapsto \lambda z$, where $\lambda = f'(z_0)$, and we consider $f: \mathbb C \to \mathbb C$ as $f: \mathbb R^2 \to \mathbb R^2$ .