# 三角矩阵

三角矩阵是一种方阵，其主对角线一侧的所有元素都为零：上三角矩阵的对角线下方为零，下三角矩阵的对角线上方为零。这种简单的零元素模式赋予了三角矩阵一些性质，使其成为线性代数的核心——无论在理论上（特征值和行列式可以轻易读出），还是在计算上（系数矩阵为三角矩阵的方程组可以用代入法低成本求解）。

| 关键事实 | 详情 |
|---|---|
| 定义 | 上三角：当 \( i > j \) 时 \( a_{ij} = 0 \)；下三角：当 \( i < j \) 时 \( a_{ij} = 0 \)<sup>[1](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)</sup> |
| 特征值 | 三角矩阵的特征值恰好是其主对角线上的元素<sup>[2](https://www.cs.bu.edu/fac/snyder/cs132-book/L16Eigenvectors.html)</sup> |
| 行列式 | 行列式等于对角线元素的乘积<sup>[3](https://opentext.uleth.ca/Math1410/sec-eigen_prop.html)</sup> |
| 可逆性 | 三角矩阵可逆当且仅当每个对角线元素都非零<sup>[1](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)</sup> |
| 封闭性 | 两个上三角矩阵的乘积仍是上三角矩阵，下三角矩阵同理<sup>[1](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)</sup> |
| 求解代价 | 三角方程组 \( A\vec{x} = \vec{b} \) 可用前代法或回代法在 \( O(n^2) \) 次运算内求解，而一般高斯消元需要 \( O(\tfrac{1}{3}n^3) \) 次<sup>[4](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_LU.html)</sup> |
| 特殊形式 | 单位三角（所有对角线元素为1）；严格三角（对角线元素也为0）<sup>[5](https://www.math.ucdavis.edu/~daddel/MATH22AL/Resources/Linear_Algebra_Glossary.html)</sup><sup> • </sup><sup>[6](https://mathworld.wolfram.com/UpperTriangularMatrix.html)</sup> |

## 定义与变体

上三角矩阵 \( A = [a_{ij}] \) 满足：只要行指标大于列指标，就有 \( a_{ij} = 0 \)，因此每个非零元素都位于主对角线上或其上方。下三角矩阵满足：当 \( i < j \) 时 \( a_{ij} = 0 \)。一个矩阵若是两者之一，就称为三角矩阵<sup>[1](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)</sup>。下三角矩阵是上三角矩阵的转置<sup>[1](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)</sup>。

文献中反复出现两种有名称的变体。单位三角矩阵的每个对角线元素都等于1；单位上三角矩阵和单位下三角矩阵出现在LU分解的 \( L \) 因子中<sup>[5](https://www.math.ucdavis.edu/~daddel/MATH22AL/Resources/Linear_Algebra_Glossary.html)</sup>。严格三角矩阵的对角线元素也为零，因此严格上三角矩阵满足：当 \( i \ge j \) 时 \( a_{ij} = 0 \)<sup>[6](https://mathworld.wolfram.com/UpperTriangularMatrix.html)</sup>。

## 代数性质

零元素模式在乘法下保持不变：若 \( A \) 和 \( B \) 都是上三角矩阵，则当 \( i > j \) 时 \( (AB)_{ij} = 0 \)，因此 \( AB \) 仍是上三角矩阵；下三角矩阵同理<sup>[1](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)</sup>。

行列式由对角线决定。由于三角矩阵的行列式可化为对角线元素的乘积，三角矩阵 \( A \) 的 \( \det(A - \lambda I) \) 直接分解为 \( (a_{11} - \lambda)(a_{22} - \lambda) \cdots (a_{nn} - \lambda) \)<sup>[3](https://opentext.uleth.ca/Math1410/sec-eigen_prop.html)</sup>。由此得到特征值定理：三角矩阵的特征值恰好是其对角线元素。证明的关键在于：\( (A - \lambda I)\vec{x} = \vec{0} \) 有非平凡解，当且仅当 \( A - \lambda I \) 的某个对角线元素为零，而这又恰好发生在 \( \lambda \) 等于 \( A \) 的某个对角线元素之时<sup>[2](https://www.cs.bu.edu/fac/snyder/cs132-book/L16Eigenvectors.html)</sup>。

可逆性同样可以从对角线读出：三角矩阵可逆当且仅当其所有对角线元素都非零<sup>[1](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)</sup>。这与特征值结果直接相关，因为0是特征值当且仅当矩阵不可逆<sup>[2](https://www.cs.bu.edu/fac/snyder/cs132-book/L16Eigenvectors.html)</sup>。

## 求解三角方程组

三角方程组是线性求解中代价低廉的情形。对于下三角矩阵 \( L \)，方程组 \( L\vec{y} = \vec{b} \) 用前代法求解：第一个方程立即给出 \( y_1 \)，之后每个方程只涉及此前已求出的未知量。对于上三角矩阵 \( U \)，回代法从最后一个方程开始向上运行同样的逻辑。每个方向都需要 \( O(n^2) \) 次算术运算<sup>[4](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_LU.html)</sup>。

这种代价优势正是三角矩阵在数值线性代数中占据主导地位的原因。标准库围绕它们构建了整套例程：LAPACK 为完整、压缩、带状和矩形完整压缩等存储布局提供了三角求解、求逆、条件数估计和迭代精化等例程<sup>[7](https://www.netlib.org/lapack/explore-html/dc/dab/group__trsv__comp__grp.html)</sup>；SciPy 提供了 `spsolve_triangular` 用于稀疏三角方程组，并可选声明对角线全为1以跳过那些除法<sup>[8](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.spsolve_triangular.html)</sup>。

实践者面临一个数值上的注意事项。LAPACK 的三角求解器会验证矩阵非奇异，但只能检测精确奇异；次正规的极小对角线元素可能通过检查而不报错，因此关心接近奇异性的调用者应先用容差检查矩阵<sup>[9](https://www.netlib.org/lapack/explore-html/d4/dc1/group__trtrs_ga51339c059a38a196be88588ec07e780c.html)</sup>。

## 在LU分解中的作用

三角矩阵最突出的用途是LU分解，即将矩阵写成 \( A = LU \)，其中 \( L \) 为下三角矩阵、\( U \) 为上三角矩阵。不进行行交换的高斯消元可以看作是对非奇异矩阵做这种三角化，而该分解是封装式线性代数求解器处理非稀疏线性方程组的最常用方式之一<sup>[4](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_LU.html)</sup><sup> • </sup><sup>[10](https://www.ams.stonybrook.edu/~jiao/teaching/ams526/lectures/lecture08.pdf)</sup>。

存在性有一个精确条件：若方阵 \( A \) 的所有顺序主子式都非零，则可将 \( A \) 写成 \( A = LU \)，并且一旦固定 \( L \) 或 \( U \) 的对角线（例如要求单位对角线），分解就是唯一的。一般情况下需要进行行置换，得到 \( PA = LU \)，其中 \( P \) 为置换矩阵，\( L \) 为单位下三角矩阵<sup>[11](https://encyclopediaofmath.org/wiki/Matrix_factorization)</sup>。

收益在于重复求解。一旦已知 \( A = LU \)，求解 \( A\vec{x} = \vec{b} \) 只需两次三角求解：先对 \( L\vec{y} = \vec{b} \) 做前代，再对 \( U\vec{x} = \vec{y} \) 做回代，每次都是 \( O(n^2) \)。这将每个右端项的成本从完全消元的 \( O(\tfrac{1}{3}n^3) \) 次运算降至 \( O(2n^2) \)，于是昂贵的分解只做一次便可反复使用<sup>[4](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_LU.html)</sup>。

## 历史背景

三角结构从消元过程中自然涌现。初等行变换将系数矩阵化为上三角形式，完成三角分解，再通过前代和回代求解方程<sup>[12](https://doi.org/10.1016/j.hm.2010.06.003)</sup>。高斯消元法——这一化简背后的算法——独立起源于古代中国和近代早期的欧洲，至今仍是数值求解非结构化线性方程组最流行的方法<sup>[12](https://doi.org/10.1016/j.hm.2010.06.003)</sup><sup> • </sup><sup>[13](https://doi.org/10.1090/noti3191)</sup>。现代以LU分解为主的矩阵分解处理方式可追溯到阿尔斯顿·S·豪斯霍尔德（Alston S. Householder）的《数值分析原理》（*Principles of Numerical Analysis*，1954），这是最早以这种方式阐述矩阵分解的著作之一<sup>[14](https://arxiv.org/abs/2107.02579)</sup>。

由于三角矩阵的行列式等于其对角线上元素的乘积，LU分解中 \( L \) 和 \( U \) 的每个元素甚至可以写成 \( A \) 的子式之商，从而为消元算法提供了一个基于行列式的视角<sup>[13](https://doi.org/10.1090/noti3191)</sup>。

## References

1. [Some special matrices, University of Manitoba Math 1220](https://linearalgebra.math.umanitoba.ca/math1220/section-22.html)
2. [Eigenvectors and Eigenvalues, Linear Algebra, Geometry, and Computation, Boston University](https://www.cs.bu.edu/fac/snyder/cs132-book/L16Eigenvectors.html)
3. [Properties of Eigenvalues and Eigenvectors, Math 1410, University of Lethbridge](https://opentext.uleth.ca/Math1410/sec-eigen_prop.html)
4. [LU Factorization, J. Foster, Numerical Methods, University of Texas at Austin](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_LU.html)
5. [Linear Algebra Glossary, UC Davis](https://www.math.ucdavis.edu/~daddel/MATH22AL/Resources/Linear_Algebra_Glossary.html)
6. [Upper Triangular Matrix, Wolfram MathWorld](https://mathworld.wolfram.com/UpperTriangularMatrix.html)
7. [LAPACK: Triangular computational routines](https://www.netlib.org/lapack/explore-html/dc/dab/group__trsv__comp__grp.html)
8. [scipy.sparse.linalg.spsolve_triangular, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.spsolve_triangular.html)
9. [LAPACK: STRTRS](https://www.netlib.org/lapack/explore-html/d4/dc1/group__trtrs_ga51339c059a38a196be88588ec07e780c.html)
10. [AMS 526 Lecture 8: Gaussian Elimination and LU Factorization, Stony Brook University](https://www.ams.stonybrook.edu/~jiao/teaching/ams526/lectures/lecture08.pdf)
11. [Matrix factorization, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Matrix_factorization)
12. [How ordinary elimination became Gaussian elimination, Historia Mathematica (2010)](https://doi.org/10.1016/j.hm.2010.06.003)
13. [Gaussian elimination, Notices of the American Mathematical Society](https://doi.org/10.1090/noti3191)
14. [J. Lu (2021). Numerical Matrix Decomposition. arXiv](https://arxiv.org/abs/2107.02579)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Matrix theory › Structured and special matrix classes

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/triangular-matrix

English original: https://www.edgepedia.org/triangular-matrix
