  In this paper, we will give a rigorous construction of the exact discrete
Lagrangian formulation associated to a continuous Lagrangian problem. Moreover,
we work in the setting of Lie groupoids and Lie algebroids which is enough
general to simultaneously cover several cases of interest in discrete and
continuous descriptions as, for instance, Euler-Lagrange equations,
Euler-Poincar\'e equations, Lagrange-Poincar\'e equations... The construction
of an exact discrete Lagrangian is of considerable interest for the analysis of
the error between an exact trajectory and the discrete trajectory derived by a
variational integrator.
