Lecture 33 · Left inverse, right inverse and pseudo inverse
Understand left inverse, right inverse and pseudo inverse, and deal with generalized inverse of rectangular matrices.
On this page
Left and right inverses; pseudoinverse | Gilbert Strang | MIT 18.06 Linear Algebra
Lecture 33 / Total 35 Lectures |Part 3 · Eigenvalues, positive definiteness and linear transformation
Video of this lecture: Bilibili p34 · Left inverse, right inverse and pseudo inverse ↗(41:53)| MIT OCW official page ↗
Illustration: MIT OCW 18.06SC official lecture summary (CC BY-NC-SA 4.0) and Bilibili classroom video frames (time stamped), about 10 frames per lecture.
Introduction to this lecture
In the previous lectures, I drew the same picture repeatedly: matrix put divided into row space (row space) and null space (nullspace), put divided into column space (column space) and left null space (left nullspace); line space and null space are mutually exclusive orthogonal complement (orthogonal complement), the column space and the left null space are also orthogonal complements of each other. The dimensions of the four subspaces are , , , , among which is rank (rank). This lecture starts from this picture and answers a question: to what extent can the “inverse” of a matrix be defined.
The source of the problem lies in the two null spaces on the graph. For a matrix that compresses non-zero vectors into zero vectors, no “inverse” can save it from zero; so whether the inverse exists depends on whether there are only zero vectors left in the two zero spaces. when they all disappear, There are the usual Bilateral inversion(two-sided inverse). When the null space disappears and the left null space remains, can only have Left reverse (left inverse): multiply back from the left identity matrix (identity matrix), multiplying from the right does not work. Exactly mirrored, only right inverse (right inverse). The most general and Neither inverse exists, but There is still a one-to-one correspondence between row space and column space. If this correspondence is reversed, we get pseudoinverse(pseudoinverse).
The three parts correspond to the three “inverses”. The left inverse and the right inverse are a summary of the previous content, and the criteria are all with The relationship, the formulas are all with These two “good matrices”; the pseudo-inverse extends this classification to the general situation, which can be found in any matrix; singular value decomposition (singular value decomposition, SVD) explains why the pseudo-inverse is almost effortless to calculate - move it to a diagonal matrix (diagonal matrix), and only need to take the reciprocal of the non-zero singular values.

MIT OCW Official Lecture Notes Summary Page 1/3 (18.06SC Lecture 33 Summary, CC BY-NC-SA 4.0).
1. Four situations: looking at the inverse from four basic subspaces
put , rank is The matrix press with The relationship classification, the inverse problem becomes four judgment questions. The first three are situations that have been dealt with earlier in the course, and the fourth is the main topic of this lecture.
Situation one: . The square array is at full rank. The line space is the entire , the column space is the entire , both null spaces have only zero vectors. The existence matrix makes
Both left multiplication and right multiplication return to the identity matrix. This is the usual inverse matrix, and it is also the most beautiful case of the word “full rank”.
Scenario 2: . Full rank(full column rank): Columns are linearly independent and rows are mostly related to each other. The null space has only zero vectors, and the row space dimension is , that is, the entire ;The column space only occupies one of dimensional subspace. Because the null space is , If there is a solution, it must be unique - all other solutions must be obtained by adding vectors in the null space, where there is nothing to add. But the rows may be related, and elimination will produce zero rows, so some right-hand sides have no solution: there are only “zero or one” solutions.
Scenario three: . Full of rank(full row rank): The rows are linearly independent, and there are only zero vectors in the left null space. Elimination will never result in zero rows, for each can be solved; but the null space dimension is , there is a free variable (free variable), there are infinite solutions, and the solution set is “a special solution plus the entire null space”.
Scenario four: and . Both null spaces exist, and the dimensions are with . Neither inverse can be created, but the matrix still maps well between row space and column space. The first three situations are actually degenerate situations in which the null space on this picture disappears in turn, and the fourth situation is the general rule.
Looking at it from another angle, the difference between the four situations can be summarized by two yes-or-no questions: whether the left null space is zero determines ” to which “There is a solution”; whether the null space is zero determines “whether the solution is unique when there is a solution”. The four situations are a combination of yes and no from these two questions. The four rows combined cover All possible values of , so this classification table is equivalent to an index of the entire course: see , the solution structure and usable formulas are determined.

Video 00:04:11 | Approximately corresponding to section 1 “1. Four situations: looking at the inverse from the four basic subspaces”.
2. Left inverse: column full rank
In case 2, we need to create a “take it from the left” To pull back the “unit matrix” matrix, you must first have an invertible square matrix, and what is available here is .
is symmetric matrix. It is reversible when the column is of full rank, and the reason is only one line: if , multiply left by both sides , got
thus ;Full column rank means that there are only zero vectors in the null space, so . The null space of a matrix contains only zero vectors, so it is invertible. This fact lies in least squares (least squares) is the core: the coefficient matrix of the entire theory is , and the condition for its reversibility happens to be The columns are irrelevant.
put with Multiply in the order of “first transpose, then inverse” to get
this is a matrix. To verify that it is the left inverse, put Just multiply on the right:
The brackets make exactly one pair, Multiply the invertible matrix by its own inverse to get the identity matrix. Note that the last one that falls back is Dimensional space: First delivered to , bring it back , again Final adjustments to the interior.
Just changing the order won’t work. is The matrix of is impossible to be , the size is wrong first; more essentially, The column space is just in dimensional subspace, put the whole are all pressed into this subspace, and when we ride back, we can only When projected into column space, there is no way to recover the components falling outside the subspace. This matrix has a name:
It acts on vectors in column space and changes nothing - if , then ; Acts on the vector in the left null space and wipes it to zero - if , then . It is identical in the column space and zero in the left null space. This is exactly the answer to the column space. projection (projection). It “wanted” to be the identity matrix, but unfortunately just gave it Wei’s room for action. A useful observation by the way: The rank is equal to , its null space is exactly The left null space of: with are mutually sufficient and necessary conditions. Projection handle The vector in is pressed to In the dimensional space, the suppressed part is the left null space.
The left inverse is generally not unique; It’s just the most common and neatest among them. Also note that the status of the two “good matrices” in this situation is not equal: is and reversible, But it is , rank only , still strange. Which one is reversible, just look is equal to Still equal to .

Video 00:09:51|Approximately corresponding to section 2 “2. Left inverse: full rank”.
3. Right reverse: full rank
By reversing the roles of rows and columns, Scenario 3 leads to completely parallel conclusions. This time the invertible “good matrix” is : it is is a symmetric matrix with full row rank to ensure that it is invertible. The reason is the same as in the previous section. Just put Replace with . Take the inverse and multiply it , get
This is matrix. Verify:
This time the identity matrix is , exactly symmetrical to the left inverse case.
Changing the order also only results in projection. Put the right side reverse to the left side,
is matrix. It is identical in row space: any vector in row space can be written as , so
It is zero in the null space: if , then . So it’s a projection into row space. Dually, this The rank of the projection is , the null space is exactly of null space. The right inverse is also not unique, Just the most commonly used one; and the reversible one in this case is , is , rank only , already strange.
There is one more practical difference between the two cases, and it lies in the solution set. When the columns are of full rank, the solutions are “zero or one”, and when the rows are of full rank, the solutions are “infinitely many” and there is a solution for each right end. The reason lies in the number of free variables: in variables is the main variable, and the remaining free variable; case 2 , situation three miles .
The right inverse also has a direct use: it gives a special solution when the rows are of full rank. take
Take left on both sides , got , indeed satisfies the equation. This special solution is not the entire solution: adding any vector in the null space is still a solution, and the null space has dimension, so there are infinitely many solutions. The left-inverse situation is dual to this: when the column is of full rank There is at most one solution. If the solution exists, use the left inverse action on You can figure it out, but not everyone There are solutions.

Video 00:12:34|Approximately corresponds to section 3 “3. Right reverse: row full rank”.
4. Why does a rectangular matrix not have a two-sided inverse?
Putting the four situations together, a structural fact emerges: As long as , There can be no bilateral inversion.
The reason is in the base diagram. The null space dimension of is , the left null space dimension is ;when When , these two numbers cannot be zero at the same time, that is to say with At least one of them has a non-zero null space. The direction in that null space has been completely killed by the matrix, and no candidate inverse can restore it. Bilateral inverses naturally do not exist. In turn, and When both null spaces are , It is a reversible square matrix.
It is more intuitive to read from the picture: The larger the value, the narrower the two zero spaces are. with decrease at the same time. For the inverse to exist, two zero spaces need to shrink to zero at the same time, which is only possible if only possible; as long as , at most one of them can be squeezed out, and the null space on the other side must be left.
List this set of categories into a table:
| situation | rank | null space | left null space | Inverse type | formula |
|---|---|---|---|---|---|
| one | Bilateral inversion | ||||
| two | Dimension | Left reverse | |||
| three | Dimension | right inverse | |||
| Four | and | Dimension | Dimension | Neither |
The null space in the second row of the table is , the left null space is non-zero, and the third line is just the opposite, so both the left and right inverses can still be defined; in the fourth line, both zero spaces are present, and both sides are blocked, leaving only the pseudo-inverse to be discussed in one section. The fourth line also shows that the pseudoinverse is not a patch: Can be compared and is any value small, the first three cases are just special cases when it happens to disappear in one or two null spaces. In other words, the “type” of the inverse is entirely determined by which null space disappears, whereas the projection matrix always appears in those rows where “the null space on the other side is still there.” This table is also a table lookup tool: given , you can immediately determine which formula to use and whether the solution set is zero, one or infinite.

Video 00:20:56 | Approximately corresponding to Section 4 “4. Why there is no bilateral inverse of a rectangular matrix”.

MIT OCW Official Lecture Notes Summary Page 2/3 (18.06SC Lecture 33 Summary, CC BY-NC-SA 4.0).
5. Pseudo-inverse: one-to-one correspondence from row space to column space
In case four, both zero spaces are present, and neither the left inverse nor the right inverse exists. But there is one fact that has not been used in the basic diagram: the dimensions of row space and column space are both , while Send row space into column space. in these two between dimensional subspaces, is reversible. This statement deserves its own proof.
Set with are in row space, and . transfer item , so Belongs to the null space; and because the row space is a subspace, Also belongs to line space. Row space and null space are orthogonal complements of each other, and the intersection only has zero vectors, so . different vectors pass through Still different after that, The restriction is injective on row space.
Both ends of the single shot are dimensional space, so it is also surjective: every All come from unique vectors in vertical space. Surjection can also be verified directly: In column space, it means that there is such that ; put Split into row space part and null space part according to orthogonal complement , then , description is a row space vector like.
With this bijection, “inverse” can be defined wherever it can be defined. in column space , order is the only one in the row space that satisfies of ;For the left null space , it is not in the column space at all, and there is no original image to be found, so let . A general vector is decomposed according to the orthogonal complement of “column space component + left null space component” and then acts block by block; zeroing the left null space is not an arbitrary agreement, but is forced out: The value must fall in the row space, and the left null space and the column space are orthogonal complements of each other, and there is no original image in the direction there; if the non-zero Mapping into a non-zero vector, still can only fall in the column space, not zero Orthogonal to the column space, Impossible. Got it this way is matrix, and Any matrix has a pseudoinverse, including those matrices that have neither left nor right inverse.
with Each is powerless against a piece of null space, and each erases another piece of null space, so the effects of the two composite mappings are completely determined:
The former is identical in the row space and zero in the null space, while the latter is identical in the column space and zero in the left null space. It’s clearer to write this as a function of arbitrary vectors: Take any of the , divided into , then , so
compound mapping put Leave the “alive” line space component in Throw away the half you kill, which is the very definition of projection. A pseudo-inverse cannot become a real inverse; the best it can do is to send the vector back to the two “good” subspaces of row space and column space, and smooth out the two zero spaces respectively. This also explains why the inverse product of the left inverse and the right inverse in Sections 2 and 3 is a projection: the null space disappears when the column is full rank, degenerate into The identity matrix of , leaving only is a non-trivial column-space projection; the reverse is true for rows of full rank.

Video 00:27:13 | Approximately corresponding to Section 5 “5. Pseudo-inverse: One-to-one correspondence from row space to column space”.
6. Why pseudo-inverse is needed: when least squares fails
Statisticians are heavy users of least squares, linear regression (linear regression) is their central tool, and the central equation of least squares
to is the coefficient matrix. The premise that this equation has a unique solution is Full rank: Reversible, left inverse formula Give the solution directly. But statisticians always worry about this premise: if the same experiment is repeated several times, the measured data columns will be linearly related. ’s rank dropped to , It becomes a singular matrix, and the inverse sign in the left inverse formula cannot be written.
The mechanism of this failure is very specific: if the two columns of data are proportional - for example, the same set of measurements is recorded twice - The rank of is at most , The rows of are also linearly related, and the determinant is zero. Once the full rank is broken, The inverse of , the left inverse formula, and the uniqueness of the solution to the equation all become invalid. The sum of the redundant directions brought about by repetition is The null space of , the dimension Just a measure of how much redundancy there is.
Pseudo-rebellion is prepared for this moment. it’s only in Inverse in the dimensional row space, excluding the direction in the null space: no matter how many times the original data is repeated, the only ones that are truly independent are This direction, the pseudo-reverse is only here Make a fuss in one direction, and repeated records will not make it move in the direction it should not move. When the rank is full , the null space disappears, and the pseudo-inverse degenerates into the left inverse, so this is a generalization rather than the establishment of another set of theories.

Video 00:33:30 | Approximately corresponding to Section 6 “6. Why pseudo-inverse is needed: when least squares fails”.
7. Use SVD to calculate pseudoinverse
How to calculate pseudo-reverse? The cleanest way is to start from singular value decomposition. SVD writes any matrix as
Among them is of orthogonal matrix(orthogonal matrix), is the orthogonal matrix, is The “diagonal” matrix: the upper left corner is a positive number , called singular value (singular value), the remaining positions are all zero. These non-zero from with ——Their square is the non-zero value of these two matrices eigenvalue (eigenvalue). Written in chunked form,
It is “ranked as of matrix” simplest sample: only non-zero yuan, OK, Column, rank There is no shortage of the same. Its null space is followed by coordinate vectors, the left null space is Two coordinate vectors are spread out - two zero spaces are clearly placed in the zero block, and it is obvious at a glance which directions should be retained and which ones should be discarded. Finding its pseudoinverse requires almost no thought: take the reciprocal of the reciprocal, and keep the rest zero.
This is matrix. The test only needs to look at the product of two: is diagonal matrix of , before A diagonal element is , the rest are zero; is homotype matrix, before A diagonal element is , the rest are zero. Neither is an identity matrix and the dimensions are different, but they are with The projection in is exactly the best result that the pseudoinverse can achieve - it sends the vector back two non-zero subspaces of .
real The pseudoinverse of is then written as
Each step here can be explained: The inverse of is , The inverse of is , two orthogonal matrices do not bring any trouble, all the “diseases” are concentrated in the middle on, and Just did the math. Let’s go back and look at the two composites:
They are projections to column space and row space respectively, which are completely consistent with the geometric definition in Section 5.
The upper right block and lower left block of must be zero, otherwise or There will be a non-zero off-diagonal block, which is no longer an orthogonal projection; as for the lower right corner block The zero area of can be filled with any number - it only multiplies to The zero row and zero column of , the two products are not affected. But it is useless to fill it in, it will only make the matrix larger; it is customary to take the cleanest pseudo-inverse, set the lower right block to zero, and only retain what must be retained . The fixed route for finding the pseudo-inverse is: Right Do SVD and process the three factors separately - both sides , Just transpose, the middle Just take the reciprocal of the non-zero singular values - and multiply the three factors back. This is the value of SVD: it turns the inversion of a rectangular matrix into the reciprocal of a diagonal matrix. All obstacles are clearly arranged in the zero block. It is clear at a glance when to count down and when to set zero. As a test, There is no zero block when That’s it , so , the pseudo-inverse degenerates into the ordinary inverse; the two rank-deficient cases degenerate into the left inverse and right inverse in Sections 2 and 3 respectively.

Video 00:37:41|Approximately corresponding to Section 7 “7. Calculate pseudo-inverse using SVD”.

MIT OCW Official Lecture Notes Summary Page 3/3 (18.06SC Lecture 33 Summary, CC BY-NC-SA 4.0).
Summary of this lecture
- The type of inverse is determined by which of the four basic subspaces the null space disappears: Both disappear, Only left null space is left, Only null space left, and Both are there.
- When the rank is full Reversible, the left inverse is ;Change it to the right and multiply it to get the projection to the column space .
- When the line is full Reversible, the right inverse is ;reverse product is the projection into row space.
- time with There is at least one non-zero null space, so a rectangular matrix can never have a two-sided inverse.
- pseudoinverse Take the inverse of the bijection from row space to column space and set zero to the vector in the left null space; then is the projection onto row space, is the projection into column space.
- Proof of one-to-one correspondence: If in line space and , then At the same time, in null space and row space, it can only be a zero vector.
- Any matrix has a pseudo-inverse, including matrices with neither left inverse nor right inverse; the pseudo-inverse degenerates into a left inverse when the columns are at full rank, and degenerates into a right inverse when the rows are at full rank.
- The actual motivation is least squares: Reversibility relies on the full rank of the column. Repeated experiments will cause the columns to be linearly correlated and the rank to decrease. At this time, pseudo-inversion takes over from the left inverse.
- SVD Attribute the problem to Above: Take the reciprocal of non-zero singular values and set the rest to zero, ; with All are only a diagonal projection.
keywords
| English | Chinese | One sentence explanation |
|---|---|---|
| left inverse | Left reverse | Take it from the left Get the matrix of the identity matrix, which is in the form |
| right inverse | right inverse | Take it from the right Get the matrix of the identity matrix, which is in the form |
| two-sided inverse | Bilateral inversion | Both left and right multiplications yield the usual inverse of the identity matrix, which only exists when the square matrix is of full rank. |
| pseudoinverse | pseudoinverse | Generalized inverse that takes the inverse between row space and column space and zeroes the left null space |
| full column rank | Full rank | , each column is linearly independent, and the null space only has zero vectors |
| full row rank | Full of rank | , each row is linearly independent, and the left null space has only zero vectors |
| projection | projection | A matrix that is equal to identity in a certain subspace and equal to zero in its orthogonal complement |
| singular value decomposition | singular value decomposition | Write any matrix as , middle Only in the upper left corner non-zero diagonal elements |
| singular value | singular value | Upper left non-zero diagonal element , its square is non-zero eigenvalues of |
| orthogonal matrix | orthogonal matrix | Transpose or inverse square matrix, |
| least squares | least squares | to is a fitting method for the coefficient matrix. The solution is unique when the columns are full rank. |
| linear regression | linear regression | In statistics, the center tool of least squares is used repeatedly, and it is easy to encounter column correlation. |
Machine-assisted translation · Read Chinese original
