What does local gauge invariance have to do with locality? This concept is just being introduced to me in my QFT course, and my instructor mentioned that if a scalar field $\phi$ has $U(1)$ symmetry, then you can make a suitable gauge transformation $\phi \rightarrow e^{i\theta}\phi$, and the underlying Lagrangian is invariant under such a change. I understand how if $\theta$ is a constant, then you have a global transformation, as you are rotating by the same angle at every point in space.
But he then mentioned that if you make $\theta$ a function of position, $\theta(x)$, such that $\phi \rightarrow e^{i\theta(x)}\phi$ and the Lagrangian is still invariant under such a change, this corresponds to local gauge invariance. He mentioned this has to do with locality.
I suppose my misunderstanding is, I don't see how making the phase dependent on each point in space says anything about locality. What does locality mean here, what is local gauge invariance, and why does $\theta \rightarrow \theta(x)$ imply it? It seems like local gauge invariance is a much more powerful property to have rather than global. Is this true?
Apologies if the lingo isn't quite correct when referring to these ideas. I am still learning the language.
 A: You are right to be confused. Local gauge invariance has to do with locality, but not in an obviously direct way.
Take the action for EM coupled to a charged scalar.
$$\mathcal{L}_{gauge} = -\frac{1}{4}F_{\mu\nu}F^{\mu\nu} + (D_\mu\phi)^*D^\mu\phi,$$
where $F_{\mu\nu}(t,x) = \partial_\mu A_\nu(t,x) - \partial_\nu A_\mu(t,x)$ and $D_\mu\phi(t,x) = \partial_\mu\phi(t,x) -ieA_\mu(t,x)\phi(t,x)$. I have put the spacetime labels to emphasise the following: every term in the lagrangian features fields evaluated at a single spacetime event.
This way we know for sure that the resulting action
$$S_{EM} := \int dtd^3x ~~\mathcal{L}_{gauge}(t,x)$$
is local. Why? Change the fields in one region of spacetime, and the action changes only there.
Ok, but what does this have to do with local gauge invariance? Can't we write down the action $S_{EM}$ directly in terms of the Lorentz tensor $F^{\mu\nu}$ (ie the E and B fields)? Yes, but it won't be written explicitly in terms of a local Lagrangian density. We know it is local, but it would not be apparent from the way it is formulated.
It turns out that this is a general pattern: the fundamental interactions are local, and can be written in local form only using gauge fields. I don't know a deep explanation for this, I think we just take it as a brute fact.
A: There are all sorts of weak and strong notions of locality. The common thread is that, informally, something is local if some key properties of it can be understood by analyzing functions of a single spacetime position. We can make things a little more specific in this context by saying:

*

*A theory is a local theory if its global symmetries are all associated with local conserved currents (i.e. currents depending only on a spacetime point). This includes the class of all theories described by an action which is an integral of a local Lagrangian.

*A symmetry is a local symmetry or gauge symmetry (local gauge symmetry is redundant) if its parameters ($\theta$ in your example) are local rather than constant.

Local symmetry is indeed a more powerful property than global symmetry in the sense that it puts strong constraints on the possible vertices. For example, the $U(1)$ global symmetry of $\partial_\mu \phi^* \partial^\mu \phi$ can be preserved by adding any function of $|\phi|^2$ as a potential. But if we want $U(1)$ to be a gauge symmetry, we have to introduce a gauge field and promote regular derivatives to covariant derivatives.
There is another layer to this when we talk about the S-matrix instead of the action. If a theory just has a global symmetry, its amplitudes organize into representations of this symmetry. But once there is gauge symmetry, the only non-trivial amplitudes are the gauge invariant ones. As Andrea mentions, this means everything we want to calculate can in principle be found in a gauge invariant way that makes no reference to a local Lagrangian. Instead, such an approach would make use of Wilson loop operators defined as
\begin{equation}
W[\gamma] = \mathrm{exp} \left ( \oint_\gamma A_\mu(x) dx^\mu \right ).
\end{equation}
These are gauge invariant but nonlocal since they depend on a whole path.
So in this sense, the entire notion of gauge symmetry is a trick. Symmetries of theories we can observe are always global ones. But for some of these theories, the only way we know of modelling them with a local Lagrangian is to use intermediate steps where the symmetry parameters are local as well.
