# 多项式的因式分解

多项式的因式分解，是指把一个给定的多项式在指定的系数环上表示成不可约多项式的乘积，并给出每个因子的重数。在一个域上，分解为首一不可约因子的方式是唯一的——至多相差因子的次序和单位，因此这项任务本质上是算法性的：要高效地找出那些不可约因子。这是计算代数的一个核心问题，针对有限域、有理数与整数、以及多元多项式，各有不同的算法族。

| 关键事实 | 详情 |
|---|---|
| 输出形式 | 一串（不可约因子，正重数）对，外加一个单位，使得 \( f = u \cdot \prod_i q_i^{k_i} \)；支持的系数环包括有限域、\( \mathbb{Z} \)、\( \mathbb{Q} \)、代数数域和局部环<sup>[1](https://docs.magma-maths.org/BasicRings/UnivariatePolynomialRings/factorization.html)</sup> |
| 有限域，小 | Berlekamp 1967 年的算法把 \( \mathrm{GF}(q) \) 上次数为 \( m \) 的多项式的分解，归结为在 \( \mathrm{GF}(q) \) 上求解约 \( m(q-1)/q \) 个线性方程<sup>[2](https://onlinelibrary.wiley.com/doi/abs/10.1002/j.1538-7305.1967.tb03174.x)</sup> |
| 有限域，大 | Cantor–Zassenhaus 算法（1981）是概率性的；Magma 对中到大有限域采用 von zur Gathen–Kaltofen–Shoup 扩展<sup>[3](https://portal.mardi4nfdi.de/wiki/A_New_Algorithm_for_Factoring_Polynomials_Over_Finite_Fields)</sup><sup> • </sup><sup>[4](https://magma.maths.usyd.edu.au/magma/info/topic_com_rng_poly)</sup> |
| 有理数 | Zassenhaus（1969）给出了第一个在实践中快速的算法；LLL（1982）给出了第一个多项式时间算法；van Hoeij 2002 年的背包算法成为 Maple、Magma、NTL 和 PARI/GP 中的默认算法<sup>[5](https://www.math.fsu.edu/~hoeij/algorithms/Qx.html)</sup> |
| 多元 | Wang 1978 年的算法对其余变量代入整数、只保留一个变量，用 Berlekamp 方法模一个小素数分解所得的一元多项式，再通过亨泽尔提升重构出多元因子<sup>[6](https://www.researchgate.net/publication/242921585_An_improved_multivariate_polynomial_factoring_algorithm)</sup> |
| 软件 | Sage 的 `factor` 方法对一元多项式调用 Pari，对多元多项式调用 Singular；FLINT 在有限域上实现了 Berlekamp、Cantor–Zassenhaus 和 Kaltofen–Shoup<sup>[7](https://doc.sagemath.org/html/en/constructions/polynomials.html)</sup><sup> • </sup><sup>[8](https://flintlib.org/doc/fq_poly_factor.html)</sup> |

## 问题及其输出

因式分解的结果以因子–指数对的列表形式返回。Magma 手册规定，每个不可约因子都要经过归一化，使得把这些因子乘开之后得到输入多项式唯一的典范相伴元；该函数还返回系数环中用于归一化的单位 \( u \)<sup>[1](https://docs.magma-maths.org/BasicRings/UnivariatePolynomialRings/factorization.html)</sup>。Sage 的 `Factorization` 类持有同类的结构——一个带整数重数的对象列表——并以分解形式打印；对整数 \( -45 \)，它打印为 \( -1 \cdot 3^2 \cdot 5 \)<sup>[9](https://doc-gitlab.sagemath.org/html/en/reference/structure/sage/structure/factorization.html)</sup>。

系数环很要紧。Magma 支持在有限域 \( \mathbb{F}_q \)、整数、有理数、代数数域 \( \mathbb{Q}(\alpha) \)、局部环，以及建立在这些之上的多项式域或函数域上做因式分解<sup>[1](https://docs.magma-maths.org/BasicRings/UnivariatePolynomialRings/factorization.html)</sup>。在一个系数环上不可约的多项式，在扩域上可能就可约了，所以系数环是问题陈述的一部分，而不是一个细节。

## 在有限域上分解

**Berlekamp 算法。** 1967 年，当时正在研究纠错码背后数学的 Elwyn R. Berlekamp 发表了一个算法，把 \( \mathrm{GF}(q) \) 上的多项式分解为不可约多项式的幂，办法是把问题归结为线性代数：对一个次数为 \( m \) 的多项式，必须在 \( \mathrm{GF}(q) \) 上求解约 \( m(q-1)/q \) 个线性方程，未知数个数与方程数相同<sup>[2](https://onlinelibrary.wiley.com/doi/abs/10.1002/j.1538-7305.1967.tb03174.x)</sup>。由于它依赖快速的线性代数，在 Magma 中它仍是极小有限域的默认算法，尤其是当输入多项式稀疏时<sup>[4](https://magma.maths.usyd.edu.au/magma/info/topic_com_rng_poly)</sup>。

**Cantor–Zassenhaus。** David G. Cantor 和 Hans Zassenhaus 于 1981 年在《Mathematics of Computation》上发表了另一种概率性算法<sup>[3](https://portal.mardi4nfdi.de/wiki/A_New_Algorithm_for_Factoring_Polynomials_Over_Finite_Fields)</sup>。Magma 文档把该算法的核心步骤描述为：对相继的 \( i \)，取输入多项式与 \( x^{q^{i}} - x \) 的最大公因式<sup>[4](https://magma.maths.usyd.edu.au/magma/info/topic_com_rng_poly)</sup>。对中到大有限域，Magma 默认采用 von zur Gathen–Kaltofen–Shoup 算法，这是 Cantor–Zassenhaus 的一个重大扩展，带有与 FFT 相关的优化<sup>[4](https://magma.maths.usyd.edu.au/magma/info/topic_com_rng_poly)</sup>。

现代库分阶段地暴露这条流水线。FLINT 的有限域因式分解模块分别提供无平方因子分解、不同次数分解（把多项式拆成按次数分组的不可约因子之积）和等次数分解的独立例程，然后是一个顶层例程，在 Berlekamp、Cantor–Zassenhaus 和快速的 Kaltofen–Shoup 变体之间做选择，后者在不同次数这一步采用小步/大步策略<sup>[8](https://flintlib.org/doc/fq_poly_factor.html)</sup>。

## 在有理数和整数上分解

\( \mathbb{Q}[x] \) 上的主流方法遵循 Zassenhaus 建立的结构：模一个小素数 \( p \) 分解多项式，把该分解亨泽尔提升到很高的 \( p \)-进精度，再把局部因子重组为 \( \mathbb{Q}[x] \) 上的真正因子<sup>[10](https://www.math.fsu.edu/~hoeij/papers/issac13/Tutorial/issac123t-van-hoeij.pdf)</sup>。重组这一步是组合性的，在标准的 Berlekamp–Zassenhaus 算法中具有指数级的最坏情形复杂度，不过这个指数作用于模因子的个数 \( r \)，而不是次数 \( N \)；\( r \) 通常远小于 \( N \)，已知的最坏情形是 Swinnerton-Dyer 多项式，其 \( r = N/2 \)<sup>[10](https://www.math.fsu.edu/~hoeij/papers/issac13/Tutorial/issac123t-van-hoeij.pdf)</sup>。

**LLL 里程碑与背包算法。** 1982 年，Arjen Lenstra、Hendrik Lenstra 和 László Lovász 基于格约化给出了第一个 \( \mathbb{Q}[x] \) 上的多项式时间因式分解算法，但在大多数输入上 Zassenhaus 仍然更快，并继续是计算机代数系统中的默认算法<sup>[5](https://www.math.fsu.edu/~hoeij/algorithms/Qx.html)</sup>。2002 年，佛罗里达州立大学数学教授 Mark van Hoeij 发表了一个算法，通过 LLL 格约化把重组问题作为背包问题来求解。它具有最好的实际性能，并迅速成为 Maple、Magma、NTL 和 PARI/GP 中的默认算法，尽管起初并没有已证明的复杂度界<sup>[5](https://www.math.fsu.edu/~hoeij/algorithms/Qx.html)</sup>。效率提升有一个具体的来源：van Hoeij 算法中的格，其维数等于模因子的个数，而不是输入多项式的次数，且其元素小得多，因此许多以前任何算法都难以处理的多项式变得容易分解了<sup>[1](https://docs.magma-maths.org/BasicRings/UnivariatePolynomialRings/factorization.html)</sup>。

**弥合理论与实践之间的鸿沟。** van Hoeij 及其合作者后来的工作为亨泽尔提升加入了一种“提前终止”策略：不是提升到足以恢复所有因子的精度，而是只提升到足以求解组合问题、并恢复除最大因子之外的所有因子。由于大多数输入都有一个大的因子和零个或多个小因子，这在多数输入上比 Zassenhaus 提升得更少，同时不损害在困难输入上的性能<sup>[5](https://www.math.fsu.edu/~hoeij/algorithms/Qx.html)</sup>。经过一篇 2010 年论文和 ISSAC 2011 上分析过的修改，该算法获得了可证明的复杂度界，同时保持了实际速度，于是自 1982 年 LLL 以来第一次，性能最好的算法与已证明最好的算法是同一个<sup>[5](https://www.math.fsu.edu/~hoeij/algorithms/Qx.html)</sup>。在由此得到的复杂度分析中，六次项是 \( r^6 \)，而不是旧有的 \( N^4(N^2+h^2) \)，其中 \( h \) 是系数大小的界<sup>[5](https://www.math.fsu.edu/~hoeij/algorithms/Qx.html)</sup>。

## 多元因式分解

整数上的多元因式分解归结为一元情形。肯特州立大学的 Paul S. Wang 在 1978 年描述了一个改进算法：对其余变量代入适当选取的整数、只保留一个变量，用 Berlekamp 算法借助一个小素数在 \( \mathbb{Z} \) 上分解所得的一元多项式，然后通过基于亨泽尔引理的 \( p \)-进程序重构出多元因子<sup>[6](https://www.researchgate.net/publication/242921585_An_improved_multivariate_polynomial_factoring_algorithm)</sup>。他的论文处理了早期 Wang–Rothschild 算法的已知失效模式，包括首项系数问题、坏零问题和多余因子，并引入了一种线性收敛的、逐变量的 \( p \)-进构造，名为 EEZ<sup>[6](https://www.researchgate.net/publication/242921585_An_improved_multivariate_polynomial_factoring_algorithm)</sup>。Wang 的首项系数修正方法后来成为 Maple 中处理非首一稀疏输入的默认方法<sup>[6](https://www.researchgate.net/publication/242921585_An_improved_multivariate_polynomial_factoring_algorithm)</sup>。

多元因式分解还与求解多项式方程组相关：Sage 通过其到 Singular 的接口，可以在解构成零维簇的情形下用 Gröbner 基求解多元多项式方程<sup>[7](https://doc.sagemath.org/html/en/constructions/polynomials.html)</sup>。

## 实现

计算机代数系统把这些算法打包在一条命令背后。在 Sage 中，分解一元多项式就是调用 `factor` 方法，它会调用 Pari；例如 \( (x^3 - 1)^2 - (x^2 - 1)^2 \) 分解为 \( (x - 1)^2 \cdot x^2 \cdot (x^2 + 2x + 2) \)，而多元多项式通过 Singular 接口分解<sup>[7](https://doc.sagemath.org/html/en/constructions/polynomials.html)</sup>。Magma 依据域的大小选择 Berlekamp 或 von zur Gathen–Kaltofen–Shoup，并在整数和有理数上使用 van Hoeij 算法，亨泽尔提升这一步用 Shoup 的树提升<sup>[1](https://docs.magma-maths.org/BasicRings/UnivariatePolynomialRings/factorization.html)</sup><sup> • </sup><sup>[4](https://magma.maths.usyd.edu.au/magma/info/topic_com_rng_poly)</sup>。FLINT 是一个数论用的 C 库，提供在整数、有理数、有限域、数域和 \( p \)-进数上的因式分解<sup>[8](https://flintlib.org/doc/fq_poly_factor.html)</sup>。\( \mathbb{Z}[x] \) 中的因式分解支撑着特征零情形下所有形式的多项式因式分解，因为其他特征零的环通常都通过归约到它来处理<sup>[4](https://magma.maths.usyd.edu.au/magma/info/topic_com_rng_poly)</sup>。

## References

1. [Factorization — Univariate Polynomial Rings, Magma Handbook](https://docs.magma-maths.org/BasicRings/UnivariatePolynomialRings/factorization.html)
2. [E. R. Berlekamp (1967). Factoring Polynomials Over Finite Fields. Bell System Technical Journal 46(8), 1853–1859.](https://onlinelibrary.wiley.com/doi/abs/10.1002/j.1538-7305.1967.tb03174.x)
3. [D. G. Cantor, H. Zassenhaus (1981). A New Algorithm for Factoring Polynomials Over Finite Fields. MaRDI portal record.](https://portal.mardi4nfdi.de/wiki/A_New_Algorithm_for_Factoring_Polynomials_Over_Finite_Fields)
4. [Polynomial Rings, Magma Handbook](https://magma.maths.usyd.edu.au/magma/info/topic_com_rng_poly)
5. [Mark van Hoeij. The complexity of factoring univariate polynomials over the rationals, Florida State University.](https://www.math.fsu.edu/~hoeij/algorithms/Qx.html)
6. [Paul S. Wang (1978). An Improved Multivariate Polynomial Factoring Algorithm. Mathematics of Computation 32(144), 1215–1231.](https://www.researchgate.net/publication/242921585_An_improved_multivariate_polynomial_factoring_algorithm)
7. [Polynomials — Constructions, SageMath documentation](https://doc.sagemath.org/html/en/constructions/polynomials.html)
8. [fq_poly_factor.h — factorisation of univariate polynomials over finite fields, FLINT documentation](https://flintlib.org/doc/fq_poly_factor.html)
9. [Factorizations — Sage 9.4 Reference Manual: Parents and Elements](https://doc-gitlab.sagemath.org/html/en/reference/structure/sage/structure/factorization.html)
10. [Mark van Hoeij (2013). The Complexity of Factoring Univariate Polynomials over the Rationals, ISSAC tutorial.](https://www.math.fsu.edu/~hoeij/papers/issac13/Tutorial/issac123t-van-hoeij.pdf)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Computational and symbolic algebra › Symbolic and algebraic algorithms › Polynomial factorization and root algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/factorization-of-polynomials

English original: https://www.edgepedia.org/factorization-of-polynomials
