owned this note
owned this note
Published
Linked with GitHub
# 建構新的子空間
Constructing new subspaces

This work by Jephian Lin is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
$\newcommand{\trans}{^\top}
\newcommand{\adj}{^{\rm adj}}
\newcommand{\cof}{^{\rm cof}}
\newcommand{\inp}[2]{\left\langle#1,#2\right\rangle}
\newcommand{\dunion}{\mathbin{\dot\cup}}
\newcommand{\bzero}{\mathbf{0}}
\newcommand{\bone}{\mathbf{1}}
\newcommand{\ba}{\mathbf{a}}
\newcommand{\bb}{\mathbf{b}}
\newcommand{\bc}{\mathbf{c}}
\newcommand{\bd}{\mathbf{d}}
\newcommand{\be}{\mathbf{e}}
\newcommand{\bh}{\mathbf{h}}
\newcommand{\bp}{\mathbf{p}}
\newcommand{\bq}{\mathbf{q}}
\newcommand{\br}{\mathbf{r}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bz}{\mathbf{z}}
\newcommand{\bu}{\mathbf{u}}
\newcommand{\bv}{\mathbf{v}}
\newcommand{\bw}{\mathbf{w}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\nul}{\operatorname{null}}
\newcommand{\rank}{\operatorname{rank}}
%\newcommand{\ker}{\operatorname{ker}}
\newcommand{\range}{\operatorname{range}}
\newcommand{\Col}{\operatorname{Col}}
\newcommand{\Row}{\operatorname{Row}}
\newcommand{\spec}{\operatorname{spec}}
\newcommand{\vspan}{\operatorname{span}}
\newcommand{\Vol}{\operatorname{Vol}}
\newcommand{\sgn}{\operatorname{sgn}}
\newcommand{\idmap}{\operatorname{id}}
\newcommand{\am}{\operatorname{am}}
\newcommand{\gm}{\operatorname{gm}}
\newcommand{\mult}{\operatorname{mult}}
\newcommand{\iner}{\operatorname{iner}}$
```python
from lingeo import random_good_matrix, column_space_matrix, left_kernel_matrix, kernel_matrix
```
## Main idea
Let $U$ and $V$ be two subspaces in the same vector space.
In general, the set $U\cup V$ is no more a subspace.
However, we may define the **sum** of $U$ and $V$ as $U + V = \vspan(U \cup V)$, which is a subspace.
Suppose $\beta_U$ and $\beta_V$ are the bases of $U$ and $V$, respectively.
Then $U + V = \vspan(\beta_U \cup \beta_V)$.
However, $\beta_U \cup \beta_V$ is not necessarily independent.
Suppose $\beta_U$ and $\beta_V$ are finite.
Let $A_U$ and $A_V$ be the matrix whose columns are vectors in $U$ and $V$, respectively.
Then the $\beta_C$ corresponding to $\begin{bmatrix} A_U & A_V \end{bmatrix}$ is a basis of $U + V$.
On the other hand, the **intersection** $U \cap V$ is indeed a subspace.
Suppose $\beta_U$ and $\beta_V$ are the bases of $U$ and $V$, respectively.
Then $(\beta_U \cap \beta_V)$ is linearly independent but not necessarily spans $U\cap V$.
(Even worse, it is quite possible that $U \cap V = \emptyset$.)
Suppose we are able to matrices $B_U$ and $B_V$ such that $U = \ker(B_U)$ and $V = \ker(B_V)$.
Then $U \cap V$ is the kernel of $\begin{bmatrix} B_U \\ B_V \end{bmatrix}$.
By the expanding lemma, one may find a basis $\beta_\cap$ of $U\cap V$,
expand it to a basis $\beta_U$ of $U$,
expand it to a basis $\beta_V$ of $V$,
and show that $\beta_\cup = \beta_U \cup \beta_V$ is a basis of $U + V$.
Therefore, we have
$$
\dim(U + V) = \dim(U) + \dim(V) - \dim(U \cap V).
$$
Suppose $V_1, \ldots, V_k$ are some subspaces in the same vector space.
We say $\{V_1, \ldots, V_k\}$ is linearly independent if
the only choice of $\bv_1\in V_1, \ldots, \bv_k\in V_k$ satisfying
$$
\bv_1 + \cdots + \bv_k = \bzero
$$
is $\bv_1 = \cdots = \bv_k = \bzero$.
The following two statments are equivalents:
1. $\{V_1, V_2\}$ is linearly independent.
2. $V_1 \cap V_2 = \{ \bzero \}$.
However, even if $V_1,V_2,V_3$ mutually have trivial intersections, $\{ V_1, V_2, V_3 \}$ might not be linearly independent.
In the case that $\{V_1,\ldots, V_k\}$ is linearly independent,
we call the subspace $V_1 + \cdots + V_k$ the **direct sum** of them and
use the notation $V_1 \oplus \cdots \oplus V_k$ instead to emphasize the linearly independence.
## Side stories
- basis of the sum and the intersection
- example of trivial intersections but not linearly independent
## Experiments
##### Exercise 1
執行以下程式碼。
令 $\bu_1, \bu_2$ 為 $A_U$ 的各行向量、
$\bv_1, \bv_2$ 為 $A_V$ 的各行向量。
令 $U = \Col(A_U)$ 且 $V = \Col(A_V)$。
已知 $R$ 為 $\begin{bmatrix} A_U & A_V \end{bmatrix}$ 的最簡階梯形式矩陣。
<!-- eng start -->
Run the code below. Let $\bu_1, \bu_2$ be the columns of $A_I$ and $\bv_1, \bv_2$ the columns of $A_V$. Let $U = \Col(A_U)$ and $V = \Col(A_V)$. Suppose $R$ is the reduced echelon form of $\begin{bmatrix} A_U & A_V \end{bmatrix}$.
<!-- eng end -->
```python
### code
set_random_seed(0)
print_ans = False
m,n,r = 4,3,3
A = random_good_matrix(m,n,r)
AU = A[:,:2]
AV = A[:,1:]
AUAV = AU.augment(AV, subdivide=True)
print("[ A_U | A_V ] =")
show(AUAV)
print("R =")
show(AUAV.rref())
BU = left_kernel_matrix(AU)
BV = left_kernel_matrix(AV)
BUBV = BU.stack(BV, subdivide=True)
if print_ans:
print("dim( U + V ) =", r)
print("basis of U + V = columns of")
print(column_space_matrix(AUAV))
print("dim( U cap V) =", 4 - r)
print("basis of U cap V = columns of")
print(kernel_matrix(BUBV))
```
##### Exercise 1(a)
求 $U + V$ 的一組基底、
以及它的維度。
<!-- eng start -->
Find a basis of $U + V$ and determine its dimension.
<!-- eng end -->
##### Exercise 1(b)
求 $\dim(U\cap V)$。
<!-- eng start -->
Find $\dim(U\cap V)$.
<!-- eng end -->
##### Exercise 1(c)
求 $U\cap V$ 的一組基底。
<!-- eng start -->
Find a basis of $U\cap V$.
<!-- eng end -->
## Exercises
##### Exercise 2
令
$$
A_U = \begin{bmatrix}
1 & 2 \\
1 & 2 \\
2 & 1 \\
2 & 1 \\
\end{bmatrix}, A_V = \begin{bmatrix}
1 & 2 \\
2 & 1 \\
1 & 2 \\
2 & 1 \\
\end{bmatrix}
$$
且 $U = \Col(A_U)$ 且 $V = \Col(A_V)$。
<!-- eng start -->
Let
$$
A_U = \begin{bmatrix}
1 & 2 \\
1 & 2 \\
2 & 1 \\
2 & 1 \\
\end{bmatrix}, A_V = \begin{bmatrix}
1 & 2 \\
2 & 1 \\
1 & 2 \\
2 & 1 \\
\end{bmatrix}.
$$
Let $U = \Col(A_U)$ and $V = \Col(A_V)$.
<!-- eng end -->
##### Exercise 2(a)
求 $U + V$ 的一組基底。
<!-- eng start -->
Find a basis of $U + V$.
<!-- eng end -->
##### Exercise 2(b)
找出 $B_U$ 和 $B_V$
使得 $U = \ker(B_U)$ 且 $V = \ker(B_V)$。
<!-- eng start -->
Find $B_U$ and $B_V$ such that $U = \ker(B_U)$ and $V = \ker(B_V)$.
<!-- eng end -->
##### Exercise 2(c)
求 $U \cap V$ 的一組基底。
<!-- eng start -->
Find a basis of $U \cap V$.
<!-- eng end -->
##### Exercise 3
若 $U$ 和 $V$ 為兩個子空間。
證明 $U + V$ 為一個子空間。
<!-- eng start -->
Let $U$ and $V$ be subspaces. Show that $U + V$ is a subspace.
<!-- eng end -->
##### Exercise 4
若 $U$ 和 $V$ 為兩個子空間。
證明 $U \cap V$ 為一個子空間。
<!-- eng start -->
Let $U$ and $V$ be subspaces. Show that $U \cap V$ is a subspace.
<!-- eng end -->
##### Exercise 5
若 $U$ 和 $V$ 為兩個子空間。
證明
$$
\dim(U + V) = \dim(U) + \dim(V) - \dim(U \cap V).
$$
<!-- eng start -->
Let $U$ and $V$ be subspaces. Show that
$$
\dim(U + V) = \dim(U) + \dim(V) - \dim(U \cap V).
$$
<!-- eng end -->
##### Exercise 6
令
$$
A_U = \begin{bmatrix}
1 & 2 \\
1 & 2 \\
2 & 1 \\
2 & 1 \\
\end{bmatrix}, A_V = \begin{bmatrix}
1 & 2 \\
2 & 1 \\
1 & 2 \\
2 & 1 \\
\end{bmatrix}
$$
且 $U = \Col(A_U)$ 且 $V = \Col(A_V)$。
<!-- eng start -->
Let
$$
A_U = \begin{bmatrix}
1 & 2 \\
1 & 2 \\
2 & 1 \\
2 & 1 \\
\end{bmatrix}, A_V = \begin{bmatrix}
1 & 2 \\
2 & 1 \\
1 & 2 \\
2 & 1 \\
\end{bmatrix}.
$$
Let $U = \Col(A_U)$ and $V = \Col(A_V)$.
<!-- eng end -->
##### Exercise 6(a)
找出一組非零向量 $\bu\in U$ 及 $\bv\in V$
使得 $\bu + \bv = \bzero$。
藉此說明 $\{U, V\}$ 不線性獨立。
<!-- eng start -->
Find nonzero vectors $\bu\in U$ and $\bv\in V$ such that $\bu + \bv = \bzero$. This shows that $\{U, V\}$ is not linearly independent.
<!-- eng end -->
##### Exercise 6(b)
令 $V_1$ 和 $V_2$ 為任意的兩個子空間。
證明以下敘述等價:
1. $\{V_1, V_2\}$ is linearly independent.
2. $V_1 \cap V_2 = \{ \bzero \}$.
<!-- eng start -->
Let $V_1$ and $V_2$ be subspaces. Show that the following are equivalent:
1. $\{V_1, V_2\}$ is linearly independent.
2. $V_1 \cap V_2 = \{ \bzero \}$.
<!-- eng end -->
##### Exercise 7
令 $\bu_1,\ldots,\bu_k$ 為一群向量。
<!-- eng start -->
Let $\bu_1, \ldots, \bu_k$ be some vectors.
<!-- eng end -->
##### Exercise 7(a)
對於每個 $i = 1,\ldots, k$,令 $U_i = \vspan(\{\bu_i\})$。
證明以下敘述等價:
1. $\{U_1, \ldots, U_k\}$ is linearly independent.
2. $\{\bu_1, \ldots, \bu_k\}$ is linearly independent.
<!-- eng start -->
For each $i = 1,\ldots, k$, let $U_i = \vspan(\{\bu_i\})$. Show that the following are equivalent:
1. $\{U_1, \ldots, U_k\}$ is linearly independent.
2. $\{\bu_1, \ldots, \bu_k\}$ is linearly independent.
<!-- eng end -->
##### Exercise 7(b)
令
$$
V_1 = \vspan\left(\left\{\begin{bmatrix} 1 \\ 0 \end{bmatrix}\right\}\right),
V_2 = \vspan\left(\left\{\begin{bmatrix} 0 \\ 1 \end{bmatrix}\right\}\right),
V_3 = \vspan\left(\left\{\begin{bmatrix} 1 \\ 1 \end{bmatrix}\right\}\right).
$$
說明對任意相異的 $i$ 和 $j$ 都有 $V_i\cap V_j = \emptyset$﹐
但是 $\{V_1,V_2,V_3\}$ 並不線性獨立。
<!-- eng start -->
Let
$$
V_1 = \vspan\left(\left\{\begin{bmatrix} 1 \\ 0 \end{bmatrix}\right\}\right),
V_2 = \vspan\left(\left\{\begin{bmatrix} 0 \\ 1 \end{bmatrix}\right\}\right),
V_3 = \vspan\left(\left\{\begin{bmatrix} 1 \\ 1 \end{bmatrix}\right\}\right).
$$
Verify that $V_i\cap V_j = \emptyset$ for any distinct $i$ and $j$, but $\{V_1, V_2, V_3\}$ is not linearly independent.
<!-- eng end -->
##### Exercise 7(c)
若 $\{\bu_1,\ldots,\bu_6\}$ 線性獨立。
令 $V_1 = \{\bu_1, \bu_2\}$、
$V_2 = \{\bu_3, \bu_4\}$ 且
$V_3 = \{\bu_5, \bu_6\}$。
證明 $\{V_1,V_2,V_3\}$ 線性獨立。
(實際上把一群線性獨立的向量分成任意堆﹐
則每堆生成出來的空間
全部合在一起會是線性獨立的。)
<!-- eng start -->
Let $\{\bu_1,\ldots,\bu_6\}$ be a linearly independent set. Let $V_1 = \{\bu_1, \bu_2\}$, $V_2 = \{\bu_3, \bu_4\}$, and $V_3 = \{\bu_5, \bu_6\}$. Show that $\{V_1,V_2,V_3\}$ is linearly independent. (In fact, for any partition of a linearly independent set, the collection of the spanning set of its parts is linearly independent.)
<!-- eng end -->