# $\mathbb{R}^n$ 中的子空間
Subspaces in $\mathbb{R}^n$

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_int_list, draw_span
```
## Main idea
Let $S$ be a set of (possibily infinitely many) vectors in $\mathbb{R}^n$.
A **linear combination** of $S$ is a vector of the form
$$
c_1\bu_1 + \cdots + c_k\bu_k,
$$
for some vectors $\bu_1,\ldots, \bu_k\in S$ and
some scalars $c_1,\ldots,c_k\in\mathbb{R}$.
_Although $S$ can have infinitely many vectors, a linear combination only uses finitely many vectors in $S$._
The **span** of $S$ is the set of all linear combination of $S$,
denoted by $\vspan(S)$.
(We vacuously define $\vspan(\emptyset) = \{\bzero\}$.)
Let $V$ be a subset of $\mathbb{R}^n$. Then the following two conditions are equivalent.
1. $V = \vspan(S)$ for some vectors $S$.
2. $V$ is a nonempty subset that is closed under scalar multiplication and vector addition. That is,
1. $V \neq \emptyset$.
2. For any scalar $k$ and vector $\bv\in V$, $k\bv\in V$. (closed under scalr multiplication)
3. For any two vectors $\bu,\bv\in V$, $\bu + \bv\in V$. (closed under vector addition)
If either one of the two conditions holds, then $V$ is called a **subspace** of $\mathbb{R}^n$.
A **system of linear equations** has the form
$$
\left\{\begin{array}{ccccccc}
a_{11}x_1 & + & \cdots & + & a_{1n}x_n & = & b_1 \\
\vdots & ~ & ~ & ~ & \vdots & = & \vdots \\
a_{m1}x_1 & + & \cdots & + & a_{mn}x_n & = & b_m \\
\end{array}\right.
$$
for some variables $x_1,\ldots,x_n$, and some numbers $a_{ij}$'s and $b_1,\ldots,b_m$.
When $b_1 = \cdots = b_m = 0$, it is a **homogeneous** system of linear equations.
An $m\times n$ **matrix** $A$ over $\mathbb{R}$ is array
$$
\begin{bmatrix}
a_{11} & \cdots & a_{1n} \\
\vdots & ~ & \vdots \\
a_{m1} & \cdots & a_{mn} \\
\end{bmatrix}
$$
for some numbers $a_{ij}$'s.
##### Matrix-vector multiplication (by entry)
Let $A = \begin{bmatrix} a_{ij}\end{bmatrix}$ be an $m\times n$ matrix and $\bv = (v_1,\ldots,v_n)$ a vector in $\mathbb{R}^n$.
Then $A\bv$ is a vector in $\mathbb{R}^m$ whose $i$-th entry is
$$
\sum_{k=1}^n a_{ik}v_k.
$$
Thus, every system of linear equation can be written as $A\bx = \bb$, while
it is homogeneous when $\bb = \bzero$.
The solution set of $A\bv = \bzero$ is called the **kernel** of $A$, denoted as $\ker(A)$.
That is, $\ker(A) = \{\bv\in\mathbb{R}^n : A\bv = \bzero\}$.
The kernel of an $m\times n$ matrix is a subspace in $\mathbb{R}^n$.
## Side stories
- set equal
## Experiments
##### Exercise 1
執行下方程式碼。
原點為橘色點、
從原點延伸出去的紅色向量和淡藍色向量分別為 $\bu_1$ 和 $\bu_2$。
黑色向量為 $\bb$。
問 $\bb$ 是否是 $\{\bu_1, \bu_2\}$ 的線性組合?
若是,求 $c_1,c_2$ 使得 $\bb = c_1\bu_1 + c_2\bu_2$。
<!-- eng start -->
Run the code below. Let the origin be the orange point. Let $\bu_1$ and $\bu_2$ be the red and blue vectors with its tails at the origin. Let $\bb$ be the black vector. Is $\bb$ a linear combination of $\{\bu_1, \bu_2\}$? If yes, find $c_1$ and $c_2$ so that $\bb = c_1\bu_1 + c_2\bu_2$.
<!-- eng end -->
<!--
---
##### **Exercise 1 - answer here**
:::info
我會這樣寫
:warning: 前面可以把程式產出來的圖和數字貼過來
令 $\bb, \bu_1, \bu_2\in \mathbb{R^3}$。 $\rightarrow$ 唸起來是 令 $\bb, \bu_1, \bu_2$ 在 $\mathbb{R}^3$ 中。
由圖可以看出 $\bb$ 在 $\bu_1, \bu_2$ 所張的平面中 $\bb \in \vspan\{\bu_1, \bu_2\}$,所以 $\bb$ 是 ${\bu_1, \bu_2}$ 的線性組合。
也就是說 $\bb$ 可以被分解成一些純量 $c_1, c_2$ 和 $\bu_1, \bu_2$ 構造出的線性組合 $\bb=c_1\bu_1+c_2\bu_2$。
已知 $\bb=(2, 16, 10)$, $\bu_1=(-4, 3, 5)$, $\bu_2=(-5, -5, 0)$
,代入 $b=c_1\bu_1 + c_2\bu_2$ 可得 $(2, 16, 10)=c_1(-4, 3, 5)+c_2(-5, -5, 0)$。 $\rightarrow$ 唸起來是 已知 $\bb$ 是 ..., $\bu_1$ 是 ..., $\bu_2$ 是 ...。代入 ???公式 可得 ???向量。
:::
$\bb, \bu_1, \bu_2\in \mathbb{R^3}$
$\bb$ 可以被分解成純量 $c$ 和 $\bu_1, \bu_2$ 的線性組合 $\bb=c_1\bu_1+c_2\bu_2, \forall c\in \mathbb{R}$
$\bb$ 在 $\bu_1, \bu_2$ 所張的平面中 $\bb \in \vspan\{\bu_1, \bu_2\}$
所以 $\bb$ 是 ${\bu_1, \bu_2}$ 的線性組合。
已知 $\bb=(2, 16, 10)$, $\bu_1=(-4, 3, 5)$, $\bu_2=(-5, -5, 0)$
,
代入 $\bb=c_1\bu_1 + c_2\bu_2$, 可得 $(2, 16, 10)=c_1(-4, 3, 5)+c_2(-5, -5, 0).$
寫成矩陣為
$\begin{bmatrix}
-4 & -5\\
3 & 5\\
5 & 0\\
\end{bmatrix}$
$\begin{bmatrix}
c_1\\
c_2\\
\end{bmatrix}$=
$\begin{bmatrix}
2\\
16\\
10\\
\end{bmatrix}$
可拆解為
$\begin{cases}
-4c_1-5c_2=2\\
3c_1-5c_2=16\\
5c_1+0c_2=10
\end{cases}$
故解 $(c_1,c_2)=(2,-2).$
-->
---
##### **Exercise 1 - updated answer here !!! (Eng ver.)**

:::warning
- [x] Let ... ~~to~~ be ... .
- [x] can be a linear combination of scalar $\bu_1$ and $\bu_2$. --> **is** a linear combination of ~~scalar~~ $\bu_1$ and $\bu_2$.
- [x] We already know that $\bb$ is $(2, 16, 10)$, $\bu_1$ is $(-4, 3, 5)$ and $\bu_2$ is $(-5, -5, 0)$. Suppose there are $c_1$ and $c_2$ such that
$$
\bb=c_1\bu_1 + c_2\bu_2.
$$
- [x] . By solving ...
:::
Let $\bb, \bu_1, \bu_2$ be vectors in $\mathbb{R}^3$.
As the picture shows, $\bb$ is in the plane of $\vspan\{\bu_1, \bu_2\}$, so $\bb$ is a linear combination of $\bu_1$ and $\bu_2$.
We already know that $\bb$ is $(2, 16, 10)$, $\bu_1$ is $(-4, 3, 5)$ and $\bu_2$ is $(-5, -5, 0)$.
Suppose there are scalars $c_1$ and $c_2$ such that
$$\bb=c_1\bu_1 + c_2\bu_2.
$$
Then, we can get the equation: $(2, 16, 10)=c_1(-4, 3, 5)+c_2(-5, -5, 0)$.
By solving the equation, we found that the scalar $(c_1, c_2)=(2, -2)$.
---
```python
### code
set_random_seed(0)
print_ans = False
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])
inside = choice([0,1,1])
coefs = random_int_list(2, 2)
if inside:
b = coefs[0]*u1 + coefs[1]*u2
else:
b = coefs[0]*u1 + coefs[1]*u2 + 3*u3
print("u1 =", u1)
print("u2 =", u2)
print("b =", b)
pic = draw_span([u1,u2])
pic += arrow((0,0,0), b, width=5, color="black")
show(pic)
if print_ans:
if inside:
print("b is a linear combination of { u1, u2 } since b = %s u1 + %s u2."%(coefs[0], coefs[1]))
else:
print("b is not a linear combination of { u1, u2 }.")
```
## Exercises
##### Exercise 2(a)
令
$$
\be_1 = \begin{bmatrix}1\\0\\0\end{bmatrix},
\be_2 = \begin{bmatrix}0\\1\\0\end{bmatrix},
\be_3 = \begin{bmatrix}0\\0\\1\end{bmatrix}.
$$
說明 $\mathbb{R}^3 = \vspan(\{\be_1, \be_2, \be_3\})$,
因此它是一個子空間。
(要說明每一個 $\mathbb{R}^3$ 中的向量都可以寫成 $c_1\be_1 + c_2\be_2 + c_3\be_3$ 的形式。)
<!-- eng start -->
Let
$$
\be_1 = \begin{bmatrix}1\\0\\0\end{bmatrix},
\be_2 = \begin{bmatrix}0\\1\\0\end{bmatrix},
\be_3 = \begin{bmatrix}0\\0\\1\end{bmatrix}.
$$
Explain why $\mathbb{R}^3 = \vspan(\{\be_1, \be_2, \be_3\})$. As a consequence, it is a subspace. (You have to show that every vector in $\mathbb{R}^3$ can be written as $c_1\be_1 + c_2\be_2 + c_3\be_3$.)
<!-- eng end -->
---
##### Exercise 2(a) - Answer (Written by @Ken)
:::warning
:+1: Mathematically correct
:+1: Writing is okay, but can be more consise.
:warning: We usually use a bold lower-case letter for a vector.
:warning: Do homework earlier next time :slightly_frowning_face:
See this example as below:
Let $\bv = (c_1,c_2,c_3)$ be a vector in $\mathbb{R}^3$.
Then it can be written as
$$
\begin{aligned}
\bv = \begin{bmatrix}c_1\\c_2\\c_3\end{bmatrix}
&= \begin{bmatrix}c_1\\0\\0\end{bmatrix}
+\begin{bmatrix}0\\c_2\\0\end{bmatrix}
+\begin{bmatrix}0\\0\\c_3\end{bmatrix} \\
&= c_1\begin{bmatrix}1\\0\\0\end{bmatrix}
+c_2\begin{bmatrix}0\\1\\0\end{bmatrix}
+c_3\begin{bmatrix}0\\0\\1\end{bmatrix} \\
&= c_1\be_1+c_2\be_2+c_3\be_3,
\end{aligned}
$$
so it is in $\vspan(\{\be_1,\be_2,\be_3\})$.
Since this argument works for any vector in $\mathbb{R}^3$, we have $\mathbb{R}^3 = \vspan(\{\be_1, \be_2, \be_3\})$ and know $\mathbb{R}^3$ is a subspace.
- [x] Suppose a vector $s=(c_1,c_2,c_3)$, $c_1, c_2,c_3$ are real numbers. --> Suppose $\bv = (c_1,c_2, c_3)$ is a vector, where $c_1,c_2,c_3$ are real numbers.
- [x] Then, conver ... <-- This paragraph is not necessary.
- [x] And we know ... <-- Not necessary, either. :warning: Please remove the second line $\bv = ...$ and the third line $\be_1 = ...$
- [x] Therefore, it can be written ... --> Then, it can be written ...
- [x] and know $\mathbb{R}$ ... --> and we know $\mathbb{R}^3$ ... :warning: $\mathbb{R}$ should be $\mathbb{R}^3$
:::
<!-- eng start -->
Suppose $\bv=(c_1,c_2,c_3)$ is a vector, where $c_1, c_2,c_3$ are real numbers.
Then, it can be written in the form of linear combination as below :
$$
\begin{aligned}
\bv&=c_1\begin{bmatrix}1\\0\\0\end{bmatrix}
+c_2\begin{bmatrix}0\\1\\0\end{bmatrix}
+c_3\begin{bmatrix}0\\0\\1\end{bmatrix} \\
&= c_1\be_1+c_2\be_2+c_3\be_3,
\end{aligned}
$$
so it is in $\vspan(\{\be_1, \be_2, \be_3\}).$
Since this argument works for any vector in $\mathbb{R}^3$, we have
$\vspan(\{\be_1, \be_2, \be_3\})=\vspan(\bv)=\mathbb{R}^3$, and we know $\mathbb{R}^3$ is a subspace.
<!-- eng end -->
---
##### Exercise 2(b)
令
$$
\bb = \begin{bmatrix}1\\2\\-3\end{bmatrix},
\bu_1 = \begin{bmatrix}-1\\1\\0\end{bmatrix},
\bu_2 = \begin{bmatrix}0\\-1\\1\end{bmatrix}.
$$
說明 $\bb\in\vspan(\{\bu_1, \bu_2\})$。
<!-- eng start -->
Let
$$
\bb = \begin{bmatrix}1\\2\\-3\end{bmatrix},
\bu_1 = \begin{bmatrix}-1\\1\\0\end{bmatrix},
\bu_2 = \begin{bmatrix}0\\-1\\1\end{bmatrix}.
$$
Explain why $\bb\in\vspan(\{\bu_1, \bu_2\})$.
<!-- eng end -->
---
##### **Exercise 2(b) - answer here (written by @吳明樺)**
:::warning
:+1: Mathematically correct.
:warning: Writting issue.
Let $S = \{\bu_1, \bu_2\}$. **Recall that** a linear combination of $S$ is a vector of the form $c_1\bu_1 + c_2\bu_2$ with $c_1,c_2\in\mathbb{R}$.
~~Let~~ **Suppose** $\bb = ...$. **By** direct computation, it is equivalent to ??? and has the solution $(c_1,c_2) = (-1,-3)$. Therefore, we can ... and $\be\in\vspan(...)$.
- [x] Remove the part $\bb = ...$, $\bu_1 = ...$ since they are just part of the problem. :warning: I meaning the beginning part.
- [x] By direct computation, $\bb\in\vspan(S)$ is equivalent to
$$
\begin{bmatrix}1\\2\\-3\end{bmatrix}=
c_1\begin{bmatrix}-1\\1\\0\end{bmatrix}+
c_2\begin{bmatrix}0\\-1\\1\end{bmatrix},
$$
for some $c_1,c_2\in\mathbb{R}$, which has the solution $(c_1,c_2)=(-1,-3)$.
:::
Let $S = \{\bu_1, \bu_2\}$.
Recall that a linear combination of $S$ is a vector of the form $c_1\bu_1+c_2\bu_2$, with $c_1, c_2$ in $\mathbb{R}$.
By direct computation, $\bb\in\vspan(S)$ is equivalent to
$$
\begin{bmatrix}1\\2\\-3\end{bmatrix}=
c_1\begin{bmatrix}-1\\1\\0\end{bmatrix}+
c_2\begin{bmatrix}0\\-1\\1\end{bmatrix},
$$
for some $c_1,c_2\in\mathbb{R}$, which has the solution $(c_1,c_2)=(-1,-3)$.
Therefore, we can conclude that $\bb$ is a linear combination of $\bu_1, \bu_2$, so $\bb$ is in $\vspan(\{\bu_1,\bu_2\})$.
---
##### Exercise 2(c)
令
$$
\bb = \begin{bmatrix}1\\1\\1\end{bmatrix},
\bu_1 = \begin{bmatrix}-1\\1\\0\end{bmatrix},
\bu_2 = \begin{bmatrix}0\\-1\\1\end{bmatrix}.
$$
說明 $\bb\notin\vspan(\{\bu_1, \bu_2\})$。
<!-- eng start -->
Let
$$
\bb = \begin{bmatrix}1\\1\\1\end{bmatrix},
\bu_1 = \begin{bmatrix}-1\\1\\0\end{bmatrix},
\bu_2 = \begin{bmatrix}0\\-1\\1\end{bmatrix}.
$$
Explain why $\bb\notin\vspan(\{\bu_1, \bu_2\})$.
<!-- eng end -->
---
##### **Exercise 2(c) - answer here (written by @lozie)**
:::warning
:warning: More details are needed.
- [x] Use equality when the both sides are **the same** . For example, a vector $\bb$ cannot be the same as a matrix, and the three matrices are also not equal.
- [x] There are no explanations about what you are doing: elimination? solving equations? how do you magically come up with the matrices and get the conclusion that there is no solution?
Examples:
This leads to the equation
...
which is equivalent to
...
Since this system of equations have no solution, we know ... not in the span.
- [x] Suppoose $\bb = c_1\bu_1+c_2\bu_2$. By plugging in the values, we have the following equation:
:::
Let $S = \{\bu_1, \bu_2\}.$
Recall that a linear combination of $S$ is a vector of the form $c_1\bu_1+c_2\bu_2$,
and $\bu_1 ,\bu_2$ in $S$, $c_1, c_2$ in $\mathbb{R}$.
Suppoose $\bb = c_1\bu_1+c_2\bu_2$. By plugging in the values, we have following equation :
$$
\begin{bmatrix}1\\1\\1\end{bmatrix}
=c_1\begin{bmatrix}-1\\1\\0\end{bmatrix}
+c_2\begin{bmatrix}0\\-1\\1\end{bmatrix},
$$
which is equivalent to :
$$
\begin{alignat*}{3}
-1c_1&{ }+{ }&0c_2&{ }={ }& 1 \\
c_1&{ }-{ }&c_2 &{ }={ }& 1 \\
0c_1&{ }+{ }&c_2 & { }={ } & 1
\end{alignat*}
$$
By solving the equation, we found that $c_1=-1$ and $c_2=1$, $c_1-c_2 \neq 1$.
Since this system of equations have no solution, we know that $\bb$ is not in the span.
---
##### Exercise 2(d)
令
$$
\bb = \begin{bmatrix}1\\2\\-3\end{bmatrix},
\bu_1 = \begin{bmatrix}-1\\1\\0\end{bmatrix},
\bu_2 = \begin{bmatrix}0\\-1\\1\end{bmatrix},
\bu_3 = \begin{bmatrix}-1\\0\\1\end{bmatrix}.
$$
找出至少兩組 $c_1, c_2, c_3$ 使得 $\bb = c_1\bu_1 + c_2\bu_2 + c_3\bu_3$。
這說明了線性組合的表示法不見得唯一。
<!-- eng start -->
Let
$$
\bb = \begin{bmatrix}1\\2\\-3\end{bmatrix},
\bu_1 = \begin{bmatrix}-1\\1\\0\end{bmatrix},
\bu_2 = \begin{bmatrix}0\\-1\\1\end{bmatrix},
\bu_3 = \begin{bmatrix}-1\\0\\1\end{bmatrix}.
$$
Find at least two combinations of $c_1, c_2, c_3$ such that $\bb = c_1\bu_1 + c_2\bu_2 + c_3\bu_3$. This shows that the forms of linear combinations might not be unique.
<!-- eng end -->
---
##### **Exercise 2(d) - answer here (written by @棉花糖)**
:::warning
:+1: Mathematically correct.
:construction: Minor writting issues.
:warning: Be aware of the use of $=$.
- [x] **Suppsoe** $\bb$ ... . **Then** ...
- [x] This is equivalent to the equation
$$
\begin{bmatrix}
1\\ 2\\ 3\\ \end{bmatrix} =
\begin{bmatrix}
-1&0&-1 \\
1&-1&0 \\
0&1&1 \\
\end{bmatrix}
\begin{bmatrix} c_1 \\ c_2 \\ c_3 \end{bmatrix},
$$
and we let $A$ be the $3\times 3$ matrix in the equation.
- [x] For row operations, replace $=$ with $\rightsquigarrow$ since the matrices are just not equal.
- [x] Written as augemented matrix : --> Consider the augmented matrix $\left[\begin{array}{c|c} A & \bb \end{array}\right]$ and apply the row operations:
- [x] Written as simultaneous equations : --> This is equivalent to the **system** of equations
- [x] Let $c_3 = t$. Then we may parametrize the system and get
$$
\begin{bmatrix} c_1 \\ c_2 \\ c_3 \end{bmatrix} =
\begin{bmatrix} -1-t\\-3-t\\t \end{bmatrix} =
\begin{bmatrix}-1\\-3\\0\end{bmatrix} + \begin{bmatrix}-t\\-t\\t\end{bmatrix} =
\begin{bmatrix}-1\\-3\\0\end{bmatrix} + t\begin{bmatrix}-1\\-1\\1\end{bmatrix}
$$
for all $t \in \mathbb{R}.$
Thus, we may plug in arbitrary $t$'s to get different solutions. For example, $(-4, -6, 3)$ is a solution by plugging in $t = 3$, while ... when t = 6$.
- [x] Remove $\bb = ...$, $\bu = ...$ since they are given in the problem.
- [x] Suppose $\bb$ is a linear combination of $\bu_1, \bu_2, \bu_3$ and scalars $c_1, c_2, c_3$ in $\mathbb{R}$, then we apply the formula of linear combination
$\bb=c_1\bu_1+c_2\bu_2+c_3\bu_3$. --> Suppose $\bb$ is a linear combination of $\bu_1, \bu_2, \bu_3$. Then we may assume $\bb=c_1\bu_1+c_2\bu_2+c_3\bu_3$ for some scalars $c_1, c_2, c_3$ in $\mathbb{R}$, which is equivalent to
- [x] Let $A$ ... . Consider ...
- [x] to get different solution**s**.
- [x] For example, $\bv = (-4, -6, 3)$ is a solution by plugging in $t=3$. We may verify it is a solution by checking $A\bv = \bb$:
- [x] **Similarly**, when $t=6$, we have a solution $(c_1, c_2, c_3)=(-7, -9, 6)$. Again, we may check ... and verify that ... is also a solution ... . :warning: The "Again" part is not done.
:::
Suppose $\bb$ is a linear combination of $\bu_1, \bu_2, \bu_3$.
Then we may assume $\bb=c_1\bu_1+c_2\bu_2+c_3\bu_3$ for some scalars $c_1, c_2, c_3$ in $\mathbb{R}$, which is equivalent to
$$
\begin{bmatrix}
1\\ 2\\ 3\\ \end{bmatrix} =
\begin{bmatrix}
-1&0&-1 \\
1&-1&0 \\
0&1&1 \\
\end{bmatrix}
\begin{bmatrix} c_1 \\ c_2 \\ c_3 \end{bmatrix}.
$$
Let $A$ be the $3\times 3$ matrix in the equation. Consider the argmented matrix $\left[\begin{array}{c|c}A&\bb\end{array}\right]$ and apply the row operations :
$$
\begin{aligned}
\left[\begin{array}{ccc|c}
-1&0&-1&1 \\
1&-1&0&2 \\
0&1&1&-3
\end{array}\right] &\rightsquigarrow
\left[\begin{array}{ccc|c}
-1&0&-1&1 \\
0&-1&-1&3 \\
0&1&1&-3
\end{array}\right] \\ &\rightsquigarrow
\left[\begin{array}{ccc|c}
-1&0&-1&1 \\
0&-1&-1&3 \\
0&0&0&0
\end{array}\right].
\end{aligned}
$$
This is equivalent to the system of equations
$\begin{cases}
c_1+c_3=-1 \\
c_2+c_3=-3
\end{cases}.$
Let $c_3=t$. Then we may parametrize the system and get :
$$
\begin{bmatrix} -1-t\\-3-t\\t\end{bmatrix}=
\begin{bmatrix}-1\\-3\\0\end{bmatrix}+
\begin{bmatrix}-t\\t\\t\end{bmatrix}=
\begin{bmatrix}-1\\-3\\0\end{bmatrix}+
t\begin{bmatrix}-1\\-1\\1\end{bmatrix},
$$
for all $t$ in $\mathbb{R}.$
Thus, we may plug in arbitrary $t$'s to get different solutions.
For example, $\bv = (-4, -6, 3)$ is a solution by plugging in $t=3$.
We may verify it is a solution by checking $A\bv = \bb$ :
$$
\begin{bmatrix}-1&0&-1 \\1&-1&0 \\0&1&1\end{bmatrix}
\begin{bmatrix}c_1\\c_2\\c_3\end{bmatrix}=
\begin{bmatrix}1\\2\\3\end{bmatrix}
$$
$$
\begin{bmatrix}-1&0&-1 \\1&-1&0 \\0&1&1\end{bmatrix}
\begin{bmatrix}-4\\-6\\3\end{bmatrix}=
\begin{bmatrix}4-3\\-4+6\\-6+3\end{bmatrix}=
\begin{bmatrix}1\\2\\3\end{bmatrix},
$$
so $(-4, -6, 3)$ is one of the solutions of $(c_1, c_2, c_3).$
Similarly, when $t=6$, we have a solution $(c_1, c_2, c_3)=(-7, -9, 6)$.
Again we may check $A\bv = \bb$, and verify that $(-7, -9, 6)$ is also a solution of $(c_1, c_2, c_3)$.
$$
\begin{bmatrix}-1&0&-1 \\1&-1&0 \\0&1&1\end{bmatrix}
\begin{bmatrix}-7\\-9\\6\end{bmatrix}=
\begin{bmatrix}1\\2\\3\end{bmatrix},
$$
In conclusion, there exist at least two combinations of $c_1, c_2, c_3$ such that $\bb = c_1\bu_1 + c_2\bu_2 + c_3\bu_3$.
This shows that the forms of linear combinations might not be unique.
---
##### Exercise 3
依照各小題的步驟來證明子空間的兩個條件等價。
1. $V = \vspan(S)$ for some vectors $S$.
2. $V$ is a nonempty subset that is closed under scalar multiplication and vector addition.
並用這些條件來判斷一個集合是否為子空間。
<!-- eng start -->
Use the given instructions to show the following statements are equivalent.
1. $V = \vspan(S)$ for some vectors $S$.
2. $V$ is a nonempty subset that is closed under scalar multiplication and vector addition.
Then you may use the equivalent conditions to check if a set is a subspace.
<!-- eng end -->
##### Exercise 3(a)
證明若條件 1 成立則條件 2 成立。
<!-- eng start -->
Show that Condition 1 implies Condition 2.
<!-- eng end -->
**[Provided by 許豐有]**
Suppose $V = \vspan(S)$ for some $S\subseteq\mathbb{R}^n$.
We verify each of the requirements in condition 2.
**nonempty**
Since $\vspan(S)$ always contains zero vector, $V$ is nonempty.
**closed under scalar multiplication**
Suppose $\bv\in V$ and $k$ a scalar.
Then $\bv$ can be written as $c_1\bu_1 + \cdots + c_k\bu_k$ for some vectors $\bu_i\in S$ and scalars $c_i$.
Then $k\bv = kc_1\bu_1 + \cdots + kc_k\bu_k$.
Since $k$ and $c_i$ are both scalars.
So $k\bv\in\vspan(S) = V$.
**closed under vector addition**
Suppose $\bv_1,\bv_2\in V$.
Then $\bv_1$ can be written as $a_1\bu_1 + \cdots + a_k\bu_k$, for some vectors $\bu_i\in S$ and scalars $a_i$,
and $\bv_2$ can be written as $b_1\bu_1 + \cdots + b_k\bu_k$, for some vectors $\bu_i\in S$ and scalars $b_i$.
Then $\bv_1 + \bv_2 = (a_1 + b_1)\bu_1 + \cdots + (a_k + b_k)\bu_k = c_1\bu_1 + \cdots + c_k\bu_k$ for scalars $a_i+b_i=c_i$.
So $\bv_1 + \bv_2 \in\vspan(S) = V$.
##### Exercise 3(b)
證明若條件 2 成立則條件 1 成立。
<!-- eng start -->
Show that Condition 2 implies Condition 1.
<!-- eng end -->
**[Provided by 許豐有]**
Suppose $V$ is a nonempty subset of $\mathbb{R}^n$ and is closed under scalar multiplication and vector addition.
It is enough to show that $V = \vspan(V)$.
**$V\subseteq\vspan(V)$**
Each element in $V$ is linear combination of $V$ and is in $\vspan(V)$, so $V\subseteq\vspan(V)$.
**$\vspan(V)\subseteq V$**
Let $\bu$ be an element of $\vspan(V)$.
Then $\bu$ can be written as $c_1\bu_1 + \cdots + c_k\bu_k$ for some vectors $\bu_i\in V$ and scalars $c_i$.
Since $V$ is closed under scalar multiplication and vector addition, we know $\bu\in V$.
##### Exercise 3(c)
判斷 $\emptyset$ 是否為一子空間。
<!-- eng start -->
Check if $\emptyset$ is a subspace.
<!-- eng end -->
**[Provided by 許豐有]**
Since $\emptyset$ does not match "$V$ is a nonempty subset" in Condition 2, $\emptyset$ is not a subspace.
##### Exercise 3(d)
判斷 $\{\bzero\}$ 是否為一子空間。
<!-- eng start -->
Check if $\{\bzero\}$ is a subspace.
<!-- eng end -->
**[Provided by 許豐有]**
Because we vacuously define $\vspan(\emptyset) = \{\bzero\}$, $\{\bzero\}$ is a subspace.
##### Exercise 3(e)
判斷 $\left\{\begin{bmatrix}1\\1\\1\end{bmatrix}\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{\begin{bmatrix}1\\1\\1\end{bmatrix}\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
When we apply the vector addition, we can get
$\begin{bmatrix}1\\1\\1\end{bmatrix} +\begin{bmatrix}1\\1\\1\end{bmatrix}
=\begin{bmatrix}2\\2\\2\end{bmatrix}.$
However, $\begin{bmatrix}2\\2\\2\end{bmatrix}$ is not in the set, so it is not a subspace.
##### Exercise 3(f)
判斷 $\left\{t\begin{bmatrix}1\\1\\1\end{bmatrix} : t\in\mathbb{R}\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{t\begin{bmatrix}1\\1\\1\end{bmatrix} : t\in\mathbb{R}\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
We can see that the set contains the origin by choosing $t = 0$.
Let $\bv_1,\bv_2\in \left\{t\begin{bmatrix}1\\1\\1\end{bmatrix} :t\in\mathbb{R}\right\}.$
We may assume
$$
\bv_1 = t_1\begin{bmatrix}1\\1\\1\end{bmatrix},
\bv_2 = t_2\begin{bmatrix}1\\1\\1\end{bmatrix}
$$
for some $t_1,t_2\in\mathbb{R}$.
Then
$$
\bv_1 + \bv_2 = \begin{bmatrix}t_1\\t_1\\t_1\end{bmatrix} +\begin{bmatrix}t_2\\t_2\\t_2\end{bmatrix} = \begin{bmatrix}t_1 + t_2\\t_1 + t_2\\t_1 + t_2\end{bmatrix} = t_1 + t_2\begin{bmatrix}1\\1\\1\end{bmatrix}\in\left\{t\begin{bmatrix}1\\1\\1\end{bmatrix} :t\in\mathbb{R}\right\}
$$
On the other hand, suppose
$$
\bv_3=t_3\begin{bmatrix}1\\1\\1\end{bmatrix} \in \left\{t\begin{bmatrix}1\\1\\1\end{bmatrix} :t\in\mathbb{R}\right\}
$$
for some $t_3\in\mathbb{R}$ and $k$ is a real number. Then
$$
k\bv_3= kt_3 \begin{bmatrix}1\\1\\1\end{bmatrix}
$$
is again a vector in $\left\{t\begin{bmatrix}1\\1\\1\end{bmatrix} :t\in\mathbb{R}\right\}$.
Therefore, $\left\{t\begin{bmatrix}1\\1\\1\end{bmatrix} : t\in\mathbb{R}\right\}$ is a subspace.
##### Exercise 3(g)
判斷 $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x^2 + y^2 + z^2 = 1\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x^2 + y^2 + z^2 = 1\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
Let $\bv_1=\begin{bmatrix}1\\0\\0\end{bmatrix}.$ Then $2\bv_1=\begin{bmatrix}2\\0\\0\end{bmatrix}.$
But $\begin{bmatrix}2\\0\\0\end{bmatrix}$ is not in the $x^2 + y^2 + z^2 =1.$
It does not close under scalar multiplication, so it is not a subspace.
##### Exercise 3(h)
判斷 $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x^2 + y^2 + z^2 \geq 1\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x^2 + y^2 + z^2 \geq 1\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
By the definition of subspace, it should contain the orgin.
But $\begin{bmatrix}0\\0\\0\end{bmatrix}$ is not the solution of $x^2 + y^2 + z^2 \geq 1.$
We can know
$\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x^2 + y^2 + z^2 \geq 1\right\}$ is not a subspace.
##### Exercise 3(i)
判斷 $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x \geq 0\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x \geq 0\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
Let $\bv_1=\begin{bmatrix}1\\0\\0\end{bmatrix}$ such that $\bv_1$ is in the $x\geq 0.$
Let $k=-1.$
Then $-1\bv_1=\begin{bmatrix}-1\\0\\0\end{bmatrix}.$
We can know $\begin{bmatrix}-1\\0\\0\end{bmatrix}$ is not in $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x \geq 0\right\}$ and the set is not closed under scalar multiplication, so it is not a subspace.
##### Exercise 3(j)
判斷 $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 0\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 0\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
1. We can know the equation contains the orgin.
2. Let $\bv_1=\begin{bmatrix}x_1\\y_1\\z_1\end{bmatrix},$ $\bv_2=\begin{bmatrix}x_2\\y_2\\z_2\end{bmatrix},$ such that $\bv_1$ and $\bv_2$ is in $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 0\right\}.$
Then for any $c_1,c_2\in\mathbb{R}$ we know $c_1\bv_1=c_1\begin{bmatrix}x_1\\y_1\\z_1\end{bmatrix}$, $c_2\bv_2=c_2\begin{bmatrix}x_2\\y_2\\z_2\end{bmatrix}$, and $c_1\bv_1+c_2\bv_2=\begin{bmatrix}c_1x_1+ c_2x_2\\c_1y_1+c_2y_2\\c_1z_1+c_2z_2\end{bmatrix}$.
Thus, we have
$$
\begin{aligned}
&\mathrel{\phantom{=}} (c_1x_1+c_2x_2)+(c_1y_1+c_2y_2)+(c_1z_1+c_2z_2) \\
&= c_1(x_1+y_1+z_1)+c_2(x_2+y_2+z_2) \\
&= 0
\end{aligned}
$$
since $x_1+y_1+z_1=0,$ and $x_2+y_2+z_2=0.$
Therefore, we know that $c_1\bv_1+c_2\bv_2$ is in the $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 0\right\}$, and it is closed under vector addition and scalar multiplication, so it is a subspace.
##### Exercise 3(k)
判斷 $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 1\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 1\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
By the definition of subspace, it should contain the orgin.
But $\begin{bmatrix}0\\0\\0\end{bmatrix}$ is not a solution of $x + y + z = 1.$
We can know
$\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : x + y + z = 1\right\}$ is not a subspace.
##### Exercise 3(l)
判斷 $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} :
\begin{aligned}
x + y + z &= 0 \\
x + 2y + 3z &= 0
\end{aligned}
\right\}$ 是否為一子空間。
<!-- eng start -->
Check if $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} :
\begin{aligned}
x + y + z &= 0 \\
x + 2y + 3z &= 0
\end{aligned}
\right\}$ is a subspace.
<!-- eng end -->
**[由鄭宗祐提供]**
**Answer**
1. We can know the equation contains the orgin.
2. Let $\bv_1=\begin{bmatrix}x_1\\y_1\\z_1\end{bmatrix},$ $\bv_2=\begin{bmatrix}x_2\\y_2\\z_2\end{bmatrix},$ such that $\bv_1$ and $\bv_2$ is in $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} : \begin{aligned}
x + y + z &= 0 \\
x + 2y + 3z &= 0
\end{aligned}
\right\}.$
Then for any $c_1,c_2\in\mathbb{R},$ we know $c_1\bv_1=c_1\begin{bmatrix}x_1\\y_1\\z_1\end{bmatrix}$, $c_2\bv_2=c_2\begin{bmatrix}x_2\\y_2\\z_2\end{bmatrix}$, and $c_1\bv_1+c_2\bv_2=\begin{bmatrix}c_1x_1+ c_2x_2\\c_1y_1+c_2y_2\\c_1z_1+c_2z_2\end{bmatrix}$.
Thus, we have
$$
\begin{aligned}
&\mathrel{\phantom{=}} (c_1x_1+c_2x_2)+(c_1y_1+c_2y_2)+(c_1z_1+c_2z_2) \\
&= c_1(x_1+y_1+z_1)+c_2(x_2+y_2+z_2) \\
&= 0
\end{aligned}
$$
since $x_1+y_1+z_1=0,$ and $x_2+y_2+z_2=0,$
and
$$
\begin{aligned}
&\mathrel{\phantom{=}} (c_1x_1+c_2x_2)+2(c_1y_1+c_2y_2)+3(c_1z_1+c_2z_2) \\
&=c_1(x_1+2y_1+3z_1)+ c_2(x_2+2y_2+3z_2)\\
&=0
\end{aligned}
$$
since $x_1+2y_1+3z_1=0,$ and $x_2+2y_2+3z_2=0.$
Therefore, we know that $c_1\bv_1+c_2\bv_2$ is in the $\left\{\begin{bmatrix}x\\y\\z\end{bmatrix} :
\begin{aligned}
x + y + z &= 0 \\
x + 2y + 3z &= 0
\end{aligned}
\right\}$, and it is closed under vector addition and scalar multiplication, so it is a subspace.
##### Exercise 4(a)
證明對任何 $S\subseteq\mathbb{R}^n$ 都有 $\vspan(\vspan(S)) = \vspan(S)$。
<!-- eng start -->
Show that $\vspan(\vspan(S)) = \vspan(S)$ for any subset $S\subseteq\mathbb{R}^n$.
<!-- eng end -->
##### Exercise 4(b)
令 $S\subseteq\mathbb{R}^n$。
證明以下敘述等價:
1. $\bw\in\vspan(S)$.
2. $\vspan(S\cup\{\bw\}) = \vspan(S)$.
<!-- eng start -->
Let $S\subseteq\mathbb{R}^n$. Show the following statements are equivalent.
1. $\bw\in\vspan(S)$.
2. $\vspan(S\cup\{\bw\}) = \vspan(S)$.
<!-- eng end -->
:::info
Group:
- cooperation: 1
- 4 problems:
- 4 after revision
- ~~1 (revise to get better scores).~~
Moderator: 0.5
Quality control: 1
:::