# 余积

**余积**是范畴论中通过将对象映入结果而非从结果映出的方式来组合对象的构造：一个对象，配备从每个被加项出发的态射，使得从这些被加项出发的任意一族映射都唯一地穿过它分解。它是范畴乘积的对偶，在具体范畴中表现为集合的不交并、群的自由积、阿贝尔群与向量空间的直和，以及编程语言中的和类型。<sup>[1](https://stacks.math.columbia.edu/tag/04AN)</sup><sup> • </sup><sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup>

| 关键事实 | 详情 |
|---|---|
| 泛性质 | 一个对象 x ⨿ y 连同态射 i、j，使得对任意 w 及映射 α: x→w、β: y→w，存在唯一的 γ: x ⨿ y → w 使图表交换<sup>[1](https://stacks.math.columbia.edu/tag/04AN)</sup> |
| 唯一性 | 同一对对象的任意两个余积通过一个与其余投影相容的同构唯一同构，这是米田引理的推论<sup>[1](https://stacks.math.columbia.edu/tag/04AN)</sup> |
| 余极限地位 | 余积 ∐ M_i 是以仅有恒等态射的范畴为指标的余极限<sup>[3](https://stacks.math.columbia.edu/tag/002D)</sup> |
| 在 Set 中 | 不交并，对有限集有 \|S ∐ T\| = \|S\| + \|T\|：余积是加法的范畴化<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup> |
| 在代数中 | Grp 中的自由积；Ab 与 Vect 中的直和（有限支撑元组）；交换环中 Z 上的张量积<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup><sup> • </sup><sup>[4](https://www.paultaylor.eu/prafm/html/s54.html)</sup> |
| 对偶性 | C 中的余积是 C^op 中的积；空余积是始对象<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup> |
| 在编程中 | 和类型：Haskell 的 `Either a b = Left a | Right b`、带标签联合，以及类型论中的余积类型 A + B<sup>[5](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/5fba3fe9c23b1fcbe00f11577e97aaf1ce6d0b36/src/content/1.5/Products%20and%20Coproducts.tex)</sup><sup> • </sup><sup>[6](https://planetmath.org/212coproducts)</sup> |

## 定义与泛性质

对于范畴中的两个对象 x 和 y，**余积**是一个对象 x ⨿ y 连同态射 i: x → x ⨿ y 和 j: y → x ⨿ y，称为**余投影**或入射，使得对每个对象 w 及每对态射 α: x → w、β: y → w，存在唯一态射 γ: x ⨿ y → w 满足 γ ∘ i = α 且 γ ∘ j = β。<sup>[1](https://stacks.math.columbia.edu/tag/04AN)</sup><sup> • </sup><sup>[26](https://ncatlab.org/nlab/show/amalgamation)</sup> 这个唯一映射 γ 常记作 (f, g)。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup> 等价地，余积是仅由两个对象构成的图表上的余极限。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup>

泛性质将对象完全确定下来：若余积存在，则它在唯一同构意义下唯一，这由米田引理应用于对偶范畴得出。<sup>[1](https://stacks.math.columbia.edu/tag/04AN)</sup> 余投影本身不必是单态射，因此映入余积的入射并不总是日常意义上的嵌入。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup> 以空集为指标的余积是该范畴的始对象。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup>

## 常见范畴中的余积

同一个泛性质因范畴不同而产生截然不同的对象，这正是余积以抽象方式陈述、并逐例具体实现的原因。<sup>[7](https://mathworld.wolfram.com/Coproduct.html)</sup>

- **集合**：不交并，以包含映射为余投影。给定 X 和 Y，可将 X ⨿ Y 实现为 X × {0} ∪ Y × {1}，于是元素带有来源标签；包含映射 i₁: X → X ⨿ Y 和 i₂: Y → X ⨿ Y 满足：任意 f: X → Z 和 g: Y → Z 给出唯一的 h: X ⨿ Y → Z。<sup>[8](https://justinasher.me/categorical-coproducts)</sup><sup> • </sup><sup>[9](https://ltrujello.github.io/category_theory/Universal%20Constructions%20and%20Limits/Finite%20Coproducts/)</sup>
- **拓扑空间**：点集为不交并、开子空间为各被加项开子空间之不交并的空间。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup>
- **带基点拓扑空间**：楔和，即在基点处粘合的空间。<sup>[10](https://doi.org/10.1090/s0002-9904-1965-11234-4)</sup>
- **群**：自由积 G * H，其元素是 G 与 H 中元素构成的约化交错词；自由积在代数拓扑中频繁出现。<sup>[9](https://ltrujello.github.io/category_theory/Universal%20Constructions%20and%20Limits/Finite%20Coproducts/)</sup><sup> • </sup><sup>[11](https://www.maths.ed.ac.uk/~tl/ct/five.pdf)</sup> 在泛代数中，余积历史上正因如此被称为自由积。<sup>[4](https://www.paultaylor.eu/prafm/html/s54.html)</sup>
- **阿贝尔群、模、向量空间**：直和，即积中由仅有有限多个非零分量的元组构成的子对象，以各被加项的入射为余投影。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup><sup> • </sup><sup>[7](https://mathworld.wolfram.com/Coproduct.html)</sup>
- **交换环**：张量积 R ⊗_Z S。<sup>[4](https://www.paultaylor.eu/prafm/html/s54.html)</sup>
- **偏序集**：并（上确界）；在公式的可证性序下，二元并为析取，始对象为假。<sup>[4](https://www.paultaylor.eu/prafm/html/s54.html)</sup>
- **概形**：不交并；由于 Spec 函子的反变性质，概形的情形更为微妙，有限积与任意余积存在，而一般概形的无限积未必存在。<sup>[8](https://justinasher.me/categorical-coproducts)</sup>

## 与积的对偶性

余积是与积对偶的范畴概念：将积的泛性质中的箭头反向，便得到对象 c，连同从 a 和 b 出发的两个入射以及到任意竞争对象的唯一分解态射。<sup>[7](https://mathworld.wolfram.com/Coproduct.html)</sup><sup> • </sup><sup>[5](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/5fba3fe9c23b1fcbe00f11577e97aaf1ce6d0b36/src/content/1.5/Products%20and%20Coproducts.tex)</sup> 形式上，C 中的余积等同于对偶范畴 C^op 中的积。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup> 积自身的泛性质，以投影 p_i(f) = f(i) 表达，是余积泛性质的镜像。<sup>[12](https://encyclopediaofmath.org/wiki/Direct_product)</sup>

**两者重合之时。** 在阿贝尔范畴中，直和就是范畴余积，且对有限指标集积与余积重合；对无限多个因子则未必重合。<sup>[13](https://planetmath.org/counterexamplesforproductsandcoproduct)</sup> 在向量空间与模范畴中，有限积与相应的余积重合，其共同对象称为双积或直和。<sup>[4](https://www.paultaylor.eu/prafm/html/s54.html)</sup><sup> • </sup><sup>[14](https://www.mathphysicsbook.com/mathematics/abstract-algebra/combining-algebraic-objects/)</sup> 麦克莱恩 1965 年的综述记录了一般性陈述：加法范畴具有有限积与有限余积，二者重合为 A₁ ⊕ ⋯ ⊕ A_n。<sup>[10](https://doi.org/10.1090/s0002-9904-1965-11234-4)</sup> 在其他情形下两种构造确实不同：在 Set 中积是笛卡尔积而余积是不交并，在 Grp 中积是直积而余积是自由积。<sup>[8](https://justinasher.me/categorical-coproducts)</sup>

## 以数言之

**余积作为加法。** 对有限集 S 和 T，|S ∐ T| = |S| + |T|，因此余积是自然数与基数加法的范畴化。有限集在余积下的同构类构成一个交换幺半群，其群完备化是有限集的 K-群，即 Z。<sup>[2](https://ncatlab.org/nlab/show/coproduct)</sup><sup> • </sup><sup>[8](https://justinasher.me/categorical-coproducts)</sup>

**无限和与积。** 对以 ℕ 为指标、每个 G_i = Z₂ 的族，积 ∏ Z₂ 是所有函数 ℕ → Z₂ 的集合，基数为 2^ℵ₀，不可数；而直和（此情形下的余积）是所有有限二进制串的集合，可数；因此这两个对象不可能同构。<sup>[13](https://planetmath.org/counterexamplesforproductsandcoproduct)</sup>

**群与阿贝尔群。** Z * Z 是两个生成元上的自由群，非阿贝尔；而 Z ⊕ Z 是阿贝尔的：同样的两个对象在 Grp 与 Ab 中的余积不同构。<sup>[13](https://planetmath.org/counterexamplesforproductsandcoproduct)</sup>

## 余积、和与类型论

在类型论中，余积类型 A + B 对应于集合论的不交并，不含任何被加项的情形由空类型 0 给出。<sup>[15](https://planetmath.org/17coproducttypes)</sup> 入射 inl: A → A + B 和 inr: B → A + B 满足不交性与单射性等价：inl(a₁) = inl(a₂) 等价于 a₁ = a₂，inr 同理，而 inl(a) = inr(b) 等价于空类型，因此 inl 与 inr 的像不交。<sup>[6](https://planetmath.org/212coproducts)</sup>

在编程中，两个类型的余积是带标签联合。经典的 Haskell 实现是 `Either`，在标准 Prelude 中定义为 `data Either a b = Left a | Right b`。<sup>[5](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/5fba3fe9c23b1fcbe00f11577e97aaf1ce6d0b36/src/content/1.5/Products%20and%20Coproducts.tex)</sup> C++ 的联合无标签，程序员必须自行追踪哪个成员有效；带标签联合也称为变体，`boost::variant` 是一个通用实现。<sup>[5](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/5fba3fe9c23b1fcbe00f11577e97aaf1ce6d0b36/src/content/1.5/Products%20and%20Coproducts.tex)</sup> “不交并”这一名称在类型论中并不贴切，因为类型论中并集没有意义；“和”是更好的术语。<sup>[16](https://people.cs.nott.ac.uk/psztxa/mgs.2022/cftlfp-4.pdf)</sup>

## 余积、余极限与伴随函子

从两个对象推广开去，以集合 I 为指标的族之余积 ∐_{i∈I} M_i 按定义是以仅有恒等态射的范畴 I 为指标的余极限（当它存在时）；这涵盖了任意（包括无限）余积。<sup>[3](https://stacks.math.columbia.edu/tag/002D)</sup> 当指标范畴只是无任何非恒等态射的一些点，其余极限称为余积，这正是直和、不交并与张量积背后的概念。<sup>[17](https://math.uchicago.edu/~amathew/chcategories.pdf)</sup> 一个范畴具有有限余积，当且仅当它具有始对象以及对象对的余积。<sup>[9](https://ltrujello.github.io/category_theory/Universal%20Constructions%20and%20Limits/Finite%20Coproducts/)</sup>

泛性质转化为 hom-集的自然同构，

\[ \mathcal{C}(X + Y, Z) \cong \mathcal{C}(X, Z) \times \mathcal{C}(Y, Z), \]

即积同构 C(Z, X × Y) ≅ C(Z, X) × C(Z, Y) 的对偶。<sup>[16](https://people.cs.nott.ac.uk/psztxa/mgs.2022/cftlfp-4.pdf)</sup> 这种伴随式刻画将余积与自由对象联系起来：左伴随 F: C → D 保持余极限，从而保持余积；而右伴随保持极限。<sup>[17](https://math.uchicago.edu/~amathew/chcategories.pdf)</sup>

积与余积所具有的泛性质可追溯至桑德斯·麦克莱恩（Saunders Mac Lane），他于 1950 年在同调代数中研究模范畴时首次陈述了这一性质；其范畴形式的定义出现在他 1950 年发表于《美国数学会公报》的论文《群的对偶性》（*Duality for Groups*）中，而这一思想已先见于他 1948 年的《美国国家科学院院刊》短文《群、范畴与对偶性》（*Groups, Categories and Duality*）。<sup>[4](https://www.paultaylor.eu/prafm/html/s54.html)</sup><sup> • </sup><sup>[18](https://hsm.stackexchange.com/questions/5256/where-did-the-notion-of-the-product-in-a-category-first-appear)</sup> 范畴、函子、自然变换、极限与余极限已出现在艾伦伯格（Eilenberg）与麦克莱恩 1945 年的论文《自然等价的一般理论》（"General Theory of Natural Equivalences"）中。<sup>[19](https://plato.stanford.edu/entries/category-theory/)</sup>

## 无限余积与存在问题

无限余积由同样的离散图表余极限定义处理，但其存在性是范畴的一个实质条件，而非理所当然。<sup>[3](https://stacks.math.columbia.edu/tag/002D)</sup> 若对任意一对对象都存在余积 x ⨿ y，则称范畴具有对象对的余积，这一概念不同于具有有限余积——后者还总要求有始对象。<sup>[1](https://stacks.math.columbia.edu/tag/04AN)</sup> ∏ Z₂ 与其直和的可数对不可数之比较表明，即便无限积与无限余积都存在，它们也可能是基数不同的对象，从而不同构。<sup>[13](https://planetmath.org/counterexamplesforproductsandcoproduct)</sup> 在概形范畴中，任意余积存在，而一般概形的无限积未必存在。<sup>[8](https://justinasher.me/categorical-coproducts)</sup>

## 近期形式化与研究（2023–2026）

形式证明库已使余积成为范畴论与类型论之间的一个实用接口。在 Lean 的 Mathlib 库中，Type u 中的范畴二元余积被等同于和类型 X ⊕ Y，函子 F: J → Type 的一般余积被等同于 sigma 类型 Σ j, F j；Mathlib 证明了 X ⨿ Y ≅ X ⊕ Y 以及 ∐ F ≅ (j : J) × F j。<sup>[20](https://leanprover-community.github.io/mathlib4_docs/Mathlib/CategoryTheory/Limits/Types/Coproducts.html)</sup> 1Lab 是一个立方 Agda 库，它建立了二元余积与从二对象离散范畴出发、分别取值于两个被加项的函子上的余极限之间的对应，这与将积刻画为极限的做法对偶，并将带指标余积处理为以指标类型的基本预群胚为形状的余极限；作为泛构造，带指标余积在同构意义下唯一。<sup>[21](https://1lab.dev/Cat.Diagram.Colimit.Coproduct.html)</sup><sup> • </sup><sup>[22](https://1lab.dev/Cat.Diagram.Coproduct.Indexed.html)</sup> 1Lab 还发展了**不交**余积的概念：带指标余积 ∑ F 称为不交的，若每个包含 F i → ∑ F 都是单态射，且对不相等的 i ≠ j，比较方块是以始对象为顶点的拉回，从而当 ⊥ 为始对象时各被加项在始对象处相交；始对象自身是任意族 ⊥ → C 的不交余积。<sup>[22](https://1lab.dev/Cat.Diagram.Coproduct.Indexed.html)</sup>

在同伦类型论中，余积类型具有其作为余极限的预期泛性质；由于那里的一切构造都是同伦不变的，所有余极限必然是同伦余极限；有限余极限（在适当的“有限”同伦定义下）可由推出与有限余积构造出来。<sup>[23](https://planetmath.org/68Pushouts)</sup> 活跃的研究仍在继续：一篇 TYPES 2025 会议论文（LIPIcs 第 384 卷）形式化了同伦类型论中关于极限的结果，其主要结果已完全形式化；agda-unimath 库的余积类型页面带有日期从 2025-01-07 到 2026-05-05 的更新日志条目，表明形式化工作仍在持续进行。<sup>[24](https://drops.dagstuhl.de/storage/00lipics/lipics-vol384-types2025/LIPIcs.TYPES.2025.1/LIPIcs.TYPES.2025.1.pdf)</sup><sup> • </sup><sup>[25](https://unimath.github.io/agda-unimath/foundation.coproduct-types.html)</sup>

## References

1. [Section 4.5 (04AN): Coproducts of pairs, The Stacks Project](https://stacks.math.columbia.edu/tag/04AN)
2. [coproduct in nLab](https://ncatlab.org/nlab/show/coproduct)
3. [Section 4.14 (002D): Limits and colimits, The Stacks Project](https://stacks.math.columbia.edu/tag/002D)
4. [Practical Foundations of Mathematics, Section 5.4, Paul Taylor](https://www.paultaylor.eu/prafm/html/s54.html)
5. [Products and Coproducts, Milewski, Category Theory for Programmers](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/5fba3fe9c23b1fcbe00f11577e97aaf1ce6d0b36/src/content/1.5/Products%20and%20Coproducts.tex)
6. [2.12 Coproducts, Homotopy Type Theory book (PlanetMath mirror)](https://planetmath.org/212coproducts)
7. [Coproduct, Wolfram MathWorld](https://mathworld.wolfram.com/Coproduct.html)
8. [Categorical coproducts and K-theory, Justin Asher](https://justinasher.me/categorical-coproducts)
9. [3.4 Finite Coproducts, lecture notes (L. Trujillo)](https://ltrujello.github.io/category_theory/Universal%20Constructions%20and%20Limits/Finite%20Coproducts/)
10. [Categorical algebra, Saunders Mac Lane, Bulletin of the AMS (1965)](https://doi.org/10.1090/s0002-9904-1965-11234-4)
11. [Category theory lecture notes, T. Leinster, University of Edinburgh](https://www.maths.ed.ac.uk/~tl/ct/five.pdf)
12. [Direct product, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Direct_product)
13. [Counterexamples for products and coproduct, PlanetMath](https://planetmath.org/counterexamplesforproductsandcoproduct)
14. [Combining algebraic objects, Mathematics for Physics](https://www.mathphysicsbook.com/mathematics/abstract-algebra/combining-algebraic-objects/)
15. [1.7 Coproduct types, PlanetMath](https://planetmath.org/17coproducttypes)
16. [Products, coproducts and exponentials, University of Nottingham lecture notes](https://people.cs.nott.ac.uk/psztxa/mgs.2022/cftlfp-4.pdf)
17. [Categories, A. Mathew, University of Chicago lecture notes](https://math.uchicago.edu/~amathew/chcategories.pdf)
18. [Where did the notion of the product in a category first appear? History of Science and Mathematics Stack Exchange](https://hsm.stackexchange.com/questions/5256/where-did-the-notion-of-the-product-in-a-category-first-appear)
19. [Category Theory, Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/entries/category-theory/)
20. [Mathlib.CategoryTheory.Limits.Types.Coproducts](https://leanprover-community.github.io/mathlib4_docs/Mathlib/CategoryTheory/Limits/Types/Coproducts.html)
21. [Coproducts are colimits, 1Lab](https://1lab.dev/Cat.Diagram.Colimit.Coproduct.html)
22. [Indexed coproducts, 1Lab](https://1lab.dev/Cat.Diagram.Coproduct.Indexed.html)
23. [6.8 Pushouts, Homotopy Type Theory book (PlanetMath mirror)](https://planetmath.org/68Pushouts)
24. [Choice Principles and Hypercompletion in HoTT, LIPIcs TYPES 2025](https://drops.dagstuhl.de/storage/00lipics/lipics-vol384-types2025/LIPIcs.TYPES.2025.1/LIPIcs.TYPES.2025.1.pdf)
25. [Coproduct types, agda-unimath](https://unimath.github.io/agda-unimath/foundation.coproduct-types.html)
26. [amalgamation in nLab](https://ncatlab.org/nlab/show/amalgamation)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Algebraic structures › Universal algebra and category theory › Category theory foundations

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/coproduct

English original: https://www.edgepedia.org/coproduct
