Linear function
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_good_matrix, kernel_matrix
Let $U$ and $V$ be two vector spaces.
A function $f: U\rightarrow V$ is linear if
$$\begin{aligned}
f(\bu_1 + \bu_2) &= f(\bu_1) + f(\bu_2) \\
f(k\bu) &= kf(\bu) \\
\end{aligned}$$
for any vectors $\bu, \bu_1, \bu_2\in U$ and scalar $k\in\mathbb{R}$.
Let $f : U \rightarrow V$ be a linear function.
The kernel of $f$ is $\ker(f) = \{\bu\in U: f(\bu) = \bzero\}$.
Recall that $\range(f) = \{ f(\bu) : \bu\in U \}$.
Indeed, $\ker(f)$ is a subspace of $U$ and $\range(f)$ is a subspace of $V$.
Thus, we define the rank of $f$ as $\rank(f) = \dim(\range(f))$ and
the nullity of $f$ as $\nul(f) = \dim(\ker(f))$.
From the definition, $f$ is surjective if and only if $\range(f) = V$, or, equivalently, $\rank(f) = \dim(V)$.
On the other hand, it is also known that $f$ is injective if and only if $\ker(f) = \{\bzero\}$, or, equivalently, $\nul(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 = \{\bu_1, \ldots, \bu_n\}$ be a basis of $U$ and $f : U\rightarrow V$ a linear function.
If $f(\bu_1) = \bv_1$, $\ldots$, $f(\bu_n) = \bv_n$, then
$$f(c_1\bu_1 + \cdots + c_n\bu_n) = c_1\bv_1 + \cdots + c_n\bv_n$$
is uniquely determined, since every vector $\bu$ can be written as a linear combinatoin $c_1\bu_1 + \cdots + c_m\bu_m$ of $\beta$ for some $c_1,\ldots, c_n\in\mathbb{R}$.
執行以下程式碼。
假設已知 $f$ 為一從 $\mathbb{R}^3$ 到 $\mathbb{R}^4$ 的線性函數。
令 $\beta = \{\be_1, \be_2, \be_3\}$ 為 $I_3$ 的行向量集合﹐其為 $\mathbb{R}^3$ 的基底。
Run the code below. Suppose $f: \mathbb{R}^3 \rightarrow \mathbb{R}^4$ is a linear function. Let $\beta = \{\be_1, \be_2, \be_3\}$ be the columns of $I_3$, which is a basis of $\mathbb{R}^3$.
### code
set_random_seed(0)
print_ans = False
m,n,r = 4,3,2
A = random_good_matrix(m,n,r)
for i in range(n):
print("f(e%s) ="%(i+1), A.column(i))
if print_ans:
print("f(3e1 + 2e2) = 3f(e1) + 2f(e2) =", 3*A.column(0) + 2*A.column(1))
print("To make f(u) = 0 for some nonzero u, one may choose u =", kernel_matrix(A).column(0))
print("A =")
show(A)
求 $\mathbb{R}^3$ 中的一個非零向量 $\bu$ 使得 $f(\bu) = \bzero$。
Find a nonzero vector $\bu\in\mathbb{R}^3$ such that $f(\bu) = \bzero$.
找一個矩陣 $A$ 使得對所有向量 $\bu\in\mathbb{R}^3$ 都有 $f(\bu) = A\bu$。
Find a matrix $A$ such that $f(\bu) = A\bu$ for any vector $\bu\in\mathbb{R}^3$.
判斷 $f: \mathbb{R}\rightarrow\mathbb{R}$ 且 $f(x) = 3x + 5$ 是否線性。
Let $f: \mathbb{R}\rightarrow\mathbb{R}$ be a function defined by $f(x) = 3x + 5$. Is it linear?
判斷 $f: \mathbb{R}\rightarrow\mathbb{R}$ 且 $f(x) = 3x$ 是否線性。
Let $f: \mathbb{R}\rightarrow\mathbb{R}$ be a function defined by $f(x) = 3x$. Is it linear?
判斷 $f: \mathbb{R}\rightarrow\mathbb{R}$ 且 $f(x) = x^2$ 是否線性。
Let $f: \mathbb{R}\rightarrow\mathbb{R}$ be a function defined by $f(x) = x^2$. Is it linear?
判斷 $f: \mathbb{R}^2\rightarrow\mathbb{R}$ 且 $f(x,y) = x^2 + y^2$ 是否線性。
Let $f: \mathbb{R}^2\rightarrow\mathbb{R}$ be a function defined by $f(x,y) = x^2 + y^2$. Is it linear?
判斷 $f: \mathbb{R}^2\rightarrow\mathbb{R}$ 且 $f(x,y) = 3x + 2y$ 是否線性。
Let $f: \mathbb{R}^2\rightarrow\mathbb{R}$ be a function defined by $f(x,y) = 3x + 2y$. Is it linear?
判斷 $f: \mathbb{R}^2\rightarrow\mathbb{R}$ 且 $f(x,y) = 3x + 2y + 1$ 是否線性。
Let $f: \mathbb{R}^2\rightarrow\mathbb{R}$ be a function defined by $f(x,y) = 3x + 2y + 1$. Is it linear?
令 $\bu_1, \bu_2, \bu_3$ 為 $U$ 中的向量﹐
已知 $f$ 為從 $U$ 到 $\mathbb{R}^4$ 的線性函數且
求 $f(3\bu_1 + 2\bu_2 + 2\bu_3)$。
Let $\bu_1, \bu_2, \bu_3$ be vectors in the space $U$. Suppose $f$ is a linear function from $U$ to $\mathbb{R}^4$ such that
$$ \begin{aligned} f(\bu_1) &= (1,1,1,1) \\ f(\bu_2) &= (1,2,3,4) \\ f(\bu_3) &= (4,3,2,1) \\ \end{aligned} $$Find $f(3\bu_1 + 2\bu_2 + 2\bu_3)$.
令 $f: U\rightarrow V$ 為一線性函數。
證明以下敘述等價:
Let $f: U\rightarrow V$ be a linear function. Show that the following are equivalent:
嵌射顧名思義有點像是把定義域嵌入到對應域之中﹐所以很多性質都會被保留下來。
The name "injection" indicates that the domain is injected, or embedded, into the codomain, so many properties of the domain preserve.
令 $f: U\rightarrow V$ 為一線性函數。
證明若 $f$ 是嵌射且
$\alpha = \{\bu_1,\ldots,\bu_k\}$ 為 $U$ 中的一線性獨立集﹐
則 $f(\alpha)$ 是 $V$ 中的一線性獨立集。
Let $f: U\rightarrow V$ be a linear function. Show that if $f$ is injective and $\alpha = \{\bu_1,\ldots,\bu_k\}$ is linearly independent in $U$, then $f(\alpha)$ is linearly independent in $V$.
令 $f: U\rightarrow V$ 為一線性函數。
證明若 $f$ 是嵌射且
$\alpha = \{\bu_1,\ldots,\bu_k\}$ 為 $U$ 的一組基底﹐
則 $f(\alpha)$ 是 $\range(f)$ 的一組基底。
Let $f: U\rightarrow V$ be a linear function. Show that if $f$ is injective and $\alpha = \{\bu_1,\ldots,\bu_k\}$ is a basis of $U$, then $f(\alpha)$ is a basis of $\range(f)$.
依照步驟確認線性擴充出來的函數符合我們要的性質。
令 $U$ 和 $V$ 為兩向量空間
且 $\beta = \{ \bu_1, \ldots, \bu_n \}$ 為 $U$ 的一組基底。
若 $f : U \rightarrow V$ 是一個線性函數
且已知 $f(\bu_1) = \bv_1$, $\ldots$, $f(\bu_n) = \bv_n$。
Use the given instructions to verify the linear extension has the desired properties. Let $U$ and $V$ be vector spaces and $\beta = \{ \bu_1, \ldots, \bu_n \}$ a basis of $U$. Suppose $f: U\rightarrow V$ is a linear function and $f(\bu_1) = \bv_1$, $\ldots$, $f(\bu_n) = \bv_n$.
說明對任何 $\beta$ 的線性組合﹐$f(c_1\bu_1 + \cdots + c_n\bu_n)$ 必須是 $c_1\bv_1 + \cdots + c_n\bv_n$。
Explain why $f(c_1\bu_1 + \cdots + c_n\bu_n)$ has to be $c_1\bv_1 + \cdots + c_n\bv_n$.
說明
$$ f(c_1\bu_1 + \cdots + c_n\bu_n) = c_1\bv_1 + \cdots + c_n\bv_n $$這個公式是定義完善的函數。
(每個 $U$ 中的元素都有被定義到、
且線性組合的不同表示法不會造成任何問題。)
Verify that
$$ f(c_1\bu_1 + \cdots + c_n\bu_n) = c_1\bv_1 + \cdots + c_n\bv_n $$is well-defined. That is, check if $f$ is defined for every vector in $U$ and check if different representations of a vector in $U$ do not result in different function values.
說明
$$ f(c_1\bu_1 + \cdots + c_n\bu_n) = c_1\bv_1 + \cdots + c_n\bv_n $$這個公式是定義出來的函數是線性的。
Verify that the function defined by
$$ f(c_1\bu_1 + \cdots + c_n\bu_n) = c_1\bv_1 + \cdots + c_n\bv_n $$is linear.