[Linear Algebra] 2. Matrix Algebra

김강태·2021년 4월 11일
0

Linear Algebra

목록 보기
2/5
post-thumbnail

이 글은 Linear Algebra and Its Applications 책을 정리한 글입니다.


2.1 Matrix Operations


Matrix의 표기법 및 용어

  • m개의 rows와 n개의 columns를 갖은 m×nm\times n matrix의 iith row, jjth column의 entry를 aija_{ij}로 표기한다.

  • 또한 m×nm\times n matrix A의 각 column을 vector in Rm\mathbb{R^m} 으로 다음과같이 표기할 수 있다
A=[a1a2an]A = [a_1\quad a_2\quad \dots \quad a_n]
  • m×nm\times n matrix의 a11,a22,a_{11}, a_{22}, \cdotsdiagonal entries 라고 하고 nondiagonal entries가 zero인 square n×nn\times n matrix를 diagoanl matrix 라고 한다

Theorem1
Let A,B and C be matrices of the same size, and let rr and ss be scalars
a. A + B = B + A
b. (A + B) + C = A + (B + C)
c. A + 0 = A
d. rr(A + B) = rrA + rrB
e. (r + sr \ + \ s)A = rrA + ssA
f. rr(ssA) = (rsrs)A

  • 위 theorem의 각 matrix를 column으로 쪼개서 봤을때도 ch1의 algebratic properties of RnR^n (벡터의 성질)을 그대로 유지한다.

Matrix multipliaction

  • A(Bx)=(AB)xA(B\bold{x}) = (AB) \bold{x}

  • A를 m×nm\times n matrix, B를 b1,,bp\bold{b_1}, \dots, \bold{b_p} 의 column vector를 가진 n×pn\times p matrix라고 하였을때 product AB 는 m×pm\times p matrix이며 Ab1,,AbpA\bold{b_1}, \dots, A\bold{b_p} 를 column 으로 갖는다

AB=A[b1,,bp]=[Ab1,,Abp]AB = A[\bold{b_1}, \dots, \bold{b_p}] \\ = [A\bold{b_1}, \dots, A\bold{b_p}]
  • matrix AB의 entry는 다음과같이 표현될 수 있다
(AB)ij=ai1b1j+ai2b2j++ainbnj(AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}

Properties of Matrix Multiplication

Theorem2
Let A be an m×nm\times n matrix, and let B and C have sizes for which the indicated sums and products are defined.
a. A(BC) = (AB)C
b. A(B + C) = AB + AC
c. (B + C)A = BA + CA
d. rr(AB) = (rrA)B = A(rrB)
e. ImI_mA = A = AInI_n


The Transpose of a Matrix

  • Given an m×nm\times n matrix A, the transpose of A is the n×mn\times m matrix, denoted by ATA^T, whose columns are formed from the corresponding rows of A.

Theorem3
a. (AT)T(A^T)^T = A
b. (A+B)T=AT+BT(A + B)^T = A^T + B^T
c. For any scalar r, (rA)T=rAT(rA)^T = rA^T
d. (AB)T=BTAT(AB)^T = B^TA^T



2.2 The Inverse of Matrix


Invertible Matrix

  • n×\timesn matrix A가 invertible하다면 n×\timesn matrix C가 있을때 CA=ICA = I and AC=IAC = I고 이때 II는 identity matrix이며 또한 matrix C는 invertible하며 unique하다.

  • B를 또다른 A의 inverse라고 가정했을때 아래와 같이 결국 C는 unique하다

B=BI=B(AC)=(BA)C=IC=CB = BI = B(AC) = (BA)C = IC = C
  • matrix가 not invertible하다면 singular matrix, invertible하다면 nonsingular matrix 라고 한다.

Theorem4

Let A = [a bc d]\begin{bmatrix} a \ b \\ c \ d \end{bmatrix}. if ad-bc \ne 0, then A is invertible and
A1=1adbc[d bc a]A^{-1} = \frac{1}{ad-bc}\begin{bmatrix}\quad d \ -b \\ -c \quad \ a \end{bmatrix}.

if ad-bc = 0, then A is not invertible

  • 이때 ad-bc를 determinent of A 라고 하며 det A 로 표기한다.

Theorem5

If A is an invertible n ×\times n matrix, then for each b\bold{b} in Rn\mathbb{R}^n,
the equation Ax=b\bold{x} = \bold{b} has the unique solution x=A1b\bold{x} = A^{-1}\bold{b}

Au=bA1Au=A1bInu=u=A1bA\bold{u} = \bold{b} \\ \to A^{-1}A\bold{u} = A^{-1}\bold{b} \\ \to I_n\bold{u} = \bold{u} = A^{-1}\bold{b}

Theorem6

a. If A is invertible matrix, then A1A^{-1} is invertible and (A1)1=A(A^{-1})^{-1} = A

b. If A and B are n×\timesn invertible matrices, then so is AB, and the inverse of AB is the product of the inverces of A and B in the reverse order.
That is (AB)1=B1A1(AB)^{-1} = B^{-1}A^{-1}

c. If A is an invertible matrix, then so is ATA^T, and the inverse of ATA^T is the tranpose of A1A^{-1}. That is (AT)1=(A1)T(A^T)^{-1} = (A^{-1})^T


Elemetary Matrices

  • Elementary matrix란 1장에서 matrix를 echelon form으로 row reduction할때 쓰였던 single elementary row operation을 identity matrix에 수행한 것 이다. 다시말해 identity matrixsingle elementary row operation 을 수행한 것 이고 다른 matrix에 Left multiplication(pre-multiplication)을 하면 single elementary row operation을 해준 것과 동일하다.

  • 위 예시는 각각 replacement, interchange, scaling이며 임의 matrix A에 left multiplication을 해보면 다음과같다.

  • 위와같은 elementary matrix EE는 invertible하며 EE의 inverse는 EE가 identity matrix II에 row operation을 해주는 것이기에 다시 II로 다시 돌아가는 operation을 해주면 된다.

Theorme7
An n ×\times n matrix A is invertible if and only if A is row equivalent to InI_n, and in this case, any sequence of elementary row operations that reduces A to InI_n also transforms InI_n into A1A^{-1}

  • 위에서 언급된데로 matrix A 가 invertible하다면 elementary matrix를 multiplication해주어 elementary row operation을 해주어 InI_n을 만들고 elemetary matrix를 sequence로 나타내주면 inverse를 찾을 수 있다.

    AE1AE2(E1A) Ep(Ep1E1A)InEpE1A=InA1=(EpE1)1A \sim E_1A \sim E_2(E_1A) \sim \cdots ~ E_p(E_{p-1} \cdots E_1A) I_n \\ E_p \cdots E_1A = I_n \\ A^{-1} = (E_p \cdots E_1)^{-1}

Algorithm for finding A1A^{-1}

  • Row reduce the augmented matrix [AI][A \quad I ]. If A is row equivalet to II, then [AI][A \quad I ] is row equinalent to [IA1][I \quad A^{-1}]. Otherwise, A does not have an inverse.

  • 위 설명은 지금까지의 augmented matrix를 [Ab][A \quad b] 로 표현하였는데 vector b대신 identity matrix I로 대신한 것이고 A부분이 I가되도록 계속 row reduction한 것이다.

Example

  • Find the inverse of the matrix A, if it exists
Example

[AI][A \quad I ] 로 두었던 부분을 row reduction을 통해 I로 만들었으니 II자리의 matrix가 A1A^{-1}이 된다.



2.3 Characterizations of invertible matrices


Theorem8
Let A be a square n ×\times n matrix. Then the following statements are equivalent.

  • a. A is an invertible matrix.
  • b. There is an n ×\times n matrix C such that CA = I.
  • c. The equation Ax = 0 has only the trivial solution.
  • d. A has n pivot position.
  • e. A is row equivalent to the idientity n ×\times n matrix
  • f. There is an n ×\times n matrix D such that AD = I.
  • g. The equation Ax = b has at least one solution for each b in RnR^n
  • h. The columns of A span RnR^n.
  • i. The linear transformation xAx\bold{x}\mapsto A\bold{x} maps RnR^n onto RnR^n.
  • j. The columns of A form a linearly independent set.
  • k. The linear transformation xAx\bold{x}\mapsto A\bold{x} id one-to-one.
  • l. ATA^T is an invertible matrix.

  • Invertible linear transformation
    - A linear transformation T : RnRnR^n \to R^n is said to be invertible if ther exists a fuction S : RnRnR^n \to R^n such that
(1)S(T(x)) for all x in Rn(2)T(S(x)) for all x in Rn(1) \quad S(T(\bold{x}))\ for\ all\ \bold{x}\ in\ R^n \\ (2) \quad T(S(\bold{x}))\ for\ all\ \bold{x}\ in\ R^n


2.4 Partitioned Matrices


Theorem10
Column-Row Expansion of AB
If A is m ×\times n and B is n ×\times p, then

  • 지금까지는 [Ab1Abn][Ab_1 \quad \cdots Ab_n] 이런 식으로 A에 B의 column 벡터를 matrix multiplication한 것을 column으로두어서 나열한 표현을 썼었다.


2.5 Matrix Factorization


  • Factorization이란 한 matrix를 두개 혹은 이상의 product로 다은과같이 표현하는 것이다.
    A=BCA = BC

LU Factorization



2.6 Subspace of Rn\mathbb{R^n}


Definition
A subspace if Rn\mathbb{R^n} is any set H\bold{H} in Rn\mathbb{R^n} that has three properties :

  • The zero vector is in H\bold{H}
  • For each u\bold{u} and v\bold{v} in H\bold{H}, the sum u+v\bold{u} + \bold{v} is in H\bold{H}.
  • For each u\bold{u} and each scalar c, the vector cuc\bold{u} is in H\bold{H}.
  • additionscalar multiplication 에 닫혀있고, zero vector를 포함하고있으면 Rn\mathbb{R^n}의 subspace가 된다.

Example

v1\bold{v_1} and v2\bold{v_2} and H\bold{H} = Span{v1,v2\bold{v_1}, \bold{v_2}} 일때 H\bold{H}Rn\mathbb{R^n}의 subspace임을 보여라

u=s1v1+s2v2andv=t1v1+t2v2\bold{u} = s_1\bold{v_1} + s_2\bold{v_2}\quad and \quad \bold{v} = t_1\bold{v_1} + t_2\bold{v_2}

라고 하였을때

u+v=(s1+t1)v1+(s2+t2)v2cu=(cs1)v1+(cs2)v2\bold{u+v} = (s_1+t_1)\bold{v_1} + (s_2+t_2)\bold{v_2} \\ c\bold{u} = (cs_1)\bold{v_1} + (cs_2)\bold{v_2}

위 식을통해 u+v\bold{u+v}cuc\bold{u}v1\bold{v_1}v2\bold{v_2}의 linear combination으로 나타내어 additionscalar multiplication 에 닫혀있음을 보일 수 있고음을 보일 수 있고 0v1+0v20\bold{v_1} + 0\bold{v_2}v1\bold{v_1}v1\bold{v_1} 의 linear combination이므로 H\bold{H}가 zero vector로 포함시켜 위 세가지 조건을 만족시키기에 H\bold{H}Rn\mathbb{R^n}의 subspace라고 할 수 있다.


Example

  • 위 그림처럼 line L\bold{L}이 원점(origin)을 지나지 않으면 additionscalar multiplication 에 닫혀있지 않으므로 subspace가 될 수 없다.

\therefore For v1,,vp\bold{v_1}, \cdots, \bold{v_p} in Rn\mathbb{R^n}, Span{v1,,vp\bold{v_1}, \cdots, \bold{v_p}} is a subspace of Rn\mathbb{R^n}



Column Space and Null Space of a Matrix


Column space (Col A)

  • The column space of a matrix A is the set Col A of all linear combinations of the columns of A.

    • Rn\mathbb{R^n} space의 column vector를 갖고있는 matrix A ( A = [a1,,an\bold{a_1}, \cdots, \bold{a_n}] ) 일때 Col A 는 Span{a1,,an\bold{a_1}, \cdots, \bold{a_n}}과 같은 표현이고 이 column space는 Rn\mathbb{R^n}의 subspace이다.

Example


일 때, is b\bold{b} in Col A ?

  • 위 matrix를 augmented matrix로 row reduce해주면 다음과 같고.

  • 위 echelon form을 보면 pivot이 2개여서 Ax\bold{x} = b\bold{b}가 consistent함을 알 수 있고, 이는 vector b\bold{b} 가 matrix의 column vector들의 linear combination으로 나타낼 수 있음을 뜻하므로 b\bold{b} in Col A이다. 이를 그림으로 나타내면 다음과 같다.


Null space (Nul A)

  • The null space of a matrix A is the set Nul A of all solutions of the homogeneous equation Ax=0\bold{x}=0

Theorem12
The null space of an m x n matrix A is a subspace of Rn\mathbb{R^n}. Equivalently, the set of all solutions of a system Ax=0\bold{x}=0 of m homogeneous linear equations in n unknowns is a subspace of Rn\mathbb{R^n}

  • Nul A에 있는 어떤 u,v\bold{u, v} (homogeneous equation의 임의의 solution) 은 Au=0\bold{u} = \bold{0}, Av=0\bold{v} = \bold{0} 두 식으로 나타낼 수 있고 이를 통해 A(u+v\bold{u + v}) = Au\bold{u} + Av\bold{v} = 0\bold{0}과 A(cu\bold{u}) = Au\bold{u} + c(Av\bold{v}) = c0\bold{0} = 0\bold{0} 을 통해 additionscalar multiplication 에 닫혀 있음을 보임으로 Nul A 는 Rn\mathbb{R^n}의 subspace임을 증명 할 수 있다.

Basis for a Subspace

  • A basis for a subspace H of Rn\mathbb{R^n} is linearly independent set in H that spans H.

  • Subspace는 무한대의 vector를 포함하고 있어 basis를 통해 최소한의 vector들로 subspace를 표현 할 수 있다.

  • 위와같은 identity matrix InI_n의 column vector들은 linearly independent set 이며 Rn\mathbb{R^n}standard basis 라고 한다.
    • 물론 Rn\mathbb{R^n}Rn\mathbb{R^n}의 subspace이다.

Example

  • Nul A의 basis를 찾아보세요~

  • 위 matrix의 homogeneous equation의 solution set은 null space이므로 augmented form으로 reduction해보면 다음과 같고,

  • 이를 free variable인 x2,x4,x5x_2, x_4, x_5를 통해 vector equation으로 general solution을 표현하면 다음과 같다.

=x2u+x4v+x5w= x_2\bold{u} + x_4\bold{v} + x_5\bold{w}
  • vector u,v,w\bold{u, v, w}으로 나타낼 수 있는 linear combination은 Nul A 가 되고 위 linear combination은 자동적으로 trivial solution을 갖기에 (vector X\bold{X}를 0으로 만드는 free variable x2,x4,x5x_2, x_4, x_5는 모두 0이 됨) vector u,v,w\bold{u, v, w}는 linearly independent set이고 {u,v,w\bold{u, v, w}} 는 Nul A 의 basis 가 된다.

Example

  • 이번엔 Col B의 basis를 찾아보세요~

  • 위 reduced matrix B의 column들을 b1,,b5b_1, \cdots, b_5 라고 하였을 때 당연하게도 아래 식처럼 다른 column들은 pivot column인 b1,b2,b5b_1, b_2, b_5의 inear combination으로 표현 할 수 있고
v=c1b1+c2b2+c3(3b1+2b2)+c4(5b1b2)+c5b5\bold{v} = c_1\bold{b1} + c_2\bold{b2} + c_3(-3\bold{b_1}+2\bold{b_2}) + c_4(5\bold{b_1}-\bold{b_2}) + c_5\bold{b_5}
  • pivot column인 b1,b2,b5b_1, b_2, b_5는 당연히 linearly independent set이므로 {b1,b2,b5b_1, b_2, b_5} 는 Col B 를 span한다.

  • \therefore pivot columns of B {b1,b2,b5b_1, b_2, b_5}는 Col B의 basis이다.

  • 위 matrix A을 row reduction하면 matirx B가 되지만 Col A \neq Col B이다.

    • row operation 이라는게 column이 아니라 row간 계산을 수행하므로 pivot column을 바꿀 수 없고 결과적으로 column간 linear dependence 관계에 영향을 미치지는 못한다.

    • 결론은 row equivalent한 matrix들은 pivot column들이 동일하여 해당 matrix의 동일 위치의 pivot column들이 column space에 basis가 되긴 하지만 column space들은 동일 공간에 있다고 볼 수 없다.


Theorem13
The pivot columns of a matrix A form a basis for the column space of A.



2.7 Dimension and Rank



Coordinate Systems

Definition
Suppose the set B\mathcal{B} = {b1,,bp\bold{b_1}, \cdots, \bold{b_p}} is a basis for a subspace H. For each x\bold{x} in H the coordinates of x relative to the basis B\mathcal{B} are the weights c1,,cp\bold{c_1}, \cdots, \bold{c_p} such that x=c1b1++cpbp\bold{x} = c_1\bold{b_1}+ \cdots + c_p\bold{b_p}, and the vector in Rp\mathbb{R^p}

[x]B=[c1cp]\left [ \bold{x} \right ]_\mathcal{B} = \begin{bmatrix} c_1\\ \vdots \\ c_p \end{bmatrix}

is called the coordinate vector of x (relative to B\mathcal{B}) or the B\mathcal{B}-coordinate vector of x

  • basis B\mathcal{B} 라는 것은 일반적인 좌표계가 아닌 basis에 대한 좌표계를 나타내며 위 definition은 basis가 주어졌을 때 H의 특정 vector x\bold{x}를 나타내는 weights(coefficient) c1,,cp\bold{c_1}, \cdots, \bold{c_p}는 unique하다는 것을 나타낸다.

Example

  • vector x\bold{x}가 subspace H = Span{v1,v2\bold{v_1, v_2}}에 있는지 보이고 B\mathcal{B}-coordinate vector of x\bold{x}를 구해라

  • 일단 v1,v2\bold{v_1, v_2}는 서로 scalar 곱으로 표현될 수 없어서 linearly independent하고 subspace H의 basis가 될 수 있다.

  • 위 vector들을 augmented matirx로 reduction하면 다음과 같고

  • vector equation c1v1+c2v2=xc_1\bold{v_1} + c_2\bold{v_2} = \bold{x} 일 때 c1=2,c2=3c_1 = 2, c_2 = 3 이므로 [x]B=[23]\left [ \bold{x} \right ]_\mathcal{B} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}이 되며 basis B\mathcal{B}는 subspace H의 "coordinate system"이 된다. 그림으로 나타내면 다음과 같다.

  • 위 그림에서 보다시피 basis의 vector들(x1,x2\bold{x_1, x_2})은 R3\mathbb{R^3}에 있지만 subspace H에있는 x\bold{x}들은 cordinate vector에 의해 마치 R2\mathbb{R^2}에 있는것 처럼 동작한다 이를 H is isomorphic to R2\mathbb{R^2} 이라고 부른다.



The Dimension of a Subspace

Definition
The dimension of a nonzero subspace H, denoted by dim H, is the number of vectors in any basis for H. The dimension of the zero subspace {0\bold{0}} is defined to be zero.

  • nonzero subspace H의 basis는 여러개일 수 있지만 dimension은 똑같다는 소리.

  • Rn\mathbb{R^n} space는 n dimension을 갖고 모든 Rn\mathbb{R^n}의 모든 basis는 n개의 vector를 갖는다.

    • 이때 0을 지나는 subspace가 평면이면 two-dimensional이고, line이면 one-dimensional이다.

Rank

definition
The rank of a matrix A, denoted by rank A, is the dimension of the column space of A.


Example

  • 아래 matrix A의 rank는????

  • 우선 rank A는 Col A의 basis의 dimension을 말하므로 matrix의 echelon form을 구하면

  • row reduction한 echelon form은 3개의 pivot column이 있는걸 알 수 있고 이는 원래의 matrix A의 pivot column과 위치가 같으므로 rank A = 3 임을 알 수 있다.

  • 이때 Ax\bold{x} = 0\bold{0}은 두개의 free variable을 갖는데 이는 5개 column중 2개의 non-pivot column이 있다는 것을 통해 바로 알 수 있고 x3u+x5xx_3\bold{u} + x_5\bold{x} 로 general solution의 vector equation을 나타낼 수 있는데 이를 통해 null space A의 dimension (dim Nul A)는 free variable의 개수와 같은 것을 알 수 있다.


<Theorem 14> The Rank Theorem
if a matrix A has n columns, then rank A C dim Nul A D n


<Theorem 15> The Basis Theorem
Let H be a p\mathcal{p}-dimensional subspace of Rn\mathbb{R^n}. Any linearly independent set of exactly p\mathcal{p} elements in H is automatically a basis for H. Also, any set of p\mathcal{p} elements of H that spans H is automatically a basis for H.


The Invertible Matrix Theorem (cont'd)

  • m. The columns of A form a basis of Rn\mathbb{R^n}.
  • n. Col A = Rn\mathbb{R^n}
  • o. dim Col A = n
  • p. rank A = n
  • q. Nul A = {0\bold{0}} : null space가 zero vector밖에 없고 trivial solution을 갖는다는 소리.
  • r. dim Nul A = 0
profile
개썅마이웨이로 shine my way

0개의 댓글