How to uncurl $\mathbf{B}=\mathbf{\nabla\times A}$ if we only know $\mathbf{B}$ at $z=z_0$? Let
$$\mathbf{B} = \mathbf{\nabla\times A},$$
where
$$\mathbf{B}(x,y,z) = B_x(x,y,z)\mathbf{\hat{x}} + B_y(x,y,z)\mathbf{\hat{y}} + B_z(x,y,z)\mathbf{\hat{z}},$$
$$\mathbf{A}(x,y,z) = A_x(x,y,z)\mathbf{\hat{x}} + A_y(x,y,z)\mathbf{\hat{y}} + A_z(x,y,z)\mathbf{\hat{z}},$$
Assume that
$$\mathbf{\nabla \cdot A} = 0.$$
This ensures that $\mathbf{A}$ is uniquely defined by the top equation.
Is it possible to calculate $A_x(x,y,z_0)$, $A_y(x,y,z_0)$ if we only know $\mathbf{B}(x,y,z)$ at $z=z_0$?
Here is my naive attempt.
Assume that
$$A_x(x,y,z_0) = \frac{\partial \phi}{\partial y},$$
$$A_y(x,y,z_0) = -\frac{\partial \phi}{\partial x},$$
where
$$\phi=\phi(x,y).$$
Substituing this into the $z$-component of the top equation gives the following 2D Poisson equation
$$\left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}\right)\phi(x,y) = -B_z(x,y,z_0).$$
We can solve this for $\phi(x,y)$ which we can use to calculate $A_x(x,y,z_0)$ and $A_y(x,y,z_0)$. Is this a valid solution? There seems to be problems. For example, since
$$\mathbf{\nabla\cdot A} = 0,$$
this implies that
$$\left.\frac{\partial A_z}{\partial z}\right|_{z=z_0}=0,$$
but $z_0$ is arbitrary so $\partial A_z / \partial z = 0$ $\forall z$?
 A: It doesn't appear so since we can, for example, add a constant field $\mathbf{A}_0$ to $\mathbf{A}$ so that $$\mathbf{A}_2=\mathbf{A}+\mathbf{A}_0$$
We now have that if $\mathbf{A}$ satisfies
$$\nabla \cdot \mathbf{A}=0$$
then also $\mathbf{A}_2$  satisfies
$$\nabla \cdot \mathbf{A}_2=0$$
since
$$\nabla \cdot \mathbf{A}_2=\nabla \cdot (\mathbf{A}+\mathbf{A}_0)=\nabla \cdot \mathbf{A}+\nabla \cdot \mathbf{A}_0=0+0=0$$
So, you cannot "see" the value of the constant field $\mathbf{A}_0$ from $$\mathbf{B}=\nabla \times \mathbf{A}$$
since also
$$\mathbf{B}=\nabla \times \mathbf{A}_2$$
due to
$$\mathbf{B}=\nabla \times \mathbf{A}_2=\nabla \times \mathbf{A}+\nabla \times \mathbf{A}_0=\nabla \times \mathbf{A}+0=\nabla \times \mathbf{A}$$
A: Given $\mathbf{B}$ on $z=z_0$ we can extend the field to all on $\mathbb{R}^3$ by
$$\begin{cases}
B_x(x,y,z) := B_x(x,y,z_0) \\
B_y(x,y,z) := B_y(x,y,z_0) \\
B_z(x,y,z) := B_z(x,y,z_0) - z \left( \partial_x B_x(x,y,z_0) + \partial_y B_y(x,y,z_0)\right)
\end{cases}$$
This extensin satisfies $\nabla\cdot \mathbf{B} = 0$ but is not the only possible extension.
Then, given $\mathbf{B}$ in all of $\mathbb{R}$ we can construct $\mathbf{A}$ such that $\nabla\times \mathbf{A} = \mathbf{B}$ and $\nabla\cdot \mathbf{A}=0$ by the convolution
$$\mathbf{A} = -G * (\mathbf{\nabla\times B}),$$
where $\nabla^2 G = \delta,$ i.e. $G(x,y,z) = \frac{1}{4\pi\sqrt{x^2+y^2+z^2}}.$
