Physics, philosophy, and the foundations of geometry