On lagrangian duality in infinite dimension and its applications