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:
A right ideal in $R$ is a subset $I$ such that:
A two-sided ideal in $R$ is a subset $I$ that is both a left and right ideal; that is:
This generalises to:
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:
We can make this look more algebraic if $L$ is a (bounded) join-semilattice:
If $L$ is indeed a lattice, then we can make this look just like the ring version:
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.
Ideals form complete lattices where arbitrary meets are given by set-theoretic intersection. In other words, ideals form a Moore collection of subsets of $R$ if $R$ is a rig, or of $L$ if $L$ is a lattice. This implies we have an ideal generated by any subset: the intersection of all ideals containing the subset. A subset $S$ that generates a given ideal $I$ may be called a subbase of $I$; then $S$ is a base if every element of $I$ is a multiple (in a rig) or a predecessor (in an order) of some element of $S$. (In particular, every singleton subset is a base of its generated ideal.) See also filter base and dualize for more about bases and subbases of ideals in lattices and other posets.
Certain kinds of ideals are often characterized by the roles they play in ideal lattices, or in terms of the Moore closure operator. Some examples follow.
The top element of an ideal lattice is called the improper ideal. That is to say, an ideal $I$ is the improper ideal if $x \in I$ for every $x$ (which follows if $1 \in I$ for the case of rigs, or $\top \in I$ for the case of bounded lattices). An ideal $I$ is proper if it is not the improper ideal: if there exists an element $x$ such that $x \notin I$. So in a rig, $I$ is proper iff $1 \notin I$; in a (bounded) lattice, $I$ is proper iff $\top \notin 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.
An ideal $I$ is principal if it is generated by a singleton. This means there exists an element $x \in I$ such that $y$ is a multiple of $x$ (in a rig) or $y \leq x$ (in an ordered set) whenever $y \in I$; we say that $I$ is generated by $x$. Thus every element $x$ generates a unique principal ideal, the set of all left/right/two-sided multiples of $x$ ($a x$, $x b$, or $a x b$ if we are talking about left/right/two-sided ideals in a rig) or the downset of $x$ (in an an order). Clearly, every ideal $I$ is a join over all the principal ideals $P_x$ generated by the elements $x$ of $I$.
As discussed at ideals in a monoid, there is for two-sided ideals an operation of ideal multiplication, making the ideal lattice a quantale (cf. Day convolution). Namely, if $I, J$ are ideals, then their product $I J$ is the ideal generated by all products $x y$ with $x \in I, y \in J$ in the case of rigs. Similarly, in the case of lattices, we could define $I J$ to be the ideal generated by all meets $x \wedge y$ – but in this case the result is the same as $I \cap J$. In any case, we say that an ideal $P$ is prime if for any ideals $I, J$, the condition $I J \subseteq P$ implies $I \subseteq P$ or $J \subseteq P$.
In the commutative case, we can characterize an ideal $I$ as prime if it is proper and it satisfies a binary condition corresponding to the nullary condition that is properness:
For noncommutative rigs, however, a two-sided ideal $P$ is prime if it satisfies a weaker binary condition: $(\forall_{x: R} a x b \in P) \Rightarrow a \in P \vee b \in P$. For example, in a matrix ring? $M_n(k)$ over a field $k$, the zero ideal is prime under our definition (really because a matrix ring is a simple ring, where the zero ideal is a maximal ideal), but $a b = 0$ does not imply $a = 0$ or $b = 0$. When the stronger binary condition is satisfied, we say $P$ is completely prime.
A maximal ideal $M$ is prime.
Because the ideal lattice is a quantale, multiplication of ideals distributes over ideal joins. Suppose $I J \subseteq M$ for two ideals $I, J$. If neither is contained in $M$, then $I \vee M = \top = J \vee M$ (the improper ideal) since $M$ is maximal. Then
where all four summands are contained in $M$ ($I J \subseteq M$ by supposition, and the other containments hold since $M$ is an ideal). Thus their join is contained in $M$, so we have proved $\top \subseteq M$, contradiction.
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.