What is the magnetic flux through a trefoil knot? Imagine a closed loop in the shape of a trefoil knot (https://en.wikipedia.org/wiki/Trefoil_knot). How should one calculate the flux through this loop? Normally we define an arbitrary smooth surface, say, $\mathcal{S}$ whose boundary $\partial{\mathcal{S}}$ is the given loop and calculate the flux using its integral definition as
$$\Phi_B = \int_{{\mathcal{S}}} \mathbf{B}\cdot d\mathbf{S}\tag{1}\label{1}$$
It is clear how to use $\eqref{1}$ when the loop is a simple loop and the surface is also a simple one, but how can one spread a surface on a trefoil and it be still true that for such surfaces the flux is always the same because $\nabla \cdot \mathbf{B}=0$, in other words how does Gauss' theorem hold for surfaces whose boundary is a trefoil?
Alternatively, one could introduce the vector potential $\mathbf{B}=\nabla \times \mathbf{A}$ and using Stokes' theorem derive from the definition of flux $\eqref{1}$ that
$$\Phi_A = \int_{{\mathcal{S}}} \nabla \times \mathbf{A}\cdot d\mathbf{S}\\
=\oint_{\partial\mathbf{S}} \mathbf{A}\cdot d \ell \tag{2}\label{2}$$
So, whenever we can use Stokes' theorem we also have $\Phi_A=\Phi_B$. How does Stokes' theorem hold if the loop is a trefoil?
If in fact the application of either Gauss' or Stokes' theorem has a problem then does the fact that the line integral via $\eqref{2}$ can always be used to define the flux $\Phi_A$ mean that at least in this sense $\mathbf{A}$ is more fundamental than $\mathbf{B}$?
 A: Every knot is the boundary of an orientable surface. Such a surface is called a Seifert surface.$^\dagger$ For any given knot (with a given embedding in 3-d space), the flux is the same through two such surfaces. As usual, the flux can be calculated either by integrating $\mathbf{B}$ over the surface, or by integrating $\mathbf{A}$ around the knot.
Figure 6 in "Visualization of Seifert Surfaces" by van Wijk and Cohen (link to pdf) shows this nice picture of an orientable surface whose boundary is a trefoil knot:

The boundary (the trefoil knot) is highlighted in yellow. To see that this really is a trefoil knot, imagine smoothing out the kinks and then looking down on the figure from above. The fact that the surface is orientable is clear by inspection (an insect on one side cannot walk to the other side without crossing the boundary), as is the fact that it does not intersect itself.
Intuitively, we can see that Stokes' theorem will still work in this case by subdividing the surface into small cells, each with the unknot as its boundary, and applying Stokes' theorem to each individual cell. The contributions from the cell-surfaces add up to the flux over the full surface, and the contributions from the cell-boundaries cancel each other wherever two boundaries are adjacent, leaving only the integral over the trefoil.
We can also see intuitively that the flux must be the same through any two such surfaces, because those two surfaces can be joined into a single closed surface over which the total flux must be zero because of $\nabla\cdot\mathbf{B}=0$. The fact that the closed surface might intersect itself is not a problem, just like it's not a problem for two intersecting surfaces sharing the same unknot as the boundary.

$^\dagger$ The idea behind the proof that a Seifert surface exists is sketched in "Seifert surfaces and genera of knots" by Landry (link to pdf).
A: For a generic, oriented knot, you can construct an oriented surface which has the knot as it's boundary through the Seifert algorithm.  Stokes' theorem says that the flux through any two such surfaces which share the same boundary must be the same.
In principle, one could construct a Seifert surface for the trefoil knot, parameterize it, and then evaluate the flux integral.  This might be tedious, but it is possible.  However, it would be far simpler as you say to simply evaluate the line integral of $\mathbf A$ around the knot.
That being said, this is not an indicator that $\mathbf A$ is more fundamental than $\mathbf B$, because there is no problem defining those flux integrals.  It would just be particularly difficult to evaluate them directly.
