|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
The residue-class predicate \(x \equiv R \pmod N\): the characteristic map of the fiber of the reduction \(\mathbb{Z} \twoheadrightarrow \mathbb{Z}/N\mathbb{Z} =\) Modular<N> over the residue R.
More...
Public Types | |
| using | Domain = decltype(N) |
| using | Codomain = bool |
Public Member Functions | |
| template<typename X> | |
| constexpr bool | operator() (const X &x) const |
The residue-class predicate \(x \equiv R \pmod N\): the characteristic map of the fiber of the reduction \(\mathbb{Z} \twoheadrightarrow \mathbb{Z}/N\mathbb{Z} =\) Modular<N> over the residue R.
isEven is Congruence<2,0>. Because the predicate factors through the finite quotient Modular<N> (the reduction is the Modular<N> constructor), a quantifier over an infinite carrier reduces to exhausting the N residues: \(\exists\) and \(\forall\) both become decidable in finite time (see the sets:quantifier finite-carrier path and the numbers-level ๐ธ<Cardinality> bridge). The modulus N is carried in the type, so the compiler sees the quotient; an opaque lambda could not.
It is a characteristic morphism (IsPredicate): Domain is the integer the reduction consumes, Codomain is bool. FIXME(#797): % may later subsume into a factor-through-quotient combinator (ยง3 morphisms / ยง4 quotients).