# Matrices: if AB=A and BA=B, then B^2 is equal to?

• Rikudo
In summary, the two methods give different results because one uses the identity matrix and the other uses a projection.

#### Rikudo

Homework Statement
If A and B are two matrices such that AB=A and BA=B, then B^2 is equal to?
(a)A (b)B (c) 1 (d)0
Relevant Equations
A A^-1= I, where I is an identity matrix
I have a different way in solving the problem, but strangely, the result is different from that written in the solution manual.

My method:

Firstly, we will solve the ##AB=A## equation
$$AB=A$$
$$B=A^{−1}A$$
$$B=I$$
where ## I## is an identity matrix

Similarly, we can solve ##BA=B## using the same method
$$BA=B$$
$$A=B^{−1}B$$
$$A=I$$
where ## I ## is an identity matrix

It can be concluded that matrix ##A=B##. Hence, ##B^2=B=A##, and the answer to the multiple choice question is (a) and (b)

Now, let's look at the book's solution:
\begin{align}
B^2 & =BB\nonumber\\\
& =(BA)B\nonumber\\\
& = B(AB)\nonumber\\\
& =BA\nonumber\\\
&=B\nonumber
\end{align}

I thought that the matrix ##B## is equal to ##A##, but it seems that I am wrong(?)
Why both methods results in different answers?

You assumed the matrices are invertible, but they might not be.

Last edited:
• WWGD, robphy, Demystifier and 6 others
Rikudo said:
JNow, let's look at the book's solution:
\begin{align}
B^2 & =BB\nonumber\\\
& =(BA)B\nonumber\\\
& = B(AB)\nonumber\\\
& =BA\nonumber\\\
&=B\nonumber
\end{align}

There's something not quite right about this problem. That shows that in all cases ##B^2 = B##, but it doesn't show the other answers are wrong. It might turn out to be the case that ##B = I##. In which case ##B^2 = B## also holds.

In fact, it might even be the case that ##A = B = I## is implied by what is given.

• malawi_glenn, FactChecker and topsquark
PeroK said:
There's something not quite right about this problem. That shows that in all cases ##B^2 = B##, but it doesn't show the other answers are wrong. It might turn out to be the case that ##B = I##. In which case ##B^2 = B## also holds.

In fact, it might even be the case that ##A = B = I## is implied by what is given.

Clearly not, because A=B= projection onto your favorite subspace also works.

I haven't come up with an example where A and B are different though. The fact that ##B^2=B## means B is a projection. ##A## is also a projection. ##AB=A## means that the image of Amust be in the image of B,and we get the other way around, which feels like A and B are projections with the same image and hence are equal, but this analysis might not hold in some corner case where there's no inner product, like if your base field is ##F_p##.

• PeroK and topsquark
Office_Shredder said:
I haven't come up with an example where A and B are different though.
Neither have I!

• topsquark
You will not find any examples of that. A and B are clearly projection operators from A^2 = A and B^2 = B.
This means that they are equal to the identity operator on their image and zero on their kernel (duh!).

By AB = A we know that B is the identity operator on the image of A so ##Im(B) \supseteq Im(A)## and vice versa. Hence ##Im(A) = Im(B)## and both operators have the same image - on which they are both the identity operator.

• topsquark
##
A=
\begin{pmatrix}
1 & 0 \\
0 & 0
\end{pmatrix}
##

##
B=
\begin{pmatrix}
1 & 0 \\
1 & 0
\end{pmatrix}
##

• Maarten Havinga, malawi_glenn, PeroK and 2 others
Orodruin said:
You will not find any examples of that. A and B are clearly projection operators from A^2 = A and B^2 = B.
This means that they are equal to the identity operator on their image and zero on their kernel (duh!).
The kernels need not be the same.
Orodruin said:
By AB = A we know that B is the identity operator on the image of A so ##Im(B) \supseteq Im(A)## and vice versa. Hence ##Im(A) = Im(B)## and both operators have the same image - on which they are both the identity operator.
This is true, but the above makes your argument incorrect.

Given vector space ##V## and a subspace ##W## there is more than one complement. In other words you can have ##V=W_1\oplus W## and ##V=W_2\oplus W## with different complements ##W_1## and ##W_2##. So the two projections onto ##W## will be different. You can project on the x-axis along the y-axis or along a diagonal (or any other slanted line). All have the same image the x-axis, but are different.

• malawi_glenn, PeroK, Orodruin and 2 others
Not every projection is an orthogonal projection. It's so obvious once you write it.

• martinbn and topsquark
martinbn said:
The kernels need not be the same.

This is true, but the above makes your argument incorrect.

Given vector space ##V## and a subspace ##W## there is more than one complement. In other words you can have ##V=W_1\oplus W## and ##V=W_2\oplus W## with different complements ##W_1## and ##W_2##. So the two projections onto ##W## will be different. You can project on the x-axis along the y-axis or along a diagonal (or any other slanted line). All have the same image the x-axis, but are different.
I probably got carried away subconciously thinking of Hermitian operators. Of course, no such requirement is mentioned in the OP. Thank you for the correction.

• martinbn and topsquark
Orodruin said:
You will not find any examples of that. A and B are clearly projection operators from A^2 = A and B^2 = B.
This means that they are equal to the identity operator on their image and zero on their kernel (duh!).

By AB = A we know that B is the identity operator on the image of A so ##Im(B) \supseteq Im(A)## and vice versa. Hence ##Im(A) = Im(B)## and both operators have the same image - on which they are both the identity operator.
So to correct this. I believe the argument of the image is still valid. However, the kernel need not be orthogonal to the image so Im(A) = Im(B) = V and A and B being the identity operator on ##V## does not imply that A = B generally. Indeed, if a vector ##u = v_A + w_A = v_B + w_B## where ##v_i## is in ##V## and ##w_A## is in the kernel of ##A## etc, then ##uA = v_A A + w_A A = v_A## and ##uB = v_B B + w_B B = v_B##. If ##w_A \neq w_B## then ##v_A \neq v_B## and therefore ##A \neq B##.

Edit: More generally, the kernel does not need to be the same just because the image is the same. This is where my brain fart appeared.

• topsquark
It's a strange way to pose this problem. Charitably, I would phrase it as: if ##AB=A## and ##BA=B##, then ##A,B## are idempotent matrices.

So, if invertibility is assumed, then it can only be the identity and the problem is trivial.

nuuskur said:
It's a strange way to pose this problem. Charitably, I would phrase it as: if ##AB=A## and ##BA=B##, then ##A,B## are idempotent matrices.

So, if invertibility is assumed, then it can only be the identity and the problem is trivial.
Sure, but that was concluded already in the OP. However, the problem itself states nothing about invertibility.

Hello and sorry for the obvious question but: on this forum when the OP writes "Relevant equations", should we assume that it is given in the problem too or that the OP believes that these are the equations that should be used? Because in this specific case, they constitute an additional assumption that provides a different solution which is a subset of the general solution.

@Amentia
It's a template of some sort. I would consider the problem statement and the proof attempt. Relevant equations are likely an interpretation of the post author and need not be applicable.

@Orodruin
Agreed, but the proof of idempotency is also included in OP. Mathematically, there is nothing else to add.

• topsquark and Amentia
Well, of the bat, neither ##A^2## nor ##B^2## may be defined.

But if we have ##A## is ##a\times c##; ##B## is ##b\times d##, and both ##AB, BA## are defined, then ##c=b, d=a##. So ##A## is ##a\times b##,
##B## is ## b\times a##
Since ##B^2## is defined, then##b=a## and both ##A,B## are square.
Seems like pulling teeth. Wonder if OP fully provided conditions of the problem.

Good point. But since AB=A, it follows that A and B have same domain, and also that the range of B is the domain of A, so B is square of dimension equal to the domain dimension of A. Then since BA=B, the same argument shows A is square of the same dimension as B. So the given information does imply both A^2 and B^2 are defined. And you are right that it needs checking.

• e_jane and WWGD
mathwonk said:
Good point. But since AB=A, it follows that A and B have same domain, and also that the range of B is the domain of A, so B is square of dimension equal to the domain dimension of A. Then since BA=B, the same argument shows A is square of the same dimension as B. So the given information does imply both A^2 and B^2 are defined. And you are right that it needs checking.
I suspect OP left out some of the conditions of the problem.