  We construct no-ghost theories of analytic mechanics involving arbitrary
higher-order derivatives in Lagrangian. It has been known that for theories
involving at most second-order time derivatives in the Lagrangian, eliminating
linear dependence of canonical momenta in the Hamiltonian is necessary and
sufficient condition to eliminate Ostrogradsky ghost. In the previous work we
showed for the specific quadratic model involving third-order derivatives that
the condition is necessary but not sufficient, and linear dependence of
canonical coordinates corresponding to higher time-derivatives also need to be
removed appropriately. In this paper, we generalize the previous analysis and
establish how to eliminate all the ghost degrees of freedom for general
theories involving arbitrary higher-order derivatives in the Lagrangian. We
clarify a set of degeneracy conditions to eliminate all the ghost degrees of
freedom, under which we also show that the Euler-Lagrange equations are
reducible to a second-order system.
