| # Matrix Inverses Matrices > Basics | Matrix products | Special matrices | QR | Matrix inverses | Linear maps | Matrix norms | Applications Square full-rank matrices and their inverse Full column rank matrices and left inverses Full row rank matrices and right inverses ## Square full rank matrices and their inverse A square matrix is said to be invertible if and only if its columns are independent. This is equivalent to the fact that its rows are independent as well. An equivalent definition states that a matrix is invertible if and only if its determinant is non-zero. For invertible matrices , there exist a unique matrix such that . The matrix is denoted and is called the inverse of . Example: a simple matrix. If a matrix is square, invertible, and triangular, we can compute its inverse simply, as follows. We solve linear equations of the form , , with the -th column of the identity matrix, using a process known as backwards substitution. Here is an example. At the outset we form the matrix . By construction, . For general square, invertible matrices , the QR decomposition allows to compute the inverse. For such matrices, the QR decomposition is of the form , with a orthogonal matrix, and is upper triangular. Then the inverse is . Matlab syntax
    Ainv = inv(A); % produces the inverse of a square, invertible matrix
A useful property is the expression of the inverse of a product of two square, invertible matrices : . (Indeed, you can check that this inverse works.) ## Full column rank matrices and left inverses A matrix is said to be full column rank if its columns are independent. This necessarily implies . A matrix has full column rank if and only if there exist a matrix such that (here is the small dimension). We say that is a left-inverse of . To find one left inverse of a matrix with independent columns , we use the full QR decomposition of to write where is upper triangular and invertible, while is and orthogonal (). We can then set a left inverse to be The particular choice above can be expressed in terms of directly: Note that is invertible, as it is equal to . In general, left inverses are not unique. ## Full row rank matrices and right inverses A matrix is said to be full row rank if its rows are independent. This necessarily implies . A matrix has full row rank if and only if there exist a matrix such that (here is the small dimension). We say that is a right-inverse of . We can derive expressions of right inverses by noting that is full row rank if and only if is full column rank. In particular, for a matrix with independent rows, the full QR decomposition (of ) allows to write where is upper triangular and invertible, while is and orthogonal (). We can then set a right inverse of to be The particular choice above can be expressed in terms of directly: Note that is invertible, as it is equal to . In general, right inverses are not unique.