# When is the permutation matrix unique?

Say I would like to swap the two rows, $$i$$th and $$j$$th in the matrix $$A$$. Then the appropriate permutation matrix is

$$P_{ij}^T = \left[e_1 \cdots e_{i-1} e_j e_{i+1} \cdots e_{j-1} e_i e_{j+1} \cdots e_n \right]$$

where WLOG $$i < j$$ assumed,

which can be premultiplied to $$A$$ such that

$$\tilde{A}_{ij} = P_{ij} A$$

where $$\tilde{A}_{ij}$$ denotes the $$i,j$$-column swapped version of $$A$$.

## Question

The above reasoning is quite straightforward to me, but I would like to know when the permutation matrix is unique as $$P_{ij}$$.

The permutation matrix is not unique, because When $$A=0$$ any row permutation of $$A$$ can be denoted as follows:

$$PA = A$$

where $$P$$ can be, any matrix with the appropriate size.

So I'm wondering if there is any necessary/sufficient condition for the $$P_{ij}$$ to be the unique row exchanging matrix. Any help will be appreciated.

## Edited

From a clever comment, I realized that

$$P_{ij} = \tilde{A_{ij}} A^{-1}$$

if $$A^{-1}$$ exists. However, I would like to know if this uniqueness is preserved even when $$A^{-1}$$ does not exist.

• Do you allow any matrix for $P$ or at least require it to be actually a permutation matrix(i.e., obtained form the identity by permuting rows)? Clearly, when $A$ is invertible, we must have $P=\tilde AA^{-1}$ – Hagen von Eitzen Apr 14 at 3:40
• @HagenvonEitzen What problems might arise when we allow $P$ to be any matrix, rather than a permutation matrix derived from $I$? – Moreblue Apr 14 at 3:50
• Let $A$ be invertible, but with one row replaced by zeroes. Then there is only one permutation matrix $P$, but many arbitrary matrices $P$. So the uniqueness condition with permutation matrices is weaker than with arbitrary matrices (in fact it then boils down to pairwise distinct rows in$A$ instead of invertibility) – Hagen von Eitzen Apr 14 at 3:54