or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
線性函數
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}}\)
Main idea
Let \(U\) and \(V\) be two vector spaces.
A function \(f: U\rightarrow V\) is linear if
\[\begin{aligned} f({\bf u}_1 + {\bf u}_2) &= f({\bf u}_1) + f({\bf u}_2) \\ f(k{\bf u}) &= kf({\bf u}) \\ \end{aligned} \] for any vectors \({\bf u}, {\bf u}_1, {\bf u}_2\in U\) and scalar \(k\in\mathbb{R}\).
Let \(f : U \rightarrow V\) be a linear function.
The kernel of \(f\) is \(\operatorname{ker}(f) = \{{\bf u}\in U: f({\bf u}) = {\bf 0}\}\).
Recall that \(\operatorname{range}(f) = \{ f({\bf u}) : {\bf u}\in U \}\).
Indeed, \(\operatorname{ker}(f)\) is a subspace of \(U\) and \(\operatorname{range}(f)\) is a subspace of \(V\).
Thus, we define the rank of \(f\) as \(\operatorname{rank}(f) = \dim(\operatorname{range}(f))\) and
the nullity of \(f\) as \(\operatorname{null}(f) = \dim(\operatorname{ker}(f))\).
From the definition, \(f\) is surjective if and only if \(\operatorname{range}(f) = V\), or, equivalently, \(\operatorname{rank}(f) = \dim(V)\).
On the other hand, it is also known that \(f\) is injective if and only if \(\operatorname{ker}(f) = \{{\bf 0}\}\), or, equivalently, \(\operatorname{null}(f) = 0\).
Thanks to the structure of a linear function, the function values of a basis of \(U\) is enough to determine the function.
Let \(\beta = \{{\bf u}_1, \ldots, {\bf u}_n\}\) be a basis of \(U\) and \(f : U\rightarrow V\) a linear function.
If \(f({\bf u}_1) = {\bf v}_1\), \(\ldots\), \(f({\bf u}_n) = {\bf v}_n\), then
\[f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n) = c_1{\bf v}_1 + \cdots + c_n{\bf v}_n \] is uniquely determined, since every vector \({\bf u}\) can be written as a linear combinatoin \(c_1{\bf u}_1 + \cdots + c_m{\bf u}_m\) of \(\beta\) for some \(c_1,\ldots, c_n\in\mathbb{R}\).
Side stories
Experiments
Exercise 1
執行以下程式碼。
假設已知 \(f\) 為一從 \(\mathbb{R}^3\) 到 \(\mathbb{R}^4\) 的線性函數。
令 \(\beta = \{{\bf e}_1, {\bf e}_2, {\bf e}_3\}\) 為 \(I_3\) 的行向量集合﹐其為 \(\mathbb{R}^3\) 的基底。
Exercise 1(a)
求 \(f(3{\bf e}_1 + 2{\bf e}_2)\)。
\(Ans:\)
因為 \(f\) 為線性函數,
所以 \(f(3{\bf e}_1 + 2{\bf e}_2)=f(3{\bf e}_1)+f(2{\bf e}_2)=3f({\bf e}_1)+2f ({\bf e}_2)\)。
而 \(f({\bf e}_1)=(1,-5,15,-12)、f({\bf e}_2)=(-5,26,-78,63)\),
則 \(f(3{\bf e}_1 + 2{\bf e}_2)=3f({\bf e}_1)+2f ({\bf e}_2)=(-7,37,-111,90)\)。
Exercise 1(b)
求 \(\mathbb{R}^3\) 中的一個非零向量 \({\bf u}\) 使得 \(f({\bf u}) = {\bf 0}\)。
\(Ans:\)
令 \(f({\bf x}) = A{\bf x}\),
根據題目 \(f({\bf u}) = {\bf 0}\) ,所以 \(A{\bf u} = {\bf 0}\) ,也就是 \(\ker({A}) = {\bf 0}\)
因為條件 \(\beta = \{{\bf e}_1, {\bf e}_2, {\bf e}_3\}\) 為 \(I_3\) 的行向量集合,
且 \(f({\bf e}_1)=(1,-5,15,-12)、f({\bf e}_2)=(-5,26,-78,63)、f({\bf e}_3)=(-22,115,-345,279)\),
所以矩陣
\[AI_3 =\begin{bmatrix} 1 & -5 & -22\\ -5 & 26 & 115\\ 15 & -78 & -345\\ -12 & 63 & 279 \end{bmatrix} = A。 \]
找到矩陣 \(A\) 的最簡階梯形式 \(R = \begin{bmatrix} 1 & 0 & 3\\ 0 & 1 & 5\\ 0 & 0 & 0\\ 0 & 0 & 0 \end{bmatrix}\)。
將自由變數設為 \(1\) 可以找到 \(A{\bf u} = 0\) 的其中一個解 \({\bf u} = (-3,-5,1)\)。
Exercise 1©
找一個矩陣 \(A\) 使得對所有向量 \({\bf u}\in\mathbb{R}^3\) 都有 \(f({\bf u}) = A{\bf u}\)。
\(Ans:\)
因為條件 \(\beta = \{{\bf e}_1, {\bf e}_2, {\bf e}_3\}\) 為 \(I_3\) 的行向量集合,
且 \(f({\bf e}_1)=(1,-5,15,-12)、f({\bf e}_2)=(-5,26,-78,63)、f({\bf e}_3)=(-22,115,-345,279)\)。
所以矩陣
\(AI_3=\begin{bmatrix} 1 & -5 & -22\\ -5 & 26 & 115\\ 15 & -78 & -345\\ -12 & 63 & 279 \end{bmatrix} = A\)。
Exercises
Exercise 2
判斷以下函數是否線性。
如函數為線性,有以下特性:
For any \({\bf u}_1, {\bf u}_2 \in U\) , \(f({\bf u}_1+{\bf u}_2)=f({\bf u}_1)+f({\bf u}_2)\) and for any \(k \in \mathbb{R}\) , \(f(k{\bf u})=kf({\bf u})\).
Exercise 2(a)
判斷 \(f: \mathbb{R}\rightarrow\mathbb{R}\) 且 \(f(x) = 3x + 5\) 是否線性。
\(Ans:\)
因為 \(f(kx) = 3kx + 5\),而 \(kf(x) = 3kx + 5k\),所以 \(f(kx) \neq kf(x)\)。
故 \(f\) 不為線性。
Exercise 2(b)
判斷 \(f: \mathbb{R}\rightarrow\mathbb{R}\) 且 \(f(x) = 3x\) 是否線性。
\(Ans:\)
因為 \(f(kx) = 3kx = kf(x)\) 而且 \(f(x_1+x_2) = 3x_1 + 3x_2 = f(x_1) + f(x_2)\),滿足定義, 故 \(f\) 為線性。
Exercise 2©
判斷 \(f: \mathbb{R}\rightarrow\mathbb{R}\) 且 \(f(x) = x^2\) 是否線性。
\(Ans:\)
因為 \(f(x_1 + x_2) = (x_1 + x_2)^2 = x_1^2 + x_2^2 + 2x_1x_2 = f(x_1)+f(x_2)+2x_1x_2\),
得到 \(f(x_1+x_2)\neq f(x_1) + f(x_2)\),
故 \(f\) 不為線性。
Exercise 2(d)
判斷 \(f: \mathbb{R}^2\rightarrow\mathbb{R}\) 且 \(f(x,y) = x^2 + y^2\) 是否線性。
\(Ans:\)
因為 \(f(kx,ky) = k^2x^2 + k^2y^2\) , 而 \(kf(x,y) = kx^2 + ky^2\), 得到 \(kf(x,y) \neq f(kx,ky)\),
故 \(f\) 不為線性。
Exercise 2(e)
判斷 \(f: \mathbb{R}^2\rightarrow\mathbb{R}\) 且 \(f(x,y) = 3x + 2y\) 是否線性。
aligned
整理好\(Ans:\)
因為 \(kf(x,y) = 3kx + 2ky = f(kx,ky)\) 且
\[\begin{align} f(x_1 + x_2,y_1 + y_2) & = 3(x_1 + x_2) + 2(y_1 + y_2) \\ & = 3x_1 + 3x_2 + 2y_1 + 2y_2 \\ & = f(x_1,y_1) + f(x_2,y_2), \end{align} \] 滿足定義。
故 \(f\) 為線性。
Exercise 2(f)
判斷 \(f: \mathbb{R}^2\rightarrow\mathbb{R}\) 且 \(f(x,y) = 3x + 2y + 1\) 是否線性。
\(Ans:\)
因為 \(kf(x,y) = 3kx + 2ky + k \neq f(kx,ky)\),
故 \(f\) 不為線性。
Exercise 3
令 \({\bf u}_1, {\bf u}_2, {\bf u}_3\) 為 \(U\) 中的向量﹐
已知 \(f\) 為從 \(U\) 到 \(\mathbb{R}^4\) 的線性函數且
\[\begin{aligned} f({\bf u}_1) &= (1,1,1,1) \\ f({\bf u}_2) &= (1,2,3,4) \\ f({\bf u}_3) &= (4,3,2,1) \\ \end{aligned} \] 求 \(f(3{\bf u}_1 + 2{\bf u}_2 + 2{\bf u}_3)\)。
aligned
整理\(Ans:\)
因為 \(f\) 為線性函數,
所以
\[\begin{aligned} f(3{\bf u}_1 + 2{\bf u}_2 + 2{\bf u}_3) &= f(3{\bf u}_1)+f(2{\bf u}_2)+f(2{\bf u}_3) \\ &= 3f({\bf u}_1)+2f({\bf u}_2)+2f({\bf u}_3) \\ &=(13,13,13,13). \end{aligned} \]
Exercise 4
令 \(f: U\rightarrow V\) 為一線性函數。
證明以下敘述等價:
\(Ans:\)
證明 \(1.\) 和 \(2.\) 等價:
\(1. \implies 2.\)
若存在 \({\bf v} \in \ker(f)\) 且 \({\bf v} \neq {\bf 0}\),
則 \(f({\bf v}) = {\bf 0}\)。
同時 \(f({\bf 0}) = f(0 \cdot {\bf 0}) = 0 \cdot f({\bf 0}) = {\bf 0}\),
所以 \({\bf v} \neq {\bf 0}\) 且 \(f({\bf v}) = f({\bf 0})\),
得到 \(f\) 不為嵌射的線性函數。
\(2. \implies 1.\)
若 \({\bf u_1} \neq {\bf u_2} \in U\),
則 \({\bf u_1} -{\bf u_2} \neq {\bf 0}\)。
因為 \(\ker(f) = {\bf 0}\),
所以 \(f({\bf u_1} - {\bf u_2}) \neq {\bf 0}\)。
因此可以知道 \(f({\bf u_1}) \neq f({\bf u_2})\),
得到 \(f\) 為嵌射的線性函數。
故 \(1.\) 和 \(2.\) 等價。
而根據線性函數定義 \(\operatorname{null}(f) = \operatorname{dim}(\ker(f))\),
所以當 \(\ker(f) = {0}\) 時 \(\operatorname{null}(f) = 0\),
得到 \(2.\) 和 \(3.\) 等價。
因為 \(1.\) 和 \(2.\) 等價且 \(2.\) 和 \(3.\) 也等價,
故 \(1.\), \(2.\), \(3.\) 互為等價。
Exercise 5
嵌射顧名思義有點像是把定義域嵌入到對應域之中﹐所以很多性質都會被保留下來。
Exercise 5(a)
令 \(f: U\rightarrow V\) 為一線性函數。
證明若 \(f\) 是嵌射且
\(\alpha = \{{\bf u}_1,\ldots,{\bf u}_k\}\) 為 \(U\) 中的一線性獨立集﹐
則 \(f(\alpha)\) 是 \(V\) 中的一線性獨立集。
令 \(c_1f({\bf u}_1) + \cdots +c_kf({\bf u}_k) = \bf0\)。
因為 \(f\) 線性,所以 \(f(c_1{\bf u}_1 + \cdots + c_k\bu_k) = \bf0\)。
因為 \(f\) 為嵌射,由上一題我們知道 \(\ker(f) = \{ \bzero \}\),
所以 \(c_1\bu_1 + \cdots + c_k{\bf u}_k = \bf0\)。
因為 \(\alpha\) 獨立,所以 \(c_1 = \cdots = c_k = 0\)。
因此 \(f(\alpha)\) 是 \(V\) 中的一線性獨立集。
Exercise 5(b)
令 \(f: U\rightarrow V\) 為一線性函數。
證明若 \(f\) 是嵌射且
\(\alpha = \{{\bf u}_1,\ldots,{\bf u}_k\}\) 為 \(U\) 的一組基底﹐
則 \(f(\alpha)\) 是 \(\operatorname{range}(f)\) 的一組基底。
Claim: \(\vspan(f(\alpha))\subseteq \operatorname{range}(f)\)
因為 \(f(\alpha)\subseteq \operatorname{range}(f)\),
所以 \(\vspan(f(\alpha))\subseteq \operatorname{range}(f)\)。
Claim: \(\operatorname{range}(f) \subseteq \vspan(f(\alpha))\)
令 \(\bv \in \operatorname{range}(f)\),則存在 \(\bu\in U\) 使得 \(f({\bf u}) = \bv\)。
因為 \(\alpha\) 為基底,所以 \(\bu\) 可寫成 \(c_1{\bf u}_1 + \cdots + c_k{\bf u}_k = \bu\),
則 \(\bv = f({\bf u}) = f(c_1{\bf u}_1 + \cdots + c_k{\bf u}_k)\),
故 \(\bv = c_1f({\bf u}_1) + \cdots +c_kf({\bf u}_k)\)。
因此 \(\bv \in \vspan(f(\alpha))\),
得到 \(\operatorname{range}(f) \subseteq \vspan(f(\alpha))\)。
Exercise 6
依照步驟確認線性擴充出來的函數符合我們要的性質。
令 \(U\) 和 \(V\) 為兩向量空間
且 \(\beta = \{ {\bf u}_1, \ldots, {\bf u}_n \}\) 為 \(U\) 的一組基底。
若 \(f : U \rightarrow V\) 是一個線性函數
且已知 \(f({\bf u}_1) = {\bf v}_1\), \(\ldots\), \(f({\bf u}_n) = {\bf v}_n\)。
Exercise 6(a)
說明對任何 \(\beta\) 的線性組合﹐\(f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n)\) 必須是 \(c_1{\bf v}_1 + \cdots + c_n{\bf v}_n\)。
\(Ans:\)
由 \(f : U \rightarrow V\) 是一個線性函數得到
\(f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n) = f(c_1{\bf u}_1) + \cdots + f(c_n{\bf u}_n) = c_1f({\bf u}_1) + \cdots + c_nf({\bf u}_n)\),
又已知 \(f({\bf u}_1) = {\bf v}_1\), \(\ldots\), \(f({\bf u}_n) = {\bf v}_n\),
則 \(c_1f({\bf u}_1) + \cdots + c_nf({\bf u}_n) = c_1{\bf v}_1 + \cdots + c_n{\bf v}_n\),
所以 \(f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n)\) 必須是 \(c_1{\bf v}_1 + \cdots + c_n{\bf v}_n\)。
Exercise 6(b)
說明 \[f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n) = c_1{\bf v}_1 + \cdots + c_n{\bf v}_n \] 這個公式是定義完善的函數。
(每個 \(U\) 中的元素都有被定義到、
且線性組合的不同表示法不會造成任何問題。)
\(Ans:\)
由於 \(\beta\) 為 \(U\) 之基底,所以任何 \(U\) 中的元素都可以寫成 \(\beta\) 的線性組合,而且係數唯一,一次 \(U\) 中的所有元素都可被題目中 \(f\) 的公式完善定義出來。
Exercise 6©
說明 \[f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n) = c_1{\bf v}_1 + \cdots + c_n{\bf v}_n \] 這個公式是定義出來的函數是線性的。
aligned
整理數學式\(Ans:\)
若要說明函數是線性的,則必須滿足以下兩點。
設以下方程式:
對於任何的 \(c_1 \cdots c_n\) 及 \(d_1 \cdots d_n\) 屬於實數,
已知 \(f({\bf u}_1) = {\bf v}_1\), \(\ldots\), \(f({\bf u}_n) = {\bf v}_n\),
則第一點: \[\begin{aligned} f((c_1\bu_1 + \cdots + c_n\bu_n) + (d_1\bu_1 + \cdots + d_n\bu_n)) &=f((c_1+d_1){\bf u}_1 + \cdots + (c_n+d_n){\bf u}_n) \\ &= (c_1+d_1){\bf v}_1 + \cdots + (c_n+d_n){\bf v}_n \\ &=(c_1{\bf v}_1+d_1{\bf v}_1) + \cdots + (c_n{\bf v}_n+d_n{\bf v}_n) \\ &=f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n)+f(d_1{\bf u}_1 + \cdots + d_n{\bf u}_n). \end{aligned} \]
第二點:
對於任何實數 \(k\) 都可驗證 \[\begin{aligned} f(k(c_1\bu_1 + \cdots + c_n\bu_n)) &= kc_1\bv_1+\cdots+kc_n\bv_n \\ &= kf(c_1\bu_1 + \cdots + c_n\bu_n). \end{aligned} \]
故此公式\[f(c_1{\bf u}_1 + \cdots + c_n{\bf u}_n) = c_1{\bf v}_1 + \cdots + c_n{\bf v}_n\] 定義的函數為線性。
目前分數 5.5