Solution (source code)

= Solution

For a twice <continuously differentiable> <vector potential> $A$, write the <curl> with the <Levi-Civita symbol>:
$$
\nabla\cdot B=\partial_i(\epsilon_{ijk}\partial_jA_k)
=\epsilon_{ijk}\partial_i\partial_jA_k.
$$
The second derivatives are symmetric in $i,j$, whereas $\epsilon_{ijk}$ is antisymmetric, so the contraction is zero. Equivalently, writing out the three components shows that each mixed derivative cancels its reversed-order partner. Thus
$$
\boxed{\nabla\cdot(\nabla\times A)=0.}
$$
This is <divergence of a curl is zero>. The regularity hypothesis is what licenses commutation of the mixed <partial derivatives>; it must not be omitted for a singular potential without specifying a weaker derivative interpretation.