The idea of mathematical duality was first noticed as projective duality. There it appears as the idea of interchanging dimension k and codimension k+1 in propositions of projective geometry. A large number of duality theories have now been created in mathematics, ranging as far as optimization theory and theoretical physics.