The consequences of the projectability of Poincar\'e-Cartan forms in a third-order jet bundle J3π to a lower-order jet bundle are analyzed using the constraint algorithm for the Euler-Lagrange equations in J3π. The results are applied to the Hilbert Lagrangian for the Einstein equations. Furthermore, the case of higher-order mechanics is also studied as a particular situation.Peer ReviewedPostprint (author's final draft