|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
A callable h on T whose codomain is std::size_t — i.e. an arrow T → size_t.
More...
A callable h on T whose codomain is std::size_t — i.e. an arrow T → size_t.
A hash function induces a canonical equivalence relation on its domain:
\[ x \,\sim_h\, y \iff h(x) \,=\, h(y), \]
the kernel of h read as a binary relation. This relation is automatically reflexive / symmetric / transitive as a consequence of size_t equality being so on std::size_t — i.e. every IsHashFunction structurally induces an IsEquivalence. The partition is the fibres \(h^{-1}(s)\) for \(s \in \mathrm{im}(h)\), grouping inputs that collide under h.
The concept lives next to IsEquivalence because the equivalence relation is the hash's mathematical content; the size_t codomain is a representation choice (the arithmetic-friendly fibre index, used by std::unordered_set / std::unordered_map for bucket dispatch).
| H | The hash callable (e.g. std::hash<T>). |
| T | The carrier the hash is defined on. |
Recommendation (per Gemini correspondence, 2026-05-06): the home of the base concept is the equivalence-relation layer; algebra- specific refinements (rolling hashes as Monoid → Ring homomorphisms, etc.) belong further downstream once they materialise.