# 单射函数

单射函数（也称一对一函数或单射）是将定义域中不同元素映射到陪域中不同元素的函数：只要 \( f(x) = f(y) \)，就有 \( x = y \)。等价地说，不同的输入总是给出不同的输出，因此陪域中没有任何值被命中一次以上。<sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup><sup> • </sup><sup>[2](https://mathworld.wolfram.com/Injection.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | 若 \( f(x_1) = f(x_2) \) 蕴含 \( x_1 = x_2 \)，则 \( f \colon X \to Y \) 是单射；像中的每个元素都有唯一的原像<sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup> |
| 等价形式 | 逆否命题：\( x \neq y \) 蕴含 \( f(x) \neq f(y) \)<sup>[3](https://www.cs.toronto.edu/~shaharry/csc236-summer-2025/lectures/l1-b.html)</sup> |
| 标准例子 | \( f(x) = x^2 \) 在 \( \mathbb{R} \) 上不是单射，因为 \( f(-2) = f(2) \)；限制在 \( [0,\infty) \) 上则成为单射<sup>[4](https://mathstats-materials.uncg.edu/mat253/web/section-inj-func.html)</sup><sup> • </sup><sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup>  |
| 左逆 | 一个函数有左逆当且仅当它是单射<sup>[5](https://mcs.une.edu.au/~pmth213/Lectures/Lecture%20Notes%20.pdf)</sup> |
| 有限集 | 对有限集，若 \( |A| > |B| \)，则不存在单射 \( A \to B \)（鸽巢原理）；若 \( |A| = |B| \)，则单射等价于满射<sup>[3](https://www.cs.toronto.edu/~shaharry/csc236-summer-2025/lectures/l1-b.html)</sup><sup> • </sup><sup>[6](https://graph.knu.ac.kr/classes/2022/spring/comb/notes.pdf)</sup>  |
| 线性代数 | 线性变换是单射当且仅当其核为 \( \{0\} \)<sup>[7](https://www.lancaster.ac.uk/~prendivs/accessible/math220/MATH220-Complete-Notes-2017.tex/Ch4.S6.html)</sup> |
| 范畴论 | 在集合范畴中，单态射恰好就是单射<sup>[8](https://encyclopediaofmath.org/wiki/Monomorphism)</sup> |

## 定义与等价表述

设 \( f \colon X \to Y \) 是一个函数。若对所有 \( x_1, x_2 \in X \)，\( f(x_1) = f(x_2) \) 蕴含 \( x_1 = x_2 \)，则该函数是单射。<sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup> 教科书中有若干等价说法，各自适用于不同类型的证明：

- \( x \neq y \) 蕴含 \( f(x) \neq f(y) \)，即逆否形式，表述为“若输入不同，则输出不同”。<sup>[3](https://www.cs.toronto.edu/~shaharry/csc236-summer-2025/lectures/l1-b.html)</sup>
- 像中的每个元素都有唯一的原像。<sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup>
- 对每个 \( y \in Y \)，方程 \( y = f(x) \) 在 \( X \) 中至多有一个解 \( x \)。<sup>[5](https://mcs.une.edu.au/~pmth213/Lectures/Lecture%20Notes%20.pdf)</sup>
- 函数“不丢失信息”：输出唯一确定输入。<sup>[4](https://mathstats-materials.uncg.edu/mat253/web/section-inj-func.html)</sup>

单射性取决于所指定的定义域和陪域，而不只是公式本身。恒等规则 \( f(n) = n \) 作为映射 \( \mathbb{N} \to \mathbb{N} \) 是满射，但作为映射 \( \mathbb{N} \to \mathbb{R} \) 不是满射；平方函数在定义域受到限制时性质也会改变。<sup>[3](https://www.cs.toronto.edu/~shaharry/csc236-summer-2025/lectures/l1-b.html)</sup>

## 例子

**非单射函数。** 平方函数 \( f \colon \mathbb{R} \to \mathbb{R} \)，\( f(x) = x^2 \)，不是单射，因为 \( f(-2) = f(2) \) 而 \( -2 \neq 2 \)。<sup>[4](https://mathstats-materials.uncg.edu/mat253/web/section-inj-func.html)</sup> 同一函数也不是满射，因为当 \( y < 0 \) 时没有实数 \( x \) 使 \( x^2 = y \)。<sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup> 从 \( \mathbb{R} \) 到 \( \mathbb{Z} \) 的向上取整函数是满射但不是单射：每个输出都对应无穷多个实数，例如 \( \lceil n - \tfrac{1}{2} \rceil = n \)。<sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup>

**单射但非满射。** 由 \( f(x) = 2x \) 定义的映射 \( f \colon \mathbb{Z} \to \mathbb{Z} \) 是一对一的，但不是满射，因为没有整数映射到奇数。<sup>[9](https://math.ucla.edu/~sharifi/notes/algebra-ch01.html)</sup>

**双射。** 既是单射又是满射的函数称为双射，此时陪域的每个元素都恰有一个原像。<sup>[1](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)</sup> 立方函数 \( f \colon \mathbb{R} \to \mathbb{R} \)，\( f(x) = x^3 \)，是一个双射。<sup>[9](https://math.ucla.edu/~sharifi/notes/algebra-ch01.html)</sup>

**日常例子。** 为大学里每个学生分配其唯一学号的函数，按设计就是单射：两个学生共享一个学号的唯一可能就是他们是同一个学生。<sup>[4](https://mathstats-materials.uncg.edu/mat253/web/section-inj-func.html)</sup> 相比之下，“父亲”函数在一位父亲有多个子女时不满足单射性。

## 证明单射性与非单射性

要证明一个函数不是单射，只需举出定义域中两个不同元素 \( a \neq b \) 使 \( f(a) = f(b) \)。<sup>[4](https://mathstats-materials.uncg.edu/mat253/web/section-inj-func.html)</sup> 要证明一个函数是单射，通常假设 \( f(a) = f(b) \) 并推出 \( a = b \)。对于 \( f \colon \mathbb{R} \to \mathbb{R} \)，\( f(x) = x/2 \)，假设 \( f(a) = f(b) \) 得 \( a/2 = b/2 \)，故 \( a = b \)；另用 \( a = 2b \) 的论证可证明满射性，因此该函数是双射。<sup>[3](https://www.cs.toronto.edu/~shaharry/csc236-summer-2025/lectures/l1-b.html)</sup>

## 逆与复合

单射性正是反转映射所需的性质：只有单射函数可逆，因为每个像都需要唯一的原像。<sup>[10](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter3/functions.html)</sup> 精确的表述是单侧逆的特征刻画：函数 \( f \colon X \to Y \) 有左逆（即存在函数 \( g \colon Y \to X \) 使 \( g \circ f = \mathrm{id}_X \)）当且仅当 \( f \) 是单射；有右逆当且仅当它是满射；有双侧逆当且仅当它是双射。<sup>[5](https://mcs.une.edu.au/~pmth213/Lectures/Lecture%20Notes%20.pdf)</sup> 正向证明是对 \( f(x) = f(u) \) 两边施加 \( g \) 得到 \( x = u \)；反向证明则通过把像中的每个 \( y \) 送回其唯一原像、把其余一切映射到 \( X \) 中某个固定元素来构造 \( g \)。<sup>[5](https://mcs.une.edu.au/~pmth213/Lectures/Lecture%20Notes%20.pdf)</sup>

复合对单射性表现良好：若 \( f \colon X \to Y \) 与 \( g \colon Y \to Z \) 均为单射，则由 \( (g \circ f)(x) = g(f(x)) \) 定义的 \( g \circ f \) 也是单射，因为 \( g(f(x_1)) = g(f(x_2)) \) 迫使 \( f(x_1) = f(x_2) \)，进而 \( x_1 = x_2 \)。<sup>[9](https://math.ucla.edu/~sharifi/notes/algebra-ch01.html)</sup>

## 有限集、基数与鸽巢原理

对有限集，单射性由计数决定。若 \( f \colon X \to Y \) 是单射，则 \( |X| \le |Y| \)；反之，鸽巢原理指出，若 \( |X| > |Y| \)，则必存在不同的 \( x, x' \in X \) 使 \( f(x) = f(x') \)，因此不存在单射函数。<sup>[11](https://appliedcombinatorics.org/book/s_basics_pigeonhole.html)</sup><sup> • </sup><sup>[3](https://www.cs.toronto.edu/~shaharry/csc236-summer-2025/lectures/l1-b.html)</sup> 用通常的比喻来说，把 \( n+1 \) 只鸽子放进 \( n \) 个洞，必有两只鸽子进入同一个洞。<sup>[11](https://appliedcombinatorics.org/book/s_basics_pigeonhole.html)</sup>

当 \( |X| = |Y| \) 且两集合均为有限集时，函数 \( f \colon X \to Y \) 是单射当且仅当它是满射。<sup>[6](https://graph.knu.ac.kr/classes/2022/spring/comb/notes.pdf)</sup> 这一等价关系对无限集不成立：\( \mathbb{Z} \) 上的 \( f(x) = 2x \) 是单射但非满射，这是无限集区别于有限集的一种方式。<sup>[9](https://math.ucla.edu/~sharifi/notes/algebra-ch01.html)</sup>

单射还给出了任意集合相对大小的标准定义：\( |A| \le |B| \) 定义为存在从 \( A \) 到 \( B \) 的单射，而 \( |A| = |B| \) 表示存在双射。<sup>[12](https://www.cs.cornell.edu/courses/cs2800/2017fa/lectures/lec12-jectivity.html)</sup>

## 代数与范畴论中的单射性

对同态而言，单射性有一个核判据。线性变换 \( T \) 是单射当且仅当 \( T(x) = 0 \) 只有平凡解，即 \( \ker(T) = \{0 \} \)；核衡量映射离单射有多远。<sup>[7](https://www.lancaster.ac.uk/~prendivs/accessible/math220/MATH220-Complete-Notes-2017.tex/Ch4.S6.html)</sup><sup> • </sup><sup>[13](https://www.maths.dur.ac.uk/users/daniel.evans/GaloisTheory/Notes/fields-and-polynomials.html)</sup> 用矩阵来说，由 \( x \mapsto Ax \) 给出的 \( T \colon \mathbb{R}^m \to \mathbb{R}^n \) 是单射当且仅当 \( A \) 的列线性无关；当 \( n < m \) 时不存在这样的单射映射。<sup>[14](https://sites.math.washington.edu/~naehrn/teaching/2015_winter_quarter_lin_alg.pdf)</sup> 域之间的每个同态都是单射，因为其核必为 \( \{0 \} \)。<sup>[13](https://www.maths.dur.ac.uk/users/daniel.evans/GaloisTheory/Notes/fields-and-polynomials.html)</sup>

在范畴论中，相应的概念是单态射，即可以在一边被消去的态射。在集合范畴中，单态射恰好就是单射；在集合、群、模等具体范畴中，这两个概念一致。<sup>[8](https://encyclopediaofmath.org/wiki/Monomorphism)</sup><sup> • </sup><sup>[2](https://mathworld.wolfram.com/Injection.html)</sup> 这种一致性并非在每个具体范畴中都自动成立：当范畴缺乏足够的态射来检测单射性的失效时，单态射作为底层函数未必是单射。<sup>[15](https://mathoverflow.net/questions/93603/why-the-underlying-function-of-a-monomorphism-may-not-be-an-injection)</sup>

## 哈希函数与伪单射性

哈希函数把任意大小的输入压缩为固定长度的输出，因此由鸽巢原理，这样的函数不可能是单射：必然存在碰撞 \( (x, x') \)，即 \( x \neq x' \) 而 \( H(x) = H(x') \)。<sup>[16](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1558053/download-documents?artifactId=8_gcz65VZE4rcwoti992YXXKeBHs37N3tbBhFqtr8rl4mRjmJfnlpPQ)</sup> 密码学用计算上的替代品取代精确的单射性。若不存在多项式时间程序能找到碰撞，则哈希函数是抗碰撞的，这样的函数“就我们的用途而言，实际上可以充当单射函数”；有作者建议用“伪单射”作为替代名称。<sup>[16](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1558053/download-documents?artifactId=8_gcz65VZE4rcwoti992YXXKeBHs37N3tbBhFqtr8rl4mRjmJfnlpPQ)</sup> 这种联系在复杂性理论中根深蒂固：多项式鸽巢原理类 PPP 刻画了抗碰撞哈希函数的困难性，而基于格的受限 SIS 问题是 PPP 完备的。<sup>[17](https://arxiv.org/abs/1808.06407)</sup>

## 术语

单射、满射、双射这三个术语由尼古拉·布尔巴基（Nicolas Bourbaki）的论著推广，用以取代“一对一”“映上”和“一对一映上”。它们很快被用英语写作的数学家接受：三者均出现在井草准一（Jun-Ichi Igusa）1956 年发表于《美国数学杂志》的论文《雅可比簇的纤维系统》中，其形容词形式出现在克劳德·谢瓦莱（Claude Chevalley）的《代数基本概念》（1956）中，该书把单同态称为单态射。<sup>[18](https://mathshistory.st-andrews.ac.uk/Miller/mathword/i/)</sup>

## References

1. [Introduction to University Mathematics (2025-26): 3 Functions, Mathematical Institute, University of Oxford](https://courses.maths.ox.ac.uk/mod/page/view.php?id=65663)
2. [Weisstein, Eric W. "Injection." Wolfram MathWorld](https://mathworld.wolfram.com/Injection.html)
3. [Lecture 01: Functions, CSC236 Summer 2025, University of Toronto](https://www.cs.toronto.edu/~shaharry/csc236-summer-2025/lectures/l1-b.html)
4. [Injective functions, MAT 253, University of North Carolina at Greensboro](https://mathstats-materials.uncg.edu/mat253/web/section-inj-func.html)
5. [PMTH 213 Lecture Notes, University of New England](https://mcs.une.edu.au/~pmth213/Lectures/Lecture%20Notes%20.pdf)
6. [Combinatorics lecture notes, Kyungpook National University](https://graph.knu.ac.kr/classes/2022/spring/comb/notes.pdf)
7. [Injective, surjective, and bijective transformations, MATH 220 notes, Lancaster University](https://www.lancaster.ac.uk/~prendivs/accessible/math220/MATH220-Complete-Notes-2017.tex/Ch4.S6.html)
8. [Monomorphism, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Monomorphism)
9. [Abstract Algebra, Chapter 1: Set theory, Romyar Sharifi, UCLA](https://math.ucla.edu/~sharifi/notes/algebra-ch01.html)
10. [3.1. Functions, Discrete Structures for Computing, Western University](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter3/functions.html)
11. [The Pigeon Hole Principle, Applied Combinatorics](https://appliedcombinatorics.org/book/s_basics_pigeonhole.html)
12. [Functions, CS 2800 Fall 2017, Cornell University](https://www.cs.cornell.edu/courses/cs2800/2017fa/lectures/lec12-jectivity.html)
13. [Fields and polynomials, Galois Theory III (MATH3041), Durham University](https://www.maths.dur.ac.uk/users/daniel.evans/GaloisTheory/Notes/fields-and-polynomials.html)
14. [Math 308, Linear Algebra with Applications, University of Washington](https://sites.math.washington.edu/~naehrn/teaching/2015_winter_quarter_lin_alg.pdf)
15. [Why the underlying function of a monomorphism may not be an injection, MathOverflow](https://mathoverflow.net/questions/93603/why-the-underlying-function-of-a-monomorphism-may-not-be-an-injection)
16. [Chapter 12: Hash Functions, The Joy of Cryptography OE (1st ed.), Mike Rosulek, Oregon State University](https://ptacts.uspto.gov/ptacts/public-informations/petitions/1558053/download-documents?artifactId=8_gcz65VZE4rcwoti992YXXKeBHs37N3tbBhFqtr8rl4mRjmJfnlpPQ)
17. [PPP-Completeness with Connections to Cryptography, arXiv:1808.06407](https://arxiv.org/abs/1808.06407)
18. [Earliest Known Uses of Some of the Words of Mathematics (I), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Miller/mathword/i/)

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

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Combinatorics › Algebraic and analytic combinatorics › Bijective methods and combinatorial identities

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/injective-function

English original: https://www.edgepedia.org/injective-function
