# 克莱斯利范畴（Kleisli category）

一个**克莱斯利范畴**是由基范畴上的一个单子构造出来的范畴：它保留基范畴的对象，并把从 \( X \) 到 \( Y \) 的态射取作基范畴中从 \( X \) 到 \( T(Y) \) 的态射，其中 \( T \) 是该单子的底层自函子。单子的单位和乘法提供恒等箭头与复合律。每个单子恰好确定一个克莱斯利范畴；对于 \( \mathcal{C} \) 上的单子 \( T \)，通常写作 \( \mathcal{C}_{T} \) 或 \( \mathrm{Kl}(T) \)。<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup>

| 关键事实 | 细节 |
|---|---|
| 对象 | 与基范畴 \( \mathcal{C} \) 相同的对象<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup> |
| 态射 | 一个态射 \( X \to Y \) 是基态射 \( X \to T(Y) \)，即一个“\( T \)-平移”箭头<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup> |
| 复合 | 由单子的乘法 \( \mu \colon T T \to T \) 连同函子的作用给出；单位 \( \eta \colon \mathrm{Id} \to T \) 给出恒等<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup> |
| 代数解读 | 等价于艾伦伯格–摩尔范畴在自由 \( T \)-代数 \( (T A, \mu_{A}) \) 上的全子范畴<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup><sup> • </sup><sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup> |
| 泛性质 | 克莱斯利伴随是诱导该单子的初始伴随；艾伦伯格–摩尔伴随是终伴随<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup> |
| 编程解读 | 克莱斯利箭头是带效应程序，克莱斯利复合是函数式编程的 bind 操作<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup> |

## 构造

设 \( \mathbf{T} = (T, \mu, \eta) \) 是范畴 \( \mathcal{C} \) 上的一个单子，其中 \( T \colon \mathcal{C} \to \mathcal{C} \) 是自函子，\( \mu \colon T T \to T \) 是乘法，\( \eta \colon \mathrm{Id}_{\mathcal{C}} \to T \) 是单位。<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup> 克莱斯利范畴 \( \mathcal{C}_{T} \) 以 \( \mathcal{C} \) 的对象为对象，而 \( \mathcal{C}_{T} \) 中的态射 \( X \to Y \) 是 \( \mathcal{C} \) 中的态射 \( X \to T(Y) \)。<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup>

单子结构诱导出这些平移态射的一种自然复合。给定克莱斯利箭头 \( f \colon X \to T(Y) \) 和 \( g \colon Y \to T(Z) \)，它们的复合先对 \( f \) 应用 \( T \)，再作用 \( g \) 的底层映射，最后用 \( \mu_{Z} \) 展平；单位 \( \eta_{X} \colon X \to T(X) \) 充当 \( X \) 上的恒等。<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup> 麦克莱恩的处理通过 hom-集上的双射 \( X_{T}(x_{T}, y_{T}) \cong X(x, Ty) \) 呈现同一构造，其中 \( X_{T} \) 中的复合定义得使该双射与复合相容。<sup>[3](https://math.mit.edu/~hrm/palestine/maclane-categories.pdf)</sup>

这一构造刻意保持经济。艾伦伯格–摩尔范畴通过构造单子的所有代数所成的范畴，把一个单子分解为一个伴随；克莱斯利构造比它早十年，用少得多的结构分解同一个单子：保留基范畴的对象，并重新定义箭头是什么。<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup>

## 自由代数

克莱斯利范畴在艾伦伯格–摩尔范畴 \( \mathcal{C}^{T} \)（即 \( T \)-代数范畴）内部有一个具体描述。对象 \( X \) 上的自由 \( T \)-代数是代数 \( (T(X), \mu_{X}) \) 连同单位分量 \( \eta_{X} \colon X \to T(X) \)。<sup>[4](https://fiveable.me/category-theory/unit-10/kleisli-category-free-algebras/study-guide/0iSuDOBOuVQMtDe0)</sup> 克莱斯利范畴是 \( \mathcal{C}^{T} \) 的全子范畴，其对象正是这些自由代数；等价地，它是自由代数函子 \( F \colon M \mapsto (T M, \mu_{M}) \) 的像上的全子范畴。<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup>

这种对应逐箭头地进行。该等价把克莱斯利对象 \( A \) 送到 \( A \) 上的自由代数，而克莱斯利箭头 \( A \to T B \) 由自由性对应于唯一的代数态射 \( (T A, \mu_{A}) \to (T B, \mu_{B}) \)。在这一等同之下，克莱斯利伴随的遗忘函子成为艾伦伯格–摩尔遗忘函子的限制。<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup>

也可以直接看出这个嵌入。在对象上定义 \( J \colon \mathcal{C}_{T} \to \mathcal{C}^{T} \) 为 \( J A = \mu_{A} \)，即 \( A \) 上的自由 \( T \)-代数；在克莱斯利态射 \( f \colon A \to B \) 上定义为 \( J f = \mu_{B} \circ T f \)。这个指派是函子性的、忠实的，而且也是满的：任何自由代数态射 \( \mu_{A} \to \mu_{B} \) 都等于 \( \mu_{B} \circ T(f \circ \eta_{A}) \)，其中底层 \( f \) 唯一。<sup>[5](https://www.cs.man.ac.uk/~schalk/notes/monads.pdf)</sup> 里尔（Riehl）的教科书把同一结果表述为一条引理：一个单子的克莱斯利范畴嵌入为自由 \( T \)-代数及其间所有映射所成的全子范畴。<sup>[6](https://math.jhu.edu/~eriehl/161/context.pdf)</sup>

## 泛性质

每个伴随 \( F \dashv G \) 都在其左伴随的定义域上产生一个单子，而每个单子都以这种方式产生。诱导一个固定单子的伴随构成一个范畴，两种标准构造位于其两端：克莱斯利伴随是初始的，艾伦伯格–摩尔伴随是终的。<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup> 具体地说，对于任何余域为 \( \mathcal{B} \) 的诱导伴随，存在唯一的函子 \( \mathcal{C}_{T} \to \mathcal{B} \) 与这些伴随交换；它把 \( A \) 送到 \( F' A \)，其存在是因为每个克莱斯利对象都是自由的。<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup> nLab 记录了同样的刻画：这种初始伴随以克莱斯利范畴作为其左伴随的余域。<sup>[1](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)</sup>

正是这种初始性使克莱斯利范畴成为该单子的最小分解。该单子的任何其他代数范畴都从它接受一个典范比较函子；而艾伦伯格–摩尔范畴包含所有代数而不只是自由代数，是最大的。<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup>

## 例子

一个基本例子来自这样的单子：其克莱斯利范畴是集合与偏函数构成的范畴 \( \mathrm{pSet} \)；它的代数范畴在标准讲义中作为配对例子与它并列出现。<sup>[7](https://nzdr.ru/data/media/biblio/kolxoz/_Papers/TU_Wien_Scripta/Algebra/Kategorientheorie/Category_Theory_001%28en%29%2861s%29.pdf)</sup> 在范畴论入门课程中，克莱斯利构造也以同样方式获得动机：如果关心自由代数，就保留基范畴 \( \mathcal{C} \) 的元素，而克莱斯利范畴的对象于是就是“自由代数”。<sup>[8](https://www.cs.uoregon.edu/research/summerschool/summer23/_lectures/Introduction_to_Category_Theory_notes.pdf)</sup> 这一构造也超出普通单子：对于不必是自函子的相对单子，克莱斯利构造与艾伦伯格–摩尔构造可以移植过去，并与相对伴随相关。<sup>[9](https://arxiv.org/abs/1412.7148)</sup>

## 编程中的克莱斯利范畴

从计算机科学的角度来读，单子的克莱斯利范畴是带效应程序的范畴，单子的乘法是顺序执行操作。<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup> 一个克莱斯利箭头 \( A \to T B \) 是一个程序：它接受类型 \( A \) 的值，返回 \( B \) 中具有 \( T \)-结构的结果，例如可能缺失的值、列表或输入输出动作。克莱斯利复合正是函数式编程的 bind 操作，因此单子律保证带效应程序的顺序执行是可结合的，并以 return 为单位。<sup>[2](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)</sup>

克莱斯利范畴在专门场景中也充当语义模型。对于概率单子，一个单子可能满足的一系列性质确保其克莱斯利范畴是交换 effectus——一种用于概率计算与布尔计算的范畴模型。<sup>[10](https://www.sciencedirect.com/science/article/pii/S2352220816301122)</sup> 在量子计算中，C*-代数与完全正映射构成的范畴已被证明，在一个非交换变体中，同构于某个子范畴上一个余单子的克莱斯利范畴。<sup>[11](https://arxiv.org/abs/1501.01020)</sup>

## References

1. [Kleisli category, nLab](https://ncatlab.org/nlab/show/Kleisli%2Bcategory)
2. [The Kleisli Category and Monads in Programming, Amittai's notes](https://notes.amittai.studio/category-theory/monads-algebras/kleisli-and-programming)
3. [Free Algebras for a Monad (Mac Lane, Categories for the Working Mathematician, excerpt)](https://math.mit.edu/~hrm/palestine/maclane-categories.pdf)
4. [Kleisli category and free algebras, Fiveable Category Theory notes](https://fiveable.me/category-theory/unit-10/kleisli-category-free-algebras/study-guide/0iSuDOBOuVQMtDe0)
5. [Some notes on monads, A. Schalk, University of Manchester](https://www.cs.man.ac.uk/~schalk/notes/monads.pdf)
6. [Category Theory in Context, E. Riehl, Chapter 5 excerpt](https://math.jhu.edu/~eriehl/161/context.pdf)
7. [Category Theory Lecture Notes, TU Wien](https://nzdr.ru/data/media/biblio/kolxoz/_Papers/TU_Wien_Scripta/Algebra/Kategorientheorie/Category_Theory_001%28en%29%2861s%29.pdf)
8. [Introduction to Category Theory, University of Oregon summer school notes](https://www.cs.uoregon.edu/research/summerschool/summer23/_lectures/Introduction_to_Category_Theory_notes.pdf)
9. [Monads need not be endofunctors, arXiv:1412.7148](https://arxiv.org/abs/1412.7148)
10. [From probability monads to commutative effectuses, Journal of Logical and Algebraic Methods in Programming](https://www.sciencedirect.com/science/article/pii/S2352220816301122)
11. [Quantum Programs as Kleisli Maps, arXiv:1501.01020](https://arxiv.org/abs/1501.01020)

---
*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/kleisli-category

English original: https://www.edgepedia.org/kleisli-category
