I was struck by the fact that Classic Gauge Theory in EM says that E & B fields are invariant under transformations of the potential, $V$, and vector potential, $A$, by any function, $f$, that is twice continuously differentiable function that depends on position and time. That is, \begin{align} \mathbf{A} &\mapsto \mathbf{A} + \nabla f\\ V &\mapsto V - \frac{\partial f}{\partial t} \end{align}
Which is remarkably similar to the invariance of action integral under the addition of the total derivative with respect to $t$ of any function of position and time.
I wanted to dig more into this, and I saw that gradient in spherical has the same terms as the square rooted the dr-dot squared portion of the Lagranian (ie the kinetic) and divided by the non-dotted term. It's hard to put what I mean into words. However, please refer to the comparison below.
Gradient: $$\boldsymbol{\nabla}{f} = \mathbf{e}_r\, \frac{\partial{f}}{\partial{r}} + \mathbf{e}_\theta\,\frac{1}{r } \,\frac{\partial{f}}{\partial{\theta}} + \mathbf{e}_\phi\,\frac{1}{r\,\sin{\theta}} \,\frac{\partial{f}}{\partial{\phi}}$$ Lagrangian: $$\vec v^2 = \dot r^2 + r^2 \dot \theta^2 + r^2 \sin^2(\theta) \dot \phi^2$$
Am I grasping at straws with a connection between Gauge invariance and Action invariance? Am I grasping at straws for connection between gradient and kinetic?