# 正则语言的泵引理

**正则语言的泵引理**是形式语言理论的一个定理，它断言每个正则语言都存在一个泵长度：该语言中长度至少为此的字符串可以拆分为三部分，使得中间部分可以被重复任意次、或被删除，而所得字符串仍留在该语言中。该定理由耶霍舒亚·巴尔-希勒尔（Yehoshua Bar-Hillel）、米哈·A·佩尔莱斯（Micha A. Perles）和埃利·沙米尔（Eli Shamir）于1961年首次提出，主要用于证明某些特定语言不是正则的。<sup>[1](https://www.degruyterbrill.com/document/doi/10.1524/stuf.1961.14.14.143/html)</sup><sup> • </sup><sup>[2](https://books.google.com/books/about/Pumping_Lemma_for_Regular_Languages.html?id=tMBgcAAACAAJ)</sup>

| 关键事实 | 详情 |
|---|---|
| 陈述 | 若 L 是正则的，则存在整数 p ≥ 1（泵长度），使得每个满足 \|s\| ≥ p 的 s ∈ L 都可写成 s = xyz，其中 \|y\| ≥ 1、\|xy\| ≤ p，且对所有 i ≥ 0 都有 xy<sup>i</sup>z ∈ L<sup>[3](https://facultyweb.cs.wwu.edu/~wehrwes/courses/csci301_24f/lectures/L32/N32.html)</sup> |
| 起源 | 巴尔-希勒尔、佩尔莱斯与沙米尔，“论简单短语结构语法的形式性质”（1961），《语音学、语言科学与传播研究杂志》第14卷，第143–172页<sup>[1](https://www.degruyterbrill.com/document/doi/10.1524/stuf.1961.14.14.143/html)</sup> |
| 证明思路 | 一个有 p 个状态的 DFA 处理长度 ≥ p 的字符串时会经过 p + 1 个状态，故由鸽巢原理必有状态重复；围绕该循环的那段输入可以被遍历任意多次<sup>[4](https://www.cs.cornell.edu/courses/cs2800/2016sp/lectures/lec36-pumping.html)</sup> |
| 逻辑地位 | 是正则性的必要条件，而非充分条件；它能表明一个语言是非正则的，但不能证明其正则性<sup>[5](https://www.cs.odu.edu/~toida/nerzic/390teched/regular/reg-lang/non-regularity.html)</sup> |
| 典型应用 | L = {0<sup>n</sup>1<sup>n</sup> \| n ≥ 0} 不是正则的：对 0<sup>p</sup>1<sup>p</sup> 的 0 块进行泵操作会破坏数量相等的要求<sup>[4](https://www.cs.cornell.edu/courses/cs2800/2016sp/lectures/lec36-pumping.html)</sup> |
| 有限语言 | 有限语言平凡地满足该引理，只需取 p 大于 L 中最长字符串的长度<sup>[6](https://www.vssut.ac.in/lecture_notes/lecture1423726104.pdf)</sup> |
| 替代方法 | 非正则性也可通过闭包性质或迈希尔-尼罗德定理来证明，后者给出了一个充要条件<sup>[7](https://courses.grainger.illinois.edu/ECE374BL1/fa2026/labs/lab07/)</sup> |

## 陈述

设 A 是一个正则语言。则存在一个整数 p ≥ 1，称为泵长度，使得 A 中每个满足 \|s\| ≥ p 的字符串 s 都可以写成 s = xyz，其中：

- \|y\| ≥ 1（中间部分非空），
- \|xy\| ≤ p（可泵部分位于前 p 个符号之内），且
- 对所有 i ≥ 0，xy<sup>i</sup>z ∈ A（将 y 重复任意次，包括零次，结果仍在 A 中）。<sup>[3](https://facultyweb.cs.wwu.edu/~wehrwes/courses/csci301_24f/lectures/L32/N32.html)</sup>

通俗地说，正则语言中所有足够长的词都可以被“泵”：即词的中间一段可以被重复任意多次，产生的新词仍属于同一语言。<sup>[2](https://books.google.com/books/about/Pumping_Lemma_for_Regular_Languages.html?id=tMBgcAAACAAJ)</sup> 一个推论是：如果一个正则语言含有任何长度不小于其泵长度的字符串，它就含有任意长的字符串；因此有限语言只是由于不存在满足长度条件的字符串而空真地满足该引理，此时 p 取严格大于其最长字符串长度的值。<sup>[8](https://www.cl.cam.ac.uk/teaching/1516/DiscMath/dism-forla-notes-2016.pdf)</sup><sup> • </sup><sup>[6](https://www.vssut.ac.in/lecture_notes/lecture1423726104.pdf)</sup>

## 基于有限自动机的证明

证明依据鸽巢原理。若 L 是正则的，则某个确定性有限自动机（DFA）M 识别它；取 p 为 M 的状态数。在处理任何被接受字符串 s 的前 p 个字符时，机器经过 p + 1 个状态，故其中必有两个是同一状态。因此计算过程中包含一个循环：一段输入从同一状态开始并结束。<sup>[4](https://www.cs.cornell.edu/courses/cs2800/2016sp/lectures/lec36-pumping.html)</sup><sup> • </sup><sup>[3](https://facultyweb.cs.wwu.edu/~wehrwes/courses/csci301_24f/lectures/L32/N32.html)</sup>

将 s 写成 s = xyz，使得 x 引导机器到达循环的起点，y 是绕循环一圈的那段，z 把机器从循环终点带到接受状态；于是机器处理 xy<sup>i</sup>z 时绕循环 i 次，仍然接受。因此对每个 i ≥ 0 都有 xy<sup>i</sup>z ∈ L。由于重复的状态出现在所访问的前 p + 1 个状态之内，故 \|xy\| ≤ p，且循环非空，故 \|y\| ≥ 1。<sup>[4](https://www.cs.cornell.edu/courses/cs2800/2016sp/lectures/lec36-pumping.html)</sup>

直观理解是：识别无限语言的有限自动机必定具有某种重复结构，因为它仅用有限个状态就能识别任意长的字符串。<sup>[3](https://facultyweb.cs.wwu.edu/~wehrwes/courses/csci301_24f/lectures/L32/N32.html)</sup>

## 用该引理证明非正则性

该引理陈述了每个正则语言都必须具有的一个性质。要证明语言 A 不是正则的，可反设 A 是正则的，应用该引理，并推出矛盾，几乎总是通过表明引理断言必定属于 A 的某个字符串实际上不属于 A。<sup>[9](https://cs.uwaterloo.ca/~watrous/ToC-notes/ToC-notes.05.pdf)</sup>

**典型例子。** 语言 L = {0<sup>n</sup>1<sup>n</sup> \| n ≥ 0}，即 0 与 1 数量相等且所有 0 在前的字符串，不是正则的。假设 L 是正则的，泵长度为 p，选取 s = 0<sup>p</sup>1<sup>p</sup>，它属于 L 且长度为 2p ≥ p。由于 \|xy\| ≤ p，片段 x 和 y 只由 0 组成，且 y 至少含一个 0。取 i = 2 进行泵操作得到 0<sup>p+\|y\|</sup>1<sup>p</sup>，其 0 比 1 多，故不属于 L，与引理矛盾。因此 L 是正则的假设为假。<sup>[4](https://www.cs.cornell.edu/courses/cs2800/2016sp/lectures/lec36-pumping.html)</sup>

同一模板可处理其他语言，如 0 与 1 数量相等的字符串语言、{a, b} 上的回文语言，以及 {a<sup>p</sup> \| p 为素数}。<sup>[10](https://www.cs.sjsu.edu/~pollett/154.1.20s/Lec20200302.html)</sup><sup> • </sup><sup>[8](https://www.cl.cam.ac.uk/teaching/1516/DiscMath/dism-forla-notes-2016.pdf)</sup> 对量词的留意至关重要：引理中的对手选择 p 以及拆分 x、y、z，而证明者选择字符串 s 和泵指数 i。<sup>[4](https://www.cs.cornell.edu/courses/cs2800/2016sp/lectures/lec36-pumping.html)</sup>

## 逻辑地位与局限

该引理表达的是正则性的一个必要条件，而非充分条件。即使某个整数 n 对某语言满足泵条件，该语言也未必是正则的，因此该引理不能用来证明一个语言是正则的；它只能表明非正则性。<sup>[5](https://www.cs.odu.edu/~toida/nerzic/390teched/regular/reg-lang/non-regularity.html)</sup>

当泵引理不便使用时，还有两条标准途径：正则语言的闭包性质——若目标语言是正则的，将蕴含某个已知非正则语言是正则的（例如通过一个将目标语言满射到 {a<sup>n</sup>b<sup>n</sup>} 的同态）；以及迈希尔-尼罗德定理，它给出了正则性的一个充要条件。<sup>[11](https://www.scranton.edu/faculty/mccloskey/courses/cmps260/chap4_linz.html)</sup><sup> • </sup><sup>[7](https://courses.grainger.illinois.edu/ECE374BL1/fa2026/labs/lab07/)</sup>

## 相关引理

上下文无关语言有类似的泵引理，其直观相同，只不过它观察的不是状态机中的循环路径，而是语法分析树中的子树必然重复；该引理用于表明某些语言不是上下文无关的。<sup>[3](https://facultyweb.cs.wwu.edu/~wehrwes/courses/csci301_24f/lectures/L32/N32.html)</sup> 针对其他语言类也已发展出泵引理，包括线性与非线性上下文无关语言、索引语言与高阶语言，以及为带建议语言设计的交换引理等变体。<sup>[12](https://arxiv.org/abs/1012.0023)</sup><sup> • </sup><sup>[13](https://arxiv.org/abs/1705.10699)</sup><sup> • </sup><sup>[14](https://arxiv.org/abs/0808.4122)</sup>

## References

1. [Bar-Hillel, Y., Perles, M., Shamir, E. (1961). On formal properties of simple phrase structure grammars. STUF - Language Typology and Universals 14, 143–172.](https://www.degruyterbrill.com/document/doi/10.1524/stuf.1961.14.14.143/html)
2. [Pumping Lemma for Regular Languages, VDM Publishing (Google Books record)](https://books.google.com/books/about/Pumping_Lemma_for_Regular_Languages.html?id=tMBgcAAACAAJ)
3. [CSCI 301 Lecture 32 Notes, Western Washington University](https://facultyweb.cs.wwu.edu/~wehrwes/courses/csci301_24f/lectures/L32/N32.html)
4. [Lecture 36: Pumping lemma, CS 2800, Cornell University](https://www.cs.cornell.edu/courses/cs2800/2016sp/lectures/lec36-pumping.html)
5. [Non-regularity and the Pumping Lemma, Old Dominion University](https://www.cs.odu.edu/~toida/nerzic/390teched/regular/reg-lang/non-regularity.html)
6. [Automata Theory lecture notes, VSS University of Technology](https://www.vssut.ac.in/lecture_notes/lecture1423726104.pdf)
7. [ECE374B Lab 7, University of Illinois](https://courses.grainger.illinois.edu/ECE374BL1/fa2026/labs/lab07/)
8. [Formal Languages and Automata lecture notes, University of Cambridge](https://www.cl.cam.ac.uk/teaching/1516/DiscMath/dism-forla-notes-2016.pdf)
9. [Theory of Computation notes, University of Waterloo (J. Watrous)](https://cs.uwaterloo.ca/~watrous/ToC-notes/ToC-notes.05.pdf)
10. [The Pumping Lemma, CS 154, San Jose State University](https://www.cs.sjsu.edu/~pollett/154.1.20s/Lec20200302.html)
11. [Chapter notes on Linz, Section 4.3, University of Scranton](https://www.scranton.edu/faculty/mccloskey/courses/cmps260/chap4_linz.html)
12. [Pumping lemmas for linear and nonlinear context-free languages, arXiv](https://arxiv.org/abs/1012.0023)
13. [Pumping Lemma for Higher-order Languages, arXiv](https://arxiv.org/abs/1705.10699)
14. [Swapping Lemmas for Regular and Context-Free Languages, arXiv](https://arxiv.org/abs/0808.4122)

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

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Formal languages and automata theory › Regular languages and rational expressions

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/pumping-lemma-for-regular-languages

English original: https://www.edgepedia.org/pumping-lemma-for-regular-languages
