MA&ALA3.10_LU分解 (The LU Factorization)

注:本文是对Matrix Analysis and Applied Linear Algebra一书3.10节The LU Factorization的学习笔记

A \mathbf A A的LU分解: A = L U \mathbf A=\mathbf {LU} A=LU,其中 L \mathbf L L是下三角矩阵, U \mathbf U U是上三角矩阵

LU分解其实是高斯消元的过程用矩阵描述

为了更好地理解这一点,我们首先引入一种特殊形式的矩阵(elementary lower-triangular matrix):
T k = I − c k e k T , \mathbf T_k=\mathbf I-\mathbf c_k \mathbf e_k^T, Tk=IckekT,
其中
c k = ( 0 0 ⋮ μ k + 1 ⋮ μ n ) , \mathbf c_k=\left(\begin{matrix}0 \\ 0\\ \vdots \\ \mu_{k+1}\\ \vdots\\\mu_n\end{matrix}\right), ck=00μk+1μn,
那么
T k = ( 1 0 ⋯ 0 0 ⋯ 0 0 1 ⋯ 0 0 ⋯ 0 ⋮ ⋮ ⋱ ⋮ ⋮   ⋮ 0 0 ⋯ 1 0 ⋯ 0 0 0 ⋯ − μ k + 1 1 ⋯ 0 ⋮ ⋮   ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ − μ n 0 ⋯ 1 ) . \mathbf T_k=\left(\begin{matrix}1& 0& \cdots &0 &0 &\cdots &0 \\0& 1& \cdots &0 &0 &\cdots &0 \\ \vdots &\vdots &\ddots &\vdots &\vdots &~ &\vdots \\0 &0 &\cdots &1 &0 &\cdots &0\\0 &0 &\cdots &-\mu_{k+1} &1 &\cdots &0\\ \vdots &\vdots &~ &\vdots &\vdots &\ddots &\vdots\\0 &0 &\cdots &-\mu_n &0 &\cdots &1\end{matrix}\right). Tk=1000001000 001μk+1μn00010 00001.
观察到 e k T c k = 0 \mathbf e_k^T \mathbf c_k=0 ekTck=0,可以得到
T k − 1 = I + c k e k T = ( 1 0 ⋯ 0 0 ⋯ 0 0 1 ⋯ 0 0 ⋯ 0 ⋮ ⋮ ⋱ ⋮ ⋮   ⋮ 0 0 ⋯ 1 0 ⋯ 0 0 0 ⋯ μ k + 1 1 ⋯ 0 ⋮ ⋮   ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ μ n 0 ⋯ 1 ) , \mathbf T_k^{-1}=\mathbf I+\mathbf c_k \mathbf e_k^T=\left(\begin{matrix}1& 0& \cdots &0 &0 &\cdots &0 \\0& 1& \cdots &0 &0 &\cdots &0 \\ \vdots &\vdots &\ddots &\vdots &\vdots &~ &\vdots \\0 &0 &\cdots &1 &0 &\cdots &0\\0 &0 &\cdots &\mu_{k+1} &1 &\cdots &0\\ \vdots &\vdots &~ &\vdots &\vdots &\ddots &\vdots\\0 &0 &\cdots &\mu_n &0 &\cdots &1\end{matrix}\right), Tk1=I+ckekT=1000001000 001μk+1μn00010 00001,
它也属于elementary lower-triangular matrix. 引入这个矩阵的目的是用它表示消除第 k k k个pivot下的元素时需要的所有 Type  I I I \text{Type }\rm{III} Type III型行变换操作。具体来说,若经 k − 1 k-1 k1步消元操作后的部分三角化矩阵 A k − 1 \mathbf A_{k-1} Ak1是如下形式:
A k − 1 = ( ∗ ∗ ⋯ α 1 ∗ ⋯ ∗ 0 ∗ ⋯ α 2 ∗ ⋯ ∗ ⋮ ⋮ ⋱ ⋮ ⋮   ⋮ 0 0 ⋯ α k ∗ ⋯ ∗ 0 0 ⋯ α k + 1 ∗ ⋯ ∗ ⋮ ⋮   ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ α n ∗ ⋯ ∗ ) , \mathbf A_{k-1}=\left(\begin{matrix}*& *& \cdots &\alpha_1 &* &\cdots &* \\0& *& \cdots &\alpha_2 &* &\cdots &* \\ \vdots &\vdots &\ddots &\vdots &\vdots &~ &\vdots \\0 &0 &\cdots &\alpha_k &* &\cdots &*\\0 &0 &\cdots &\alpha_{k+1} &* &\cdots &*\\ \vdots &\vdots &~ &\vdots &\vdots &\ddots &\vdots\\0 &0 &\cdots & \alpha_n &* &\cdots &*\end{matrix}\right), Ak1=0000000 α1α2αkαk+1αn ,
那么
T k A k − 1 = ( I − c k e k T ) A k − 1 = A k − 1 − c k e k T A k − 1 = ( ∗ ∗ ⋯ α 1 ∗ ⋯ ∗ 0 ∗ ⋯ α 2 ∗ ⋯ ∗ ⋮ ⋮ ⋱ ⋮ ⋮   ⋮ 0 0 ⋯ α k ∗ ⋯ ∗ 0 0 ⋯ 0 ∗ ⋯ ∗ ⋮ ⋮   ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ 0 ∗ ⋯ ∗ ) , where  c k = ( 0 0 ⋮ α k + 1 / α k ⋮ α n / α k ) \begin{aligned} \mathbf T_k \mathbf A_{k-1}&=(\mathbf I-\mathbf c_k \mathbf e_k^T)\mathbf A_{k-1}=\mathbf A_{k-1}-\mathbf c_k \mathbf e_k^T \mathbf A_{k-1} \\ &=\left(\begin{matrix}*& *& \cdots &\alpha_1 &* &\cdots &* \\0& *& \cdots &\alpha_2 &* &\cdots &* \\ \vdots &\vdots &\ddots &\vdots &\vdots &~ &\vdots \\0 &0 &\cdots &\alpha_k &* &\cdots &*\\0 &0 &\cdots &0 &* &\cdots &*\\ \vdots &\vdots &~ &\vdots &\vdots &\ddots &\vdots\\0 &0 &\cdots & 0 &* &\cdots &*\end{matrix}\right), \quad \text{where } \mathbf c_k=\left(\begin{matrix}0 \\ 0\\ \vdots \\ \alpha_{k+1}/\alpha_k\\ \vdots\\\alpha_n/\alpha_k\end{matrix}\right) \end{aligned} TkAk1=(IckekT)Ak1=Ak1ckekTAk1=0000000 α1α2αk00 ,where ck=00αk+1/αkαn/αk
可以看到第 k k k个pivot α k \alpha_k αk下的元素已经都清零了。

因此,如果不需要进行行交换的话,高斯消元的过程等价于左乘一系列 T i \mathbf T_i Ti,也即 T n − 1 ⋯ T 2 T 1 A = U \mathbf T_{n-1}\cdots\mathbf T_2 \mathbf T_1 \mathbf A=\mathbf U Tn1T2T1A=U,因此
A = T 1 − 1 T 2 − 1 ⋯ T n − 1 − 1 U . \mathbf A=\mathbf T_1^{-1}\mathbf T_2^{-1}\cdots \mathbf T_{n-1}^{-1}\mathbf U. A=T11T21Tn11U.
注意到 j ≤ k j \le k jk e j T c k = 0 \mathbf e_j^T \mathbf c_k=0 ejTck=0,有
T 1 − 1 T 2 − 1 ⋯ T n − 1 − 1 = ( I + c 1 e 1 T ) ( I + c 2 e 2 T ) ⋯ ( I + c n − 1 e n − 1 T ) = I + c 1 e 1 T + c 2 e 2 T + ⋯ + c n − 1 e n − 1 T . \begin{aligned} \mathbf T_1^{-1}\mathbf T_2^{-1}\cdots \mathbf T_{n-1}^{-1}&=(\mathbf I+\mathbf c_1 \mathbf e_1^T)(\mathbf I+\mathbf c_2 \mathbf e_2^T)\cdots(\mathbf I+\mathbf c_{n-1}\mathbf e_{n-1}^T)\\ &=\mathbf I+\mathbf c_1 \mathbf e_1^T+\mathbf c_2 \mathbf e_2^T+\cdots+\mathbf c_{n-1}\mathbf e_{n-1}^T. \end{aligned} T11T21Tn11=(I+c1e1T)(I+c2e2T)(I+cn1en1T)=I+c1e1T+c2e2T++cn1en1T.
由于
c k e k T = ( 0 0 ⋯ 0 0 ⋯ 0 0 0 ⋯ 0 0 ⋯ 0 ⋮ ⋮ ⋱ ⋮ ⋮   ⋮ 0 0 ⋯ 0 0 ⋯ 0 0 0 ⋯ l k + 1 , k 0 ⋯ 0 ⋮ ⋮   ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ l n , k 0 ⋯ 0 ) , \mathbf c_k \mathbf e_k^T=\left(\begin{matrix}0& 0& \cdots &0 &0 &\cdots &0 \\0& 0& \cdots &0 &0 &\cdots &0 \\ \vdots &\vdots &\ddots &\vdots &\vdots &~ &\vdots \\0 &0 &\cdots &0 &0 &\cdots &0\\0 &0 &\cdots &l_{k+1,k} &0 &\cdots &0\\ \vdots &\vdots &~ &\vdots &\vdots &\ddots &\vdots\\0 &0 &\cdots &l_{n,k} &0 &\cdots &0\end{matrix}\right), ckekT=0000000000 000lk+1,kln,k00000 00000,
其中 l i k l_{ik} lik是第 k k k步消元时需要乘的系数。

那么有 A = L U \mathbf A=\mathbf {LU} A=LU,其中
L = I + c 1 e 1 T + c 2 e 2 T + ⋯ + c n − 1 e n − 1 T = ( 1 0 0 ⋯ 0 l 21 1 0 ⋯ 0 l 31 l 32 1 ⋯ 0 ⋮ ⋮ ⋮ ⋱ ⋮ l n 1 l n 2 l n 3 ⋯ 1 ) . \mathbf L=\mathbf I+\mathbf c_1 \mathbf e_1^T+\mathbf c_2 \mathbf e_2^T+\cdots+\mathbf c_{n-1}\mathbf e_{n-1}^T=\left(\begin{matrix}1 & 0 & 0 & \cdots & 0\\ l_{21} & 1 & 0 & \cdots & 0\\ l_{31} &l_{32} &1 &\cdots &0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ l_{n1} & l_{n2} & l_{n3} & \cdots &1 \end{matrix}\right). L=I+c1e1T+c2e2T++cn1en1T=1l21l31ln101l32ln2001ln30001.
注:也可以不引入elementary lower-triangular matrix直接一步步按高斯消元法左乘一系列 Type  I I I \text{Type }\rm{III} Type III型矩阵 G j i = I − μ i e j e i T \mathbf G_{ji}=\mathbf I-\mu_i\mathbf e_j \mathbf e_i^T Gji=IμiejeiT(第 j j j行=第 j j j行- μ i \mu_i μi i i i行),可以发现 T i = G n i ⋯ G 2 i G 1 i \mathbf T_i=\mathbf G_{ni}\cdots\mathbf G_{2i}\mathbf G_{1i} Ti=GniG2iG1i,也即 T i \mathbf T_i Ti表达了将第 i i i个pivot下的元素清零需要的所有步骤。

例:对 A = ( 2 2 2 4 7 7 6 18 22 ) \mathbf A=\left(\begin{matrix}2 & 2& 2\\ 4&7&7\\6&18&22\end{matrix}\right) A=24627182722进行LU分解

原先 0 0 0的位置可以用来记录系数 l i k l_{ik} lik,用加粗表示:
( 2 2 2 4 7 7 6 18 22 ) ⟶ R 2 − 2 R 1 R 3 − 3 R 1 ( 2 2 2 2 3 3 3 12 16 ) ⟶ R 3 − 4 R 2 ( 2 2 2 2 3 3 3 4 4 ) . \left(\begin{matrix}2 & 2& 2\\ 4&7&7\\6&18&22\end{matrix}\right)\stackrel{R_2-2R_1\\R_3-3R_1}{\longrightarrow}\left(\begin{matrix}2 & 2& 2\\ \mathbf 2&3&3\\\mathbf 3&12&16\end{matrix}\right)\stackrel{R_3-4R_2}{\longrightarrow}\left(\begin{matrix}2 & 2& 2\\ \mathbf 2&3&3\\\mathbf 3&\mathbf 4&4\end{matrix}\right). 24627182722R22R1R33R122323122316R34R2223234234.

L = ( 1 0 0 2 1 0 3 4 1 )  and  U = ( 2 2 2 0 3 3 0 0 4 ) \mathbf L=\left(\begin{matrix}1 & 0& 0\\ 2&1&0\\3&4&1\end{matrix}\right)\text{ and }\mathbf U=\left(\begin{matrix}2 & 2& 2\\ 0&3&3\\0&0&4\end{matrix}\right) L=123014001 and U=200230234
这也意味着LU分解不需要占用比原矩阵 A \mathbf A A更多的内存。

LU Factorization

If A \mathbf A A is an n × n n \times n n×n matrix such that a zero pivot is never encountered when applying Gaussian elimination with Type III operations, then A \mathbf A A can be factored as the product A = L U \mathbf{A = LU} A=LU, where the following hold.

  • L \mathbf L L is lower triangular and U \mathbf U U is upper triangular.
  • l i i = 1 l_{ii}=1 lii=1 and u i i ≠ 0 u_{ii} \ne 0 uii=0 for each i = 1 , 2 , . . . , n . i =1, 2,...,n. i=1,2,...,n.
  • Below the diagonal of L \mathbf L L, the entry l i j l_{ij} lij is the multiple of row j j j that is subtracted from row i i i in order to annihilate the ( i , j ) (i, j) (i,j) -position during Gaussian elimination.
  • U \mathbf U U is the final result of Gaussian elimination applied to A \mathbf A A.
  • The matrices L \mathbf L L and U \mathbf U U are uniquely determined.

The decomposition of A \mathbf A A into A = L U \mathbf{A = LU} A=LU is called the LU factorization of A \mathbf A A, and the matrices L \mathbf L L and U \mathbf U U are called the LU factors of A \mathbf A A.

关于LU分解唯一性的证明

由于 L , U \mathbf L,\mathbf U L,U对角线元素都是非零的下/上三角矩阵,所以 L , U \mathbf L,\mathbf U L,U非奇异。假设存在 L 1 U 1 = A = L 2 U 2 \mathbf L_1 \mathbf U_1=\mathbf A=\mathbf L_2 \mathbf U_2 L1U1=A=L2U2,那么
L 2 − 1 L 1 = U 2 U 1 − 1 . \mathbf L_2^{-1}\mathbf L_1=\mathbf U_2\mathbf U_1^{-1}. L21L1=U2U11.
下/上三角矩阵的逆和乘积依然是下/上三角矩阵,因此 L 2 − 1 L 1 \mathbf L_2^{-1}\mathbf L_1 L21L1是下三角矩阵, U 2 U 1 − 1 \mathbf U_2\mathbf U_1^{-1} U2U11是上三角矩阵。要使两者相等,则必须有 L 2 − 1 L 1 = U 2 U 1 − 1 = I \mathbf L_2^{-1}\mathbf L_1=\mathbf U_2\mathbf U_1^{-1}=\mathbf I L21L1=U2U11=I. 因此 L 1 = L 2 , U 1 = U 2 \mathbf L_1=\mathbf L_2,\mathbf U_1=\mathbf U_2 L1=L2,U1=U2.

一旦矩阵 A \mathbf A A的LU分解确定了,会极大简化线性方程组 A x = b \mathbf {Ax=b} Ax=b的求解

  • To solve a nonsingular system A x = b \mathbf {Ax = b} Ax=b using the LU factorization A = L U \mathbf {A = LU} A=LU, first solve L y = b \mathbf {Ly = b} Ly=b for y \mathbf y y with the forward substitution algorithm , and then solve U x = y \mathbf {Ux = y} Ux=y for x \mathbf x x with the back substitution procedure.
  • The advantage of this approach is that once the LU factors for A \mathbf A A have been computed, any other linear system A x = b ~ \mathbf A\mathbf x = \tilde{\mathbf b} Ax=b~ can be solved with only n 2 n^2 n2 multiplications/divisions and n 2 − n n^2 − n n2n additions/subtractions.

例:说明LU分解可以简化计算 A − 1 \mathbf A^{-1} A1的过程

A − 1 \mathbf A^{-1} A1也即求 A X = I \mathbf {AX=I} AX=I. 注意到 A X = A [ x 1   x 2   ⋯   x n ] = [ e 1   e 2   ⋯   e n ] \mathbf {AX}=\mathbf A[\mathbf x_1~\mathbf x_2~\cdots~\mathbf x_n]=[\mathbf e_1~\mathbf e_2~\cdots ~\mathbf e_n] AX=A[x1 x2  xn]=[e1 e2  en],则问题可以转化为分别求 A x j = L U x j = e j \mathbf A \mathbf x_j=\mathbf{LUx}_j=\mathbf e_j Axj=LUxj=ej,这可以通过两步解决

  1. y j = U x j \mathbf y_j=\mathbf {Ux}_j yj=Uxj,然后通过forward substitution求 L y j = e j \mathbf{Ly}_j=\mathbf e_j Lyj=ej.
  2. 接着通过back substitution求解 U x j = y j \mathbf {Ux}_j=\mathbf y_j Uxj=yj

不是所有矩阵都能进行LU分解

Existence of LU Factors

Each of the following statements is equivalent to saying that a nonsingular matrix A n × n \mathbf A_{n \times n} An×n possesses an LU factorization.

  • Each leading principal submatrix A k \mathbf A_k Ak is nonsingular.
  • A zero pivot does not emerge during row reduction to upper-triangular form with Type  I I I \text{Type } \rm{III} Type III operations.

关于第一点的证明:

a nonsingular matrix A n × n \mathbf A_{n \times n} An×n possesses an LU factorization ⟹ \Longrightarrow each leading principal submatrix A k \mathbf A_k Ak is nonsingular

假设 A \mathbf A A有LU分解:
A = L U = ( L 11 0 L 21 L 22 ) ( U 11 U 12 0 U 22 ) = ( A k ∗ ∗ ∗ ) , \mathbf A=\mathbf L \mathbf U=\left(\begin{matrix}\mathbf L_{11} & \mathbf 0 \\ \mathbf L_{21} & \mathbf L_{22}\end{matrix}\right)\left(\begin{matrix}\mathbf U_{11} & \mathbf U_{12} \\ \mathbf 0 & \mathbf U_{22}\end{matrix}\right)=\left(\begin{matrix}\mathbf A_k & * \\ * & *\end{matrix}\right), A=LU=(L11L210L22)(U110U12U22)=(Ak),
其中 L 11 \mathbf L_{11} L11 U 11 \mathbf U_{11} U11都是 k × k k \times k k×k的矩阵。那么有 A k = L 11 U 11 \mathbf A_k=\mathbf L_{11} \mathbf U_{11} Ak=L11U11,因为 L 11 \mathbf L_{11} L11 U 11 \mathbf U_{11} U11都是非奇异的, A k \mathbf A_k Ak也是非奇异的。

a nonsingular matrix A n × n \mathbf A_{n \times n} An×n possesses an LU factorization ⟸ \Longleftarrow each leading principal submatrix A k \mathbf A_k Ak is nonsingular

首先用数学归纳法进行证明每个leading principal submatrix都可以进行LU分解:

k = 1 k=1 k=1, 若 A 1 = ( a 11 ) \mathbf A_1=(a_{11}) A1=(a11)是非奇异的,它存在LU分解 A 1 = ( 1 ) ( a 11 ) \mathbf A_1=(1)(a_{11}) A1=(1)(a11);

假设 A k \mathbf A_k Ak存在LU分解 A k = L k U k \mathbf A_k=\mathbf L_k \mathbf U_k Ak=LkUk,那么
A k + 1 = ( A k b c T α k + 1 ) = ( L k 0 c T U k − 1 1 ) ( U k L k − 1 b 0 α k + 1 − c T A k − 1 b ) ≜ L k + 1 U k + 1 , \mathbf A_{k+1}=\left(\begin{matrix}\mathbf A_k & \mathbf b \\ \mathbf c^T & \alpha_{k+1}\end{matrix}\right)=\left(\begin{matrix}\mathbf L_k & \mathbf 0 \\ \mathbf c^T \mathbf U_k^{-1} & 1\end{matrix}\right)\left(\begin{matrix}\mathbf U_k & \mathbf L_k^{-1}\mathbf b \\ \mathbf 0 & \alpha_{k+1}-\mathbf c^T \mathbf A_k^{-1}\mathbf b\end{matrix}\right)\triangleq\mathbf L_{k+1} \mathbf U_{k+1}, Ak+1=(AkcTbαk+1)=(LkcTUk101)(Uk0Lk1bαk+1cTAk1b)Lk+1Uk+1,
因为 A k + 1 \mathbf A_{k+1} Ak+1 L k + 1 \mathbf L_{k+1} Lk+1都是非奇异的,有 U k + 1 \mathbf U_{k+1} Uk+1是非奇异的,即 α k + 1 − c T A k − 1 b ≠ 0. \alpha_{k+1}-\mathbf c^T\mathbf A_k^{-1}\mathbf b \ne 0. αk+1cTAk1b=0. 因此 A k + 1 \mathbf A_{k+1} Ak+1存在LU分解。

A n \mathbf A_n An本身也是一个leading principal submatrix,因此可以进行LU分解。

关于第二点的证明:

a nonsingular matrix A n × n \mathbf A_{n \times n} An×n possesses an LU factorization ⟹ \Longrightarrow all pivots must be nonzero

首先根据
A k + 1 = ( L k 0 c T U k − 1 1 ) ( U k L k − 1 b 0 α k + 1 − c T A k − 1 b ) \mathbf A_{k+1}=\left(\begin{matrix}\mathbf L_k & \mathbf 0 \\ \mathbf c^T \mathbf U_k^{-1} & 1\end{matrix}\right)\left(\begin{matrix}\mathbf U_k & \mathbf L_k^{-1}\mathbf b \\ \mathbf 0 & \alpha_{k+1}-\mathbf c^T \mathbf A_k^{-1}\mathbf b\end{matrix}\right) Ak+1=(LkcTUk101)(Uk0Lk1bαk+1cTAk1b)
得到第 ( k + 1 ) (k+1) (k+1)个pivot: p k + 1 = α k + 1 − c T A k − 1 b p_{k+1}=\alpha_{k+1}-\mathbf c^T\mathbf A_k^{-1}\mathbf b pk+1=αk+1cTAk1b.

借用第一点的结论:a nonsingular matrix A n × n \mathbf A_{n \times n} An×n possesses an LU factorization ⟹ \Longrightarrow each leading principal submatrix A k \mathbf A_k Ak is nonsingular

已知 A k + 1 \mathbf A_{k+1} Ak+1 L k + 1 \mathbf L_{k+1} Lk+1都非奇异,有 U k + 1 \mathbf U_{k+1} Uk+1非奇异, p k + 1 ≠ 0 p_{k+1}\ne0 pk+1=0.

a nonsingular matrix A n × n \mathbf A_{n \times n} An×n possesses an LU factorization ⟸ \Longleftarrow all pivots must be nonzero

也即不需要进行行交换,满足从高斯消元过程中得到LU分解的前提条件


如果出现行交换应该怎么分解?

回忆之前的 elementary lower-triangular matrix  T k = I − c k e k T \text{elementary lower-triangular matrix }\mathbf T_k=\mathbf I-\mathbf c_k \mathbf e_k^T elementary lower-triangular matrix Tk=IckekT Type  I  elementary interchange matrix  E = I − u u T  with  u = e k + i − e k + j \text{Type }\rm{I}\text{ elementary interchange matrix }\mathbf E=\mathbf I-\mathbf u \mathbf u^T\text{ with }\mathbf u=\mathbf e_{k+i}-\mathbf e_{k+j} Type I elementary interchange matrix E=IuuT with u=ek+iek+j,不难发现 E 2 = I \mathbf E^2=\mathbf I E2=I. 另外,有
T ~ k ≜ E T k E = E 2 − E c k e k T E = I − c ~ k e k T , \tilde{\mathbf T}_k \triangleq \mathbf E \mathbf T_k \mathbf E=\mathbf E^2-\mathbf E \mathbf c_k \mathbf e_k^T \mathbf E=\mathbf I-\tilde{\mathbf c}_k\mathbf e_k^T, T~kETkE=E2EckekTE=Ic~kekT,
其中 c ~ k = E c k \tilde{\mathbf c}_k=\mathbf E \mathbf c_k c~k=Eck.

可以看出 T ~ k \tilde{\mathbf T}_k T~k也是一个elementary lower-triangular matrix,而且与 T k \mathbf T_k Tk的差别仅仅在于 μ k + i \mu_{k+i} μk+i μ k + j \mu_{k+j} μk+j交换了一下位置。

现在我们假设在第 k k k行高斯消元结束后必须进行一次行交换,也即用 E T k ⋯ T 1 \mathbf E \mathbf T_k \cdots \mathbf T_1 ETkT1左乘 A \mathbf A A,利用 E 2 = I \mathbf E^2=\mathbf I E2=I,有
E T k T k − 1 ⋯ T 1 = E T k E 2 T k − 1 E 2 ⋯ E 2 T 1 E 2 = ( E T k E ) ( E T k − 1 E ) ⋯ ( E T 1 E ) E = T ~ k T ~ k − 1 ⋯ T ~ 1 E . \begin{aligned} \mathbf E \mathbf T_k \mathbf T_{k-1}\cdots \mathbf T_1&=\mathbf E \mathbf T_k \mathbf E^2 \mathbf T_{k-1} \mathbf E^2\cdots \mathbf E^2 \mathbf T_1 \mathbf E^2\\ &=(\mathbf E \mathbf T_k \mathbf E)(\mathbf E \mathbf T_{k-1}\mathbf E)\cdots (\mathbf E \mathbf T_1 \mathbf E)\mathbf E \\ &=\tilde{\mathbf T}_k \tilde{\mathbf T}_{k-1}\cdots \tilde{\mathbf T}_1 \mathbf E. \end{aligned} ETkTk1T1=ETkE2Tk1E2E2T1E2=(ETkE)(ETk1E)(ET1E)E=T~kT~k1T~1E.
可以发现 E \mathbf E E被变换到了最右端,且 T ~ k T ~ k − 1 ⋯ T ~ 1 \tilde{\mathbf T}_k \tilde{\mathbf T}_{k-1}\cdots\tilde{\mathbf T}_1 T~kT~k1T~1 T k T k − 1 ⋯ T 1 \mathbf T_{k} \mathbf T_{k-1}\cdots\mathbf T_1 TkTk1T1的区别仅在于第 k + i k+i k+i k + j k+j k+j行被交换了。

把高斯消元过程执行完,整体可以写成 T ~ n − 1 ⋯ T ~ 2 T ~ 1 P A = U \tilde{\mathbf T}_{n-1}\cdots \tilde{\mathbf T}_2\tilde{\mathbf T}_1 \mathbf {PA=U} T~n1T~2T~1PA=U,其中 P \mathbf P P是所有 Type  I \text{Type }\rm I Type I型行交换矩阵的乘积。令 L = T ~ 1 − 1 T ~ 2 − 2 ⋯ T ~ n − 1 − 1 \mathbf L=\tilde{\mathbf T}_1^{-1}\tilde{\mathbf T}_2^{-2}\cdots \tilde{\mathbf T}_{n-1}^{-1} L=T~11T~22T~n11,有 P A = L U \mathbf {PA=LU} PA=LU.

也即,对任意非奇异矩阵 A \mathbf A A,存在置换矩阵 P \mathbf P P使得 P A \mathbf {PA} PA存在LU分解。

(上面的推理过程也可以理解为,预先对 A \mathbf A A做行交换,使交换后的矩阵所有pivot都不为零)

例:对矩阵 A = ( 1 2 − 3 4 4 8 12 − 8 2 3 2 1 − 3 − 1 1 − 4 ) \mathbf A=\left(\begin{matrix}1 & 2 & -3 & 4 \\ 4 & 8 & 12 & -8\\ 2 & 3 & 2 & 1\\ -3 & -1 & 1 & -4\end{matrix}\right) A=14232831312214814,确定 P A \mathbf {PA} PA的LU分解,其中 P \mathbf P P是对应的置换阵

为了容易看出行交换过程,通常会加入permutation counter column p \mathbf p p,它一开始是 1 , 2 , 3 , 4 1,2,3,4 1,2,3,4的自然排列:(下面的过程有一些交换不是必做的)
[ A ∣ p ] = ( 1 2 − 3 4 4 8 12 − 8 2 3 2 1 − 3 − 1 1 − 4 ∣ 1 2 3 4 ) ⟶ ( 4 8 12 − 8 1 2 − 3 4 2 3 2 1 − 3 − 1 1 − 4 ∣ 2 1 3 4 ) ⟶ ( 4 8 12 − 8 1 / 4 0 − 6 6 1 / 2 − 1 − 4 5 − 3 / 4 5 10 − 10 ∣ 2 1 3 4 ) ⟶ ( 4 8 12 − 8 − 3 / 4 5 10 10 1 / 2 − 1 − 4 5 1 / 4 0 − 6 6 ∣ 2 4 3 1 ) ⟶ ( 4 8 12 − 8 − 3 / 4 5 10 10 1 / 2 − 1 / 5 − 2 3 1 / 4 0 − 6 6 ∣ 2 4 3 1 ) ⟶ ( 4 8 12 − 8 − 3 / 4 5 10 10 1 / 4 0 − 6 6 1 / 2 − 1 / 5 − 2 3 ∣ 2 4 1 3 ) ⟶ ( 4 8 12 − 8 − 3 / 4 5 10 10 1 / 4 0 − 6 6 1 / 2 − 1 / 5 1 / 3 1 ∣ 2 4 1 3 ) . \begin{aligned} \left[\mathbf A|\mathbf p\right]=&\left(\begin{matrix}1 & 2 & -3 & 4 \\ 4 & 8 & 12 & -8\\ 2 & 3 & 2 & 1\\ -3 & -1 & 1 & -4\end{matrix}\right|\left.\begin{matrix}1 \\2\\3\\4\end{matrix}\right)\longrightarrow \left(\begin{matrix} 4 & 8 & 12 & -8\\1 & 2 & -3 & 4 \\ 2 & 3 & 2 & 1\\ -3 & -1 & 1 & -4\end{matrix}\right|\left.\begin{matrix}2 \\1\\3\\4\end{matrix}\right)\\ \longrightarrow & \left(\begin{matrix} 4 & 8 & 12 & -8\\\mathbf {1/4} & 0 & -6 & 6 \\ \mathbf {1/2} & -1 & -4 & 5\\ -\mathbf {3/4} & 5 & 10 & -10\end{matrix}\right|\left.\begin{matrix}2 \\1\\3\\4\end{matrix}\right)\longrightarrow \left(\begin{matrix} 4 & 8 & 12 & -8\\-\mathbf {3/4} & 5 & 10 & 10 \\ \mathbf {1/2} & -1 & -4 & 5\\ \mathbf {1/4} & 0 & -6 & 6\end{matrix}\right|\left.\begin{matrix}2 \\4\\3\\1\end{matrix}\right)\\ \longrightarrow & \left(\begin{matrix} 4 & 8 & 12 & -8\\-\mathbf {3/4} & 5 & 10 & 10 \\ \mathbf {1/2} & -\mathbf {1/5} & -2 & 3\\ \mathbf {1/4} & \mathbf 0 & -6 & 6\end{matrix}\right|\left.\begin{matrix}2 \\4\\3\\1\end{matrix}\right)\longrightarrow \left(\begin{matrix} 4 & 8 & 12 & -8\\-\mathbf {3/4} & 5 & 10 & 10 \\ \mathbf {1/4} & \mathbf 0 & -6 & 6\\ \mathbf {1/2} & -\mathbf {1/5} & -2 & 3\\ \end{matrix}\right|\left.\begin{matrix}2 \\4\\1\\3\end{matrix}\right)\\ \longrightarrow& \left(\begin{matrix} 4 & 8 & 12 & -8\\-\mathbf {3/4} & 5 & 10 & 10 \\ \mathbf {1/4} & \mathbf 0 & -6 & 6\\ \mathbf {1/2} & -\mathbf {1/5} & \mathbf {1/3} & 1\\ \end{matrix}\right|\left.\begin{matrix}2 \\4\\1\\3\end{matrix}\right). \end{aligned} [Ap]=14232831312214814123441238231123218414213441/41/23/4801512641086510213443/41/21/4851012104681056243143/41/21/4851/5012102681036243143/41/41/28501/512106281063241343/41/41/28501/5121061/3810612413.
因此有
L = ( 1 0 0 0 − 3 / 4 1 0 0 1 / 4 0 1 0 1 / 2 − 1 / 5 1 / 3 1 ) , U = ( 4 8 12 − 8 0 5 10 10 0 0 − 6 6 0 0 0 1 ) , P = ( 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 ) . \mathbf L=\left(\begin{matrix} 1 & 0 & 0 & 0\\-{3/4} & 1 & 0 & 0 \\ {1/4} & 0 & 1 & 0\\ {1/2} & -1/5 & 1/3 & 1\end{matrix}\right),\mathbf U=\left(\begin{matrix} 4 & 8 & 12 & -8\\0 & 5 & 10 & 10 \\ 0 &0 & -6 & 6\\ 0 & 0 & 0 & 1\end{matrix}\right),\mathbf P=\left(\begin{matrix} 0 & 1 & 0 & 0\\0 & 0 & 0 & 1 \\ 1 &0 & 0 & 0\\ 0 & 0 & 1 & 0\end{matrix}\right). L=13/41/41/20101/50011/30001,U=4000850012106081061,P=0010100000010100.

LU Factorization with Row Interchanges
  • For each nonsingular matrix A \mathbf A A, there exists a permutation matrix P \mathbf P P such that P A \mathbf {PA} PA possesses an LU factorization P A = L U \mathbf{PA = LU} PA=LU.
  • To compute L \mathbf L L, U \mathbf U U, and P \mathbf P P, successively overwrite the array originally containing A \mathbf A A. Replace each entry being annihilated with the multiplier used to execute the annihilation. Whenever row interchanges such as those used in partial pivoting are implemented, the multipliers in the array will automatically be interchanged in the correct manner.
  • Although the entire permutation matrix P \mathbf P P is rarely called for, it can be constructed by permuting the rows of the identity matrix I \mathbf I I according to the various interchanges used. These interchanges can be accumulated in a “permutation counter column” p \mathbf p p that is initially in natural order ( 1 , 2 , . . . , n ) ( 1, 2,...,n ) (1,2,...,n).
  • To solve a nonsingular linear system A x = b \mathbf{Ax = b} Ax=b using the LU decomposition with partial pivoting, permute the components in b \mathbf b b to construct b ~ \tilde{\mathbf b} b~ according to the sequence of interchanges used—i.e.,
    according to p \mathbf p p —and then solve L y = b ~ \mathbf{Ly} = \tilde{\mathbf b} Ly=b~ by forward substitution followed by the solution of U x = y \mathbf{Ux = y} Ux=y using back substitution.

The LDU factorization

在LU分解中, L \mathbf L L的对角线上是全 1 1 1的,但 U \mathbf U U并不是,这在结构上缺乏对称性。我们可以将原来的 U \mathbf U U写为:
( u 11 u 12 ⋯ u 1 n 0 u 22 ⋯ u 2 n ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ u n n ) = ( u 11 0 ⋯ 0 0 u 22 ⋯ 0 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ u n n ) ( 1 u 12 / u 11 ⋯ u 1 n / u 11 0 1 ⋯ u 2 n / u 22 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ 1 ) , \left(\begin{matrix}u_{11} & u_{12} & \cdots & u_{1n}\\ 0 & u_{22} & \cdots & u_{2n}\\ \vdots & \vdots & \ddots & \vdots\\0& 0 &\cdots & u_{nn} \end{matrix}\right)=\left(\begin{matrix}u_{11} & 0 & \cdots & 0\\ 0 & u_{22} & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\0& 0 &\cdots & u_{nn} \end{matrix}\right)\left(\begin{matrix}1 & u_{12}/u_{11} & \cdots & u_{1n}/u_{11}\\ 0 & 1 & \cdots & u_{2n}/u_{22}\\ \vdots & \vdots & \ddots & \vdots\\0& 0 &\cdots & 1 \end{matrix}\right), u1100u12u220u1nu2nunn=u11000u22000unn100u12/u1110u1n/u11u2n/u221,
D = d i a g ( u 11 , u 22 , . . . , u n n ) \mathbf D=diag(u_{11},u_{22},...,u_{nn}) D=diag(u11,u22,...,unn),得到LDU分解。由LU分解是唯一确定的,容易得到LDU分解也是唯一确定的。而且当 A \mathbf A A是对称矩阵时,有 A = L D L T \mathbf A=\mathbf L \mathbf D \mathbf L^T A=LDLT(根据唯一性容易得到).


The Cholesky Factorization

A symmetric matrix A \mathbf A A possessing an LU factorization in which each pivot is positive is said to be positive definite.

Prove that A \mathbf A A is positive definite if and only if A \mathbf A A can be uniquely factored as A = R T R \mathbf A = \mathbf R^T \mathbf R A=RTR, where R \mathbf R R is an upper-triangular matrix with positive diagonal entries.

This is known as the Cholesky factorization of A \mathbf A A, and R \mathbf R R is called the Cholesky factor of A \mathbf A A.

⟹ \Longrightarrow

A \mathbf A A是正定的,那么存在LDU分解 A = L D L T \mathbf A=\mathbf L \mathbf D \mathbf L^T A=LDLT,其中 D = d i a g ( p 1 , p 2 , ⋯   , p n ) \mathbf D=diag(p_1,p_2,\cdots,p_n) D=diag(p1,p2,,pn) p i > 0 p_i>0 pi>0. 取 R = D 1 / 2 L T \mathbf R=\mathbf D^{1/2}\mathbf L^T R=D1/2LT即有 A = R T R \mathbf A=\mathbf R^T\mathbf R A=RTR R \mathbf R R是上三角矩阵且对角元素均为正。

⟸ \Longleftarrow

A = R R T \mathbf A=\mathbf R \mathbf R^T A=RRT R \mathbf R R是对角元素均为正的下三角矩阵,则它可以被分解为 R = L D \mathbf R=\mathbf L \mathbf D R=LD,其中 L \mathbf L L是对角线元素都为 1 1 1的下三角矩阵, D \mathbf D D是对角线元素为 r i i r_{ii} rii的对角阵。因此 A = L D 2 L T \mathbf A=\mathbf L \mathbf D^2 \mathbf L^T A=LD2LT A \mathbf A A的LDU分解,且所有pivot均为正值

唯一性可以从LDU分解的唯一性得到


Examples

If A \mathbf A A is a matrix that contains only integer entries and all of its pivots are 1 1 1, explain why A − 1 \mathbf A^{−1} A1 must also be an integer matrix.

Note: This fact can be used to construct random integer matrices that possess integer inverses by randomly generating integer matrices L \mathbf L L and U \mathbf U U with unit diagonals and then constructing the product A = L U \mathbf{A = LU} A=LU.

由于所有的pivot都等于1,存在LU分解 A = L U \mathbf A=\mathbf L \mathbf U A=LU,其中 L \mathbf L L U \mathbf U U分别是对角线全为1的下三角和上三角整数矩阵。对于这样的矩阵,它们的逆也是整数矩阵(因为在 [ L ∣ I ] ⟶ G a u s s − J o r d a n [ I ∣ L − 1 ] [\mathbf L|\mathbf I]\overset{Gauss-Jordan}{\longrightarrow}[\mathbf I|\mathbf L^{-1}] [LI]GaussJordan[IL1]的过程中,每一次 Type  I I \text{Type }\rm{II} Type II Type  I I I \text{Type }\rm{III} Type III型的操作都是乘以整数系数)。因此 A − 1 = U − 1 L − 1 \mathbf A^{-1}=\mathbf U^{-1}\mathbf L^{-1} A1=U1L1也是整数矩阵。

Consider the tridiagonal matrix T = ( β 1 γ 1 0 0 α 1 β 2 γ 2 0 0 α 2 β 3 γ 3 0 0 α 3 β 4 ) \mathbf T=\left(\begin{matrix}\beta_1 & \gamma_1 & 0 & 0\\\alpha_1 & \beta_2 & \gamma_2 & 0\\0& \alpha_2 & \beta_3 & \gamma_3\\0 & 0 & \alpha_3 & \beta_4\end{matrix}\right) T=β1α100γ1β2α200γ2β3α300γ3β4. Assume that T \mathbf T T possesses an LU fractorization, verify that it is given by
L = ( 1 0 0 0 α 1 / π 1 1 0 0 0 α 2 / π 2 1 0 0 0 α 3 / π 3 1 ) , U = ( π 1 γ 1 0 0 0 π 2 γ 2 0 0 0 π 3 γ 3 0 0 0 π 4 ) ,  where \mathbf L=\left(\begin{matrix}1 & 0 & 0 & 0\\\alpha_1/\pi_1 & 1 & 0 & 0\\0& \alpha_2/\pi_2 & 1 & 0\\0 & 0 & \alpha_3/\pi_3 & 1\end{matrix}\right), \mathbf U=\left(\begin{matrix}\pi_1 & \gamma_1 & 0 & 0\\0 & \pi_2 & \gamma_2 & 0\\0& 0 & \pi_3 & \gamma_3\\0 & 0 & 0 & \pi_4\end{matrix}\right),\text{ where} L=1α1/π10001α2/π20001α3/π30001,U=π1000γ1π2000γ2π3000γ3π4, where

π 1 = β 1 and π i + 1 = β i + 1 − α i γ i π i . \pi_1=\beta_1 \quad \text{and} \quad \pi_{i+1}=\beta_{i+1}-\frac{\alpha_i\gamma_i}{\pi_i}. π1=β1andπi+1=βi+1πiαiγi.

代入验证即可,对任意大小的tridiagonal矩阵都成立。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值