0

Starting with the identity matrix, $I_n$ ($n \in \mathbb{N}$), if I swap two distinct rows $a$ and $b$, and then multiply this matrix by $M$, the result is the same as had I just swapped the rows in $A$. I have proved this, something along these lines

$$ S = \begin{cases} 1 \text{ if $i=j$ and $i \ne a$ and $i \ne b$} \\ 1 \text{ if $i=a$ and $j=b$} \\ 1 \text{ if $i=b$ and $j=a$} \\ 0 \text{ otherwise} \end{cases} $$

Then, multiplying $S$ by $M$,

$$ (SA)_{i,j} = \sum_{x=1}^{j} S_{i, x} M_{x, j} $$

So in the case where $i \ne a$ and $i \ne b$ this is just $M_{i, j}$, and in the case where $i=a$ then this is just $M_{b, j}$ and in the case $i=b$ it is just $M_{a, j}$ (i.e. all the rows of $M$ have been swapped).

However, what confuses me is why it is the case that it is the rows and not the columns which are swapped (in $M$)? The identity matrix is symmetric $I = I^T$ and thus (I feel a bit nervous about saying this, as I couldn't prove it "rigorously" unfortunately) swapping the rows is the same as swapping the columns. However, for an arbitrary matrix $M$ swapping rows is definitely not the same as swapping columns). Why does this swap rows and not swap columns?

1 Answers1

1

The upshot is that both follow from the fact that multiplying a vector $v$ by $S$ (ie $Sv$) swaps the $a$ and $b$ entries of $v$.

Notice that multiplying $S$ by $M$ on the right is multiplying $S$ by each column of $M$. That is, if $c_i$ are the columns of $M$ (we'll write this as $M = (c_1 | \cdots | c_n)$), we have $$ SM = S(c_1 | \cdots | c_n) = (S c_1 | \dotsc | S c_n). $$

When written in this way, it's clearer that $S$ can act on each $c_i$ by swapping their $a$ and $b$ entries, which corresponds to swapping the $a$ and $b$ rows of $M$.

We can do an equivalent thing with multiplying $S$ by $M$ on the left by letting $r_i$ be the rows of $M$ (expressed as column vectors so that $M^{\mathrm{T}} = (r_1 | \cdots | r_n)$) so that $$ MS = \begin{pmatrix}r_1^\mathrm{T} \\ \vdots \\ r_n^\mathrm{T} \end{pmatrix} S = \begin{pmatrix}r_1^\mathrm{T} S \\ \vdots \\ r_n^\mathrm{T} S \end{pmatrix} = \begin{pmatrix}(S^\mathrm{T} r_1)^\mathrm{T} \\ \vdots \\ (S^\mathrm{T} r_1)^\mathrm{T}\end{pmatrix} = \begin{pmatrix}(Sr_1)^\mathrm{T} \\ \vdots \\ (S r_1)^\mathrm{T}\end{pmatrix}, $$ where the last line follows from the fact that $S^\mathrm{T} = S$ due to the fact that $S$ is a single transposition.

In particular, each $S r_i$ is $r_i$ with the $a$ and $b$ entries swapped, so multiplying $S$ by $M$ on the left has the effect of swapping the $a$ and $b$ entry of each row of $M$, which corresponds to swapping the $a$ and $b$ column of $M$.