Theorems

Contents

Idea

The lexicographic order is a generalization of the order in which words are listed in a dictionary, according to the order of letters where the spelling of two words first differs.

Definition

Definition

Let {Li}i∈I\{L_i\}_{i \in I} be a well-ordered family of linearly ordered sets. The lexicographic order on the product of sets L=∏i∈ILiL = \prod_{i \in I} L_i is the linear order defined as follows: if x,y∈Lx, y \in L and x≠yx \neq y, then x<yx \lt y iff xi<yix_i \lt y_i where ii is the least element in the set {j∈I:xj≠yj}\{j \in I: x_j \neq y_j\}.

While this notion is most often seen for linear orders, it can be applied also toward more general relations. For example, one might apply the construction to sets equipped with a transitive relation <\lt, dropping the trichotomy assumption.

Often this notion is extended to subsets of ∏i∈ILi\prod_{i \in I} L_i as well. For instance, the free monoidS*S^\ast on a linearly ordered set SS can be embedded in a countable power

Then the lexicographic order on S*S^\ast is the one inherited from its embedding into the lexicographically ordered set (1+S)ℕ(1 + S)^\mathbb{N}.

Remark

The decision to freely adjoin a bottom element ee is of course purely a convention, based on the ordinary dictionary convention that the Scrabble word AAH should come after AA. Alternatively, we could equally well deem that ee is a freely adjoined top element, so that AA comes after AAH; this might be called the “anti-dictionary” convention.

Corecursive definition

if LL is linearly ordered and the underlying set C=LℕC = L^\mathbb{N} is regarded as the terminal coalgebra for the functor L×−:Set→SetL \times - \colon Set \to Set, with coalgebra structure ⟨h,t⟩:C→L×C\langle h, t \rangle \colon C \to L \times C, then the lexicographic order on CC may be defined corecursively:

For the special case L=ℕL = \mathbb{N}, the terminal coalgebra ℕℕ\mathbb{N}^\mathbb{N} with this lexicographic order is order-isomorphic to the real interval [0,∞)[0, \infty). This isomorphism is described more precisely here.