# 行阶梯形

矩阵的行阶梯形，是经由初等行变换从原矩阵得到的矩阵，其中非零元素呈阶梯状分布：每一行的第一个非零元素称为主元，严格位于上一行主元的右侧，而所有零行都位于底部。<sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>行阶梯形是高斯消元法的目标形式，而高斯消元法是求解线性方程组的标准程序；其完全简化形式则是读取秩、基和解集的基础。<sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义条件 | 零行位于底部；每一行的第一个非零元素位于上一行第一个非零元素的右侧；主元下方的所有元素均为零<sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup> |
| 简化形式（RREF） | 每个主元等于1，且是其所在列中唯一的非零元素<sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup> |
| 存在性与唯一性 | 任何矩阵都可以通过行变换化为简化行阶梯形，且简化行阶梯形是唯一的<sup>[3](https://www.homepages.ucl.ac.uk/~ucahmto/0007/_book/2-3-linear-equations-and-row-operations.html)</sup><sup> • </sup><sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup> |
| 秩 | 矩阵的秩等于主元列的数目，等价地，等于阶梯形中非零行的数目<sup>[4](https://math.libretexts.org/Courses/Irvine_Valley_College/Math_26%3A_Introduction_to_Linear_Algebra/01%3A_Systems_of_Linear_Equations/1.07%3A_Basis_and_Dimension/1.7.03%3A_Rank_and_Nullity)</sup> |
| 秩-零化度 | 对于有\( n \)列的矩阵，\( \mathrm{rank}(A) + \mathrm{nullity}(A) = n \)；零化度等于列数减去秩<sup>[4](https://math.libretexts.org/Courses/Irvine_Valley_College/Math_26%3A_Introduction_to_Linear_Algebra/01%3A_Systems_of_Linear_Equations/1.07%3A_Basis_and_Dimension/1.7.03%3A_Rank_and_Nullity)</sup><sup> • </sup><sup>[5](https://sites.math.rutgers.edu/~cherlin/Courses/250/Lectures/250L03.html)</sup> |
| 数值代价 | 对\( n \times n \)矩阵，采用部分主元的高斯消元法进行LU分解，需要\( 2n^{3}/3 + O(n^{2}) \)次浮点运算<sup>[6](https://www.netlib.org/lapack/lawnspdf/lawn60.pdf)</sup> |
| 历史渊源 | 古代中国《九章算术》第八章（方程）中出现了等价的消元程序<sup>[7](https://mathshistory.st-andrews.ac.uk//HistTopics/Nine_chapters/)</sup> |

## 定义

一个\( m \times n \)矩阵\( A \)处于行阶梯形，当且仅当以下两个条件成立：每一行的第一个非零元素严格位于之前各行第一个非零元素的右侧；任何完全由零组成的行都位于所有非零行之后。<sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>第二个条件可以通过将零行的第一个非零元素位置指定为\( +\infty \)来处理为第一个条件的特例。<sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>此类矩阵的主元是\( r \le m \)个非零行第一个非零元素的位置\( (i, j(i)) \)，主元列为\( 1 \le j(1) < j(2) < \cdots < j(r) \le n \)。<sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>

**简化行阶梯形。** 一个行阶梯矩阵处于简化行阶梯形（RREF），如果此外每个主元元素等于1，且主元列中所有其他元素为零。<sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>从实际意义上说，处于RREF的矩阵是完全解出的：每个在变量列中有主元的非零行，将其主元变量用常数和任何自由变量表示出来，因此无需回代即可读出方程组的解。<sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup><sup> • </sup><sup>[17](https://www.cs.bu.edu/fac/snyder/cs132-book/L03RowReductions.html)</sup>

“echelon”一词源自法语中对军队排列方式的描述；它最初意为“梯子的横档”，源自拉丁语“scala”，意为梯子或台阶。<sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>

## 存在性与唯一性

每个矩阵都可以通过有限序列的初等行变换化为RREF：交换两行、将一行乘以非零标量、将一行的倍数加到另一行。<sup>[3](https://www.homepages.ucl.ac.uk/~ucahmto/0007/_book/2-3-linear-equations-and-row-operations.html)</sup>证明通过对列数进行归纳来完成；对于单列，将零行移至底部，对非零行进行缩放使首个元素为1，并清除其下方的元素。<sup>[3](https://www.homepages.ucl.ac.uk/~ucahmto/0007/_book/2-3-linear-equations-and-row-operations.html)</sup>

矩阵的行阶梯形不是唯一的，因为不同的运算序列可以产生具有相同主元位置的不同阶梯矩阵。<sup>[8](https://math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_%28Nicholson%29/05%3A_Vector_Space_R/5.04%3A_Rank_of_a_Matrix)</sup>简化形式则不同：每个矩阵\( A \)都等价于唯一的简化行阶梯形矩阵，因此两个不同的行变换序列如果都以RREF结束，则产生相同的矩阵。<sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup>

## 求解线性方程组

为求解\( A\mathbf{x} = \mathbf{b} \)，构造增广矩阵\( (A \mid \mathbf{b}) \)并施加行变换直至达到阶梯形或简化阶梯形。行变换保持解集不变：向量\( \mathbf{v} \)是\( A\mathbf{x} = \mathbf{b} \)的解，当且仅当它是简化方程组\( A'\mathbf{x} = \mathbf{b}' \)的解。<sup>[3](https://www.homepages.ucl.ac.uk/~ucahmto/0007/_book/2-3-linear-equations-and-row-operations.html)</sup>

**读出解。** 从RREF增广矩阵中，变量分为两类。主元列中的\( r \)个变量是主元变量（也称为基本变量或约束变量），其余\( n - r \)个是自由变量。<sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>每个自由变量可以取任意值，然后主元变量随之确定；相容方程组若至少有一个自由变量，则有无穷多解，通过将基本变量用参数表示来写出；而不相容方程组无解。<sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup><sup> • </sup><sup>[18](https://math.libretexts.org/Bookshelves/Linear_Algebra/Fundamentals_of_Matrix_Algebra_(Hartman)/01:_Systems_of_Linear_Equations/1.04:_Existence_and_Uniqueness_of_Solutions)</sup>方程组不相容，当且仅当简化形式包含一行\( 0 = 1 \)，即零系数行对应非零右端项。<sup>[3](https://www.homepages.ucl.ac.uk/~ucahmto/0007/_book/2-3-linear-equations-and-row-operations.html)</sup>

由于简化形式是唯一的，\( A \)的主元位置是良定义的：\( A \)的主元位置是在\( A \)的某个行阶梯形中作为主元出现的元素位置，主元列是包含主元位置的列。<sup>[2](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)</sup>

## 秩、零化度与子空间

阶梯形将抽象不变量转化为计数。\( A \)的秩，即其列空间的维数，等于主元列的数目；零化度，即零空间的维数，等于没有主元的列数，即自由变量的数目。<sup>[4](https://math.libretexts.org/Courses/Irvine_Valley_College/Math_26%3A_Introduction_to_Linear_Algebra/01%3A_Systems_of_Linear_Equations/1.07%3A_Basis_and_Dimension/1.7.03%3A_Rank_and_Nullity)</sup>由于主元列和非主元列合计覆盖所有列，秩-零化度定理随之成立：对于有\( n \)列的矩阵，

\[ \mathrm{rank}(A) + \mathrm{nullity}(A) = n. \]

等价地，零化度定义为列数减去秩。<sup>[5](https://sites.math.rutgers.edu/~cherlin/Courses/250/Lectures/250L03.html)</sup>原矩阵\( A \)的主元列构成其列空间的一组基，而前\( r \)个标准基向量构成阶梯矩阵本身列空间的一组基。<sup>[4](https://math.libretexts.org/Courses/Irvine_Valley_College/Math_26%3A_Introduction_to_Linear_Algebra/01%3A_Systems_of_Linear_Equations/1.07%3A_Basis_and_Dimension/1.7.03%3A_Rank_and_Nullity)</sup><sup> • </sup><sup>[1](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)</sup>该定理还有定性解读：对于相容方程组，列向量张成的空间的维数加上解集的维数等于变量数，因此在选择\( \mathbf{x} \)时自由度越大，意味着在选择\( \mathbf{b} \)时自由度越小。<sup>[4](https://math.libretexts.org/Courses/Irvine_Valley_College/Math_26%3A_Introduction_to_Linear_Algebra/01%3A_Systems_of_Linear_Equations/1.07%3A_Basis_and_Dimension/1.7.03%3A_Rank_and_Nullity)</sup>

## 计算与数值实践

高斯消元法将\( n \times n \)矩阵化为阶梯形，需要约\( n^{3} \)次算术运算；LAPACK库中使用的部分主元LU分解需要\( 2n^{3}/3 + O(n^{2}) \)次浮点运算，并将\( A \)分解为\( PA = LU \)，其中\( P \)是置换矩阵，\( L \)是单位下三角矩阵，\( U \)是上三角矩阵。<sup>[9](https://math.mit.edu/~djk/18_022/chapter15/section05.html)</sup><sup> • </sup><sup>[6](https://www.netlib.org/lapack/lawnspdf/lawn60.pdf)</sup>部分主元法在每一步选择当前列中绝对值最大的元素，这是数值稳定性所必需的，并使\( L \)中的乘数绝对值不超过1。<sup>[6](https://www.netlib.org/lapack/lawnspdf/lawn60.pdf)</sup>J. H. 威尔金森在20世纪60年代证明，采用部分主元法时，该方法在产生小后向误差的意义上是稳定的，即计算解精确地求解了一个轻微扰动的方程组。<sup>[10](https://ecommons.cornell.edu/entities/publication/5fd0e8bb-7c26-4632-923c-ec3c59e400ce)</sup>

在浮点运算中，不能依赖精确的零元素，因此软件使用容差。GNU Octave的`rref`函数返回矩阵的简化行阶梯形，将低于容差\( \mathrm{eps} \cdot \mathrm{max(size}(A)) \cdot \mathrm{norm}(A, \mathrm{inf}) \)的元素视为零，还可以返回约束变量列的索引。<sup>[11](https://octave.sourceforge.io/octave/function/rref.html)</sup>LAPACK的`dgesv`等库求解器不显式构造阶梯矩阵，而是分解\( A = PLU \)并使用三角因子求解方程组。<sup>[12](https://www.math.utah.edu/software/lapack/lapack-d/dgesv.html)</sup>

行化简也适用于非方阵系统。超定方程组的最小二乘解通过将正规方程\( A^{T}A\mathbf{x} = A^{T}\mathbf{b} \)行化简为阶梯形并从最后一列读出解来求得。<sup>[13](https://interactivetextbooks.tudelft.nl/linear-algebra/Chapter7/LeastSquares.html)</sup>

## 历史

现今公认的高斯消元法的最早已知记录出现在中国数学著作《九章算术》中，这是一本包含246个问题的实用手册，涉及工程、测量、贸易和税收。<sup>[7](https://mathshistory.st-andrews.ac.uk//HistTopics/Nine_chapters/)</sup>其第八章“方程”（意为“矩形阵列”）将线性方程组的系数排列成网格，并使用初等运算将阵列化为三角形形式，解释结果以解决原始问题；该章还引入了负数及其运算规则。<sup>[7](https://mathshistory.st-andrews.ac.uk//HistTopics/Nine_chapters/)</sup>计算使用放置在平面上的竹制算筹进行。<sup>[14](https://www.jaiewrites.com/nine-chapters-mathematical-art/)</sup>

在欧洲，消元程序出现在文艺复兴晚期，并成为代数教科书的常见内容；艾萨克·牛顿（Isaac Newton）在他宁愿不发表的笔记中描述了它，莱昂哈德·欧拉（Leonhard Euler）不推荐它，阿德里安-马里·勒让德（Adrien-Marie Legendre）称其为“寻常的”，高斯称其为“普通的”。<sup>[15](https://arxiv.org/abs/0907.2397)</sup>高斯的名字之所以与该法联系在一起，是因为他为其最小二乘计算设计了一种专门的记号，职业计算员采用了这种记号，使得消元法可以被视为一系列算术运算，后来用矩阵来描述。<sup>[15](https://arxiv.org/abs/0907.2397)</sup>高斯在他关于小行星智神星轨道的工作中使用了消元法，将二次型的系数排列成矩形阵列。<sup>[16](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)</sup>20世纪初的矩阵描述调和了教科书方法和专业方法，矩阵记号的采用完成了行化简的现代图景。<sup>[15](https://arxiv.org/abs/0907.2397)</sup>

## References

1. [Gaussian Elimination, MIT 18.700 Linear Algebra (Fall 2013) lecture notes](https://ocw.mit.edu/courses/18-700-linear-algebra-fall-2013/b144082f6883d02faeec26d7f708c63e_MIT18_700F13_gauss.pdf)
2. [1.2: Matrix Notation and Row Reduction, Mathematics LibreTexts](https://math.libretexts.org/Courses/Canada_College/Linear_Algebra_and_Its_Application/01%3A_Solving_Systems_of_Linear_Equations/1.02%3A_Matrix_Notation_and_Row_Reduction)
3. [2.3 Linear equations and row operations, MATH0007, University College London](https://www.homepages.ucl.ac.uk/~ucahmto/0007/_book/2-3-linear-equations-and-row-operations.html)
4. [1.7: Rank and Nullity, Mathematics LibreTexts](https://math.libretexts.org/Courses/Irvine_Valley_College/Math_26%3A_Introduction_to_Linear_Algebra/01%3A_Systems_of_Linear_Equations/1.07%3A_Basis_and_Dimension/1.7.03%3A_Rank_and_Nullity)
5. [Lecture notes, Linear Algebra 250, Rutgers University](https://sites.math.rutgers.edu/~cherlin/Courses/250/Lectures/250L03.html)
6. [LAPACK Working Note 60: Implementation of the SVD and LU decomposition algorithms](https://www.netlib.org/lapack/lawnspdf/lawn60.pdf)
7. [Nine Chapters, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk//HistTopics/Nine_chapters/)
8. [5.4: Rank of a Matrix, Mathematics LibreTexts](https://math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_%28Nicholson%29/05%3A_Vector_Space_R/5.04%3A_Rank_of_a_Matrix)
9. [15.5 Important Observations about Gaussian Elimination, MIT 18.022](https://math.mit.edu/~djk/18_022/chapter15/section05.html)
10. [How Accurate is Gaussian Elimination? N. J. Higham, Cornell Computer Science Technical Report 89-1024](https://ecommons.cornell.edu/entities/publication/5fd0e8bb-7c26-4632-923c-ec3c59e400ce)
11. [Function Reference: rref, GNU Octave](https://octave.sourceforge.io/octave/function/rref.html)
12. [DGESV documentation, LAPACK](https://www.math.utah.edu/software/lapack/lapack-d/dgesv.html)
13. [7.4 Least-squares solutions, Linear Algebra, TU Delft](https://interactivetextbooks.tudelft.nl/linear-algebra/Chapter7/LeastSquares.html)
14. [The Nine Chapters: The 1,800-Year-Old Chinese Math Text That Invented Linear Algebra, Jaie](https://www.jaiewrites.com/nine-chapters-mathematical-art/)
15. [J. F. Grcar, How Ordinary Elimination Became Gaussian Elimination, arXiv:0907.2397](https://arxiv.org/abs/0907.2397)
16. [Matrices and determinants, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)
17. [Gaussian Elimination, Linear Algebra, Geometry, and Computation](https://www.cs.bu.edu/fac/snyder/cs132-book/L03RowReductions.html)
18. [1.4: Existence and Uniqueness of Solutions](https://math.libretexts.org/Bookshelves/Linear_Algebra/Fundamentals_of_Matrix_Algebra_(Hartman)/01:_Systems_of_Linear_Equations/1.04:_Existence_and_Uniqueness_of_Solutions)

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

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Decompositions and canonical forms › Triangular and orthogonal factorizations

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/row-echelon-form

English original: https://www.edgepedia.org/row-echelon-form
