The algebraic structure of the generalized uncertainty principle