Ideals show up both in ring theory and in lattice theory. We recall both of these below and look at some slight generalizations.
A left ideal in a ring (or even rig) $R$ is a subset $I$ of (the underlying set of) $R$ such that: * $0 \in I$; * $x + y \in I$ whenever $x, y \in I$; * $x y \in I$ whenever $y \in I$, regardless of whether $x \in I$.
A right ideal in $R$ is a subset $I$ such that: * $0 \in I$; * $x + y \in I$ whenever $x, y \in I$; * $x y \in I$ whenever $x \in I$.
A two-sided ideal in $R$ is a subset $I$ that is both a left and right ideal; that is: * $0 \in I$; * $x + y \in I$ whenever $x \in I$ and $y \in I$; * $x y \in I$ whenever $x \in I$ or $y \in I$.
This generalises to: * $x_1 + \cdots + x_n \in I$ whenever $x_k \in I$ for every $k$; * $x_1 \cdots x_n \in I$ whenever $x_k \in I$ for some $k$.
Notice that all three kinds of ideal are equivalent for a commutative ring.
An ideal in a lattice (or even proset) $L$ is a subset $I$ of (the underlying set of) $L$ such that: * There is an element of $I$ (so that $I$ is inhabited); * if $x, y \in I$, then $x, y \leq z$ for some $z \in I$; * if $x \in I$ and $y \leq x$, then $y \in I$ too.
We can make this look more algebraic if $L$ is a (bounded) join-semilattice: * $\bot \in I$; * $x \vee y \in I$ if $x, y \in I$; * $y \in I$ whenever $x \vee y \in I$.
If $L$ is indeed a lattice, then we can make this look just like the ring version: * $\bot \in I$; * $x \vee y \in I$ whenever $x, y \in I$; * $x \wedge y \in I$ whenever $x \in I$.
The concept of ideal is dual to that of filter. A subset of $L$ that satisfies the first two of the three axioms for an ideal in a proset is precisely a directed subset of $L$; notice that this is weaker than being a sub-join-semilattice even if $L$ is a lattice.
There are some common situations where these two kinds of ideal might seem to clash but fortunately do not:
A distributive lattice is both a lattice and a commutative rig; the two concepts of ideal are the same, as can be seen by comparing the definition for rigs to the last definition for lattices.
A Boolean algebra is a both a distributive lattice and a Boolean ring; again, the two concepts of ideal are the same (partly because the multiplication operators are the same, although there is still some checking to do regarding closure under addition).
On the other hand, every poset is a poset in an opposite way, and this does not give the same concept of ideal; an ideal in one is a filter in the opposite one. We are lucky that the convention for interpreting a Boolean ring as a lattice goes in the correct direction, or the two notions of ideal in a Boolean algebra would not match; or perhaps it is not a matter of luck, but the convention for which way to define ideals in a lattice was chosen precisely to match the conventions for Boolean algebras!
There is a notion of ideal in a monoid (or even semigroup), or more generally in a monoid object in any monoidal category $C$, which generalises the notion of ideal in a ri(n)g or in a (semi)lattice. That is, if $C$ is Ab, then a monoid in $C$ is a ring; if $C$ is Ab Mon, then a monoid in $C$ is a rig; and a semilattice is a commutative idempotent monoid in Set. See ideal in a monoid.
This generalizes all of the above notions of ideal except for ideals in prosets that are not (possibly unbounded) join-semilattices.
More generally still, passing from monoids to their many-object version there is a notion of ideal in a category, called a sieve. See there for details.
An ideal $I$ is proper if there exists an element $x$ such that $x \notin I$. In a rig, $I$ is proper iff $1 \notin I$; in a (bounded) lattice, $I$ is proper iff $\top \notin I$. If instead $x \in I$ for every $x$ (which follows if $1 \in I$ or $\top \in I$), we have the improper ideal.
An ideal $I$ is prime if it is proper and it satsfies a binary condition corresponding to the nullary condition that is properness: * In a rig, $x \in I$ or $y \in I$ if $x y \in I$; * In a proset, $x \in I$ or $y \in I$ if, for all $z$, $z \in I$ if $z \leq x$ or $z \leq y$. * In a lattice (simplifying the proset version to look like the rig verison), $x \in I$ or $y \in I$ if $x \wedge y \in I$.
An ideal is a maximal ideal if it is maximal among proper ideals. A maximal ideal in a rig (including in a distributive lattice, but not in every lattice) is necessarily prime; a prime ideal in a Boolean algebra is necessarily maximal.
That every ideal is contained in a prime ideal is a prime ideal theorem; that every ideal is contained in a maximal ideal is a maximal ideal theorem.
An ideal $I$ is principal if there exists an element $x \in I$ such that $y$ is a multiple of $x$ (in a rig) or $y \leq q$ (in an ordered set) whenever $y \in I$; we say that $I$ is generated by $x$. Every element $x$ generates a unique principal ideal, the set of all multiples of $x$ (in a rig) or the downset of $x$ (in an an order). In the noncommutative case, ‘multiple’ should be interpreted in a left/right sense to match that of ‘ideal’.
More generally, the ideals form a Moore collection of subsets of $R$ or $L$, so we have an ideal generated by any subset.