• Support PF! Buy your school textbooks, materials and every day products Here!

Trace of matrix proof

  • #1
189
0

Homework Statement



Prove ##tr(AA^T)=tr(A^TA)=s## where ##s## is the sum of the squares of the entries of A

I need help cleaning this up and I don't think my sigma notation is completely correct.


The Attempt at a Solution



I found the identity $$(AB)^T=B^TA^T$$then applying it to ##AA^T \Rightarrow (AA^T)^T= (A^T)^TA^T=AA^T## and ##(A^T)^T=A, A^T=A^T## so now I know A is symmetric.

##A= \displaystyle\sum_{i,j=1}^{n} a_{i,j}## and ##A^T= \displaystyle\sum_{j,i=1}^{n} a_{j,i}##, ##A=A^T##so we know ##\displaystyle\sum_{j,i=1}^{n} a_{j,i}= \displaystyle\sum_{i,j=1}^{n} a_{i,j}##

also ##s=\displaystyle\sum_{i,j}^{n}(a_{i,j})^2##

then ##AA^T=A^TA=A^2 \Rightarrow [AA^T]_{i,k} = \displaystyle\sum_{j}^{n} a_{i,j}a_{j,k} ##
so ##Tr(A^2) = Tr\Bigg(\displaystyle\sum_{j}^{n} a_{i,j}a_{j,k}\Bigg) = \displaystyle\sum_{i,j}^{n}(a_{i,j})^2 = s ##
thanks!
 
Last edited:

Answers and Replies

  • #2
Zondrina
Homework Helper
2,065
136
Prove ##tr(AA^T)=tr(A^TA)=s## where ##s## is the sum of the squares of the entries of A
Actually looks completely fine.
 
  • #3
189
0
Do you intend this to mean the sum of the squares along the diagonal?

If so looks fine.
the trace of the the product would be the sum of the squares along the diagonal and s is the entries of A (not the product) squared and summed. I know its true, I proved it for a 3x3 square matrix but it has to be symmetric.

heres the 2x2 case

Let ##A=\left[\begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22}\end{array}\right]##so ##A^T= \left[\begin{array}{cc} a_{11} & a_{21} \\ a_{12} & a_{22}\end{array}\right] ##

and ##s=(a_{11})^2+(a_{12})^2+(a_{21})^2+(a_{22})^2##

now,

##tr(AA^T)=tr\Bigg(\left[\begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22}\end{array}\right]\left[\begin{array}{cc} a_{11} & a_{21} \\ a_{12} & a_{22}\end{array}\right]\Bigg) = tr\Bigg(\left[\begin{array}{cc} (a_{11})^2 + (a_{12})^2 & a_{11}a_{21} + a_{12}a_{22} \\ a_{11}a_{21} + a_{12}a_{22} & (a_{21})^2 + (a_{22})^2\end{array}\right]\Bigg) ##

##= (a_{11})^2+(a_{12})^2+(a_{21})^2+(a_{22})^2 = s##

and,

##tr(A^TA)=tr\Bigg(\left[\begin{array}{cc} a_{11} & a_{21} \\ a_{12} & a_{22}\end{array}\right]\left[\begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22}\end{array}\right]\Bigg) = tr\Bigg(\left[\begin{array}{cc} (a_{11})^2 + (a_{21})^2 & a_{11}a_{12} + a_{21}a_{22} \\ a_{11}a_{12} + a_{21}a_{22} & (a_{12})^2 + (a_{22})^2\end{array}\right]\Bigg) ##

##=(a_{11})^2+(a_{12})^2+(a_{21})^2+(a_{22})^2 = s##

therefore, ##tr(AA^T)=tr(A^TA)=s##

its probably not the best proof. Now I am trying to do the more general proof and want to use sigma notation so its not really messy making general square matrices.



Edit. Thanks!
 
  • #4
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728

Homework Statement



Prove ##tr(AA^T)=tr(A^TA)=s## where ##s## is the sum of the squares of the entries of A

I need help cleaning this up and I don't think my sigma notation is completely correct.


The Attempt at a Solution



I found the identity $$(AB)^T=B^TA^T$$then applying it to ##AA^T \Rightarrow (AA^T)^T= (A^T)^TA^T=AA^T## and ##(A^T)^T=A, A^T=A^T## so now I know A is symmetric.

##A= \displaystyle\sum_{i,j=1}^{n} a_{i,j}## and ##A^T= \displaystyle\sum_{j,i=1}^{n} a_{j,i}##, ##A=A^T##so we know ##\displaystyle\sum_{j,i=1}^{n} a_{j,i}= \displaystyle\sum_{i,j=1}^{n} a_{i,j}##

also ##s=\displaystyle\sum_{i,j}^{n}(a_{i,j})^2##

then ##AA^T=A^TA=A^2 \Rightarrow [AA^T]_{i,k} = \displaystyle\sum_{j}^{n} a_{i,j}a_{j,k} ##
so ##Tr(A^2) = Tr\Bigg(\displaystyle\sum_{j}^{n} a_{i,j}a_{j,k}\Bigg) = \displaystyle\sum_{i,j}^{n}(a_{i,j})^2 = s ##
thanks!
Why do you claim that ##A## is symmetric? The result holds equally well for any square matrix, whether symmetric or not. Your 2x2 example shown later does NOT need a symmetric matrix; nowhere there did you say that you had to have ##a_{12} = a_{21}## in order to make it work.

Also, you have written a number of seriously incorrect statements: the equations
[tex] A =\sum_{i,j=1}^{n} a_{i,j} \text{ and } A^T = \sum_{j,i=1}^{n} a_{j,i} [/tex]
are wrong (and, basically, meaningless). You cannot just equate the ##n \times n## matrix ##A## to a sum of scalars ##a_{ij}##.
 
  • #5
189
0
Why do you claim that ##A## is symmetric? The result holds equally well for any square matrix, whether symmetric or not. Your 2x2 example shown later does NOT need a symmetric matrix; nowhere there did you say that you had to have ##a_{12} = a_{21}## in order to make it work.

Also, you have written a number of seriously incorrect statements: the equations
[tex] A =\sum_{i,j=1}^{n} a_{i,j} \text{ and } A^T = \sum_{j,i=1}^{n} a_{j,i} [/tex]
are wrong (and, basically, meaningless). You cannot just equate the ##n \times n## matrix ##A## to a sum of scalars ##a_{ij}##.
I tried find summation notation for a matrix the ones I found were in similar fashion also

and ##\left[\begin{array}{cc} 1&4\\2&3\end{array}\right] \left[\begin{array}{cc} 1&2\\4&3\end{array}\right]##wont have the same trace as ##\left[\begin{array}{cc} 1&2\\4&3\end{array}\right]\left[\begin{array}{cc} 1&4\\2&3\end{array}\right]##
 
  • #6
Zondrina
Homework Helper
2,065
136
Hmm I would write it like this:

You want to show ##s##, which is the sum of the squares of the entries in matrix ##A##, is equal to the trace of ##AA^T##.

So ##s = \sum_{j = 1}^{m} \sum_{i = 1}^{n} (A_{ij}^2)## where the ##A_{ij}## are the matrix elements in ##A##.

Then the trace is given by:

##tr(AA^T) = tr([AA^T]_{ij}) = tr(\sum_{k=1}^{m} A_{ik} A^T_{kj})##
 
Last edited:
  • #7
189
0
oh okay so to write the n x n matrix A

##[A]_{i,j} = \displaystyle\sum_{i,j=1}^{n} A_{i,j}##


and to continue what you have

##tr(AA^T) = tr([AA^T]_{ij}) = tr(\sum_{k=1}^{m} A_{ik} A^T_{kj}) = (a_{i,1})^2+(a_{i,2})^2+...+(a_{i,n})^2+(a_{1,j})^2+(a_{2,j})^2+...+(a_{n,j})^2 = \sum_{j = 1}^{m} \sum_{i = 1}^{n} (A_{ij}^2) = s##
 
  • #8
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
I tried find summation notation for a matrix the ones I found were in similar fashion also

and ##\left[\begin{array}{cc} 1&4\\2&3\end{array}\right] \left[\begin{array}{cc} 1&2\\4&3\end{array}\right]##wont have the same trace as ##\left[\begin{array}{cc} 1&2\\4&3\end{array}\right]\left[\begin{array}{cc} 1&4\\2&3\end{array}\right]##
Nope. If you compute them both you will see that they both have the same trace = 30 = 1^2 + 2^2 + 3^2 + 4^2.
 
  • #9
189
0
Nope. If you compute them both you will see that they both have the same trace = 30 = 1^2 + 2^2 + 3^2 + 4^2.
oh yeah, I was squaring down the diagonal for whatever reason. I apologize, you are correct.
 
  • #10
Zondrina
Homework Helper
2,065
136
To continue further:

##tr(AA^T) = tr([AA^T]_{ij}) = tr(\sum_{k=1}^{m} A_{ik} A^T_{kj}) = tr(A_{i1}A^T_{1j} + A_{i2}A^T_{2j} + A_{i3}A^T_{3j} + ... + A_{im}A^T_{mj} )##

The sum ##s = \sum_{j = 1}^{m} \sum_{i = 1}^{n} (A_{ij}^2) = A_{11}^2 + A_{21}^2 + \cdots + A_{n1}^2 + \cdots + A_{1m}^2 + A_{2m}^2 + \cdots + A_{nm}^2##
 
  • #11
Fredrik
Staff Emeritus
Science Advisor
Gold Member
10,851
406
##tr(AA^T) = tr([AA^T]_{ij}) = tr(\sum_{k=1}^{m} A_{ik} A^T_{kj}) = tr(A_{i1}A^T_{1j} + A_{i2}A^T_{2j} + A_{i3}A^T_{3j} + ... + A_{im}A^T_{mj} )##
This notation is a bit odd, since indices suggest that we're dealing with a component of a matrix rather than the matrix itself. I would write the definitions of trace and matrix multiplication as
\begin{align}
&\operatorname{Tr} A=\sum_i A_{ii}\\
&(AB)_{ij}=\sum_k A_{ik}B_{kj},
\end{align} and then start the calculation like this:
$$\operatorname{Tr}(AA^T)=\sum_i (AA^T)_{ii} =\cdots $$ I initially wrote down two more very short and simple steps, but then I took another look at the problem statement and realized that my string of three simple equalities was the complete solution.
 
  • #12
189
0
figured this out another way

Let A be an m x n matrix and ## s =\displaystyle\sum_{i=1}^{m}\sum_{j=1}^{n} a_{i,j}^2##

##A = \left[\begin{array}{cc}R_{1}\\R_{2}\\.\\.\\.\\R_{m}\end{array}\right] = \left[\begin{array}{cc}C_{1}&C_{2}&.&.&.&C_{n}\end{array}\right]## where ##R_{i},C_{i}## are rows and columns

now ##A^T =\left[\begin{array}{cc}R_{1}&R_{2}&.&.&.&R_{m}\end{array}\right] = \left[\begin{array}{cc}C_{1}\\C_{2}\\.\\.\\.\\C_{n}\end{array}\right] ##

so ##AA^T## gives an m x m matrix and ##A^TA## gives an n x n matrix by doing the dot product, ##R_{i} \cdot R_{i}, C_{i} \cdot C_{i}##, respectively. Now, I'm after the trace so I only need the diagonal
so ##\displaystyle\sum_{i=1}^{m} R_{i} \cdot R_{i} = \displaystyle\sum_{i=1}^{n} C_{i} \cdot C_{i} =\displaystyle\sum_{i=1}^{m}\sum_{j=1}^{n} a_{i,j}^2 = s##

this is just the rundown, the version I turned in was more formal looking.
 
Last edited:
  • #13
Fredrik
Staff Emeritus
Science Advisor
Gold Member
10,851
406
##A = \left[\begin{array}{cc}R_{1}\\R_{2}\\.\\.\\.\\R_{m}\end{array}\right] = \left[\begin{array}{cc}C_{1}&C_{2}&.&.&.&C_{n}\end{array}\right]## where ##R_{i},C_{i}## are rows and columns

now ##A^T =\left[\begin{array}{cc}R_{1}&R_{2}&.&.&.&R_{m}\end{array}\right] = \left[\begin{array}{cc}C_{1}\\C_{2}\\.\\.\\.\\C_{n}\end{array}\right] ##
If the Rs and Cs denote the same things in that last line as in the first, there should be transpose symbols on them in the last line, i.e. ##R_1{}^T## rather than ##R_1##.

so ##AA^T## gives an m x m matrix and ##A^TA## gives an n x n matrix by doing the dot product, ##R_{i} \cdot R_{i}, C_{i} \cdot C_{i}##, respectively.
The ij component of ##AA^T## will be ##R_iR_j{}^T##. This is equal to ##R_i{}^T\cdot R_j{}^T## and ##R_i\cdot R_j##, so you appear to be doing the right calculations, but writing them down in a way that's a little bit strange.

Since you have solved the problem, I will show you my complete solution:
$$\operatorname{Tr}(AA^T)=\sum_i (AA^T)_{ii} =\sum_i\sum_j A_{ij}(A^T)_{ji} =\sum_i\sum_j A_{ij}A_{ij}=s.$$ First equality: Just the definition of the trace.
Second equality: Just the definition of matrix multiplication.
Third equality: Just the definition of the transpose.

Most people don't bother to learn the definitions in this way. Perhaps this will be the motivation you need to do it.
 
  • #14
189
0
okay perfect thanks! Yeah the more I know the better, I am a math major so I don't want to learn just the bare minimum.
 
  • #15
HallsofIvy
Science Advisor
Homework Helper
41,794
924
oh okay so to write the n x n matrix A

##[A]_{i,j} = \displaystyle\sum_{i,j=1}^{n} A_{i,j}##
Again, this is wrong. On the left you have an array of numbers, on the right a single number- the sum of the numbers in that array.

and to continue what you have

##tr(AA^T) = tr([AA^T]_{ij}) = tr(\sum_{k=1}^{m} A_{ik} A^T_{kj}) = (a_{i,1})^2+(a_{i,2})^2+...+(a_{i,n})^2+(a_{1,j})^2+(a_{2,j})^2+...+(a_{n,j})^2 = \sum_{j = 1}^{m} \sum_{i = 1}^{n} (A_{ij}^2) = s##
 

Related Threads for: Trace of matrix proof

  • Last Post
2
Replies
25
Views
6K
  • Last Post
2
Replies
37
Views
4K
  • Last Post
Replies
5
Views
5K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
17
Views
2K
Replies
2
Views
5K
  • Last Post
Replies
5
Views
427
Replies
17
Views
3K
Top