Injective Functions

Can two different inputs to a function ever produce the same output? For some functions the answer is always no. These functions turn out to be exactly the ones that can be "undone" on their range. This single question — does distinctness of inputs guarantee distinctness of outputs — is the heart of the notion of an injective function, also called a one-to-one function. It sounds like a small technical property. But it is one of the load-bearing walls of modern mathematics. It is the precise tool used to compare the sizes of infinite sets, to embed one structure inside another without collapsing information, and to certify that an operation like encryption or hashing does not destroy distinctions between messages. The idea matters because "size" and "sameness" for infinite collections cannot be checked by counting. Instead, mathematicians certify that one set is "at least as large as" another by exhibiting an injective function from the first into the second. This is a rule that assigns to each element of the first set a distinct partner in the second. Injectivity is therefore the engine behind the entire theory of Comparing Cardinalities. This includes the celebrated fact that the real numbers outnumber the natural numbers. The big picture is this: a function is a package of input–output pairs satisfying a rule (see Functions as Special Relations). Injectivity is one of the two independent properties — the other being surjectivity. Their conjunction (bijectivity) makes a function reversible. Understanding injectivity in isolation, with clean proof techniques, is the prerequisite for understanding Bijections and Inverse Functions correctly. An inverse function can only be defined without ambiguity when the original function never sends two points to the same place. This article gives the precise definition of injectivity, the standard proof strategies (direct argument and contrapositive), a full worked derivation for both a polynomial-type and a piecewise function, a theorem connecting injectivity to left-invertibility, and a counterexample showing exactly what fails when the codomain is chosen carelessly.

Key takeaways
  • An injective (one-to-one) function never sends two distinct inputs to the same output.
  • Formally: ff is injective iff f(x1)=f(x2)  ⟹  x1=x2f(x_1) = f(x_2) \implies x_1 = x_2 for all x1,x2x_1, x_2 in the domain.
  • The standard proof technique is the direct argument or its logical twin, the contrapositive: x1≠x2  ⟹  f(x1)≠f(x2)x_1 \neq x_2 \implies f(x_1) \neq f(x_2).
  • Injectivity is equivalent to the existence of a left inverse function (a retraction), when the domain is nonempty.
  • Graphically, injectivity is the horizontal line test: no horizontal line meets the graph more than once.
  • Key idea: injectivity is a promise that the function loses no information — it is the algebraic seed of comparing the sizes of sets.

Where this lives today

Injectivity is not a museum piece confined to introductory proof courses — it is load-bearing machinery across mathematics and its applications.

  • Cardinality and set theory. The relation ∣A∣≤∣B∣|A| \le |B| is defined by the existence of an injection A→BA \to B; the Cantor–Schröder–Bernstein theorem shows that mutual injections A→BA \to B and B→AB \to A force a bijection to exist, the technical foundation for Comparing Cardinalities.
  • Linear algebra. A linear map T:V→WT : V \to W between vector spaces is injective if and only if its kernel is {0}\{0\}; this single fact converts an infinite verification into a one-line computation, and underlies rank-nullity arguments.
  • Cryptography. Encryption functions must be injective (for a fixed key) so that decryption — a left inverse in the exact sense of the theorem above — is possible; a non-injective cipher would make some ciphertexts undecryptable to a unique plaintext.
  • Hash functions and data structures. Ideal hash functions aim to approximate injectivity ("collision resistance"); the entire theory of hash collisions is the theory of failures of injectivity, studied quantitatively via the birthday bound.
  • Real analysis. Strictly monotonic functions (strictly increasing or strictly decreasing) are always injective, giving a fast sufficient criterion used constantly when justifying the existence of inverse functions like ln⁡\ln, arcsin⁡\arcsin (on restricted domains), and root functions.
  • Computer science. Injective functions model perfect encodings: lossless compression schemes and unique object identifiers (serial numbers, memory addresses under certain guarantees) are required to be injective on their domain of legitimate inputs.
  • Category theory. The categorical generalization of "injective" is a monomorphism, defined by a left-cancellation property that specializes exactly to the set-theoretic definition given here when working in the category of sets.

Ask the tutor: How does injectivity of a function combine with surjectivity to prove the Cantor–Schröder–Bernstein theorem when comparing infinite sets?

DefinitionInjective Function

Let f:A→Bf : A \to B be a function, i.e., a subset of A×BA \times B satisfying the functional condition that every a∈Aa \in A has exactly one b∈Bb \in B with (a,b)∈f(a,b) \in f (written b=f(a)b = f(a)). We say ff is injective, or one-to-one, if it satisfies:

∀x1∈A ∀x2∈A  (f(x1)=f(x2)  ⟹  x1=x2).\forall x_1 \in A\, \forall x_2 \in A \; \big(f(x_1) = f(x_2) \implies x_1 = x_2\big).

Equivalently, by contraposition, ff is injective iff

∀x1∈A ∀x2∈A  (x1≠x2  ⟹  f(x1)≠f(x2)).\forall x_1 \in A\, \forall x_2 \in A \; \big(x_1 \neq x_2 \implies f(x_1) \neq f(x_2)\big).

A function that is not injective is called many-to-one: there exist x1≠x2x_1 \neq x_2 in AA with f(x1)=f(x2)f(x_1) = f(x_2).

Intuition

Think of a function as a machine with input slot AA and output slot BB. Injectivity says the machine keeps a perfect paper trail: if you only ever see the output, you can still work out which input produced it, provided you know the output came from this function at all. Nothing is ever "merged." Two different students never get assigned the same locker; two different countries never get the same capital-city code; two different DNA sequences (in an idealized world) never hash to the same fingerprint. This is exactly the geometric content of the horizontal line test for real-valued functions of a real variable: draw the graph of ff, and draw any horizontal line y=cy = c. If ff is injective, that line can touch the graph in at most one point, because two intersection points would be two different xx-values sharing the same output cc. It is essential to keep injectivity conceptually separate from surjectivity (hitting every element of BB) — a function can miss most of BB and still be injective, as long as it never doubles up on the elements it does hit. The rectangle-and-arrows picture below makes this visible: every arrow lands on a different target, but some targets in BB receive no arrow at all. That is completely compatible with injectivity.

Figure
An injective function f:A→Bf:A\to B with A={a1,a2,a3}A=\{a_1,a_2,a_3\}: three distinct inputs land on three distinct outputs, even though BB has an extra unused element b4b_4.
A B a₁ a₂ a₃ b₁ b₂ b₃ b₄

Proof techniques in practice

There are exactly two standard logical strategies for establishing f:A→Bf: A \to B is injective, and one standard strategy for refuting it. 1. Direct proof of the implication. Fix arbitrary x1,x2∈Ax_1, x_2 \in A, assume f(x1)=f(x2)f(x_1) = f(x_2), and derive x1=x2x_1 = x_2 using algebra or the definition of ff. 2. Contrapositive proof. Fix arbitrary x1,x2∈Ax_1, x_2 \in A with x1≠x2x_1 \neq x_2, and show f(x1)≠f(x2)f(x_1) \neq f(x_2). This is logically equivalent to the direct method and is often easier when ff involves strict monotonicity or absolute values. 3. Refutation by counterexample. To show ff is not injective, it suffices to exhibit one explicit pair x1≠x2x_1 \neq x_2 with f(x1)=f(x2)f(x_1) = f(x_2) — an existential witness, not a universal argument.

TheoremInjectivity and Left Invertibility

Let f:A→Bf : A \to B be a function with A≠∅A \neq \varnothing. Then ff is injective if and only if there exists a function g:B→Ag : B \to A such that

g∘f=idA,g \circ f = \mathrm{id}_A,

where idA\mathrm{id}_A is the identity function on AA. Such a gg is called a left inverse, or retraction, of ff.

Proof

We prove both directions. The proof technique is direct construction in one direction and a direct algebraic argument in the other; neither direction uses any fact about surjectivity or bijections, so there is no circularity with Bijections and Inverse Functions, which is built on top of this result rather than beneath it.

(⇐\Leftarrow) Suppose a left inverse g:B→Ag : B \to A exists with g∘f=idAg \circ f = \mathrm{id}_A. Let x1,x2∈Ax_1, x_2 \in A with f(x1)=f(x2)f(x_1) = f(x_2). Apply gg to both sides; since gg is a function, equal inputs to gg give equal outputs, so

g(f(x1))=g(f(x2)).g(f(x_1)) = g(f(x_2)).

By definition of composition, the left side is (g∘f)(x1)(g \circ f)(x_1) and the right side is (g∘f)(x2)(g\circ f)(x_2). Since g∘f=idAg \circ f = \mathrm{id}_A, this reads

idA(x1)=idA(x2),\mathrm{id}_A(x_1) = \mathrm{id}_A(x_2),

that is, x1=x2x_1 = x_2. This is exactly the definition of injectivity, so ff is injective.

(⇒\Rightarrow) Suppose ff is injective and A≠∅A \neq \varnothing. Fix any element a0∈Aa_0 \in A (possible since AA is nonempty). Define g:B→Ag : B \to A by:

g(b)={aif b=f(a) for some a∈A,a0if b∉ran⁡(f).g(b) = \begin{cases} a & \text{if } b = f(a) \text{ for some } a \in A, \\ a_0 & \text{if } b \notin \operatorname{ran}(f). \end{cases}

We must check gg is well-defined as a function, i.e., that the first case never assigns two different values to the same bb. Suppose b=f(a)b = f(a) and also b=f(a′)b = f(a') for some a,a′∈Aa, a' \in A. Then f(a)=f(a′)f(a) = f(a'), and since ff is injective, a=a′a = a'. Hence the value assigned by the first clause is unique whenever it applies, and the two clauses never overlap (the first applies exactly when b∈ran⁡(f)b \in \operatorname{ran}(f), the second exactly when b∉ran⁡(f)b \notin \operatorname{ran}(f)). So gg is a well-defined function B→AB \to A. Now verify g∘f=idAg \circ f = \mathrm{id}_A. Let a∈Aa \in A be arbitrary and set b=f(a)b = f(a). Then b∈ran⁡(f)b \in \operatorname{ran}(f) by construction (witnessed by aa itself), so the first clause of gg applies: g(b)=ag(b) = a. Hence

(g∘f)(a)=g(f(a))=g(b)=a=idA(a).(g \circ f)(a) = g(f(a)) = g(b) = a = \mathrm{id}_A(a).

Since a∈Aa \in A was arbitrary, g∘f=idAg \circ f = \mathrm{id}_A, so gg is a left inverse of ff. ■\blacksquare

∎
CorollaryInjectivity is preserved by composition

If f:A→Bf : A \to B and h:B→Ch : B \to C are both injective, then h∘f:A→Ch \circ f : A \to C is injective.

Proof

Let x1,x2∈Ax_1, x_2 \in A with (h∘f)(x1)=(h∘f)(x2)(h \circ f)(x_1) = (h\circ f)(x_2), i.e. h(f(x1))=h(f(x2))h(f(x_1)) = h(f(x_2)). Since hh is injective, this gives f(x1)=f(x2)f(x_1) = f(x_2). Since ff is injective, this gives x1=x2x_1 = x_2. This is the direct proof technique applied twice in sequence, and it establishes injectivity of h∘fh \circ f. ■\blacksquare

∎

Worked examples

Example 1 — a rational (non-polynomial) function, asymmetric domain. Let A=(−∞,2)∪(2,∞)A = (-\infty, 2) \cup (2, \infty) — the reals excluding the single point 22 — and let B=R∖{0}B = \mathbb{R} \setminus \{0\}. Define

f(x)=3x−2.f(x) = \frac{3}{x - 2}.

We claim f:A→Bf : A \to B is injective. First check ff is well-defined into BB: for x≠2x \neq 2, x−2≠0x - 2 \neq 0 so f(x)f(x) is defined, and f(x)=3/(x−2)≠0f(x) = 3/(x-2) \neq 0 since a nonzero numerator over a finite denominator is never 00; so indeed f(x)∈Bf(x) \in B for all x∈Ax \in A. Direct proof of injectivity. Let x1,x2∈Ax_1, x_2 \in A with f(x1)=f(x2)f(x_1) = f(x_2):

3x1−2=3x2−2.\frac{3}{x_1 - 2} = \frac{3}{x_2 - 2}.

Both denominators are nonzero (since x1,x2≠2x_1, x_2 \neq 2), so we may cross-multiply:

3(x2−2)=3(x1−2).3(x_2 - 2) = 3(x_1 - 2).

Dividing both sides by 33 (nonzero), x2−2=x1−2x_2 - 2 = x_1 - 2, hence x1=x2x_1 = x_2. This establishes injectivity directly, verifying the definition for arbitrary x1,x2x_1, x_2. Sanity check with actual numbers. Take x1=5x_1 = 5: f(5)=3/3=1f(5) = 3/3 = 1. Take x2=−1x_2 = -1: f(−1)=3/(−3)=−1f(-1) = 3/(-3) = -1. Indeed 1≠−11 \neq -1 and 5≠−15 \neq -1, consistent with injectivity — no collision occurs. Take x2=5x_2 = 5 again with a different candidate x3=2.5x_3 = 2.5: f(2.5)=3/0.5=6≠1=f(5)f(2.5) = 3/0.5 = 6 \neq 1 = f(5), again no collision, as guaranteed by the theorem above since 5≠2.55 \neq 2.5. Left inverse, explicitly constructed as in the theorem. Since ran⁡(f)=B\operatorname{ran}(f) = B here (one can check every nonzero real is hit: given y≠0y \neq 0, solve y=3/(x−2)y = 3/(x-2) to get x=2+3/y∈Ax = 2 + 3/y \in A), the left inverse is total on BB and is given by

g(y)=2+3y.g(y) = 2 + \frac{3}{y}.

Check: g(f(x))=2+33/(x−2)=2+(x−2)=xg(f(x)) = 2 + \dfrac{3}{3/(x-2)} = 2 + (x - 2) = x. This matches idA\mathrm{id}_A, confirming injectivity via the equivalence proved above.

Example 2 — a piecewise function requiring case analysis. Define f:Z→Zf : \mathbb{Z} \to \mathbb{Z} by

f(n)={2nn≥0−2n−1n<0.f(n) = \begin{cases} 2n & n \geq 0 \\ -2n - 1 & n < 0. \end{cases}

(This is a classical pairing-style function: nonnegative integers go to nonnegative even numbers, negative integers go to nonnegative odd numbers.) We show ff is injective using the contrapositive strategy combined with case analysis, since the formula itself splits into cases. Suppose n1≠n2n_1 \neq n_2 in Z\mathbb{Z}. We must show f(n1)≠f(n2)f(n_1) \neq f(n_2). There are three sub-cases depending on the signs of n1,n2n_1, n_2. Case A: n1,n2≥0n_1, n_2 \geq 0. Then f(n1)=2n1f(n_1) = 2n_1 and f(n2)=2n2f(n_2) = 2n_2. If f(n1)=f(n2)f(n_1) = f(n_2) then 2n1=2n22n_1 = 2n_2, so n1=n2n_1 = n_2, contradicting n1≠n2n_1 \neq n_2. So f(n1)≠f(n2)f(n_1) \neq f(n_2) in this case. Case B: n1,n2<0n_1, n_2 < 0. Then f(n1)=−2n1−1f(n_1) = -2n_1 - 1 and f(n2)=−2n2−1f(n_2) = -2n_2-1. If these were equal, −2n1=−2n2-2n_1 = -2n_2, so n1=n2n_1 = n_2, again a contradiction. So f(n1)≠f(n2)f(n_1)\neq f(n_2). Case C: one is ≥0\geq 0 and the other <0<0 (WLOG n1≥0>n2n_1 \geq 0 > n_2). Then f(n1)=2n1f(n_1) = 2n_1 is even and nonnegative, while f(n2)=−2n2−1f(n_2) = -2n_2 - 1 is odd (since −2n2-2n_2 is even, subtracting 11 makes it odd). An even number can never equal an odd number, so f(n1)≠f(n2)f(n_1) \neq f(n_2) automatically — no algebra even needed here, only parity. Since all three exhaustive cases give f(n1)≠f(n2)f(n_1) \neq f(n_2), the contrapositive holds for every pair with n1≠n2n_1 \neq n_2, so ff is injective. Numeric check. f(−3)=−2(−3)−1=5f(-3) = -2(-3) - 1 = 5. f(2)=4f(2) = 4. f(0)=0f(0) = 0. f(−1)=1f(-1) = 1. All four outputs 5,4,0,15, 4, 0, 1 are distinct, consistent with injectivity, and note the outputs are exactly {0,1,4,5}\{0,1,4,5\} — a mix of small evens and odds, matching the parity argument in Case C (evens from nonnegative inputs, odds from negative inputs).

Why the domain/codomain framing matters

CounterexampleDropping "for all x1,x2x_1, x_2 in the domain" — checking only special pairs

The universal quantifier over all pairs x1,x2∈Ax_1, x_2 \in A in the definition is not decorative — weakening it to "for all pairs in some proper subset" can make a genuinely non-injective function look injective. Consider

f:R→R,f(x)=x2.f : \mathbb{R} \to \mathbb{R}, \qquad f(x) = x^2.

Suppose a careless argument checks injectivity only on pairs of nonnegative reals: for x1,x2≥0x_1, x_2 \geq 0 with x12=x22x_1^2 = x_2^2, taking nonnegative square roots gives x1=x2x_1 = x_2. This step is entirely correct restricted to [0,∞)[0,\infty). If one then (wrongly) concludes "ff is injective on R\mathbb{R}" by forgetting that the definition demands the implication for every pair drawn from the full domain R\mathbb{R}, the conclusion is false. Indeed, take x1=3x_1 = 3 and x2=−3x_2 = -3, both in R\mathbb{R}, with x1≠x2x_1 \neq x_2. Then

f(3)=9=f(−3),f(3) = 9 = f(-3),

a genuine collision. So f(x)=x2f(x) = x^2 is not injective on R→R\mathbb{R} \to \mathbb{R}, even though it is injective when the domain is restricted to [0,∞)→R[0, \infty) \to \mathbb{R} or to (−∞,0]→R(-\infty, 0] \to \mathbb{R}. This shows precisely what the universal quantifier over the whole stated domain is protecting against: injectivity is not a property of a formula alone, but of a formula together with a specified domain. Changing the domain from R\mathbb{R} to [0,∞)[0,\infty) changes the truth value of "is injective" even though the algebraic rule x↦x2x \mapsto x^2 never changes.

Scope, edge cases & common traps

SituationWhat to checkCommon error
Domain is a proper subset of a larger natural domainInjectivity must hold on the stated domain, not some ambient supersetForgetting the restriction and testing points outside it
Codomain larger than the rangeInjectivity says nothing about hitting every element of BBConfusing injective with surjective/bijective
Empty domain A=∅A = \varnothingThe universal statement is vacuously true: f=∅f = \varnothing is injective by defaultAssuming injectivity requires a nonempty witness; it does not
Piecewise formulasMust rule out cross-case collisions, not just within-case collisionsChecking each branch separately and skipping the "one from each branch" case
Finite setsIf ∣A∣>∣B∣|A| > |B|, no function A→BA \to B can be injective (pigeonhole)Trying to construct an injection anyway instead of citing the counting argument

The mathematician behind it

Origins · 1 minNicolas Bourbaki (collective pseudonym) and how this was discovered
NB
Nicolas Bourbaki (collective pseudonym)
founded 1935, active through the 20th century · Modern foundational mathematics, France

The terms "injective," "surjective," and "bijective" were coined and standardized by the Bourbaki group, a collective of mostly French mathematicians writing under a shared pseudonym starting in the 1930s. Their multi-volume Éléments de mathématique fixed the modern set-theoretic vocabulary for functions that undergraduates use today, replacing older, less uniform terminology like "one-to-one" (still common in English-language texts as a synonym for injective) and "onto" (for surjective). The idea of injectivity itself is far older — implicit already in Cantor's late-19th-century work comparing the sizes of infinite sets — but the crisp trichotomy of injective/surjective/bijective, and the systematic proof style built around it, is a 20th-century codification.

History
- 1874–1884: Georg Cantor develops the theory of comparing infinite sets via correspondences, implicitly using injective and bijective maps to define and compare cardinalities.
- 1888: Richard Dedekind, in Was sind und was sollen die Zahlen?, gives an explicit set-theoretic treatment of one-to-one mappings ("ähnliche Abbildung," similar mapping) between sets.
- 1895–1897: Cantor formalizes cardinal comparison ∣A∣≤∣B∣|A| \leq |B| via the existence of an injection A→BA \to B, laying groundwork for the Cantor–Schröder–Bernstein theorem.
- 1935 onward: The Bourbaki collective introduces the standardized terms injective, surjective, bijective in their foundational volumes on set theory.
- 1950s: The vocabulary becomes standard in university curricula worldwide, cementing "injective function" as the modern term for "one-to-one function."
Is "injective" the same thing as "one-to-one"?

Yes — in most English-language textbooks, "injective" and "one-to-one" are exact synonyms, both meaning distinct inputs always give distinct outputs. The word "injective" (and "injection" for the function itself) is the term standardized by the Bourbaki school and used in more formal or research-level writing, while "one-to-one" is the older, still very common phrasing in introductory courses. Be careful with the closely related but different phrase "one-to-one correspondence," which is a synonym for bijective, not merely injective — the word "correspondence" is doing important extra work there, signaling that the function is also surjective.

Can an injective function fail to be surjective, and vice versa?

Yes to both, and they are logically independent properties. The function f:N→Nf: \mathbb{N} \to \mathbb{N} given by f(n)=2nf(n) = 2n is injective (distinct naturals double to distinct naturals) but not surjective, since no odd number is ever hit. Conversely, g:N→Ng : \mathbb{N} \to \mathbb{N} given by g(0)=0g(0) = 0 and g(n)=n−1g(n) = n - 1 for n≥1n \geq 1 is surjective (every natural number mm is hit by m+1m+1) but not injective, since g(0)=0=g(1)g(0) = 0 = g(1). A function that is both injective and surjective is called bijective, the subject of Bijections and Inverse Functions.

How does injectivity interact with function composition when the composite is injective but the pieces are not?

If h∘fh \circ f is injective, it forces ff itself to be injective: if f(x1)=f(x2)f(x_1) = f(x_2) then h(f(x1))=h(f(x2))h(f(x_1)) = h(f(x_2)), so (h∘f)(x1)=(h∘f)(x2)(h\circ f)(x_1) = (h\circ f)(x_2), and injectivity of the composite forces x1=x2x_1 = x_2. However, this argument says nothing about hh on its own — hh can be wildly non-injective outside the range of ff. For instance, let f:{1}→Rf : \{1\} \to \mathbb{R} send 1↦51 \mapsto 5, and let h:R→Rh:\mathbb{R}\to\mathbb{R} send every real to 00 except that h(5)=5h(5) = 5 is not even required; here h∘fh\circ f is trivially injective (a one-point domain always gives an injective function) despite hh collapsing everything else. So "composite injective" only certifies the first map, not the second.

Is the empty function injective?

Yes, vacuously. If A=∅A = \varnothing, then f:∅→Bf : \varnothing \to B is the empty set of pairs, and the defining implication "∀x1,x2∈A (f(x1)=f(x2)  ⟹  x1=x2)\forall x_1, x_2 \in A\,(f(x_1)=f(x_2) \implies x_1=x_2)" has a universally quantified statement over an empty domain. Since there are no elements of AA to serve as counterexamples, the universal statement is vacuously true, exactly as with any universally quantified claim over an empty set. This is a standard and important edge case, not a paradox.

Does injectivity depend only on the formula, or also on the stated domain and codomain?

It depends on all three together — the formula, the domain, and (for well-definedness, though not directly for injectivity) the codomain. As shown in the counterexample above, f(x)=x2f(x) = x^2 is injective as a function [0,∞)→R[0,\infty)\to\mathbb{R} but not as a function R→R\mathbb{R}\to\mathbb{R}, even though the algebraic rule never changes. Whenever you assert "ff is injective," you are implicitly asserting it about a fully specified function — rule plus domain — not about a bare formula. Always state the domain explicitly before checking injectivity.

What is the fastest sufficient condition for injectivity of a real function, without doing the full algebraic proof?

For a function ff defined on an interval, if ff is strictly increasing (i.e. x1<x2  ⟹  f(x1)<f(x2)x_1 < x_2 \implies f(x_1) < f(x_2)) or strictly decreasing throughout its domain, then ff is automatically injective: distinct points get strictly ordered outputs, which are therefore unequal. This is provable directly from the trichotomy of real numbers (x1<x2x_1 < x_2, x1=x2x_1 = x_2, or x1>x2x_1 > x_2) applied case by case. In calculus, checking f′(x)>0f'(x) > 0 (or <0<0) on an interval is the usual shortcut to strict monotonicity, and hence to injectivity, without doing an algebraic solve of f(x1)=f(x2)f(x_1)=f(x_2).

How does injectivity generalize beyond functions on sets, say to structures with extra properties?

In algebra, an injective homomorphism between groups, rings, or vector spaces is a structure-preserving map that is also injective as a set function; for linear maps this reduces to the map having trivial kernel. In category theory more broadly, the right generalization is a monomorphism: a morphism ff such that f∘g1=f∘g2f \circ g_1 = f \circ g_2 implies g1=g2g_1 = g_2 for all morphisms g1,g2g_1, g_2 with matching codomain. In the category of sets this categorical definition is provably equivalent to the elementwise definition given in this article, but in other categories (e.g. rings) monomorphisms and set-theoretic injections can occasionally diverge in subtle ways, which is part of why category theory treats "injective" and "monomorphism" as related but formally distinct notions.

Before this

Where this leads