Robinson–Schensted correspondence

In mathematics, the Robinson–Schensted correspondence is a bijective correspondence between permutations and pairs of standard Young tableaux of the same shape. It has various descriptions, all of which are of algorithmic nature, it has many remarkable properties, and it has applications in combinatorics and other areas such as representation theory. The correspondence has been generalized in numerous ways, notably by Knuth to what is known as the Robinson–Schensted–Knuth correspondence, and a further generalization to pictures by Zelevinsky.

The simplest description of the correspondence is using the Schensted algorithm, a procedure that constructs one tableau by successively inserting the values of the permutation according to a specific rule, while the other tableau records the evolution of the shape during construction. The correspondence had been described, in a rather different form, much earlier by Robinson, in an attempt to prove the Littlewood–Richardson rule. The correspondence is often referred to as the Robinson–Schensted algorithm, although the procedure used by Robinson is radically different from the Schensted algorithm, and almost entirely forgotten. Other methods of defining the correspondence include a nondeterministic algorithm in terms of jeu de taquin.

The bijective nature of the correspondence relates it to the enumerative identity


 * $$\sum_{\lambda\in\mathcal{P}_n} (t_\lambda)^2= n!$$

where $$\mathcal{P}_n$$ denotes the set of partitions of $n$ (or of Young diagrams with $n$ squares), and $t_{λ}$ denotes the number of standard Young tableaux of shape $λ$.

The Schensted algorithm
The Schensted algorithm starts from the permutation $σ$ written in two-line notation


 * $$\sigma=\begin{pmatrix}1 & 2 & 3 & \cdots & n\\ \sigma_1 & \sigma_2 & \sigma_3 & \cdots & \sigma_n \end{pmatrix}$$

where $σ_{i} = σ(i)$, and proceeds by constructing sequentially a sequence of (intermediate) ordered pairs of Young tableaux of the same shape:


 * $$(P_0, Q_0), (P_1, Q_1), \ldots, (P_n, Q_n),$$

where $P_{0} = Q_{0}$ are empty tableaux. The output tableaux are $P = P_{n}$ and $Q = Q_{n}$. Once $P_{i−1}$ is constructed, one forms $P_{i}$ by inserting $σ_{i}$ into $P_{i−1}$, and then $Q_{i}$ by adding an entry $i$ to $Q_{i−1}$ in the square added to the shape by the insertion (so that $P_{i}$ and $Q_{i}$ have equal shapes for all $i$). Because of the more passive role of the tableaux $Q_{i}$, the final one $Q_{n}$, which is part of the output and from which the previous $Q_{i}$ are easily read off, is called the recording tableau; by contrast the tableaux $P_{i}$ are called insertion tableaux.

Insertion
The basic procedure used to insert each $σ_{i}$ is called Schensted insertion or row-insertion (to distinguish it from a variant procedure called column-insertion). Its simplest form is defined in terms of "incomplete standard tableaux": like standard tableaux they have distinct entries, forming increasing rows and columns, but some values (still to be inserted) may be absent as entries. The procedure takes as arguments such a tableau $T$ and a value $x$ not present as entry of $T$; it produces as output a new tableau denoted $T ← x$ and a square $s$ by which its shape has grown. The value $x$ appears in the first row of $T ← x$, either having been added at the end (if no entries larger than $x$ were present), or otherwise replacing the first entry $y > x$ in the first row of $T$. In the former case $s$ is the square where $x$ is added, and the insertion is completed; in the latter case the replaced entry $y$ is similarly inserted into the second row of $T$, and so on, until at some step the first case applies (which certainly happens if an empty row of $T$ is reached).

More formally, the following pseudocode describes the row-insertion of a new value $x$ into $T$.
 * 1) Set $i = 1$ and $j$ to one more than the length of the first row of $T$.
 * 2) While $j > 1$ and $x < T_{i, j−1}$, decrease $j$ by 1. (Now $(i, j)$ is the first square in row $i$ with either an entry larger than $x$ in $T$, or no entry at all.)
 * 3) If the square $(i, j)$ is empty in $T$, terminate after adding $x$ to $T$ in square $(i, j)$ and setting $s = (i, j)$.
 * 4) Swap the values $x$ and $T_{i, j}$. (This inserts the old $x$ into row $i$, and saves the value it replaces for insertion into the next row.)
 * 5) Increase $i$ by 1 and return to step 2.

The shape of $T$ grows by exactly one square, namely $s$.

Correctness
The fact that $T ← x$ has increasing rows and columns, if the same holds for $T$, is not obvious from this procedure (entries in the same column are never even compared). It can however be seen as follows. At all times except immediately after step 4, the square $(i, j)$ is either empty in $T$ or holds a value greater than $x$; step 5 re-establishes this property because $(i, j)$ now is the square immediately below the one that originally contained $x$ in $T$. Thus the effect of the replacement in step 4 on the value $T_{i, j}$ is to make it smaller; in particular it cannot become greater than its right or lower neighbours. On the other hand the new value is not less than its left neighbour (if present) either, as is ensured by the comparison that just made step 2 terminate. Finally to see that the new value is larger than its upper neighbour $T_{i−1, j}$ if present, observe that $T_{i−1, j}$ holds after step 5, and that decreasing $j$ in step 2 only decreases the corresponding value $T_{i−1, j}$.

Constructing the tableaux
The full Schensted algorithm applied to a permutation $σ$ proceeds as follows.
 * 1) Set both $P$ and $Q$ to the empty tableau
 * 2) For $i$ increasing from $1$ to $n$ compute $P ← σ_{i}$ and the square $s$ by the insertion procedure; then replace $P$ by $P ← σ_{i}$ and add the entry $i$ to the tableau $Q$ in the square $s$.
 * 3) Terminate, returning the pair $(P, Q)$.

The algorithm produces a pair of standard Young tableaux.

Invertibility of the construction
It can be seen that given any pair $(P, Q)$ of standard Young tableaux of the same shape, there is an inverse procedure that produces a permutation that will give rise to $(P, Q)$ by the Schensted algorithm. It essentially consists of tracing steps of the algorithm backwards, each time using an entry of $Q$ to find the square where the inverse insertion should start, moving the corresponding entry of $P$ to the preceding row, and continuing upwards through the rows until an entry of the first row is replaced, which is the value inserted at the corresponding step of the construction algorithm. These two inverse algorithms define a bijective correspondence between permutations of $n$ on one side, and pairs of standard Young tableaux of equal shape and containing $n$ squares on the other side.

Properties
One of the most fundamental properties, but not evident from the algorithmic construction, is symmetry:


 * If the Robinson–Schensted correspondence associates tableaux $(P, Q)$ to a permutation $σ$, then it associates $(Q, P)$ to the inverse permutation $σ^{−1}$.

This can be proven, for instance, by appealing to Viennot's geometric construction.

Further properties, all assuming that the correspondence associates tableaux $(P, Q)$ to the permutation $σ = (σ_{1}, ..., σ_{n})$.


 * In the pair of tableaux $(P′, Q′)$ associated to the reversed permutation $(σ_{n}, ..., σ_{1})$, the tableau $P′$ is the transpose of the tableau $P$, and $Q′$ is a tableau determined by $Q$, independently of $P$ (namely the transpose of the tableau obtained from $Q$ by the Schützenberger involution).
 * The length of the longest increasing subsequence of $σ_{1}, ..., σ_{n}$ is equal to the length of the first row of $P$ (and of $Q$).
 * The length of the longest decreasing subsequence of $σ_{1}, ..., σ_{n}$ is equal to the length of the first column of $P$ (and of $Q$), as follows from the previous two properties.
 * The descent set ${i : σ_{i} > σ_{i+1}}|undefined$ of $σ$ equals the descent set ${i : i+1 is in a row strictly below the row of i}$ of $Q$.
 * Identify subsequences of $π$ with their sets of indices. It is a theorem of Greene that for any $k ≥ 1$, the size of the largest set that can be written as the union of at most $k$ increasing subsequences is $λ_{1} + ... + λ_{k}$. In particular, $λ_{1}$ equals the largest length of an increasing subsequence of $π$.
 * If $σ$ is an involution, then the number of fixed points of $σ$ equals the number of columns of odd length in $λ$.

Application to the Erdős–Szekeres theorem
The Robinson-Schensted correspondence can be used to give a simple proof of the Erdős–Szekeres theorem.