nLab
lexicographic order

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 {L i} iI\{L_i\}_{i \in I} be a well-ordered family of linearly ordered sets. The lexicographic order on the product of sets L= iIL iL = \prod_{i \in I} L_i is the linear order defined as follows: if x,yLx, y \in L and xyx \neq y, then x<yx \lt y iff x i<y ix_i \lt y_i where ii is the least element in the set {jI:x jy j}\{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 iIL i\prod_{i \in I} L_i as well. For instance, the free monoid S *S^\ast on a linearly ordered set SS can be embedded in a countable power

i:S *(1+S) = n(1+S)i \colon S^\ast \hookrightarrow (1 + S)^\mathbb{N} = \prod_{n \in \mathbb{N}} (1 + S)

where 1+S1 + S is the result of freely adjoining a bottom element ee to SS, and for each finite list (s 1,,s k)(s_1, \ldots, s_k) we have

i(s 1,,s k)=(s 1,s 2,,s k,e,e,e,).i(s_1, \ldots, s_k) = (s_1, s_2, \ldots, s_k, e, e, e, \ldots).

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}.

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×:SetSetL \times - \colon Set \to Set, with coalgebra structure h,t:CL×C\langle h, t \rangle \colon C \to L \times C, then the lexicographic order on CC may be defined corecursively:

  • c<cc \lt c' if h(c)<h(c)h(c) \lt h(c') or (h(c)=h(c)h(c) = h(c') and t(c)<t(c)t(c) \lt t(c')).
Revised on September 16, 2012 15:15:14 by Todd Trimble (67.81.93.25)