# 鸽巢原理

鸽巢原理是指：如果将多于 n 个物体放入 n 个盒子中，那么至少有一个盒子包含两个或更多物体。它也被称为狄利克雷盒原理或抽屉原理（德语 *Schubfachprinzip*），是组合数学中最基本的原理之一。<sup>[1](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)</sup><sup> • </sup><sup>[2](https://www.imsc.res.in/~vikram/DiscreteMaths/2011/pp.pdf)</sup>

| 关键事实 | 细节 |
|---|---|
| 简单形式 | 将多于 n 个物体放入 n 个盒子，必然有某个盒子至少包含两个物体。<sup>[1](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)</sup> |
| 推广形式 | 将 N 个物体分配到 k 个盒子中，必然有某个盒子至少包含 ⌈N/k⌉ 个物体，其中 ⌈x⌉ 是不小于 x 的最小整数。<sup>[1](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)</sup> |
| 精确阈值 | 在 k 个盒子中迫使某个盒子至少装有 m 个物体的最小物体数为 n = k(m − 1) + 1；当有 k(m − 1) 个物体时，每个盒子都可以恰好装有 m − 1 个。<sup>[3](https://louis.pressbooks.pub/discretemathematics/chapter/the-pigeonhole-principle/)</sup> |
| 命名由来 | 约翰·彼得·古斯塔夫·勒热纳·狄利克雷（Johann Peter Gustav Lejeune Dirichlet，1805–1859），他称之为抽屉原理；传统上认为他于1834年提出该原理，但他发表使用该原理的著作出现在1842年。<sup>[4](https://proofwiki.org/wiki/Dirichlet%27s_Box_Principle/Historical_Note)</sup><sup> • </sup><sup>[5](https://backoffice.biblio.ugent.be/download/4115264/4115265)</sup> |
| 已知最早使用 | 法国耶稣会士让·勒雷雄（Jean Leurechon）在《精选命题》（*Selectæ Propositiones*，1622年）中间接使用了该原理，比狄利克雷早了大约两个世纪。<sup>[5](https://backoffice.biblio.ugent.be/download/4115264/4115265)</sup> |
| 函数形式 | 从集合 X 到集合 Y 的函数 f，若 \|X\| > \|Y\|，则 f 不可能是单射：X 中有两个不同元素具有相同的像。<sup>[6](https://cs.clarku.edu/~cs122/class/pigeonhole/)</sup> |
| 证明复杂性 | 弱鸽巢原理（n 个鸽巢）的归结证明需要长度 Ω(2^{n^{ε}})，其中 ε = 1/3。<sup>[7](https://arxiv.org/abs/cs/0304041)</sup> |

## 陈述与证明思路

其最简单的陈述是：如果将多于 n 个物品放入 n 个容器中，那么至少有一个容器最终装有两个或更多物品。推广形式是说，将 N 个物体分配到 k 个盒子中，必然有某个盒子至少包含 ⌈N/k⌉ 个物体。<sup>[1](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)</sup> 上取整 ⌈x⌉ 是不小于 x 的最小整数。<sup>[1](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)</sup>

证明是一个计数论证。假设每个盒子最多装有 r − 1 个物品；那么总数不可能超过 k(r − 1)，因此任何 N > k(r − 1) 都保证有某个盒子装有 r 个或更多。<sup>[1](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)</sup> 等价地，满足 m ≤ ⌈n/k⌉ 的最小整数 n 是 n = k(m − 1) + 1：当有 k(m − 1) 个物体时，可以在每个盒子中放 m − 1 个，因此再多一个物体就迫使某个盒子装有 m 个。<sup>[3](https://louis.pressbooks.pub/discretemathematics/chapter/the-pigeonhole-principle/)</sup>

用函数的语言来说，该原理指出：对于有限集 X 和 Y，函数 f : X → Y 若 |X| > |Y|，则不可能是单射，因此存在不同的 x₁ 和 x₂ 使得 f(x₁) = f(x₂)。<sup>[6](https://cs.clarku.edu/~cs122/class/pigeonhole/)</sup> 更精确地说，某个值 y 被 X 中至少 ⌈|X|/|Y|⌉ 个元素取到。<sup>[6](https://cs.clarku.edu/~cs122/class/pigeonhole/)</sup> 物体和盒子是建模选择，而非字面意义上的物品；应用该原理的困难在于决定什么扮演每个角色。<sup>[1](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)</sup><sup> • </sup><sup>[8](https://math.ethz.ch/news-and-events/news/d-math-news/2016/05/creative-proofs-with-pigeons-and-boxes.html)</sup>

## 历史

该原理通常以狄利克雷命名，他称之为 Schubfachprinzip（抽屉或搁架原理）。1834年常被提及为发现之年，但尚未在他的著作中找到更早的确切记载，而他发表该原理的应用是在1842年；在这些出版物中，他没有给该原理命名，也没有声称它是新的。<sup>[4](https://proofwiki.org/wiki/Dirichlet%27s_Box_Principle/Historical_Note)</sup><sup> • </sup><sup>[5](https://backoffice.biblio.ugent.be/download/4115264/4115265)</sup>

**更早的出现。** 巴黎北索邦大学的历史学家伯努瓦·里托（Benoît Rittaud）和根特大学科学史中心的阿尔布雷希特·黑费尔（Albrecht Heeffer）表明，该原理早在狄利克雷之前至少两个世纪就已出现：法国耶稣会数学家让·勒雷雄在1622年印刷的一本小书《精选命题》中间接使用了它，而马兰·梅森（Marin Mersenne）在1625年的一部著作中从勒雷雄那里抄录了几个相关命题。<sup>[5](https://backoffice.biblio.ugent.be/download/4115264/4115265)</sup><sup> • </sup><sup>[9](https://openurl.ebsco.com/contentitem/gcd%3A96032739?crl=c&id=ebsco%3Agcd%3A96032739&jrnl=03436993&sid=ebsco%3Aplink%3Acrawler-gcd)</sup>

英文名称有其自身的历史。“Pigeon-hole principle”在英语中出现于保罗·埃尔德什（Paul Erdős）和理查德·拉多（Richard Rado）1956年的论文《集合论中的一种划分演算》（*A partition calculus in set theory*，载《美国数学会公报》第62卷），作者在其中描述了“戴德金的鸽巢原理，也称为盒子论证或抽屉论证（Schubfachprinzip）”；法语术语仍然是“le principe des tiroirs de Dirichlet”，即狄利克雷抽屉原理。<sup>[10](https://fomarchive.ugent.be/2000-December/004615.html)</sup>

## 应用

**丢番图逼近。** 最早的非平凡应用之一是狄利克雷本人的工作，在丢番图逼近中：对任意无理实数 α，存在无穷多个有理数 p/q 满足 |α − p/q| ≤ 1/q²。对于无理数 α 和每个正整数 N，存在整数 p 和 q，满足 1 ≤ q ≤ N 且 |qα − p| < 1/(N + 1)。为了证明这一点，将 0, α, …, Nα 的 N + 1 个小数部分排列在单位圆上；它们的圆弧间隔之和为 1，且某个间隔严格小于 1/(N + 1)，因为若间隔相等则意味着 α 是有理数。该间隔给出了所需的 p 和 q。<sup>[2](https://www.imsc.res.in/~vikram/DiscreteMaths/2011/pp.pdf)</sup><sup> • </sup><sup>[5](https://backoffice.biblio.ugent.be/download/4115264/4115265)</sup><sup> • </sup><sup>[17](https://www.cambridge.org/core/books/abs/concise-introduction-to-the-theory-of-numbers/diophantine-approximation/54BCAC364ABE159F31ACC115237AE8AB)</sup>

**数论。** 从 {1, 2, …, 2n} 中任取 n + 1 个整数，其中必有两个数，一个整除另一个。每个数都可以唯一地写成 2^s·a，其中 a 为奇数，而 [2n] 中只有 n 个奇数，因此所取的数中有两个具有相同的奇数部分，于是 2 的幂较小的那个整除另一个。<sup>[2](https://www.imsc.res.in/~vikram/DiscreteMaths/2011/pp.pdf)</sup><sup> • </sup><sup>[11](https://ayong.web.illinois.edu/Fall2026Math413/lecture7.html)</sup> 类似地，从 {1, 2, …, 2n} 中任取 n + 1 个整数，其中必有两个数相差 1，只需将 {1, 2}, {3, 4}, …, {2n − 1, 2n} 配成 n 个盒子。<sup>[11](https://ayong.web.illinois.edu/Fall2026Math413/lecture7.html)</sup>

**图论。** 在任何图（不一定连通）中，存在两个度数相同的顶点，因为 n 个顶点的图中顶点的度数在 0 到 n − 1 之间，但度数 0 和 n − 1 不能同时出现。<sup>[2](https://www.imsc.res.in/~vikram/DiscreteMaths/2011/pp.pdf)</sup>

**拉姆齐理论。** 该原理是拉姆齐理论的基础情形，后者研究在足够大的组合对象中什么结构是不可避免的。经典例子：在任意六个人中，要么有三个人互相认识，要么有三个人互相不认识，而五个人不够。将其中一人标记为 A，对两个盒子和五个人应用鸽巢原理，表明 A 与其余人中至少三人是朋友，或与其中至少三人是陌生人。<sup>[2](https://www.imsc.res.in/~vikram/DiscreteMaths/2011/pp.pdf)</sup> 一般地，对于 [n] 的顶点的 r 着色，n = Σᵢ(ℓᵢ − 1) + 1 足以迫使出现 ℓᵢ 个同色顶点；这正是鸽巢原理，这就是为什么拉姆齐理论被认为是它的推广。<sup>[2](https://www.imsc.res.in/~vikram/DiscreteMaths/2011/pp.pdf)</sup>

**计算机科学。** 将任意长度字符串映射到 λ 位输出的哈希函数 H 是一个压缩映射，因此根据鸽巢原理，碰撞必然存在，尽管对于随机函数，通过采样找到碰撞的概率很小。<sup>[12](https://www.cs.uic.edu/~block/courses/cs402-fall2026/resources.html)</sup> 生日攻击利用生日悖论来找到这样的碰撞：选择 2^{λ/2} 个随机输入并检查所有配对，这需要 O(2^{λ/2}) 的时间和空间，远低于针对 λ = 256 的哈希朴素检查配对的 O(2^λ) 成本，而穷举存储大约需要 4 × 10^{22} PB。<sup>[12](https://www.cs.uic.edu/~block/courses/cs402-fall2026/resources.html)</sup> 哈希表同样必须处理碰撞，因为该原理保证键会落入共享的桶中。<sup>[6](https://cs.clarku.edu/~cs122/class/pigeonhole/)</sup>

## 逻辑与证明复杂性

形式上，该原理指出不存在从有限集到更小集合的单射映射。对于固定的 m > n，命题 PHP^n_m（不存在从 m 只鸽子到 n 个鸽巢的一一映射）可以写成以布尔变量 x_{ij} 表示的命题公式，而该原理就是断言这个公式是重言式。<sup>[13](https://www.math.ias.edu/files/Website03-25-19.pdf)</sup> 尽管该陈述是平凡的，但它体现了数学中的非构造性论证：一个证明可以确立碰撞或重复值的存在，而不必指出它，正如闵可夫斯基关于凸体中格点的定理，或埃尔德什关于小拉姆齐图存在的概率证明。<sup>[13](https://www.math.ias.edu/files/Website03-25-19.pdf)</sup>

该原理对于证明指数困难函数存在的计数论证至关重要，这在一定程度上解释了人们对其证明复杂性的兴趣。<sup>[13](https://www.math.ias.edu/files/Website03-25-19.pdf)</sup> 衡量形式证明必须有多长，产生了精确的下界：弱鸽巢原理（n 个鸽巢，任意数量的鸽子）的任何归结证明，其长度均为 Ω(2^{n^{ε}})，其中常数 ε = 1/3。<sup>[7](https://arxiv.org/abs/cs/0304041)</sup> 2025年，比姆（Beame）和惠特迈耶（Whitmeyer）证明了位鸽巢原理 CNF 的树状割平面反驳的 2^{n^{1−o(1)}} 下界，改进了此前最好的 2^{Ω(√n)}。<sup>[14](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICALP.2025.21)</sup>

**无限形式。** 无限鸽巢原理指出，任何有限着色的无限序列都有一个无限单色子序列，等价地说，一个有限值域的函数会无限次取到某个值。一般来说，不存在产生这种子序列的可计算泛函，该原理的强度已在可计算性理论和反推数学中得到广泛研究。<sup>[15](https://academic.oup.com/logcom/article-abstract/22/2/329/943665)</sup><sup> • </sup><sup>[16](https://arxiv.org/abs/2407.01236)</sup>

## References

1. [Pigeonhole Principle Cheat Sheet, Discrete Mathematics, Math101.ca](https://learn.math101.ca/cheatsheets/discrete-mathematics-pigeonhole-principle/)
2. [Pigeonhole Principle and Ramsey Theory, lecture notes, Institute of Mathematical Sciences, Chennai](https://www.imsc.res.in/~vikram/DiscreteMaths/2011/pp.pdf)
3. [The Pigeonhole Principle, Logical Thinking through Discrete Mathematics, Loyola University Pressbooks](https://louis.pressbooks.pub/discretemathematics/chapter/the-pigeonhole-principle/)
4. [Dirichlet's Box Principle, Historical Note, ProofWiki](https://proofwiki.org/wiki/Dirichlet%27s_Box_Principle/Historical_Note)
5. [Benoît Rittaud and Albrecht Heeffer (2014). The pigeonhole principle, two centuries before Dirichlet. Mathematical Intelligencer 36(2), 27–29.](https://backoffice.biblio.ugent.be/download/4115264/4115265)
6. [Lecture Notes: The Pigeonhole Principle, Clark University CS 122](https://cs.clarku.edu/~cs122/class/pigeonhole/)
7. [P ≠ NP, propositional proof complexity, and resolution lower bounds for the weak pigeonhole principle, arXiv:cs/0304041](https://arxiv.org/abs/cs/0304041)
8. [Creative proofs with pigeons and boxes, ETH Zurich Department of Mathematics (2016)](https://math.ethz.ch/news-and-events/news/d-math-news/2016/05/creative-proofs-with-pigeons-and-boxes.html)
9. [The Pigeonhole Principle, Two Centuries Before Dirichlet, EBSCOhost abstract, Mathematical Intelligencer](https://openurl.ebsco.com/contentitem/gcd%3A96032739?crl=c&id=ebsco%3Agcd%3A96032739&jrnl=03436993&sid=ebsco%3Aplink%3Acrawler-gcd)
10. [FOM mailing list: History of Pigeon-hole Principle, Jeff Hirst, December 2000](https://fomarchive.ugent.be/2000-December/004615.html)
11. [Math 413 Lecture 7: The pigeonhole principle, Alexander Yong, University of Illinois](https://ayong.web.illinois.edu/Fall2026Math413/lecture7.html)
12. [CS 402 Resources: Birthday Attacks, University of Illinois Chicago](https://www.cs.uic.edu/~block/courses/cs402-fall2026/resources.html)
13. [Avi Wigderson, Mathematics and Computation, draft chapter on the pigeonhole principle, Institute for Advanced Study](https://www.math.ias.edu/files/Website03-25-19.pdf)
14. [Paul Beame and Michael Whitmeyer (2025). Multiparty Communication Complexity of Collision-Finding and Cutting Planes Proofs of Concise Pigeonhole Principles. ICALP 2025, LIPIcs 334.](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICALP.2025.21)
15. [Exploring the Computational Content of the Infinite Pigeonhole Principle, Journal of Logic and Computation 22(2)](https://academic.oup.com/logcom/article-abstract/22/2/329/943665)
16. [The reverse mathematics of the pigeonhole hierarchy, arXiv:2407.01236](https://arxiv.org/abs/2407.01236)
17. [Diophantine approximation (Chapter 6) - A Concise Introduction to the Theory of Numbers](https://www.cambridge.org/core/books/abs/concise-introduction-to-the-theory-of-numbers/diophantine-approximation/54BCAC364ABE159F31ACC115237AE8AB)

---
*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 › Combinatorics › Enumerative combinatorics › Counting techniques and recurrences

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/pigeonhole-principle

English original: https://www.edgepedia.org/pigeonhole-principle
