# How is diagonal matrices a subspace of upper triangular matrices?

I'm kind of confused that the diagonal matrices is a subspace of the upper triangular matrices. Suppose I have the following matrices: $$U=\begin{bmatrix} a & b\\ 0 & d \end{bmatrix} ; \; D=\begin{bmatrix} a & 0\\ 0 & d \end{bmatrix}$$

I read in the book that the matrix $D$ is a subspace of $U$. But how's it so? At first, I thought the reason why the diagonal matrices are subspaces of the upper triangular matrices was because the the matrix $D$ is just a case of matrix $U$ with $b=0$ and that's why it is a subspace of it.

But on a second thought, if my assumption was true, then everything, even the identity matrix is a subspace of the upper triangular matrices and the upper triangular matrices would be subspace of any 2 by 2 matrices. This doesn't make sense at all.

So how is this being looked at that $D$ is a subspace of $U$?

I don't know whether you are dealing with $2\times 2$ matrices or general $n \times$n$matrices. The result is true in either case. It may not be clear to you what these spaces are. Define addition of matrices by adding corresponding entries. So for example $$\begin{bmatrix} 1 & 2\\ 0 & 3 \end{bmatrix} + \begin{bmatrix} 5 & 3\\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 6 & 5\\ 0 & 4 \end{bmatrix}$$ If$c$is a constant (a scalar, a number) then you multiply a matrix by$c$by multiplying each entry by$c$. So for example $$3\begin{bmatrix} 1 & 2\\ 0 & 3 \end{bmatrix} = \begin{bmatrix} 3 & 6\\ 0 & 9 \end{bmatrix}$$ A vector space of matrices is a collection$V$of matrices (of the same size) such that if$A$and$B$are matrices in the collection, then so is the sum$A+B$, and also if$c$is any scalar, then$cA$is in the collection. So typically a vector space of matrices will have many matrices in it. The only vector space of matrices that consists of a single matrix is the space whose only element is the all$0$'s matrix. In particular, the identity matrix by itself ($1$'s down the main diagonal,$0$'s elsewhere) is not a subspace of the collection of$2\times 2$matrices, for if the identity matrix$I$is in the subspace, then$cI$has to be in the subspace for all numbers$c$. The collection of all matrices which are$0$off diagonal, and have all diagonal terms equal is a subspace of the space of all matrices. Maybe that will take care of part of your objection. Let$V$be any vector space, and take a collection$U$of some of the elements of$V$. Then$U$is called a subspace of$V$if$U$by itself is a vector space, meaning that the sum of any two elements of$U$is in$U$, and any constant times an element of$U$is in$U$. You quoted something to the effect that a certain$D$is a subspace of the space of upper triangular matrices. That's not true. The collection of all matrices of the shape you described, with everything off diagonal equal to$0$, is a subspace. So$D$is supposed to be not a single matrix, it is a largish collection of matrices. Now let's look at your particular problem. Let$V$be the collection of all upper triangular matrices. Is this a vector space? Take any two upper triangular matrices$A$and$B$. Is$A+B$upper triangular? Yes. If$c$is a constant, and$A$is upper triangular, is$cA$upper triangular? Yes. So$V$is a vector space. Let$D$be the collection of all diagonal matrices? Is this a vector space? Yes, the sum of two diagonal matrices is diagonal, a constant times a diagonal matrix is a diagonal matrix.$D$is a subspace of the upper triangular matrices, because any diagonal matrix is in particular upper triangular, it is a special upper triangular matrix. • I'm a little confuse with the part that if the identity matrix$I$is a subspace, then$cI$has to be in the subspace for all numbers$c$. If an identity matrix is multiplied by a constant$c$, it is still diagonal. Adding a identity matrix to another diagonal matrix is still a diagonal matrix. Then this satisfies the linearity rules but isn't it still a subspace? eg: $$3\begin{bmatrix}1 & 0\\ 0 & 1\end{bmatrix}=\begin{bmatrix}3 & 0\\ 0 & 3\end{bmatrix}$$ $$\begin{bmatrix}1 & 0\\ 0 & 1\end{bmatrix}+\begin{bmatrix}4 & 0\\ 0 & 4\end{bmatrix}=\begin{bmatrix}5 & 0\\ 0 & 5\end{bmatrix}$$ – xenon Sep 24 '11 at 14:55 • The collection of$K$of all matrices of the shape$0$off diagonal, constant on diagonal is a subspace. This collection contains the matrices in your comment above, and many more. The identity matrix by itself is not a subspace. This space$K$is a subspace of the space$D$of (all) diagonal matrices, which is a subspace of the space of (all) upper triangular matrices, which is a subspace of the space of all$2\times 2$matrices. Remember, with one trivial exception, any of our vector spaces has infinitely many elements. Don't confuse a single matrix with a space of matrices. – André Nicolas Sep 24 '11 at 15:10 • oh yea.. you are right. I think I got the single matrix and space of matrices confused. Thanks! – xenon Sep 24 '11 at 15:15 • Yes, my post was almost totally concerned with trying to explain that single object is never (well, almost never!) a subspace. It was clear that this was the source of your difficulty. A space is a space, lots of stuff. – André Nicolas Sep 24 '11 at 15:19 Generally to check that a given subset is a Subspace of a vector space you should check to things: a) The operation$*$of the vector space$U$(in your case i assume to be addition between$2\times2$matrices) is closed in$D$i.e. it is well define as a bilinear map $$+:D\times D\to D,$$ and this is easy to check. b) You have to check that multiplication by scalar elements of the field (usually your matrices are defined over a field, i.e real/complex matrices, or more generally$K$- matrices where$K$is a field), is well define as a bilinear map $$\cdot:K\times D \to D.$$ Now you should check that both these two operations are well defined on$D$as I have described previously. But then you can onclude that$D$is a subspace of$U$. Note that in this case, since you are working with square matrices, you can as well have a product defined in$U$, namely $$*:U\times U\to U,$$ which is the usual product between matrices. Equipped with this operation,$U$becomes more than a vector space, it becomes an Algebra. The interesting thing is that, if you consider the restriction to the subspace$D$, you obtain another bilinear map $$*:D\times D\to D,$$ and so in this case you can view$D$as a subalgebra of$U$, not only as a subspace. Now let's come to your doubts: The identity matrix is not a subspace: for example what happens if you multiply by a scalar element of the field? you obtain something different from the identity but this contradicts b). Finally the space of the upper triangular matrices is a subspace of$M_2(K)$, the vector space of the$2\times 2$matrices over a generic field$K$. But, as i pointed out before, this is more than just a subspace, it is a subalgebra of$M_2(K)$. Recalling everything.. You have the follwing $$D\leq U\leq M_2(K).$$ Where$\leq\$ means "to be a subspace of." In your case this can be read even as "to be a subalgebra of." Hope everything is clearer now.