导航菜单

矩阵与线性变换

问题提出

“同学们,今天我们要学习一个非常重要的数学概念——线性变换。“我站在呼噜星球的黑板上,写下了两个关键术语。

“呼噜呼噜?“小绿人歪着头,“线性变换是什么?听起来很复杂的样子。”

“别担心,“我微笑着说,“线性变换其实描述的是一种保持基本运算规则的变换。让我们从最直观的例子开始。”

我画了一个坐标系,并在其中画了一个正方形:

graph LR
    A[正方形] --> B[变换后]
    B --> C[可能变为长方形]
    B --> D[可能旋转]
    B --> E[可能拉伸]

“看,这个正方形经过各种变换后,形状发生了变化。但有些变换具有特殊的性质——它们保持向量的加法和数乘运算。”

“呼噜呼噜!“小蓝人举手,“为什么要学习线性变换?有什么实际用途吗?”

“问得好!“我点头,“线性变换在计算机图形学、物理、经济学等领域都有广泛应用。比如,游戏中的3D图形变换,机器人运动规划,甚至量子力学中的态演化,都用到了线性变换。“

观察与猜想

“让我们先来看几个具体的例子,感受什么是线性变换。”

线性变换的直观理解

一个变换TT是线性的,如果它:

  1. 保持向量的加法运算
  2. 保持向量的数乘运算

“第一个例子:平面上的旋转变换。”

我画了一个向量v=(x,y)\mathbf{v} = (x, y),然后旋转θ\theta角得到新的向量v=(x,y)\mathbf{v}' = (x', y')

“旋转变换可以用公式表示为:

x' = x\cos\theta - y\sin\theta\\ y' = x\sin\theta + y\cos\theta \end{cases}$$" <Alert type="success" variant="soft" closable={false}> ✅ **验证线性性质**: 对于任意向量$\mathbf{u}, \mathbf{v}$和标量$c$: 1. $T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v})$ 2. $T(c\mathbf{v}) = cT(\mathbf{v})$ </Alert> "第二个例子:平面上的缩放变换。" "如果我们把每个向量都放大2倍,变换公式就是: $$T(x, y) = (2x, 2y)$$" <Definition title="缩放变换的线性性"> 对于任意$(x_1, y_1), (x_2, y_2) \in \mathbb{R}^2$和标量$c$: $$\begin{align} T((x_1, y_1) + (x_2, y_2)) &= T(x_1+x_2, y_1+y_2)\\ &= (2(x_1+x_2), 2(y_1+y_2))\\ &= (2x_1+2x_2, 2y_1+2y_2)\\ &= (2x_1, 2y_1) + (2x_2, 2y_2)\\ &= T(x_1, y_1) + T(x_2, y_2) \end{align}$$ </Definition> "第三个例子:平面上的剪切变换。" "剪切变换会让图形沿某个方向'滑动',比如: $$T(x, y) = (x + y, y)$$" <Alert type="warning" variant="soft" closable={false}> ⚠️ **注意**:不是所有变换都是线性的! 比如平移变换$T(x, y) = (x + 1, y + 1)$就不是线性的,因为它不保持向量加法: $$T((0, 0) + (1, 1)) = T(1, 1) = (2, 2)$$ 但$$T(0, 0) + T(1, 1) = (1, 1) + (2, 2) = (3, 3)$$ 两者不相等,所以平移不是线性变换。 </Alert> "现在让我们来看看这些变换有什么共同特征。" 我写下了几个线性变换的矩阵表示: 1. **旋转变换**: $$T_{\text{rot}}(\mathbf{x}) = \begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix}\mathbf{x}$$ 2. **缩放变换**: $$T_{\text{scale}}(\mathbf{x}) = \begin{pmatrix} 2 & 0\\ 0 & 2 \end{pmatrix}\mathbf{x}$$ 3. **剪切变换**: $$T_{\text{shear}}(\mathbf{x}) = \begin{pmatrix} 1 & 1\\ 0 & 1 \end{pmatrix}\mathbf{x}$$ <Definition title="线性变换的矩阵表示"> 对于$n$维空间中的线性变换$T: \mathbb{R}^n \to \mathbb{R}^m$,存在一个$m \times n$矩阵$A$,使得: $$T(\mathbf{x}) = A\mathbf{x}$$ 其中$A$被称为变换$T$的**标准矩阵**。 </Definition> "呼噜呼噜!"小红人兴奋地说,"我发现所有线性变换都能用矩阵表示!" "完全正确!"我赞赏地说,"这就是线性变换最优美的地方——**每个线性变换都对应一个矩阵,每个矩阵都对应一个线性变换**。" ## 严格证明 "现在我们来严格证明这个重要结论。" <Definition title="线性变换的定义"> 设$T: \mathbb{R}^n \to \mathbb{R}^m$是一个变换。如果对于任意$\mathbf{u}, \mathbf{v} \in \mathbb{R}^n$和标量$c$,都满足: 1. **加法保持**:$T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v})$ 2. **数乘保持**:$T(c\mathbf{v}) = cT(\mathbf{v})$ 则称$T$为**线性变换**。 </Definition> "我们的目标是证明:**每个线性变换$T: \mathbb{R}^n \to \mathbb{R}^m$都存在唯一的$m \times n$矩阵$A$,使得$T(\mathbf{x}) = A\mathbf{x}$对所有$\mathbf{x} \in \mathbb{R}^n$成立。**" <Definition title="标准向量"> 在$\mathbb{R}^n$中,标准向量$\mathbf{e}_i$是指第$i$个分量为1,其余分量为0的向量,即: $$\mathbf{e}_i = (0, \ldots, 0, 1, 0, \ldots, 0)^T$$ 其中第$i$个位置为1。 </Definition> "证明分为两步:**存在性**和**唯一性**。" ### 存在性证明 设$T: \mathbb{R}^n \to \mathbb{R}^m$是一个线性变换。 **第一步**:计算$T$在标准向量$\mathbf{e}_1, \mathbf{e}_2, \ldots, \mathbf{e}_n$上的值: $$\mathbf{a}_j = T(\mathbf{e}_j), \quad j = 1, 2, \ldots, n$$ 其中每个$\mathbf{a}_j \in \mathbb{R}^m$是一个列向量。 **第二步**:构造矩阵$A = [\mathbf{a}_1 \ \mathbf{a}_2 \ \cdots \ \mathbf{a}_n]$,即把$\mathbf{a}_1, \mathbf{a}_2, \ldots, \mathbf{a}_n$作为$A$的列向量。 **第三步**:证明对于任意$\mathbf{x} = (x_1, x_2, \ldots, x_n)^T \in \mathbb{R}^n$,都有$T(\mathbf{x}) = A\mathbf{x}$。 因为$\mathbf{x} = x_1\mathbf{e}_1 + x_2\mathbf{e}_2 + \cdots + x_n\mathbf{e}_n$,由$T$的线性性: $$\begin{align} T(\mathbf{x}) &= T(x_1\mathbf{e}_1 + x_2\mathbf{e}_2 + \cdots + x_n\mathbf{e}_n)\\ &= x_1T(\mathbf{e}_1) + x_2T(\mathbf{e}_2) + \cdots + x_nT(\mathbf{e}_n)\\ &= x_1\mathbf{a}_1 + x_2\mathbf{a}_2 + \cdots + x_n\mathbf{a}_n\\ &= A\mathbf{x} \end{align}$$ 证毕。 ### 唯一性证明 假设存在另一个$m \times n$矩阵$B$,使得$T(\mathbf{x}) = B\mathbf{x}$对所有$\mathbf{x} \in \mathbb{R}^n$成立。 那么对于每个标准向量$\mathbf{e}_j$,有: $$\mathbf{a}_j = T(\mathbf{e}_j) = B\mathbf{e}_j$$ 但$B\mathbf{e}_j$就是矩阵$B$的第$j$列向量,所以$B$的第$j$列等于$\mathbf{a}_j$。 因此$B = [\mathbf{a}_1 \ \mathbf{a}_2 \ \cdots \ \mathbf{a}_n] = A$。 证毕。 <Alert type="success" variant="soft" closable={false}> 🎯 **重要结论**:线性变换与矩阵是**一一对应**的!每个线性变换都唯一确定一个矩阵,每个矩阵都唯一确定一个线性变换。 </Alert> "现在我们来看几个具体的矩阵变换。" ### 2×2矩阵与平面变换 最常见的线性变换是$\mathbb{R}^2 \to \mathbb{R}^2$的变换,对应$2 \times 2$矩阵。 <Definition title="2×2矩阵的一般形式"> 一个$2 \times 2$矩阵的一般形式为: $$A = \begin{pmatrix} a & b\\ c & d \end{pmatrix}$$ 它对应的线性变换为: $$T_A(x, y) = (ax + by, cx + dy)$$ </Definition> "让我们来看看几种基本的2×2矩阵变换:" **1. 单位矩阵**: $$I = \begin{pmatrix} 1 & 0\\ 0 & 1 \end{pmatrix}$$ 对应的变换$T_I(x, y) = (x, y)$是**恒等变换**,保持向量不变。 **2. 对角矩阵**: $$D = \begin{pmatrix} \lambda_1 & 0\\ 0 & \lambda_2 \end{pmatrix}$$ 对应的变换$T_D(x, y) = (\lambda_1x, \lambda_2y)$是**缩放变换**。 如果$\lambda_1 = \lambda_2 = \lambda$,则是**等比例缩放**。 **3. 旋转矩阵**: $$R_{\theta} = \begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix}$$ 对应的变换是旋转$\theta$角。 **4. 剪切矩阵**: $$S = \begin{pmatrix} 1 & k\\ 0 & 1 \end{pmatrix}$$ 对应的变换$T_S(x, y) = (x + ky, y)$是**水平剪切**。 $$S = \begin{pmatrix} 1 & 0\\ k & 1 \end{pmatrix}$$ 对应的变换$T_S(x, y) = (x, kx + y)$是**垂直剪切**。 <Definition title="线性变换的基本性质"> 设$T: \mathbb{R}^n \to \mathbb{R}^m$和$S: \mathbb{R}^n \to \mathbb{R}^m$都是线性变换,则: 1. **线性组合**:$aT + bS$也是线性变换 2. **复合变换**:$T \circ S$(如果定义域匹配)是线性变换 3. **零变换**:$T(\mathbf{0}) = \mathbf{0}$ 4. **变换相加**:$(T + S)(\mathbf{x}) = T(\mathbf{x}) + S(\mathbf{x})$ 5. **标量乘法**:$(cT)(\mathbf{x}) = cT(\mathbf{x})$ </Definition> "呼噜呼噜!"小绿人问,"线性变换的组合和复合有什么区别?" "好问题!"我解释道: - **线性组合**:$(aT + bS)(\mathbf{x}) = aT(\mathbf{x}) + bS(\mathbf{x})$ - **复合变换**:$(T \circ S)(\mathbf{x}) = T(S(\mathbf{x}))$ 矩阵表示对应为: - 线性组合:$aA + bB$ - 复合变换:$AB$ "现在我们来学习单位矩阵和恒等变换。" <Definition title="单位矩阵与恒等变换"> $n \times n$单位矩阵: $$I_n = \begin{pmatrix} 1 & 0 & \cdots & 0\\ 0 & 1 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & 1 \end{pmatrix}$$ 对应的线性变换$T_{I_n}: \mathbb{R}^n \to \mathbb{R}^n$定义为: $$T_{I_n}(\mathbf{x}) = I_n\mathbf{x} = \mathbf{x}$$ 这被称为**恒等变换**,保持向量不变。 </Definition> "单位矩阵有一些非常重要的性质:" **性质1**:对于任何$n \times m$矩阵$A$,都有$I_mA = AI_n = A$。 **性质2**:恒等变换是线性变换,因为: 1. $T_I(\mathbf{u} + \mathbf{v}) = \mathbf{u} + \mathbf{v} = T_I(\mathbf{u}) + T_I(\mathbf{v})$ 2. $T_I(c\mathbf{v}) = c\mathbf{v} = cT_I(\mathbf{v})$ **性质3**:恒等变换的逆变换是它本身。 ## 结论与应用 "现在让我们通过几个例题来巩固所学知识。" ### 例题1:判断变换是否为线性变换 **问题**:判断以下变换是否为线性变换: $$T(x, y) = (2x + y, x - 3y)$$ **解答**: 根据线性变换的定义,我们需要验证: 1. **加法保持**: $$\begin{align} T((x_1, y_1) + (x_2, y_2)) &= T(x_1 + x_2, y_1 + y_2)\\ &= (2(x_1 + x_2) + (y_1 + y_2), (x_1 + x_2) - 3(y_1 + y_2))\\ &= (2x_1 + 2x_2 + y_1 + y_2, x_1 + x_2 - 3y_1 - 3y_2)\\ &= (2x_1 + y_1 + 2x_2 + y_2, x_1 - 3y_1 + x_2 - 3y_2)\\ &= (2x_1 + y_1, x_1 - 3y_1) + (2x_2 + y_2, x_2 - 3y_2)\\ &= T(x_1, y_1) + T(x_2, y_2) \end{align}$$ 2. **数乘保持**: $$\begin{align} T(c(x, y)) &= T(cx, cy)\\ &= (2(cx) + cy, cx - 3(cy))\\ &= (c(2x + y), c(x - 3y))\\ &= c(2x + y, x - 3y)\\ &= cT(x, y) \end{align}$$ 因为两个性质都满足,所以$T$是线性变换。 **矩阵表示**: $$T(x, y) = \begin{pmatrix} 2 & 1\\ 1 & -3 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix}$$ ### 例题2:求线性变换的矩阵表示 **问题**:求线性变换$T: \mathbb{R}^2 \to \mathbb{R}^3$的矩阵表示,其中: $$T(x, y) = (x + 2y, 3x - y, 2x + 4y)$$ **解答**: **第一步**:计算$T$在标准向量上的值: $$\begin{align} T(1, 0) &= (1 + 2 \times 0, 3 \times 1 - 0, 2 \times 1 + 4 \times 0) = (1, 3, 2)\\ T(0, 1) &= (0 + 2 \times 1, 3 \times 0 - 1, 2 \times 0 + 4 \times 1) = (2, -1, 4) \end{align}$$ **第二步**:构造矩阵$A$,把$T(1, 0)$和$T(0, 1)$作为列向量: $$A = \begin{pmatrix} 1 & 2\\ 3 & -1\\ 2 & 4 \end{pmatrix}$$ **第三步**:验证: $$A\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 1 \cdot x + 2 \cdot y\\ 3 \cdot x - 1 \cdot y\\ 2 \cdot x + 4 \cdot y \end{pmatrix} = \begin{pmatrix} x + 2y \\ 3x - y \\ 2x + 4y \end{pmatrix} = T(x, y)$$ 验证正确。 ### 例题3:利用线性变换求解 **问题**:设$T: \mathbb{R}^2 \to \mathbb{R}^2$是线性变换,已知: $$T(1, 2) = (3, 1), \quad T(2, 1) = (1, 4)$$ 求$T(3, 4)$。 **解答**: **第一步**:找到向量$(3, 4)$用$(1, 2)$和$(2, 1)$的线性表示。 设$(3, 4) = a(1, 2) + b(2, 1)$,则: $$\begin{cases} a + 2b = 3\\ 2a + b = 4 \end{cases}$$ 解得:$a = 2$, $b = 0.5$ **第二步**:利用$T$的线性性: $$\begin{align} T(3, 4) &= T(2(1, 2) + 0.5(2, 1))\\ &= 2T(1, 2) + 0.5T(2, 1)\\ &= 2(3, 1) + 0.5(1, 4)\\ &= (6, 2) + (0.5, 2)\\ &= (6.5, 4) \end{align}$$ ### 例题4:复合变换的矩阵 **问题**:设$T, S: \mathbb{R}^2 \to \mathbb{R}^2$都是线性变换,其矩阵表示分别为: $$A = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}, \quad B = \begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}$$ 求复合变换$T \circ S$的矩阵表示。 **解答**: 复合变换$T \circ S$的矩阵表示就是矩阵乘积$AB$: $$\begin{align} AB &= \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}\\ &= \begin{pmatrix} 1 \times 2 + 2 \times 1 & 1 \times 0 + 2 \times 3\\ 0 \times 2 + 1 \times 1 & 0 \times 0 + 1 \times 3 \end{pmatrix}\\ &= \begin{pmatrix} 4 & 6 \\ 1 & 3 \end{pmatrix} \end{align}$$ 所以$(T \circ S)(x, y) = (4x + 6y, x + 3y)$。 <Alert type="info" variant="soft" closable={false}> 💡 **重要技巧**:复合变换的矩阵表示就是各变换矩阵的乘积,注意顺序:$(T \circ S)(\mathbf{x}) = T(S(\mathbf{x}))$ 对应的矩阵是$AB$。 </Alert> ## 呼噜星人的收获 经过这堂课的学习,呼噜星球的学生们对线性变换有了深入的理解: 1. **线性变换的本质**:线性变换保持向量的加法和数乘运算,这是其最核心的特征。 2. **矩阵表示的重要性**:每个线性变换都对应一个唯一的矩阵,这使得我们能够用代数方法研究几何变换。 3. **2×2矩阵的应用**:常见的平面变换如旋转、缩放、剪切都可以用2×2矩阵表示。 4. **变换的性质**:线性变换保持直线的线性性、原点的位置,以及平行线的平行性。 5. **矩阵运算与变换运算**:矩阵的加法、数乘、乘法分别对应线性变换的加法、数乘、复合。 "呼噜呼噜!"学生们兴奋地说,"原来矩阵和线性变换这么有趣!" "是的,线性变换是连接代数和几何的桥梁,"我微笑着说,"希望你们能在今后的学习中继续探索这个美妙的世界。今天只是开始,还有更多的精彩等着我们去发现!" <Alert type="success" variant="soft" closable={false}> 🎯 **课堂总结**: - 线性变换保持向量加法和数乘 - 每个线性变换对应唯一矩阵,每个矩阵对应唯一线性变换 - 2×2矩阵可表示常见的平面变换 - 线性变换具有优美的代数结构 </Alert>

搜索