I have the matrix $$A= \begin{pmatrix} -1&1&1\\1&-1&1\\1&1&-1 \end{pmatrix} $$
It is invertible so it has an LU-factorization (Am I right about that?)
I tried to solve it, I first reached that the upper matrix is equal to $$U=P(2,3)E_1A= \begin{pmatrix} -1&1&1\\0&2&0 \\0&0&2 \end{pmatrix} $$
Where $$E_1= \begin{pmatrix} 1&0&0\\1&1&0 \\1&0&1 \end{pmatrix} $$ And $P(2,3)$ is the matrix that switches the 2nd row with the $3$rd row.
But I continued as I usually do, the matrix $L$ usually turns out to be $L=[P(2,3)E_1]^{-1}$, but this wasn't a lower matrix !!
I got that $$L= \begin{pmatrix} 1&0&0\\-1&0&1 \\-1&1&0 \end{pmatrix} $$
I checked my calculations $3$ times I don't think I have calculation mistakes...
Can anyone help please by giving a correct method and tell me what I did wrong in the method I used?