I’ve been trying to understand the relationship between conserved charges and symmetry transformations; in particular how the conserved charges act as generators for the symmetry in the Hamiltonian formalism and how, given a conserved charge, we can derive the associated symmetry. I’ve seen this referred to as the inverse Noether theorem.
Here https://arxiv.org/abs/1601.03616 (section 2.2) the argument is as follows:
Given a conserved charge $Q$ with
$$ \frac{dQ}{d t} = 0\tag{1} $$
and a transformation defined by the infinitesimal change in the coordinates being:
$$\delta_{s} q^{i}=\left[q^{i}, \epsilon Q\right]=\epsilon \frac{\partial Q}{\partial p_{i}}, \qquad \delta_{s} p_{i}=\left[p_{i}, \epsilon Q\right]=-\epsilon \frac{\partial Q}{\partial q^{i}} ,\tag{2}$$
the change in the action is:
\begin{equation} \begin{aligned} \delta I &=\int d t\left(\delta_{s} p \dot{q}+p \frac{d}{d t} \delta_{s} q-\frac{\partial H}{\partial p} \delta_{s} p-\frac{\partial H}{\partial q} \delta_{s} q\right) \\ &=\int d t\left(-\epsilon \frac{\partial Q}{\partial q} \dot{q}+\frac{d}{d t}\left(p \delta_{s} q\right)-\epsilon \dot{p} \frac{\partial Q}{\partial p}+\epsilon \frac{\partial H}{\partial p} \frac{\partial Q}{\partial q}-\epsilon \frac{\partial H}{\partial q} \frac{\partial Q}{\partial p}\right) \\ &=\int d t\left(\epsilon\left(-\frac{d Q}{d t}+\frac{\partial Q}{\partial t}+[Q, H]\right)+\frac{d}{d t}\left(p \delta_{s} q\right)\right) \\ &=\int d t \frac{d}{d t}\left(-\epsilon Q+p \delta_{s} q\right). \end{aligned}\tag{3} \end{equation}
This is confusing me because it seems the change in the Lagrangian would be a total time derivative regardless of whether $Q$ is a constant of the motion or not.
$$ \frac{\partial F}{\partial t}+[F, H]=\frac{dF}{d t} ,\tag{4}$$
for any function, so, in the second to last line, wouldn’t all terms involving $Q$ disappear from the change in the Lagrangian even if $Q$ wasn’t constant?
Any help would be appreciated. I’d also like to gain some intuition for why it’s the conserved charges in particular which generate symmetries even when the Poisson bracket with the Hamiltonian is non-zero due to explicit time dependence.