矩陣的跡(matrix trace)的特性以及證明

本文详细介绍了矩阵迹的概念及一系列性质,并提供了相应的证明。矩阵迹定义为对角线上元素之和,性质包括线性性、转置不变性以及乘积的迹等于迹的乘积。此外,还证明了迹的循环性质,即多个矩阵相乘时,改变矩阵的排列顺序不影响迹的值。这些性质在矩阵运算和线性代数中具有重要意义。
摘要由CSDN通过智能技术生成

前言

本篇整理自深藍學院三維點雲處理課程的Lecture 9 – Registration,並補上證明。

definition

tr ( A ) = ∑ i = 1 n a i i = a 11 + a 22 + . . . + a n n \text{tr}(A) = \sum\limits_{i=1}^n a_{ii} = a_{11}+a_{22}+...+a_{nn} tr(A)=i=1naii=a11+a22+...+ann

linear mapping

tr ( A + B ) = tr ( A ) + tr ( B ) \text{tr}(\bold{A}+\bold{B}) = \text{tr}(\bold{A})+\text{tr}(\bold{B}) tr(A+B)=tr(A)+tr(B)

tr ( c A ) = c tr ( A ) \text{tr}(c\bold{A}) = c\text{tr}(\bold{A}) tr(cA)=ctr(A)

tr ( A ) = tr ( A T ) \text{tr}(\bold{A}) = \text{tr}(\bold{A}^T) tr(A)=tr(AT)

trace of product

tr ( A B T ) = tr ( A T B ) = tr ( B A T ) = tr ( B T A ) = ∑ i , j A i j B i j , ∀ A , B ∈ R m × n \text{tr}(\bold{A}\bold{B}^T) = \text{tr}(\bold{A}^T\bold{B}) = \text{tr}(\bold{B}\bold{A}^T) = \text{tr}(\bold{B}^T\bold{A}) = \sum\limits_{i,j}A_{ij}B_{ij}, \forall A,B \in \R^{m \times n} tr(ABT)=tr(ATB)=tr(BAT)=tr(BTA)=i,jAijBij,A,BRm×n

tr ( a b T ) = a T b 向量外積的跡等於向量的內積 ∀ a , b ∈ R n × 1 \begin{aligned}\text{tr}(\bold{a}\bold{b}^T) = \bold{a}^T\bold{b} && \text{向量外積的跡等於向量的內積}\end{aligned} \forall \bold{a},\bold{b} \in \R^{n \times 1} tr(abT)=aTb向量外積的跡等於向量的內積a,bRn×1

性質一證明

參考proof of properties of trace of a matrix

tr ( A B T ) = ∑ i = 1 m ∑ j = 1 n A i j B j i T 對角線上第i個元素為 ∑ j = 1 n A i j B j i T ,trace為m個對角線元素的和 = ∑ j = 1 n ∑ i = 1 m B j i T A i j 交換 ∑ 順序和乘法順序 = ∑ i = 1 n ∑ j = 1 m B i j T A j i i,j互換 = tr ( B T A ) \begin{aligned}\text{tr}(\bold{A}\bold{B}^T) &=\sum\limits_{i=1}^m\sum\limits_{j=1}^nA_{ij}B^T_{ji} && \text{對角線上第i個元素為}\sum\limits_{j=1}^nA_{ij}B^T_{ji}\text{,trace為m個對角線元素的和} \\&= \sum\limits_{j=1}^n\sum\limits_{i=1}^mB^T_{ji}A_{ij} && \text{交換}\sum\text{順序和乘法順序} \\&= \sum\limits_{i=1}^n\sum\limits_{j=1}^mB^T_{ij}A_{ji} && \text{i,j互換} \\&=\text{tr}(\bold{B}^T\bold{A})\end{aligned} tr(ABT)=i=1mj=1nAijBjiT=j=1ni=1mBjiTAij=i=1nj=1mBijTAji=tr(BTA)對角線上第i個元素為j=1nAijBjiT,tracem個對角線元素的和交換順序和乘法順序i,j互換

tr ( A B T ) = ∑ i = 1 n ∑ j = 1 m B i j T A j i = ∑ j = 1 m ∑ i = 1 n B j i A i j T 轉置A,B並交換 ∑ 順序 = ∑ i = 1 m ∑ j = 1 n B i j A j i T i,j互換 = tr ( B A T ) \begin{aligned}\text{tr}(\bold{A}\bold{B}^T) &=\sum\limits_{i=1}^n\sum\limits_{j=1}^mB^T_{ij}A_{ji} \\&= \sum\limits_{j=1}^m\sum\limits_{i=1}^nB_{ji}A^T_{ij} && \text{轉置A,B並交換}\sum\text{順序} \\&= \sum\limits_{i=1}^m\sum\limits_{j=1}^nB_{ij}A^T_{ji} && \text{i,j互換} \\&= \text{tr}(\bold{B}\bold{A}^T)\end{aligned} tr(ABT)=i=1nj=1mBijTAji=j=1mi=1nBjiAijT=i=1mj=1nBijAjiT=tr(BAT)轉置A,B並交換順序i,j互換

最後因為 tr ( A B T ) = tr ( B T A ) \begin{aligned}\text{tr}(\bold{A}\bold{B}^T) = \text{tr}(\bold{B}^T\bold{A})\end{aligned} tr(ABT)=tr(BTA),同理 tr ( B A T ) = tr ( A T B ) \text{tr}(\bold{B}\bold{A}^T) = \text{tr}(\bold{A}^T\bold{B}) tr(BAT)=tr(ATB)

性質二證明

參考A Relation between the Dot Product and the Trace

tr ( a b T ) = tr ( [ a 1 a 2 . . . a n ] [ b 1 b 2 . . . b n ] ) = tr ( [ a 1 b 1 a 1 b 2 . . . a 1 b n a 2 b 1 a 2 b 2 . . . a 2 b n . . . a n b 1 a n b 2 . . . a n b n ] ) = ∑ i = 1 n a i b i = a T b \begin{aligned}\text{tr}(\bold{a}\bold{b}^T) &= \text{tr}(\begin{bmatrix}a_1 \\ a_2 \\ ... \\ a_n\end{bmatrix}\begin{bmatrix}b_1 & b_2 & ... & b_n\end{bmatrix}) \\&= \text{tr}(\begin{bmatrix}a_1b_1 & a_1b_2 & ... & a_1b_n \\ a_2b_1 & a_2b_2 & ... & a_2b_n \\ ... \\ a_nb_1 & a_nb_2 & ... & a_nb_n \end{bmatrix}) \\&= \sum\limits_{i=1}^n a_ib_i \\&= \bold{a}^T\bold{b}\end{aligned} tr(abT)=tr(a1a2...an[b1b2...bn])=tr(a1b1a2b1...anb1a1b2a2b2anb2.........a1bna2bnanbn)=i=1naibi=aTb

cyclic property

tr ( A B C D ) = tr ( B C D A ) = tr ( C D A B ) = tr ( D A B C ) \text{tr}(\bold{ABCD}) = \text{tr}(\bold{BCDA}) = \text{tr}(\bold{CDAB}) = \text{tr}(\bold{DABC}) tr(ABCD)=tr(BCDA)=tr(CDAB)=tr(DABC)

證明

參考Prove that trace(ABC)=trace(BCA)=trace(CAB)

trace of product的性質一 tr ( A B T ) = tr ( B T A ) , ∀ A , B ∈ R m × n \text{tr}(\bold{A}\bold{B}^T) = \text{tr}(\bold{B}^T\bold{A}), \forall A,B \in \R^{m \times n} tr(ABT)=tr(BTA),A,BRm×n可以被重新表述成:

tr ( X Y ) = tr ( Y X ) , ∀ X ∈ R m × n , Y ∈ R n × m \text{tr}(\bold{X}\bold{Y}) = \text{tr}(\bold{Y}\bold{X}), \forall X \in \R^{m \times n},Y \in \R^{n \times m} tr(XY)=tr(YX),XRm×n,YRn×m

先從三個矩陣相乘開始:

tr ( A B C ) = tr ( A ( B C ) ) 矩陣的結合律 = tr ( ( B C ) A ) tr ( X Y ) = tr ( Y X ) = tr ( B C A ) = tr ( B ( C A ) ) = tr ( ( C A ) B ) tr ( X Y ) = tr ( Y X ) = tr ( C A B ) \begin{aligned}\text{tr}(\bold{A}\bold{B}\bold{C}) &= \text{tr}(\bold{A}(\bold{B}\bold{C})) && \text{矩陣的結合律}\\&= \text{tr}((\bold{B}\bold{C})\bold{A}) && \text{tr}(\bold{X}\bold{Y}) = \text{tr}(\bold{Y}\bold{X})\\&= \text{tr}(\bold{B}\bold{C}\bold{A}) \\&= \text{tr}(\bold{B}(\bold{C}\bold{A})) \\&= \text{tr}((\bold{C}\bold{A})\bold{B}) && \text{tr}(\bold{X}\bold{Y}) = \text{tr}(\bold{Y}\bold{X})\\&= \text{tr}(\bold{C}\bold{A}\bold{B})\end{aligned} tr(ABC)=tr(A(BC))=tr((BC)A)=tr(BCA)=tr(B(CA))=tr((CA)B)=tr(CAB)矩陣的結合律tr(XY)=tr(YX)tr(XY)=tr(YX)

四個矩陣相乘:

tr ( A B C D ) = tr ( A ( B C D ) ) = tr ( ( B C D ) A ) = tr ( B C D A ) = tr ( B ( C D A ) ) = tr ( ( C D A ) B ) = tr ( C D A B ) = tr ( C ( D A B ) ) = tr ( ( D A B ) C ) = tr ( D A B C ) \begin{aligned}\text{tr}(\bold{ABCD}) &= \text{tr}(\bold{A}(\bold{BCD})) = \text{tr}((\bold{BCD})\bold{A}) = \text{tr}(\bold{BCDA}) \\&= \text{tr}(\bold{B}(\bold{CDA}))= \text{tr}((\bold{CDA})\bold{B}) = \text{tr}(\bold{CDAB}) \\&= \text{tr}(\bold{C}(\bold{DAB}))= \text{tr}((\bold{DAB})\bold{C}) = \text{tr}(\bold{DABC})\end{aligned} tr(ABCD)=tr(A(BCD))=tr((BCD)A)=tr(BCDA)=tr(B(CDA))=tr((CDA)B)=tr(CDAB)=tr(C(DAB))=tr((DAB)C)=tr(DABC)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值