Electromagnetic duality interacting with a complex scalar field My question refers to example theory introduced in the book "Supergravity" from D.Z.Freedman & A. van Proeyen p.80. Its Lagrangian is given by
$${\cal L}(Z,F) =-\frac{1}{4}(Im Z)F_{\mu\nu}F^{\mu\nu} -\frac{1}{8}(Re Z)\epsilon^{\mu\nu\rho\sigma} F_{\mu\nu}F_{\rho\sigma}=-\frac{1}{2}Im(Z F_{\mu\nu}^- F^{\mu\nu-})$$
where $F_{\mu\nu}$ is the field tensor of a $U(1)$ gauge field and $Z$ is a complex scalar field. The field tensor has a dual
$$F^\tilde{\mu\nu}  =-\frac{1}{2}i\epsilon^{\mu\nu\rho\sigma}F_{\rho\sigma}$$
and (apart from a possible sign) self-dual combinations can be defined:
$$F^{\mu\nu\pm} = \frac{1}{2}(F^{\mu\nu} \pm F^\tilde{\mu\nu})$$
The negative linear combination is used in the definition of the Lagrangian. This theory gives rise to the following field equations (FEs):
$$\partial_\mu F^\tilde{\mu\nu}=0 \quad\quad\text{and}\quad\quad \partial_\mu[(ImZ) F^{\mu\nu} + i(ReZ) F^\tilde{\mu\nu}]=0  $$
which by using the definition
$$ G^{\mu\nu} = \epsilon^{\mu\nu\rho\sigma}\frac{\delta S}{\delta F^{\rho\sigma}} = -i(ImZ) F^\tilde{\mu\nu} + (ReZ) F^{\mu\nu} $$
can be also written in the following form:
$$\partial_\mu Im F^{\mu\nu-} =0\quad\quad \text{and}\quad\quad \partial_\mu Im G^{\mu\nu-} =0$$
where the same definition of the self dual combination was applied on $G^{\mu\nu}$. $G$ also fulfils:
$$G^{\mu\nu-} = Z F^{\mu\nu-}$$.
Now the authors claim that the field equations are invariant to the following transformation:
$$\left(\begin{array}{c} F'^-\\ G'^-\end{array}\right) = {\cal S} \left(\begin{array}{c} F^-\\ G^-\end{array}\right)$$
with ${\cal S} \in SL(2,\mathbb{R})$, i.e.
$${\cal S} = \left(\begin{array}{cc} d & c \\ b & a \end{array} \right) \quad\quad \text{with} \quad\quad ad-cb=1$$
Invariance is supposed to be that  both $F'^-$ and $G'^-$  fulfill  the same FEs than $F^-$ & $G^-$ as well as that $Z$ transforms like:
$$ Z' = \frac{aZ+b  }{cZ+d }$$ where $Z'$ is defined as:
$$ G'^{\mu\nu-} = Z' F'^{\mu\nu-}$$
I checked the claimed invariance and it is indeed realised. The curious thing is that on the next page the authors claim that the Lagrangian is not invariant to the same transformation:
$${\cal L}(Z',F') = -\frac{1}{2} Im(Z(1+cZ)F_{\mu\nu}^- F^{\mu\nu-})\neq {\cal L}(Z,F)$$
I was quite surprised by this result. Would it be mean that a (more subtle) duality as presented here leaves the field equations invariant, but the Lagrangian not? I always thought that an invariance found on the FEs corresponds one-to-one to an invariance of the Lagrangian. Is this not the case for a duality?
Any help is appreciated.
 A: In Maxwell theory, duality transformation reads infinitesimally $\delta F_{\mu\nu}=\tilde F_{\mu\nu}$ or
$\delta \vec E= \vec B,\; \delta \vec B= -\vec E$. Using this in the action with Lagrangian ${\cal L}=-1/4 F_{\mu\nu}F^{\mu\nu}$ we find
\begin{align}
\delta S&=-1/2 \int F^{\mu\nu} \tilde F_{\mu\nu}=-1/2 \int \epsilon^{\mu\nu\alpha\beta}F_{\mu\nu} F_{\alpha\beta}\\
&=-1/2\oint \partial_\alpha \left(\epsilon^{\mu\nu\alpha\beta}F_{\mu\nu}A_\beta\right)
\end{align}
However, this can be regarded as a true symmetry of the Lagrangian if it is represented as a transformation on the dynamical field $A_\mu$. It is shown by Deser and Teitelboim here that this is possible, but the duality transformation $\delta A$ is non-local, see their eq. 2.12. Therefore duality transformation is a symmetry of the action as it changes the action by a boundary (Chern-Simons) term.
However, more generally it is not true that every symmetry of the field equations can be realized in the Lagrangian.
There is a class of symmetries called hidden symmetries defined as those transformations that can be realized on the (Hamiltonian) phase space, but not on the configuration space.
More explicitly on the phase space $(x,p)$ a symmetry transformation is one that preserves the symplectic form $dx\wedge dp$ and the Hamiltonian $H$. Here, the transformation of $x,p$ are independent of each other. However, the Lagrangian formulation is based on the tangent bundle of the configuration space (parametrized by $q$) and therefore the symmetries are written as diffeomorphisms on the configuration space leaving the action invariant (up to boundary terms). The transformation on $\dot q$ is implied by the transformation on $q$. Therefore there are some symmetries in the Hamiltonian formulation that cannot be realized in the Lagrangian formulation.
The simplest example is the Runge-Lenz vector in the Kepler problem, see e.g. this paper by Cariglia.
