Let $A$ be a square matrix. Then there exist a permutation matrix $P$ such that $PA$ = $LU$ , where $L$ is a lower triangular matrix and $U$ is a upper triangular matrix.
Here, the permutation matrix $P$ is the row swappings applied to $A$ during Gaussian Elimination.
Can someone explain why is this true?
In LU decomposition you convert A into an upper triangular matrix and the operations you do can be expressed by lower triangular matrices. Lets say for argument sake there are no swap required so $L_kL_{k-1}...L_1A=U$. Now product of bunch of lower triangular matirces is lower triangular and inverse of lower triangular matrix is also lower triangular so $A=LU$. Now if swaps were required in the decomposition and you knew them beforehand and then you can apply them first and do your decomposition(without any swaps required now) so if P encodes all the swaps then you have $PA=LU$.