Perpetual motion is the motion of bodies that continues forever in an unperturbed system. A perpetual motion machine is a hypothetical machine that can do work infinitely without an external energy source. This kind of machine is impossible, as it would violate either the first or second law of thermodynamics, or both.
These laws of thermodynamics apply regardless of the size of the system. For example, the motions and rotations of celestial bodies such as planets may appear perpetual, but are actually subject to many processes that slowly dissipate their kinetic energy, such as solar wind, interstellar medium resistance, gravitational radiation and thermal radiation, so they will not keep moving forever.
Thus, machines that extract energy from finite sources will not operate indefinitely, because they are driven by the energy stored in the source, which will eventually be exhausted. A common example is devices powered by ocean currents, whose energy is ultimately derived from the Sun, which itself will eventually burn out.
In 2016, new states of matter, time crystals, were discovered in which on a microscopic scale the component atoms are in continual repetitive motion, thus satisfying the literal definition of "perpetual motion". However, these do not constitute perpetual motion machines in the traditional sense or violate thermodynamic laws because they are in their quantum ground state, so no energy can be extracted from them; they exhibit motion without energy.
History of perpetual motion machines
The history of perpetual motion machines dates back to the Middle Ages. For millennia, it was not clear whether perpetual motion devices were possible or not, but the development of modern theories of thermodynamics has shown that they are impossible. Despite this, many attempts have been made to construct such machines, continuing into modern times. Modern designers and proponents often use other terms, such as "over unity", to describe their inventions.