1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
use crateHom;
/// A [`Hom`] that is **injective**: `f(a) == f(b)` implies `a == b`.
///
/// In categorical terms a monomorphism. The embeddings of the number tower are all injective and
/// none is surjective, which is exactly why they are not isomorphisms and could not be expressed
/// before: ℤ ↪ ℚ misses `1/2`, ℝ ↪ ℂ misses `i`.
///
/// An unverifiable promise, like the algebraic laws.
/// A [`Hom`] that is **surjective**: every element of the codomain is `f(x)` for some `x`.
///
/// In categorical terms an epimorphism — the projection side. `ℤ → ℤ/nℤ` is the archetype, and the
/// real part of a complex number, `ℂ → ℝ`, is surjective while being neither injective nor a
/// [`RingHom`](crate::RingHom): `re(i · i) = -1` but `re(i) · re(i) = 0`.
///
/// An unverifiable promise, like the algebraic laws.
/// A [`Hom`] that is both [`Injective`] and [`Surjective`], hence invertible.
///
/// This is a **definition rather than a promise**, so unlike the other properties it is
/// blanket-implemented: a map that is injective and surjective *is* bijective, and asserting it
/// separately would let the two disagree. That is the same reasoning under which `Annihilating` is
/// stated on `Semiring` but is a theorem on `Ring`.
///
/// A bijective [`RingHom`](crate::RingHom) is a ring isomorphism — the map-level counterpart of the
/// pair-shaped traits in [`crate::iso`].
/// A [`Bijective`] map that can produce its inverse — an **isomorphism**.
///
/// Named for what it is rather than `Invertible`, which this crate already uses for the
/// field-division marker `a · a⁻¹ = 1`. Different claim, different trait.
///
/// Bijectivity says an inverse *exists*; this says the map can hand it to you. Splitting them means
/// a map can be known bijective without the inverse being constructible, which is the usual
/// situation for an abstract existence argument.
///
/// The inverse's ends are the original's, swapped — which is the statement that only became
/// sayable once maps carried named ends.