---
tags: Linear Algebra - HungYiLee
---
Linear Algebra - Lec 18~20: Subspace and Basis
===
[TOC]
# [課程網站](http://speech.ee.ntu.edu.tw/~tlkagk/courses_LA18.html)
# [Lecture 18: Subspace](https://www.youtube.com/watch?v=pXtXnY2b2-E&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=18)

## Subspace v.s. Span
- the **span of a vector set is a subspace**
- 
- $u = c_1w_1+...+c_kw_k, v = c_1'w_1+...+c_k'w_k$
- **反過來**其實也成立,**每一個 Subspace 都是由某個 vector set 產生出來的 Span**,下節課會講
## Null Space
- The null space of a matrix $A$ is the **solution set** of $Ax=0$, denoted as $Null(A)$
- $Null(A)$ is a **subspace**.
## Column Space and Row Space
### Column Space
- column space of matrix $A$ is the **span of its columns**, it is denoted as $\text{Col}\, A$
- $A\in\mathbb R^{m\times n}\implies \text{Col}\,A=\{Av:v\in\mathbb R^n\}$
- if matrix $A$ represents a function, then $\text{Col}\,A$ is the **range of the function**
- 因為 $\text{Col}\,A$ 此時代表 $Ax$ 的**所有可能的輸出**所形成的集合
### Row Space
- row space of matrix $A$ is the **span of its rows**, denoted as $\text{Row}\,A$
- $\text{Row}\,A=\text{Col}\,A^T$
### Column Space = Range

## RREF v.s. Column Space & Row Space
Original Matrix $A$ v.s. its RREF $R$ (Review of Lec 10)
- Columns:
- The relations between the columns are the same (review)
- **But** the span of the columns are different
- $\text{Col}\,A\neq\text{Col}\,R$
- Rows:
- The relations between the rows are changed
- **But** the span of the rows are the same
- $\text{Col}\,A=\text{Col}\,R$
## Review: Consistent

## Conclusion
Subspace is Closed under **Addition and Multiplication**.
# [Lecture 19: Basis](https://www.youtube.com/watch?v=GB48DyvC14o&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=19)
## Outline
- what is a basis **for a subspace**?
- confirming that a set is a basis for a subspace
## Basis
- Let $V$ be a **nonzero subspace** of $\mathbb R^n$. A <font color="red">basis $B$</font> for $V$ is a <font color="blue">linearly independent</font> <font color="green">generation set of $V$</font>
- $B$ is generation set of $V$ 表示 <font color="green">$V=Span\,B$</font>
### Example

## Basis of Column Space
- The **pivot column** of matrix $A$ form a basis for its **column space**
- pivot column 即矩陣 $A$ 的 RREF 的 leading entry 所在 columns (Lec 8)

## Property of Span

## Basis 最重要的 3 個定理 (Theorem) & Dimension

- The number of vectors in a basis for a nonzero subspace $V$ is called dimension of $V$, denoted $dim(V)$
## 先證明第三個定理
- Any two bases of a subspace $V$ contain **the same number** of vectors

## n 維空間的 basis 就有 n 個 vector,dimension 就是 n

### Example for finding dim V

- 這裡可複習一下 Lec 8 的 Parametric Representation
- 把 **linear system 的解** 給算出來,就可以得到它的 **basis**
- ***Q: 是指 column space 的 basis 嗎??? 還是 Null Space 的 basis ??? 還是都可以啊???***
- 看到這樣的式子,換句話說就是 Span of 這三個 vector 會包含 $b$
## 證明第一個定理
懶得看ㄌ,略過
要先證明 reduction theorem
### Reduction Theorem
- 所有的 generation set 裡面都包含了 basis (basis 的 vector 數目一定小於等於 generation set 的 vector 數目)
證明: 將 generation set 裡的所有 vector 都排成一個 matrix $A$,而這個 matrix 的 column space 的 basis 就是它的 pivot column,得證。
- 記憶法:**所有的 generation set 心中都有一個 basis**
## 證明第二個定理
- 若 basis 有 $k$ 個 vector,則在 subspace 中找不到多於 $k$ 個 independent 的 vector
### Extension Theorem
- Given an independent vector set $S$ in the subspace, $S$ can be extended to a basis by adding more vectors.
- 記憶法:**indepdent vector set: 我不是 basis,就是正在成為 basis 的路上**
證明:

## Summary

## Confirming that a set is a basis

有點難,所以我們需要另外一種方式來檢查是否為 basis
## Another way to confirm if is basis

- 此時只需要檢查其中一個條件,basis 就成立
證明:

Example:

# [Lecture 20: Column Space, Null Space, Row Space](https://www.youtube.com/watch?v=aW0JVmpIxas&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=20)
## Review of Column/Null/Row Space (Lec 18)
$A\in\mathbb R^{m\times n}$
- Column Space
- $Col\,A\in\mathbb R^m$
- 是 $A$ 的 columns 的 linear combination 的集合
- 是 $A$ 這個 linear system 的 co-domain 的 range
- Null Space
- $Null\,A\in\mathbb R^n$
- 是 $Ax=0$ 的所有解 $x$ 形成的集合
- 必定包含 zero vector
- Row Space
- $Row\,A=Col\,A^T$

- 那如何找到這些 space 的 **basis**、計算它們的 **dimension** 呢?
## Column Space: Basis and Dimension
- basis: **pivot columns** of $A$ form a basis of $Col\,A$
- **Dim(Col A)** = number of pivot columns of $A$ = $rank\,A$,所以 $A$ 的 rank 又等於 $A$ 的 column space 的 dimension
### Review of Rank:
- Maximum number of independent columns
- Number of pivot columns
- Number of non-zero rows in $RREF(A)$
- Number of basic variables
Now we also know that $rank\,A$ is
- **Dim (Col A)**: dimension of column space of $A$
- Dimension of the range of $A$
## Null Space: Basis and Dimension
- Basis

1. 把 $A$ 做 RREF
2. 轉換成 parametric representation (review Lec 8)
3. 再轉換成向量 linear combination 的形式,那些**和 free variable 相乘的 vectors** 就是 basis
- Dimension
- $Dim(Null\,A)\\ = \text{number of free variables}\\=Nullity\,A\\=n-rank(A)$
如此我們知道
- $A$ 的 column space 的 dimension 是 $rank(A)$
- $A$ 的 null space 的 dimension 是 $nullity(A)$
由此可知,$Dim(Col\,A)+Dim(Null\,A)=n$,即
- **$A$ 的 column space 和 null space 的 dimension 加起來會是 $n$**
## Row Space: Basis and Dimension

- **Basis: non-zero rows of RREF(A)**
- **Dimension: Rank A (居然和 column space 的 dimension 一樣!)**
## Rank A (revisit)

## 矩陣做 transpose 後,rank 仍一樣

- $Rank\,A=Rank\,A^T$
## Dimension Theorem

- **Dim of Range + Dim of Null = Dim of Domain**
- domain 是該 linear system 所有可能的 input 形成的集合;是所有可能的 output 形成的集合???
## Summary
