Rel, bicategory of relations, allegory
left and right euclidean;
extensional, well-founded relations.
A (binary) relation $\prec$ on a set $S$ is called well-founded if it is valid to do induction on $\prec$ over $S$.
Given a subset $A$ of $S$, suppose that $A$ has the property that, given any element $x$ of $S$, if
then $x \in A$. Such an $A$ may be called a $\prec$-inductive subset of $S$. The relation $\prec$ is well-founded if the only $\prec$-inductive subset of $S$ is $S$ itself.
Note that this is precisely what is necessary to validate induction over $\prec$: if we can show that a statement is true of $x\in S$ whenever it is true of everything $\prec$-below $x$, then it must be true of everything in $S$. In the presence of excluded middle it is equivalent to other commonly stated definitions; see Formulations in classical logic below.
While the definition above follows how a well-founded relation is generally used (namely, to prove properties of elements of $S$ by induction), it is complicated. Two alternative formulations are given by the following:
The relation $\prec$ has no infinite descent (usually attributed to Pierre de Fermat) if there exists no sequence $\cdots \prec x_2 \prec x_1 \prec x_0$ in $S$. (Such a sequence is called an infinite descending sequence.)
The relation $\prec$ is classically well-founded if every inhabited subset $A$ of $S$ has a member $x \in A$ such that no $t \in A$ satisfies $t \prec x$. (Such an $x$ is called a minimal element of $A$.)
In classical mathematics, both of these conditions are equivalent to being well-founded. In constructive mathematics, we may prove that a well-founded relation has no infinite descent (see Proposition 1), but not the converse, and that a classically well-founded relation is well-founded (see Proposition 2), but not the converse.
We note that classical well-foundedness is really too strong for constructive (i.e., intuitionistic) mathematics: if there exists an inhabited relation that is classically well-founded, then excluded middle follows. (This holds true in any topos; for a proof, see here.) On the other hand, the infinite descent condition is too weak to be of much use in constructive mathematics. It is the inductive notion of well-foundedness that is just right.
Note however that in predicative mathematics, the definition of well-founded may be impossible to even state, and so either of these alternative definitions would be preferable, provided classical logic is used.
Even in constructive predicative mathematics, (1) is strong enough to establish the Burali-Forti paradox (when applied to linear orders). In material set theory, (2) is traditionally used to state the axiom of foundation, although the impredicative definition could also be used as an axiom scheme (and must be in constructive versions). In any case, either (1) or (2) is usually preferred by classical mathematicians as simpler.
To round out the discussion we prove the following two results, both valid in intuitionistic mathematics:
If $(X, \prec)$ is a well-founded relation and $A \subseteq X$ has no minimal element, then $A$ is empty.
This result makes it trivial to infer (under classical logic) that classical well-foundedness is a consequence of well-foundedness. It also shows that well-foundedness rules out infinite descent (intuitionistically), since an infinite descent sequence has no minimal element.
Let $U = \{u \in X: u \notin A\; \wedge \; (\forall x: X),\; x \prec u \Rightarrow x \notin A\}$. Clearly $U \cap A = \emptyset$. We show $U$ is inductive, so that under well-foundedness $U = X$ and $A = X \cap A = U \cap A = \emptyset$, as desired.
So, suppose $z$ is an element such that $y \in U$ whenever $y \prec z$. We must show $z \in U$. Claim: $z \notin A$. For if $z \in A$, then $z$ would be a minimal element of $A$ (as $y \prec z \Rightarrow y \in U \Rightarrow y \notin A$). But this negates the assumption that $A$ has no minimal element.
Thus $z \notin A$, and $y \prec z \Rightarrow y \in U \Rightarrow y \notin A$, so that $z \in U$. This completes the proof.
In intuitionistic set theory, classical well-foundedness implies (inductive) well-foundedness.
Let $\prec$ be a classically well-founded relation on $X$, and let $U$ be an inductive subset. We must show that every element $x \in X$ belongs to $U$. Since $U$ is inductive, it suffices to show that every $u \prec x$ belongs to $U$, i.e. we may assume given a $u$ such that $u\prec x$ and show $u\in U$. But under this assumption we have that $\prec$ is inhabited, so according to Remark 1, the law of excluded middle follows and we might as well then argue classically. The argument is well-known but we include it for completeness: under classical well-foundedness, if an inductive subset $U$ is not the entirety of $X$, then the complement $\neg U$ has a minimal element $y$. In that case, $v \prec y$ implies $v \in \neg\neg U = U$, but then $y \in U$ since $U$ is inductive, contradiction. Hence $U = X$ and in particular $u \in U$, which is what we wanted.
To bring us full circle: in classical set theory we may prove that if $(X, \prec)$ has no infinite descent, then $\prec$ is classically well-founded. For suppose an inhabited subset $P \subseteq X$ (say with an element $x \in P$) failed to have a least element. Then we can find an infinite descent sequence $x_n \in P$ with $x_0 = x$, by choosing at each stage $x_{n+1} \in P$ such that $x_{n+1} \prec x_n$. Technically this requires the use of dependent choice, but generally this is felt to be a mild choice principle (that is true even for intuitionistic mathematics).
Many inductive or recursive notions may also be packaged in coalgebraic terms. For the concept of well-founded relation, first observe that a binary relation $\prec$ on a set $X$ is the same as a coalgebra structure $\theta\colon X \to P(X)$ for the covariant power-set endofunctor on $Set$, where $y \prec x$ if and only if $y \in \theta(x)$.
In this language, a subset $i\colon U \hookrightarrow X$ is $\prec$-inductive, or $\theta$-inductive, if in the pullback
the map $j$ factors through $i$. (Note that $j$ is necessarily monic, since $P$ preserves monos.) Unpacking this a bit: for any $x \in X$, if $\theta(x) = V$ belongs to $P U$, that is if $\theta(x) \subseteq U$, then $x \in U$. This says the same thing as $\forall_{x\colon X} (\forall_{y\colon X} y \prec x \Rightarrow y \in U) \Rightarrow x \in U$.
Then, as usual, the $P$-coalgebra $(X, \theta)$ is well-founded if every $\theta$-inductive subset $U \hookrightarrow X$ is all of $X$.
Other relevant notions may also be packaged; for example, the $P$-coalgebra $X$ is extensional if $\theta\colon X \to P X$ is monic. See also well-founded coalgebra.
Given two sets $S$ and $T$, each equipped with a well-founded relation $\prec$, a function $f\colon S \to T$ is a simulation of $S$ in $T$ if
$f(x) \prec f(y)$ whenever $x \prec y$ and
given $t \prec f(x)$, there exists $y \prec x$ with $t = f(y)$.
Then sets so equipped form a category with simulations as morphisms. See extensional relation for more uses of simulations.
In coalgebraic language, a simulation $S \to T$ is simply a $P$-coalgebra homomorphism $f\colon S \to T$. Condition (1), that $f$ is merely $\prec$-preserving, translates to the condition that $f$ is a colax morphism of coalgebras, in the sense that there is an inclusion
If $(X, \prec)$ is well-founded and $(Y, \prec)$ is (weakly) extensional, then there is at most one simulation $f: X \to Y$.
Every well-founded relation is irreflexive; that is, $x \nprec x$. Sometimes one wants a reflexive version $\preceq$ of a well-founded relation; let $x \preceq y$ if and only $x \prec y$ or $x = y$. Then the requirement that $x$ be a minimal element of a subset $A$ states that $t \preceq x$ only if $t = x$. But infinite descent or direct proof by induction still require $\prec$ rather than $\preceq$.
A well order may be defined as a well-founded linear order, or alternatively as a transitive, extensional, well-founded relation.
A well-quasi-order is a well-founded preorder (referring to the reflexive version of well-foundedness above) that in addition has no infinite antichains.
The axiom of foundation in material set theory states precisely that the membership relation $\in$ on the proper class of all pure sets is well-founded. In structural set theory, accordingly, one uses well-founded relations in building structural models of well-founded pure sets.
Let $S$ be a finite set. Then any relation on $S$ whose transitive closure is irreflexive is well-founded.
Let $S$ be the set of natural numbers, and let $x \prec y$ if $y$ is the successor of $x$: $y = x + 1$. That this relation is well-founded is the usual principle of mathematical induction.
Again let $S$ be the set of natural numbers, but now let $x \prec y$ if $x \lt y$ in the usual order. That this relation is well-founded is the principle of strong induction.
More generally, let $S$ be a set of ordinal numbers (or even the proper class of all ordinal numbers), and let $x \prec y$ if $x \lt y$ in the usual order. That this relation is well-founded is the principle of transfinite induction.
Similarly, let $S$ be a set of pure sets (or even the proper class of all pure sets), and let $x \prec y$ if $x \in y$. That this relation is well-founded is the axiom of foundation.
Let $S$ be the set of integers, and let $x \prec y$ mean that $x$ properly divides $y$: $y/x$ is an integer other than $\pm{1}$. This relation is also well-founded, so one can prove properties of integers by induction on their proper divisors.