Given a monoid (or semigroup) $M$ and an element $a \in M$, a left principal ideal in $M$ is a subset$M a$ of $M$ such that for all $m \in M$, $m a \in M a$. Similarly, a right principal ideal in $M$ is a subset$a M$ of $M$ such that for all $m \in M$, $a m \in a M$. Finally, a two-sided principal ideal, or simply principal ideal, in $M$ is a subset $\langle a \rangle$ that is both a left ideal and a right ideal.