
Should this theorem not instead state: $\operatorname{curl}\mathbf{A}=0$ on the surface $S$ as by Stokes' theorem
$\displaystyle \oint_{\gamma} \vec{A} \cdot d\vec{r}=\int_S$curl A $\cdot $ $d\vec{S}$

Should this theorem not instead state: $\operatorname{curl}\mathbf{A}=0$ on the surface $S$ as by Stokes' theorem
$\displaystyle \oint_{\gamma} \vec{A} \cdot d\vec{r}=\int_S$curl A $\cdot $ $d\vec{S}$
Given a vector field ${\bf A}$ in some region $\Omega\subset{\mathbb R}^n$ there is some notion of ${\rm curl}({\bf A})$ for any $n\geq2$.
When $n=2$ and ${\bf A}(x,y)=\bigl(P(x,y),Q(x,y)\bigr)\ $ then ${\rm curl}({\bf A})$ is a scalar function defined by ${\rm curl}({\bf A}):=Q_x-P_y$.
When $n=3$ then ${\rm curl}({\bf A})$ is the familiar curl vector, and when $n>3$ then ${\rm curl}({\bf A})$ is a certain skew bilinear form in the variables $dx_1$, $\ldots$, $dx_n$ whose coefficients depend on $(x_1,\ldots, x_n)$.
Your Theorem is valid for any $n\geq2$, under the following absolutely crucial assumption: The domain $\Omega$ where ${\bf A}$ is defined has to be simply connected.
The standard example in this regard is the following: The curl of the field $${\bf A}(x,y):=\nabla\arg(x,y)=\left({-y\over x^2+y^2},{x\over x^2+y^2}\right)$$ defined in the punctured plane is $\equiv 0$, but for the unit circle $\partial D$ one has $$\int_{\partial D}{\bf A}\cdot\>d{\bf z}=2\pi\ .$$
For an coservative $\overset{\rightharpoonup }{A}$ say
$\overset{\rightharpoonup }{A}=(P,Q)=\left(\frac{\partial U}{\partial x},\frac{\partial U}{\partial y}\right)=\left(U_x,U_y\right)$
set
$\omega =U_x\text{dx} + U_y\text{dy}$
Evaluate the exterior derivative
$\text{d$\omega $}=\text{dU}_x\wedge \text{dx}+\text{dU}_y\wedge \text{dy}$
That is
$\text{d$\omega $}=\left( \frac{\partial U_x}{\partial x}\text{dx}+ \frac{\partial U_x}{\partial y}\right)\text{dy}\wedge \text{dx}+\left( \frac{\partial U_y}{\partial x}\text{dx}+ \frac{\partial U_y}{\partial y}\text{dy}\right)\wedge \text{dy}$
$\text{d$\omega $}= U_{x,y}\text{dx}\wedge \text{dy}+U_{y,x}\text{dy}\wedge \text{dx} $
$\text{d$\omega $}=(U_{x,y}-U_{y,x})\text{dx}\wedge \text{dy}$
because
$\text{dx}\wedge \text{dx}=0$
$\text{dy}\wedge \text{dy}=0$
and
$\text{dy}\wedge \text{dx}=-\text{dx}\wedge \text{dy}$
Also
$U_{x,y}-U_{y,x}=0$
mixed partials are equal. Therefore
$\text{curl} \overset{\rightharpoonup }{A}=U_{x,y}-U_{y,x}=0$
Let $\gamma$ be the boundary for our surface $S$,
write
$\gamma=\partial S$
and let $dS=\text{dx}\wedge \text{dy}$ be the volume-element for $S$
then $\text{d$\omega $}=curl(\overset{\rightharpoonup }{A})dS$
so we found
$$\int _{\partial S}\omega =\int _S\text{d$\omega $}=0$$