Matrix representation in $\mathbb{R}^n$
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, random_good_matrix
Recall that if $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ is a linear function and $\{ \be_1,\ldots, \be_n\}$ is the standard basis of $\mathbb{R}^n$, then the matrix
$$ [f] = \begin{bmatrix} | & ~ & | \\ f(\be_1) & \cdots & f(\be_n) \\ | & ~ & | \\ \end{bmatrix} $$has the property that $f(\bb) = [f]\bb$ for all $\bb\in\mathbb{R}^n$.
Sometimes $f(\be_i)$ cannot be easily found, while the function $f$ is described by the bases of $\mathbb{R}^n$ and $\mathbb{R}^m$ instead.
Let $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ be a linear function,
$\alpha = \{ \bv_1, \ldots, \bv_n \}$ be a basis of $\mathbb{R}^n$, and
$\beta$ a basis of $\mathbb{R}^m$.
Then the matrix
has the property that $[f(\bb)]_\beta = [f]_\alpha^\beta [\bb]_\alpha$.
Therefore, we call $[f]_\alpha^\beta$ the matrix representation of $f$ with respect to $\alpha$ and $\beta$.
The equality can be visualized by the following diagram.
$$ \begin{array}{ccc} \bb & \xrightarrow{f} & f(\bb) \\ \downarrow & ~ & \downarrow \\ [\bb]_\alpha & \xrightarrow{[f]_\alpha^\beta\cdot\square} & [f(\bb)]_\beta \\ \end{array} $$Let $\mathcal{E}_n$ and $\mathcal{E}_m$ be the standard basis of $\mathbb{R}^n$ and $\mathbb{R}^m$, respectively. Since we know
We know $[f] = ([\idmap]_{\mathcal{E}_m}^\beta)^{-1} [f]_\alpha^\beta [\idmap]_{\mathcal{E}_n}^\alpha = [\idmap]_\beta^{\mathcal{E}_m} [f]_\alpha^\beta ([\idmap]_\alpha^{\mathcal{E}_n})^{-1}$.
執行以下程式碼。
已知 $f$ 為 $\mathbb{R}^3$ 到 $\mathbb{R}^2$ 的線性函數﹐
而 $\alpha$ 和 $\beta$ 分別為 $\mathbb{R}^3$ 和 $\mathbb{R}^2$ 的一組基底。
### code
set_random_seed(0)
print_ans = False
m,n = 2,3
alpha = random_good_matrix(n,n,n, bound=3)
beta = random_good_matrix(m,m,m, bound=3)
A = matrix(m, random_int_list(m*n))
v = vector(random_int_list(n, 3))
b = alpha * v
print("alpha contains %s vectors:"%n)
for j in range(n):
print("v%s ="%(j+1), alpha.column(j))
print("beta contains %s vectors:"%m)
for i in range(m):
print("u%s ="%(i+1), beta.column(i))
for j in range(n):
print( "f(v%s) = "%(j+1) + " + ".join("%s u%s"%(A[i,j],i+1) for i in range(m)) )
print("b =", b)
if print_ans:
print("[b]_alpha =", v)
print("[f(b)]_beta =", A*v)
print("f(b) =", beta * A * v)
print("[f]_alpha^beta =")
show(A)
print("[f] =")
show(beta * A * alpha.inverse())
求 $[\bb]_\alpha$、$[f(\bb)]_\beta$、及 $f(\bb)$。
Find $[\bb]_\alpha$, $[f(\bb)]_\beta$, and $f(\bb)$.求 $[f]_\alpha^\beta$ 及 $[f]$。
Find $[f]_\alpha^\beta$ 及 $[f]$.令 $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ 為一線性函數、
$\alpha = \{\bv_1, \ldots, \bv_n\}$ 為 $\mathbb{R}^n$ 的一組基底、
$\beta = \{\bu_1, \ldots, \bu_m\}$ 為 $\mathbb{R}^m$ 的一組基底。
令 $m = n = 3$ 且
$\alpha = \beta$ 為
的各行向量。
已知
$f(\bv_1) = \bu_1$、
$f(\bv_2) = \bu_2$、
$f(\bv_3) = \bzero$。
求 $[f]_\alpha^\beta$ 及 $[f]$ 並說明 $f$ 的作用。
令 $m = n = 3$ 且
$\alpha = \beta$ 為
的各行向量。
已知
$f(\bv_1) = \bu_1$、
$f(\bv_2) = \bu_2$、
$f(\bv_3) = -\bu_3$。
求 $[f]_\alpha^\beta$ 及 $[f]$ 並說明 $f$ 的作用。
令 $m = n = 3$ 且
$\alpha = \beta$ 為
的各行向量。
已知
$f(\bv_1) = \bu_2$、
$f(\bv_2) = -\bu_1$、
$f(\bv_3) = \bu_3$。
求 $[f]_\alpha^\beta$ 及 $[f]$ 並說明 $f$ 的作用。
令 $m = 3$、$n = 2$ 且
$\alpha$ 為
的各行向量、
$\beta$ 為
的各行向量。
已知
$f(\bv_1) = 3\bu_1$、
$f(\bv_2) = 4\bu_2$、
$f(\bv_3) = \bzero$。
求 $[f]_\alpha^\beta$ 及 $[f]$。
若 $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ 為一線性函數。
而 $\mathcal{E}_n$ 和 $\mathcal{E}_m$ 分別為 $\mathbb{R}^n$ 和 $\mathbb{R}^m$ 的一組基底。
說明 $[f]$ 就是 $[f]_{\mathcal{E}_n}^{\mathcal{E}_m}$。