  Recently, Lobb and Nijhoff initiated the study of variational (Lagrangian)
structure of discrete integrable systems from the perspective of
multi-dimensional consistency. In the present work, we follow this line of
research and develop a Lagrangian theory of integrable one-dimensional systems.
We give a complete solution of the following problem: one looks for a function
of several variables (interpreted as multi-time) which delivers critical points
to the action functionals obtained by integrating a Lagrangian 1-form along any
smooth curve in the multi-time. The Lagrangian 1-form is supposed to depend on
the first jet of the sought-after function. We derive the corresponding
multi-time Euler-Lagrange equations and show that, under the multi-time
Legendre transform, they are equivalent to a system of commuting Hamiltonian
flows. Involutivity of the Hamilton functions turns out to be equivalent to
closeness of the Lagrangian 1-form on solutions of the multi-time
Euler-Lagrange equations. In the discrete time context, the analogous extremal
property turns out to be characteristic for systems of commuting symplectic
maps. For one-parameter families of commuting symplectic maps (B\"acklund
transformations), we show that their spectrality property, introduced by
Kuznetsov and Sklyanin, is equivalent to the property of the Lagrangian 1-form
to be closed on solutions of the multi-time Euler-Lagrange equations, and
propose a procedure of constructing Lax representations starting from the maps
themselves.
