  The analogy between dynamics and optics had a great influence on the
development of the foundations of classical and quantum mechanics. We take this
analogy one step further and investigate the validity of Fermat's principle in
many-dimensional spaces describing dynamical systems (i.e., the quantum Hilbert
space and the classical phase and configuration space). We propose that if the
notion of a metric distance is well defined in that space and the velocity of
the representative point of the system is an invariant of motion, then a
generalized version of Fermat's principle will hold. We substantiate this
conjecture for time-independent quantum systems and for a classical system
consisting of coupled harmonic oscillators. An exception to this principle is
the configuration space of a charged particle in a constant magnetic field; in
this case the principle is valid in a frame rotating by half the Larmor
frequency, not the stationary lab frame.
