A foundation of information geometry