changed 4 years ago
Linked with GitHub

\(\mathbb{R}^n\) 中的仿射子空間

Creative Commons License
This work by Jephian Lin is licensed under a Creative Commons Attribution 4.0 International License.

\(\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}}\)

from lingeo import random_int_list, draw_span

Main idea

An affine subspace in \(\mathbb{R}^n\) is a subset of \(\mathbb{R}^n\) of the form
\[{\bf p} + V = \{{\bf p} + {\bf v}: {\bf v} \in V\}, \] where \({\bf p}\) is a vector and \(V\) is a subspace in \(\mathbb{R}^n\).
An affine subspace is a subspace if and only if it contains the origin \({\bf 0}\).

Let \(U\) be an affine subspace in \(\mathbb{R}^n\).
Then \(U = {\bf p} + V\) for some vector \({\bf p}\) and some subspace if and only if
\({\bf p}\) is a vector in \(U\) and \(V = \{{\bf p}_1 - {\bf p}_2: {\bf p}_1,{\bf p}_2\in U\}\).

Side stories

  • element + set
  • choice of the representative

Experiments

Exercise 1

執行下方程式碼。
原點為橘色點、\({\bf p}\) 為橘色向量、
\({\bf p}\) 的終點延伸出去的紅色向量和淡藍色向量分別為 \({\bf u}_1\)\({\bf u}_2\)
黑色向量為 \({\bf b}\)
\({\bf b}\) 是否是落在 \({\bf p} + \operatorname{span}(\{{\bf u}_1, {\bf u}_2\})\)
若是﹐求 \(c_1,c_2\) 使得 \({\bf b} = {\bf p} + c_1{\bf u}_1 + c_2{\bf u}_2\)

### code
set_random_seed(0)
print_ans = True
while True:
    l = random_int_list(9)
    A = matrix(3, l)
    if A.det() != 0:
        break
u1 = vector(A[0])
u2 = vector(A[1])
u3 = vector(A[2])
p = vector(random_int_list(3))        

inside = choice([0,1,1])
coefs = random_int_list(2, 2)
if inside:
    b = p + coefs[0]*u1 + coefs[1]*u2
else:
    b = p + coefs[0]*u1 + coefs[1]*u2 + 3*u3
    
print("p =", p)
print("u1 =", u1)
print("u2 =", u2)
print("b =", b)

pic = draw_span([u1,u2], p)
pic += arrow((0,0,0), b, width=5, color="black")
show(pic)

if print_ans:
    if inside:
        print("b is on Col(A) since b = %s u1 + %s u2."%(coefs[0], coefs[1]))
    else:
        print("b is not on Col(A).")
  • 第一題要選一個 seed 把題目給的數字貼上來,然後寫如何得到答案

答:
[由練朗順同學提供]
以下為題目給的數字:

p = (4, -4, -3) u1 = (-4, 3, 5) u2 = (-5, -5, 0) b = (6, 12, 7)

\({\bf b}-{\bf p}=c_1{\bf u}_1+c_2{\bf u}_2\) 有解的時候,即 \({\bf b}\) 落在 \({\bf p} + \operatorname{span}(\{{\bf u}_1, {\bf u}_2\})\) 中。
我們可以計算
\[{\bf b} - {\bf p}=\begin{bmatrix}6\\12\\7\end{bmatrix}-\begin{bmatrix}4\\-4\\-3\end{bmatrix}=\begin{bmatrix}2\\16\\10\end{bmatrix} \]
並觀察 \[2{\bf u}_1 - 2{\bf u}_2=2\begin{bmatrix}-4\\3\\5\end{bmatrix}-2\begin{bmatrix}-5\\-5\\0\end{bmatrix}=\begin{bmatrix}2\\16\\10\end{bmatrix} \]
得到 \({\bf b}={\bf p}+2{\bf u}_1-2{\bf u}_2\)
因此 \({\bf b}\) 落在 \({\bf p} + \operatorname{span}(\{{\bf u}_1, {\bf u}_2\})\)

[由張朔祐同學提供]
\({\bf b} = {\bf p}+c_1{\bf u}_1 + c_2{\bf u}_2\) 寫成 \[ \begin{bmatrix}6\\12\\7\end{bmatrix}= \begin{bmatrix}4\\-4\\-3\end{bmatrix}+ c_1\begin{bmatrix}-4\\3\\5\end{bmatrix}+ c_2\begin{bmatrix}-5\\-5\\0\end{bmatrix}, \] 可推得 \[ \left\{\begin{aligned} 4-4c_1-5c_2 &= 6, \\ -4+3c_1-5c_2 &= 12, \\ -3+5c_1+0c_2 &= 7. \end{aligned}\right. \] 因此 \(c_1 = 2\), \(c_2 = -2\)
帶回原式 \({\bf b} = {\bf p}+c_1{\bf u}_1 + c_2{\bf u}_2\)
可推得 \({\bf b} = {\bf p}+2{\bf u}_1 +( -2){\bf u}_2\)
\({\bf b}\)\({\bf p}\)+\(\{{\bf u}_1, {\bf u}_2\}\) 的線性組合。

Exercises

Exercise 2

\(S\) 為一實數的集合、\(p\) 為一實數。
我們定義 \(p + S = \{p + s: s\in S\}\)

Exercise 2(a)

執行以下程式碼。
算出 \(p + S\)

### code
set_random_seed(0)
print_ans = False
nums = list(range(-20,21))
p = choice(nums)
while True:
    S = [choice(nums) for _ in range(5)]
    if len(set(S)) == len(S):
        break
        
print("p =", p)
print("S =", S)

if print_ans:
    print("p + S =", [p + s for s in S])
  • 記錄題目並說明和答案,並說明為什麼

答:

以下為題目給的數字:

p = -13 S = [12, -18, -19, 1, 13]

因此 \(p + S = \{-13+s:s\in S\} = \{-1, -31, -32, -12, 0\}\)

Exercise 2(b)

\(3\mathbb{Z} = \{3k: k \in \mathbb{Z}\}\)
寫出 \(1 + 3\mathbb{Z}\)\(-2 + 3\mathbb{Z}\)
並觀察它兩者是否一樣。

  • 整數的封閉性是指:若 \(a,b\in\mathbb{Z}\),則 \(a+b\in\mathbb{Z}\)。這樣並沒有說明為什麼 \(\{-2+3s:s\in\mathbb{Z}\}=\{1+3(s-1):s\in\mathbb{Z}\}\)
  • 用以下的方式證明 \(A = B\)。令 \(x\in A\) \(x\in B\),所以 \(A\subseteq B\)。另一方面,令 \(x\in B\) \(x\in A\),所以 \(B\subseteq A\)
  • 標點 B01

答:
可以觀察到
\(1+3\mathbb{Z}=\{1+3t:t\in\mathbb{Z}\}\)
\(-2+3\mathbb{Z}=\{-2+3s:s\in\mathbb{Z}\}\)

\(1 + 3t \in 1 + 3\mathbb{Z}\),其中 \(t\) 是整數,
\(1 + 3t = -2 + (3 + 3t)\)
因為 \(1+t\in\mathbb{Z}\)
所以 \(1 + t = -2 + 3(1+t)\in -2 + 3\mathbb{Z}\)
因此 \(1 + 3\mathbb{Z} \subseteq -2 + 3\mathbb{Z}\)

\(-2 + 3s \in -2 + 3\mathbb{Z}\),其中 \(s\) 是整數,
\(-2 + 3s = 1 + (-3 + 3s)\)
因為 \(-1+s\in\mathbb{Z}\)
所以 \(-1+s = 1 + 3(-1+s)\in 1 + 3\mathbb{Z}\)
因此 \(-2 + 3\mathbb{Z} \subseteq 1 + 3\mathbb{Z}\)

最後得到兩個集合相等。

Exercise 2©

\(U = 1 + 3\mathbb{Z}\)
說明 \(\{p_1 - p_2: p_1, p_2 \in U\} = 3\mathbb{Z}\)

  • \(\mathbb{U}\) > \(U\)
  • 目前只證明了 \(\subseteq\),還要證明另一邊:若 \(z\in\mathbb{Z}\),則可以令 \(p_1 = ?\)\(p_2 = ?\) 使得 \(z = p_1 - p_2\),因此 \(z \in \{p_1 - p_2: p_1,p_2\in U\}\)。所以 \(\{p_1 - p_2: p_1,p_2\in U\} \supseteq \mathbb{Z}\)
  • 正式寫作不要用邏輯符號 B03

答:

\(1+3s,1+3t\in 1 + 3\mathbb{Z}\),其中 \(s,t\in\mathbb{Z}\)
由於整數的封閉性,可以得到 \(s-t\in \mathbb{Z}\)
\((1+3s) - (1+3t) = 3(s-t) \in 3\mathbb{Z}\)
因此 \(\{p_1 - p_2: p_1, p_2\in U\} \subseteq \mathbb{Z}\)

\(3k\in 3\mathbb{Z}\),其中 \(k\in\mathbb{Z}\)
\(p_1 = 1+3k\)\(p_2 = 1\),則 \(p_1,p_2\in U\)
\(3k = p_1 - p_2 \in \{p_1 - p_2: p_1, p_2\in U\}\)
因此 \(\{p_1 - p_2: p_1, p_2\in U\} \supseteq \mathbb{Z}\)
最後得到兩集合相等。

Exercise 3

\(U = \left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 3\right\}\)

Exercise 3(a)

找一群 \(\mathbb{R}^3\) 中的向量 \({\bf p}\)\({\bf u}_1\)\({\bf u}_2\)
使得 \(U = {\bf p} + \operatorname{span}(\{{\bf u}_1, {\bf u}_2\})\)

  • 要說明為什麼,或是怎麼找到的

答:
先任意找一個符合 \(x+y+z=3\)\({\bf p}\),如 \({\bf p}=\begin{bmatrix}1\\1\\1\end{bmatrix}\) 就是一個簡單的例子。
接著在 \(x+y+z=0\) 平面上找兩個不互相平行的向量,例如 \(\bu_1=\begin{bmatrix}1\\-1\\0\end{bmatrix}\)\(\bu_2 = \begin{bmatrix}1\\0\\-1\end{bmatrix}\)
就可以得到答案 \[ \bp = \begin{bmatrix}1\\1\\1\end{bmatrix}, \bu_1=\begin{bmatrix}1\\-1\\0\end{bmatrix}, {\bf u}_2=\begin{bmatrix}1\\0\\-1\end{bmatrix}. \]

Exercise 3(b)

驗證 \(V = \{{\bf p}_1 - {\bf p}_2 : {\bf p}_1,{\bf p}_2 \in U\}\) 是一個子空間
(它非空、對純量乘法和向量加法有封閉性)。
因此 \(U\) 可以寫成 \(U = {\bf p} + V\)

  • 要驗證它非空、對純量乘法和向量加法有封閉性,參考 102-3;而且 \(V \neq \vspan(\{\bp_1,\bp_2\})\)
  • \(\because {\bf p}_1,{\bf p}_2\in U\) > 令 \(\bp_1,\bp_2 \in U\)
  • 正式寫作不要用邏輯符號 B03
  • 標點

答:
對任意 \({\bf p}_1,{\bf p}_2\in U\)
都可以寫成 \({\bf p}_1 = {\bf p}+a_1{\bf u}_1+a_2{\bf u}_2\) \({\bf p}_2 = {\bf p}+b_1{\bf u}_1+b_2{\bf u}_2\),其中 \(a_1, a_2,b_1,b_2\in\mathbb{R}\)
因此,
\[\begin{aligned} V &= \{{\bf p}_1 - {\bf p}_2 : {\bf p}_1,{\bf p}_2 \in U\} \\ &= \{(a_1-b_1){\bf u}_1+(a_2-b_2){\bf u}_2:a_1, a_2,b_1,b_2\in\mathbb{R}\} \\ &=\{c_1{\bf u}_1+c_2{\bf u}_2:c_1, c_2\in\mathbb{R}\}=\operatorname{span}(\{{\bf u}_1,{\bf u}_2\}). \end{aligned} \]
因此 \(V\) 為一子空間,且 \(U = {\bf p} + V\)

Exercise 3©

證明任一個超平面
\[\{ {\bf v}\in\mathbb{R}^n : \langle{\bf r},{\bf v}\rangle = b \} \]
(其中 \({\bf r}\in\mathbb{R}^n\)\(b\in\mathbb{R}\) 都是一個仿射子空間。
而且 \({\bf r}\)\(V = \{{\bf p}_1 - {\bf p}_2 : {\bf p}_1,{\bf p}_2 \in U\}\) 中的所有向量垂直﹐
因此它是 \(U\) 的法向量。

  • 標點
  • 不要用邏輯符號

答:
\({\bf w}\)\(\langle{\bf r},{\bf v}\rangle = b\) 的一組解。
另外考慮集合 \(V=\{ {\bf p}\in\mathbb{R}^n : \langle{\bf r},{\bf p}\rangle = 0 \}\)
由下列向量內積的性質
\[\langle{\bf a}+{\bf b}, {\bf c}\rangle=\langle{\bf a},{\bf c}\rangle+\langle{\bf b},{\bf c}\rangle, \] \[\langle r{\bf a},{\bf b}\rangle=r\langle{\bf a},{\bf b}\rangle \] 可知 \(V\) 有向量加法和純量乘法封閉性,且明顯地 \({\bf 0}\in V\),因此 \(V\) 為非空集合
綜合以上三點可知 \(V\) 為子空間。
考慮 \({\bf w}+V=\{{\bf w}+{\bf p}:\langle{\bf r},{\bf p}\rangle = 0\}\) 為一仿射子空間,
因為 \(\langle{\bf r},{\bf w}\rangle = b\)
所以 \({\bf w}+V=\{{\bf w}+{\bf p}:\langle{\bf r},{\bf p}\rangle = 0\}=\{{\bf w}+{\bf p}:\langle{\bf r},{\bf w}+{\bf p}\rangle = b\}=\{{\bf v}:\langle{\bf r},{\bf v}\rangle = b\}\)
因此 \(\{{\bf v}\in\mathbb{R}^n:\langle{\bf r},{\bf v}\rangle = b\}\) 為一仿射子空間。

Exercise 4

\(U = \left\{\begin{bmatrix}x\\y\\z\\w\end{bmatrix} : \begin{array}{ccccc} x & +y & & +w & = 3 \\ & & z & +w & = 2 \\ \end{array}\right\}\)
找一群 \(\mathbb{R}^4\) 中的向量 \({\bf p}\)\({\bf u}_1\)\({\bf u}_2\)
使得 \(U = {\bf p} + \operatorname{span}(\{{\bf u}_1, {\bf u}_2\})\)
(因此這組方程式的解形成一個仿射子空間。)

  • 第二個大數學式最後加半型句點
  • 矩陣 > 向量
  • 再由 > 因此所有解都可以寫成 \[U = \{\bp + c_1\bu_1 + c_2\bu_2: c_1,c_2\in\mathbb{R}\} = \bp + \vspan(\{\bu_1,\bu_2\}), \] 其中

答:
依題中方程式可得知 \(z = 2 - w\)\(x = 3 - y - w\)
因此可得下列向量
\[\begin{bmatrix}x\\y\\z\\w\end{bmatrix} = \begin{bmatrix}3 - y - w\\y\\2 - w\\w\end{bmatrix}, \]
而向量又可分解為
\[\begin{bmatrix}3 - y -w\\y\\2 - w\\w\end{bmatrix} = \begin{bmatrix}3\\0\\2\\0\end{bmatrix} + y \begin{bmatrix}- 1\\1\\0\\0\end{bmatrix} + w \begin{bmatrix}- 1\\0\\- 1\\1\end{bmatrix}. \] 因此所有解都可以寫成 \[U = \{\bp + c_1\bu_1 + c_2\bu_2: c_1,c_2\in\mathbb{R}\} = \bp + \vspan(\{\bu_1,\bu_2\}), \] 其中
向量 \({\bf p} = (3,0,2,0)\)
向量 \({\bf u}_1 = (- 1,1,0,0)\)
向量 \({\bf u}_2 = (- 1,0,- 1,1)\)

Exercise 5

\(U\)\(\mathbb{R}^n\) 中的仿射子空間。

Exercise 5(a)

\(V\)\(\mathbb{R}^n\) 中的一子空間、
\({\bf p}_1\)\({\bf p}_2\)\(\mathbb{R}^n\) 中的向量。
證明以下敘述等價:

  1. \({\bf p}_1 + V = {\bf p}_2 + V\).
  2. \({\bf p}_1 - {\bf p}_2 \in V\).
  • 用 1 > 2, 2 > 1 完整寫出來:假設 \(\bp_1 + V = \bp_2 + V\)。因為 \(V\) 是一個子空間且 \(\bzero\in V\),所以 \(\bp_1 = \bp_1 + \bzero \in \bp_1 + V = \bp_2 + V\)。如此一來,存在某一個 \(\bv\in V\) 使得 \(\bp_1 = \bp_2 + \bv\),所以
  • \({\bf p}_1+V={\bf p}_2+V\Leftrightarrow\) 每一組 \((x_1,...,x_k)\) 都有一一對應的一組 \((y_1,...,y_k)\) < 敘述很模糊,比如說如果有一一對應,就一定會有 \(\bp_1 + V = \bp_2 + V\) 嗎?它的對應是怎樣?
  • 不要用邏輯符號

答:

"\(1\implies 2\)"

假設 \(\bp_1 + V = \bp_2 + V\)
因為 \(V\) 是一個子空間且 \(\bzero\in V\)
所以 \(\bp_1 = \bp_1 + \bzero \in \bp_1 + V = \bp_2 + V\)
如此一來,存在某一個 \(\bv\in V\) 使得 \(\bp_1 = \bp_2 + \bv\)
所以 \(\bp_1 - \bp_2 = \bv\)\({\bf p}_1 - {\bf p}_2 \in V\)

"\(2\implies 1\)"
假設 \({\bf p}_1 - {\bf p}_2 \in V\)
\({\bf p}_1 - {\bf p}_2\) 等於某一個 \(\bv\in V\)
因此 \(\bp_1 - \bp_2 = \bv\),也就是\(\bp_1 = \bp_2 + \bv\)

任取 \(\bp_1 + \bu \in\bp_1+V\),得到 \(\bp_1 + \bu =\bp_2 + \bu + \bv\)
因為 \(\bv,\bu\in V\)\(V\) 是一個子空間,所以 \(\bv + \bu\in V\)
\(\bp_1 + \bu = \bp_2 + \bv + \bu \in \bp_2 + V\)
因此我們知道 \(\bp_1 + V \subseteq \bp_2 + V\)

同理,從 \(\bp_1 - \bp_2 = \bv\) 可得 \(\bp_2 = \bp_1 - \bv\)
任取 \(\bp_2 + \bu \in\bp_2+V\),得到 \(\bp_2 + \bu =\bp_1 - \bv + \bu\)
因為 \(\bv,\bu\in V\)\(V\) 是一個子空間,所以 \(-\bv + \bu\in V\)
\(\bp_2 + \bu =\bp_1 - \bv + \bu\in \bp_1 + V\)
因此我們知道 \(\bp_2 + V \subseteq \bp_1 + V\)

最後我們得到 \(\bp_1 + V = \bp_2 + V\)

Exercise 5(b)

\(U\) 可以寫為 \({\bf p} + V\)
其中 \({\bf p}\in\mathbb{R}^n\)\(V\)\(\mathbb{R}^n\) 中的一子空間。

證明 \(V = \{{\bf p}_1 - {\bf p}_2 : {\bf p}_1,{\bf p}_2 \in U\}\)
\({\bf p}\) 可以選為 \(U\) 中的任一元素。

\(Ans\):
[由廖緯程同學提供]
\(S = \{{\bf p}_1 - {\bf p}_2 : {\bf p}_1,{\bf p}_2 \in U\}\)

1. 先證明 \(V \subseteq S\):
因為 \(V\)\(\mathbb{R}^n\) 中的一個子空間,所以 \({\bf 0} \in V\)
再任意取 \(\bv_1 \in V\),我們可以有以下推論,

\[ \bv_1 = \bv_1 - {\bf 0} = (\bp + \bv_1) - (\bp + {\bf 0}) \in S, \]

所以 \(V \subseteq S\)

2. 再證明 \(S \subseteq V\):
任取 \(S\) 中的元素,\(\bp_3 - \bp_4 \in S\),其中 \(\bp_3,\bp_4 \in U = \bp + V\)
則我們可以找到 \(\bv_3,\bv_4 \in V\) 使得 \(\bp_3 = \bp + \bv_3\)\(\bp_4 = \bp + \bv_4\)。如此一來,

\[ \bp_3 - \bp_4 = (\bp + \bv_3) - (\bp + \bv_4) = \bv_3 - \bv_4 \in V, \]

所以 \(S \subseteq V\)
因為 1,2 所以 \(V = S\)

最後,對任意 \(\bp_3 = \bp + \bv_3 \in U\),因為 \(\bp_3 + V = \bp + (\bv_3 + V) = \bp + V\),所以 \(\bp\) 可以選為 \(U\) 中的任一元素。

前一天沒有寄信 除了 3© 和 4 以外,其它邏輯上都有不清楚的地方 5(b) 半對

幾乎改完了~

目前分數:4.5/5

Select a repo