# **線代不熟部分整理**
###### tags: `線代`
---
## 判定1-1 and onto(linear transformation)
### souce:陳欣得線代ch6
Let $L:R^m \to R^n$ be a transformation
1. onto(映成)的條件
- $dim(range(L))=L$的行空間 =$dim(R^n)$
- Why? 因為值域需對應到全部basis可以展開的值
2. 1-1(每一個值都有對應)
- $dim(ker(L))=0$
:::info
線代課本的寫法(P375):
1-1:check L(v_1)≠L(v_2)是否成立
- claim that $\exists$ L(v_1)=L(v_2) and find contradiction.
onto: 做法一樣
:::
## Linear transformation + basis
Assume that $T:V \to W$ is a linear transformation, $\alpha$ is a bases of V, $\gamma$ is a bases of W.解出$[T]^α_β$(讀作 the representation of T respect to $α$ and $β$),如下圖所示:

- $[T]^α_β$直覺想法:$T(α)$可以寫成$β$的線性組合,這樣不用解C,直接把$T(α)$塞到右邊就好。
### 另一種解法:$B=Q^{-1}AP$
- 前提:linear transformation在同維 EX. $T:R^2 \to R^2$
假設A是linear transformation的矩陣代表。
$[T]^α_β=Q^{-1}AP=(T(β))^{-1}Aα$
- 不同維的解法:
$Q^{-1}AP$
$P:$linear transfor前的basis matrix.
$Q:$不確定
## Similarity
### source : P410
B is similar to A if $B=P^{-1}AP$, where P is a nonsingular matrix.
- 正常來說會是$B=Q^{-1}AP$,如果$Q=P$就會構成Similarity
- 可對角化矩陣也會構成Similarity
## Nonsingular Matrices & singular Matrices
### source: P46
An n $\times$ n matrix A is called nonsingular, or invertible, if there eixists an n $\times$ n matrix B such that $AB=BA=I_n$; such a B is called an inverse of A. Otherwise, A is called singular, or noninvertible.
# CH4行列式
## 行列式定義
### souce: P142
Let A = [$a_{ij}$] be a n $\times$ n matrix. The determinant functio, denoted by **det**, is defined by
\begin{split}det(A)=\sum(±) a_{1j_1}a_{2j_2}...a_{nj_n}\end{split}
where the summation is over all permutations $j_1j_2...j_n$ of tge set $S=${1, 2,...n}. The sign is taken as + or - according to whether the permutations $j_1j_2...j_n$ si even or odd.
- 行列式跟列的排列有關係,所以一旦做列交換,數值會有正負號的差異。
### souce: DP222
Let $A \in M_{n×n}(F)$. If n = 1, so that $A=(A_{11})$, we difine $det(A)=A_{11}$. For n≥2, we defined $det(A)$ recursively as:
$det(A)=$$\sum \limits_{j=1}^n(-1)^{1+j}A_{ij}$•$det(\bar{A}_{ij})$
## determinant properties
### source: P146
- if A is a matrix, then $det(A)=det(A^T)$.
:::info
:point_up_2: 延伸:
求$det(A)$可以用column消去再求。
:::
- 若A任意變換某一列or行,形成B,則$det(B)=-det(A)$
- 有2個以上(含)相同的列or行之矩陣C,其$det(C)=0$
- if $A\xrightarrow{kR_r -> R_r}E$, then $det(E) = kdet(A)$
- $det(A)=det(A^T)$(待prove)
# Ch5 Inner product space
## 正定&半正定
$x^H=x的共軛轉至矩陣,實數=x^T$
$正定:x^HAx>0, \forall x≠0$
$半正定:x^HAx\ge0, \forall x$
反之為負定、半負定。
:::info
:information_source: 用意:確認特徵直是否皆為正數
- $>0$ -> $A^H=A$ (正定一定是hermitian)
- $\ge0$ -> $A^H=A$
:::
# CH6 or more 正交系列
## orthogonal & orthonormal
### source: P315
- Let $V$ be an inner produc space. A set $S$ of vector in $V$ is called **orthogonal** if any two distinct(ex. u,w) vectors in $S$ are orthogonal, a.k.a
- <u,w>=0.
- In addtion, each vector in $S$ is of unit lenth, then $S$ is call **orthonormal**.
- $u =\frac {u}{||u||}$, $w=\frac {w}{||w||}$ and <u,w>=0
## G-S Process step
條件:已知有一對 vector $u_1, u_2...u_n \subset W$,求orthonormal basis $v_1,v_2...v_n$
1. Let $v_1=u_1$
2. $v_2=u_2-\frac {<u_2,v_1>}{<v_1,_v,1>}v_1$
3. $v_3=u_3-\frac {<u_3,v_1>}{<v_1,_v,1>}v_1-\frac {<u_3,v_2>}{<v_2,_v,2>}v_2$
and so on
## 正交投影與G-S Process的關係
關係如下圖

公式
$v=u+w$
$w=<v,w_1>w_1+<v,w_2>w_2$,以此類推。
## QR分解
$A=Q\times R$
:::warning
:warning: 條件:A方陣且的 columns 為 indep.
:arrow_right: 延伸:可QR的矩陣才可使用正交投影的公式解:
$P=X(X^TX)^{-1}Z$
向量關係圖

:::
Q:orthonormal basis
R:下三角矩陣,看G-S過程中的係數部分的反轉(跟linear combination有關),s.t
$v_i=u_i-\frac {<u_i,v_1>}{<v_1,_v,1>}v_1-...\frac {<u_i,v_{i-1}>}{<v_{i-1},v_{i-1}>}v_{i-1}$
$\to u_i=v_i+\frac {<u_i,v_1>}{<v_1,_v,1>}v_1+...\frac {<u_i,v_{i-1}>}{<v_{i-1},v_{i-1}>}v_{i-1}$
另一種方法:R相當於u跟w的內積。
$R=\begin{pmatrix}
<u_1,w_1> & <u_2,w_1> & \cdots & <u_n,w_1>\\
0 & <u_2, w_2> & \cdots & <u_n, w_2>\\
\vdots & \vdots & \ddots & \vdots\\
0 & \cdots & \cdots & <u_n,w_n>
\end{pmatrix}$
最簡單的方法
$A=QR$
know $Q^tQ=QQ^t=I$
$Q^tA=Q^tQR=R$
這裡的Q的每一向量需orthonormal。
## 特徵多項式應用1: quadratic form
$x=Py$求$P$
本質上為找orthogonal matrix。
1. 找eigen vector
2. G-S化
3. 組orthogonal matrix.
## 特徵多項式應用2: 遞迴關係式recurrence relation
$a_n=\alpha a_{n-1}+\beta a_{n-2}$, where $\alpha$ and $\beta$ are constant. Thwn we can writing in martix:
$$
\begin{bmatrix}
a_n \\
a_{n-1}\\
\end{bmatrix}=
\begin{bmatrix}
\alpha & \beta \\
1 & 0 \\
\end{bmatrix}
\begin{bmatrix}
a_{n-1} \\
a_{n-2} \\
\end{bmatrix}
$$
因其係數矩陣皆為固定,可從n持續遞減至$a_1$,$a_0$表示:
$$
\begin{bmatrix}
a_n \\
a_{n-1}\\
\end{bmatrix}=
\begin{bmatrix}
\alpha & \beta \\
1 & 0 \\
\end{bmatrix}^{n-1}
\begin{bmatrix}
a_{1} \\
a_{0} \\
\end{bmatrix}
$$
因此只要已知$a_0$、$a_1$,對係數矩陣做對角化,即可求出$a_n$、$a_{n-1}$
## 特徵多項式應用3: Marokov Chain 釋疑
### 定義寫法
矩陣寫法依不同課本,有2種設計方式:
1. 要$A_{n\times n} \times v_{n \times 1}$的寫法,其(Marokov 矩陣A)行(column)的總和需=1。
2. 要$v_{1\times n} \times A_{n \times n}$的寫法,其(Marokov 矩陣A)列(row)的總和需=1。
**通常以1. 為主。**
# 冷門的Spectral decomposition
source: 魏文翔講義

此方法分解出來的$\lambda$可視為不同資料的**權重(weight)**
# 其他無法分類的東西
## 交換矩陣(commute martrx)
If $AB=BA$,則B為A的commute martrx
## Congruent
B is congruent to A if $B=P^TAP$
### equivalent
If A and B are congruent to each other i.e $\require{extpfeil}
A \xtofrom[congruent]{congruent} B$, then we called *A and B are eqivalent*.
## similar
B is similar to A if $B=P^{-1}AP$
## 證明題需要用到的定義
### 矩陣代寫
$A=[a_{ij}]$
如果A為對稱則可寫成:
1. $[a_{ij}]=[a_{ji}]$
2. $A=A^T$
其中第二點在證明中常用
$<a,b>=\sum \limits_{i=1}^{n}a_ib_i$
### direct sum
如果direct sum($V=W_1+W_2$)成立,則:
1. $v=w_1+w_2\to$任一從space抽出來的向量具加法封閉性。
2. $W_1\cap W_2=${0}$\to <w_1,w_2>=0$
### 證明方式不熟整理
#### 證明A是否有span到B的方式
看dim(A)是否=dim(B)
#### if $V=span{v_1,v_2}$
Span Def.: <u>所有線性組合所成之集合。</u>
所以就代表可以寫成$c_1v_1+c_2v_2=0$, c為常數
#### $n\times n$矩陣A的等價敘述
1. 可正交對角化i.e $A=QDQ^T$
2. A有一含n個特徵向量的對角化集合
3. A為對稱矩陣
以上三點只要有一個中另外兩個必定也有
pf:


## GM、AM
$Gm(\lambda)=Null(A-\lambda I)$就是該特徵根λ分到的eigen vector個數。
$AM(\lambda)=\lambda$在特徵多項式的次數
:::info
:information_source: 只要有一個λ,它的$Gm(\lambda)\ne Am(\lambda)$,就不可對角化!!
:::
## 特徵值的性質
1. $\sum \lambda=Tr(A)$
2. $\prod \lambda=det(A)$
3. $A^{-1}$的特徵值$=A$的特徵值