In canonical transformations, how come we allow hamiltonian to change by a partial derivative of time? $$H'(P, Q, t) = H(p, q, t) + \frac{\partial F}{\partial t}.$$ Here $F$ is the generating function.
I mean geometrically that is not how a function should be transformed when there is a change of variables. Geometrically it should be $$H'(P, Q, t) = H(p, q, t).$$ In Lagrangian mechanics it is indeed so $$L'(Q, \dot{Q}, T) = L(q, \dot{q}, t).$$