How can I derive the most general scalar field Lagrangian from locality? My understanding of the principle of locality in a field theory demands that field degrees of freedom interact locally. For example, $\phi(x)$ at the spacetime point $\phi(x+\delta x)$ can interact where $x\equiv x^\mu$ and $\delta x^\mu$ is an infinitesimal fourvector. Now, the Taylor expansion gives $$\phi(x+\delta x)=\phi(x)+\eta_{\mu\nu}\delta x^\mu\partial^\nu\phi(x)+\frac{1}{2}\eta_{\mu\nu}\eta_{\sigma\rho}\delta x^\mu\delta x^\sigma\partial^\nu\phi(x)\partial^\rho\phi(x)+O((\delta x)^3)$$. Therefore, locality should give rise to a terms in the Lagrangian density such as $$\phi(x)\phi(x+\delta x)\approx \phi^2+\eta_{\mu\nu}\delta x^\mu\phi\partial^\nu\phi+...$$
$\bullet$ We see that the coupling $\phi(x)\phi(x+\delta x)$ generates term proportional to various powers of $\delta x$. But a field theory Lagrangian contains only fields couplings between fields $\phi$ and its derivatives and no power of $\delta x$. Why is that even though a term like $\eta_{\mu\nu}\delta x^\mu\phi\partial^\nu\phi$ is Lorentz invariant?
$\bullet$ How does a Lagrangian (such a free Klein-Gordon Lagrangian) follow from my understanding of local interactions?
$\bullet$ Do I need to change or enlarge my understanding of locality?
 A: A local Lagrangian is one that can be written as a function (as opposed to a functional) of $\phi$, and a finite number of derivatives $\phi_{,\mu},\phi_{,\mu\nu},\cdots$. Therefore, a term
$$
\phi(x)\phi(x+a)=\phi(x)^2+\phi(x)(a\cdot\partial)\phi(x)+\frac12\phi(x)(a\cdot\partial)^2\phi(x)+\cdots\tag{1}
$$
is non-local, as it includes an infinite number of derivatives.
Similarly, a Lagrangian
$$
\mathcal L=\phi(x)\int \mathrm dz\ f(z)\phi(z)+\cdots\tag{2}
$$
is non-local, as it cannot be written as a function of $\phi(x)$ (it is a functional).
Note that this example actually contains the previous one as a subcase: by writing $\phi(z)=\phi(x)+(x-z)\cdot\partial\phi(x)+\cdots$, this functional is actually
$$
\mathcal L=\phi(x)\left[\phi(x)+A\cdot\partial\phi(x)+\cdots\right]\tag{3}
$$
where
$$
A\equiv \int\mathrm dz\ (x-z)f(z)\tag{4}
$$
In other words, the Lagrangian $(2)$ is non-local because it is a functional, or because it includes an infinite number of derivatives: both statements are equivalent.

A local Lagrangian is always a polynomial $\mathcal L=\mathcal L(\phi,\phi_{,\mu},\phi_{,\mu_1\mu_2},\cdots,\phi_{,\mu_1\mu_2\cdots\mu_n})$ with a finite number of arguments $n<\infty$. We could in principle consider non-polynomial Lagrangians, but these are always understood in the sense of their power series, and so we lose no generality.  In any case, the rule is: write $\mathcal L$ as a function of $\phi(x)$ and a finite number of derivatives, evaluated also at $x$. If in your Lagrangian you have a term that includes $\phi$ evaluated at any point different from $x$, then your Lagrangian is non-local.
