I am looking at Griffith's Electrodynamics textbook and on page 76 he is discussing the curl of electric field in electrostatics. He claims that since $$\oint_C\mathbf{E}\cdot{d}\boldsymbol\ell=0$$ then $$\nabla\times\mathbf{E}=\mathbf{0}$$ I don't follow this logic. Although I know that curl of $\mathbf{E}$ in statics is $\mathbf{0}$, I can't see how you can simply apply Stokes' theorem to equate the two statements.
If we take Stokes' original theorem, we have $\oint\mathbf{E}\cdot{d}\boldsymbol\ell=\int\nabla\times\mathbf{E}\cdot{d}\mathbf{a}=0$. How does this imply $\nabla\times\mathbf{E}=\mathbf{0}$? Griffiths seem to imply that this step is pretty easy, but I can't see it!
Suppose $\nabla \times {\bf E}$ is a well-behaved function and $\nabla \times {\bf E}\neq 0$ in some region. Then you could find a surface $S$ through which $\int_S \nabla \times {\bf E} \cdot d{\bf a}\neq0$ by making that surface very small and close to the aforementioned region.
This contradicts Stokes's theorem, so it must be that $\nabla \times {\bf E}=0$ everywhere.