Principles of Discrete Time Mechanics