a question on lexicographic order and change of indices Consider a vector of components which are listed in lexicographic order: $\boldsymbol{z} = (z_{1,2},z_{1,3},\ldots,z_{1,K}, z_{2,3},z_{2,4},\ldots,z_{2,K},\ldots,z_{i,i+1},z_{i,i+2},\ldots,z_{i,K},\ldots,z_{K-1,K})'$ and $z_{k,l} = -z_{l,k}$ for $k<l$. Now suppose indices $(i,j)$ are interchanged in $\boldsymbol{z}$ and the resulting vector is denoted by $\boldsymbol{z}_{ij}$. I have verified that there is an orthogonal matrix say $\mathrm{H}$ with unit vectors such that $\mathrm{H}\boldsymbol{z} = \boldsymbol{z}_{ij}$. For example let $K=4$ then
\begin{equation}
\boldsymbol{z} = \begin{bmatrix}z_{12}\\
z_{13}\\
z_{14}\\
z_{23}\\
z_{24}\\
z_{34}
\end{bmatrix}
\end{equation}
and after interchanging $1$ and $2$ we get
\begin{equation}
\boldsymbol{z}_{12} = \begin{bmatrix}z_{21}\\
z_{23}\\
z_{24}\\
z_{13}\\
z_{14}\\
z_{34}
\end{bmatrix}
\end{equation}
Next
\begin{equation}
\boldsymbol{z}_{12} = \begin{bmatrix}
-1 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 1 & 0 & 0\\
0 & 0 & 0 & 0 & 1 & 0\\
0 & 1 & 0 & 0 & 0 & 0\\
0 & 0 & 1 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 1\\
\end{bmatrix}
\boldsymbol{z} = \mathrm{H}\boldsymbol{z}
\end{equation}
It can be noted that $ \mathrm{H}$ is symmetric and orthogonal. Is there any way to express the $\mathrm{H}$ matrix in a compact form in general when indices $i$ and $j$ are interchanged?
 A: I copy @HughDenocourt's comment from MathOverflow, made CW to avoid reputation:

What are you looking for as a compact form? Where $(k, l)$ is mapped can be broken into cases according to whether $k$ or $l$ is equal to $i$ or $j$ or neither. Note that $H$ is determined by the signed permutation of the roots/reflections for the geometric representation of the symmetric group as a Coxeter group. In this representation, each transposition $(i, j)$ corresponds to a positive root (in type A) as well as an action of the group that permutes (in a signed way) all the roots.

Specifically, suppose for convenience of notation that we have $i < j$.  If, for every $r < s \le K$, I write $e_{(r, s)}$ for the vector whose entry in position $(r, s)$ is $1$ and whose other entries are $0$, then we have that
$$
\mathrm H e_{(r, s)} = \begin{cases}
e_{(r, s)}, & \text{$r \notin \{i, j\}$ and $s \notin \{i, j\}$} \\
e_{(j, s)}, & \text{$r = i$ and $j < s$} \\
-e_{(s, j)}, & \text{$r = i$ and $s < j$} \\
e_{(i, s)}, & \text{$r = j$ and $i < s$} \\
%-e_{(i, s)}, & \text{$r = j$ and $s < i$} \\
%% Can't happen.
e_{(r, i)}, & \text{$r < i$ and $s = j$} \\
-e_{(r, i)}, & \text{$i < r$ and $s = j$} \\
e_{(r, j)}, & \text{$r < j$ and $s = i$} \\
%-e_{(r, j)}, & \text{$j < r$ and $s = i$} \\
%% Can't happen.
-e_{(i, j)}, & \text{$r = i$ and $s = j$.} \\
\end{cases}
$$
Therefore,
$$
\mathrm H_{(m, n)(r, s)} = \begin{cases}
1, & \text{$m = r \notin \{i, j\}$ and $n = s \notin \{i, j\}$} \\
1, & \text{$\{m, r\} = \{i, j\}$ and $n = s$} \\
-1, & \text{$m = i$, $n = r$, and $s = j$} \\
1, & \text{$m = r$ and $\{n, s\} = \{i, j\}$} \\
-1, & \text{$m = s$, $n = j$, and $r = i$} \\
-1, & \text{$m = r = i$ and $n = s = j$} \\
0, & \text{otherwise.}
\end{cases}
$$
