I have Matrix A
A= A^-1=
1 2 0 -1 2 0
1 1 0 1 -1 0
0 0 1 0 0 1
Which forms the upper and lower matrices
U= U^-1=
1 2 0 1 -2 0
0 1 0 0 1 0
0 0 1 0 0 1
L= L^-1 =
1 0 0 1 0 0
1 1 0 -1 1 0
0 0 1 0 0 1
Usually
A^-1 = U^=1 * L^-1
But when I multiply U^-1 * L^-1 I get
3 -2 0
-1 1 0
0 0 1
Which != A^-1
Is there a special case that L U Factorization is not true for all Matrices?
The matrix $U$ should be $\begin{bmatrix}1 & 2 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1\end{bmatrix}$. The entry in the middle of $U$ should be $-1$ so that $A=LU$. Then since $L$ and $U$ are triangular and have nonzero diagonal, they are invertible, and $A^{-1}=U^{-1}L^{-1}$