Use nonnegative integer matrix entries, including zero, and English Young diagram conventions: rows run left to right and columns run down. Replace by a two-line array containing copies of , sorted lexicographically by upper letter and then lower letter . Finite support makes the array finite.
In the RSK algorithm, insert each lower letter into by row insertion. In the first row replace the leftmost entry strictly greater than , carrying the replaced entry into the next row; if there is no such entry, append and stop. Repeat in subsequent rows until a new cell is made. Put the upper letter in that new cell of the recording tableau .
The insertion-path facts used here are the following: row insertion preserves weak rows and strict columns; inserting followed by puts the latter new cell strictly to the right of the former; reverse insertion undoes insertion; and the reverse paths from a right-to-left horizontal strip recover its input letters in weakly decreasing order. These standard path facts ensure that is a semistandard Young tableau. The upper letters are nondecreasing, so the entries of are weakly increasing in rows. Equal upper letters have sorted lower letters, and hence create a horizontal strip; they cannot occupy the same column. Thus is also a semistandard Young tableau, of exactly the same shape as .
Here is the inverse on any such pair. Select a largest entry in , and among the cells carrying it select the rightmost one. It is an outer corner: there can be no larger entry below it, and any entry to its right would be another maximal entry farther right. Delete that cell from and reverse-insert the value at its cell in . In each preceding row replace the rightmost entry strictly smaller than the carried value and carry that old entry upward. The value emerging from the first row is . Record and repeat. Equal maximal entries form a horizontal strip, so the reverse-path fact gives their 's in weakly decreasing order. Reversing the recovered list therefore gives exactly a lexicographically sorted two-line array. The procedures are mutually inverse, proving the RSK correspondence bijection, including the zero matrix and the pair of empty tableaux.
Insertion only moves previous entries and adds one copy of its new letter; recording adds one copy of its upper letter. Consequently
For the trace assertion, use the insertion-path form of the RSK growth-diagram local rule. Let be the shapes from the northwest, northeast, southwest and southeast matrix prefixes around entry . Padding row lengths with zeros, the rule is
This local rule counts the two merging insertion paths row by row: the entry supplies the initial carry, the longer extension supplies the current row, and the overlap of the extensions beyond is bumped to the next row. It is a standard insertion-path fact being used in addition to the preceding monotonicity statements.
Define . Each column of the Young diagram contributes its alternating vertical sum, which is one for odd length and zero for even length. Thus counts odd-length columns. For symmetric , transposition symmetry of RSK gives equal shapes for the two prefixes off the diagonal, so at entry . The rule becomes
Taking alternating sums makes the two sums involving cancel, leaving
Starting from the empty northwest corner and proceeding along the diagonal proves the trace and odd columns in symmetric RSK identity
This also accommodates arbitrary diagonal entries, rather than only permutation matrices.