inversion in discrete mathematics