|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
Concepts | |
| concept | dedekind::morphologies::IsCyclic |
\emph{Operational} duck-typed check that T carries the member API of a cyclic structure: T::Domain alias, T::generator() returning a Domain element, and T::successor(a) walking the chain. | |
| concept | dedekind::morphologies::IsSimplyInfinite |
| concept | dedekind::morphologies::IsCyclicRing |
| concept | dedekind::morphologies::IsOrderedField |
| concept | dedekind::morphologies::IsArchimedeanField |
| concept | dedekind::morphologies::IsDedekindCompleteField |
| concept | dedekind::morphologies::IsMinkowskiSummable |
| concept | dedekind::morphologies::IsInteger |
| concept | dedekind::morphologies::IsSaturatingInteger |
Saturating-ℤ-shape integer: integer surface + translation-invariant order (sentinels propagate cleanly; no cyclic wrap). The variant ℤ proxy SignedCardinality is the canonical witness. | |
| concept | dedekind::morphologies::IsCyclicInteger |
Cyclic-ℤ-shape integer: integer surface + abelian-group-cyclic under +. SignedExtensionalCardinal<> (sign-magnitude ℤ/2^{N*64}ℤ) is the canonical witness via IsCyclicGroup<SignedExtensionalCardinal<>, std::plus<>> pinned in :sets:cardinality. | |
| concept | dedekind::morphologies::HasEuclideanGcd |
Classes | |
| struct | dedekind::morphologies::CauchyPath< T > |
| class | dedekind::morphologies::CyclicRing< T, N > |
Minimal int-backed \(\mathbb{Z}/N\mathbb{Z}\) carrier from the experimental reintegration phase. Retained for parity with the existing test; Modular<N> below is the broader (auto-typed N) replacement. More... | |
| struct | dedekind::morphologies::Modular< N > |
| \(\mathbb{Z}/N\mathbb{Z}\) as a total finite cyclic ring. More... | |
| struct | dedekind::morphologies::Congruence< N, R > |
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... | |
| struct | dedekind::morphologies::ModularCongruence< N > |
The binary congruence relation \(x \equiv y \pmod N\) on the integer carrier: the kernel of the reduction \(\mathbb{Z} \twoheadrightarrow \mathbb{Z}/N\mathbb{Z} =\) Modular<N>. More... | |
| struct | dedekind::category::SpeciesTraits< dedekind::morphologies::Modular< N > > |
| struct | dedekind::morphologies::first_iso_mod_2::mod_2_arrow |
The parity homomorphism mod_2: int → bool. More... | |
| struct | dedekind::morphologies::first_iso_mod_2::connector |
Hand-rolled iso connector Modular<2> → bool. More... | |
| struct | dedekind::morphologies::first_iso_mod_2::connector_inv |
Inverse direction: bool → Modular<2>. More... | |
| class | dedekind::morphologies::safe_float< F > |
Finite IEEE-754 subset: the finiteness invariant makes the order total, so (unlike raw F) this carrier reflexively compares. More... | |
Typedefs | |
| using | dedekind::morphologies::𝔽ₚ = Modular<18446744073709551557ull> |
The largest prime field of a machine word: \(\mathbb{F}_p\) with \(p = 2^{64} - 59\), the largest prime below \(2^{64}\). The field beside the ring std::uint64_t \(= \mathbb{Z}/2^{64}\). | |
| using | dedekind::morphologies::extensional_integer = int |
| Current extensional machine integer carrier. | |
| template<std::floating_point F> | |
| using | dedekind::morphologies::𝕃 = safe_float<F> |
\(\mathbb{L}\langle F\rangle\) — the algebraic handle for the finite-float lattice. Names the (min, max) lattice reduct only; the carrier's (+, x) arithmetic is deliberately not claimed (it is non-associative under rounding). safe_float<F> is the ASCII spelling. | |
Functions | |
| constexpr bool | dedekind::morphologies::is_prime (std::uint64_t n) |
Whether n is prime: Miller–Rabin with the first twelve primes as witnesses, which decides every 64-bit n (J. Sorenson and J. Webster, "Strong pseudoprimes to twelve prime bases", Math. Comp. 86 (2017), 985–1003). constexpr, so a modulus in a type is certified by the compiler. | |
| template<auto N> | |
| constexpr Modular< N > | dedekind::morphologies::nth_value (std::type_identity< Modular< N > >, std::uint64_t i) |
The i-th element of Modular<N> for a bounded search (sets:spans' search_value): the symmetric representatives in order of size, 0, 1, −1, 2, −2, … | |
| constexpr connector_inv | dedekind::morphologies::first_iso_mod_2::inverse (connector) noexcept |
Free-function inverse hook satisfying :morphism::IsIsomorphism. | |
| constexpr connector | dedekind::morphologies::first_iso_mod_2::inverse (connector_inv) noexcept |
|
template<typename T, typename K, auto N, decltype(N) R, typename L, typename C> requires std::same_as<std::remove_cvref_t<T>, decltype(N)> && std::unsigned_integral<decltype(N)> && (std::has_single_bit( static_cast<std::make_unsigned_t<decltype(N)>>(N))) | |
| constexpr auto | dedekind::morphologies::preimage (const Comprehension< 𝔸< std::pair< T, T >, L, C >, Translation< K > > &g, Congruence< N, R >) |
preimage of a residue class through the translation \(x\mapsto
x+K\): again a residue class, shifted. \(\{x \mid x+K \equiv R \pmod N\} =
\{x \mid x \equiv R-K \pmod N\}\), the grammar's residue atom π % N == (R−K) mod N over the carrier. | |
| template<std::unsigned_integral U> | |
| constexpr dedekind::sets::Cardinality | dedekind::morphologies::embed_uint_ℕ (U v) |
Universal machine-to-variant lift: std::unsigned_integral → Cardinality. Closes part of #417. | |
|
template<typename S> requires ( requires { typename std::remove_cvref_t<S>::Domain; requires std::same_as<typename std::remove_cvref_t<S>::Domain, unsigned>; } || requires { typename std::remove_cvref_t<S>::value_type; requires std::same_as< typename std::remove_cvref_t<S>::value_type, unsigned>; }) && requires(S&& s) { dedekind::sets::image(embed_uint_ℕ_, std::forward<S>(s)); } | |
| constexpr auto | dedekind::morphologies::embed_uint_ℕ (S &&s) |
Set-level lift of embed_uint_ℕ_: image of an unsigned-set S under the canonical mono unsigned ↪ ℕ. | |
| template<IsInteger Z, std::signed_integral S> | |
| constexpr Z | dedekind::morphologies::embed_signed_integral (S v) |
| Canonical injection from std::signed_integral into any IsInteger domain Z. | |
| template<IsInteger Z> | |
| constexpr Z | dedekind::morphologies::integer_abs (Z value) |
| Absolute value in the integer spine. | |
| template<IsInteger Z> | |
| constexpr Z | dedekind::morphologies::euclidean_gcd (Z lhs, Z rhs) |
| Euclidean GCD over an IsInteger carrier. | |
| template<std::signed_integral S> | |
| constexpr dedekind::sets::SignedCardinality | dedekind::morphologies::embed_sint_ℤ (S v) |
Universal machine-to-variant lift: std::signed_integral → SignedCardinality. Closes part of #418. | |
|
template<typename S> requires ( requires { typename std::remove_cvref_t<S>::Domain; requires std::same_as<typename std::remove_cvref_t<S>::Domain, int>; } || requires { typename std::remove_cvref_t<S>::value_type; requires std::same_as< typename std::remove_cvref_t<S>::value_type, int>; }) && requires(S&& s) { dedekind::sets::image(embed_sint_ℤ_, std::forward<S>(s)); } | |
| constexpr auto | dedekind::morphologies::embed_sint_ℤ (S &&s) |
Set-level lift of embed_sint_ℤ_: image of an int-set S under the canonical mono int ↪ ℤ. | |
| constexpr unsigned | dedekind::morphologies::abs_int_unsigned (int x) noexcept |
Type-honest absolute value at the machine layer: int → unsigned. | |
| template<std::floating_point F> | |
| constexpr std::optional< safe_float< F > > | dedekind::morphologies::try_safe_float (F x) noexcept |
Free-function spelling of safe_float<F>::lift. | |
Variables | |
| constexpr auto | dedekind::morphologies::GF_p |
GF_p — the universe over the field, 𝔸 <𝔽ₚ>{}: the twin of Python's GF_p (A(𝔽ₚ)), named for the Galois field GF(p). | |
| constexpr auto | dedekind::morphologies::embed_𝔹_uint_ |
| Canonical embedding 𝔹 ↪ ℕ: bool → unsigned. | |
| constexpr auto | dedekind::morphologies::embed_uint_ℕ_ |
| Concrete monic arrow: unsigned ↪ Cardinality (variant ℕ-proxy). | |
| constexpr auto | dedekind::morphologies::embed_sint_ℤ_ |
| Concrete monic arrow: int ↪ SignedCardinality (variant ℤ-proxy). | |
Files | |
| file | src/main/modules/dedekind/morphologies/morphologies.cppm |
| Cyclic and Archimedean morphology carriers. | |
| file | src/main/modules/dedekind/morphologies/archimedean.cppm |
| Archimedean / ordered-field convergence stubs. | |
| file | src/main/modules/dedekind/morphologies/cyclic.cppm |
| Cyclic-morphology carriers and their concept witnesses. | |
| file | src/main/modules/dedekind/morphologies/floating_point.cppm |
| file | src/main/modules/dedekind/morphologies/integral.cppm |
| file | src/main/modules/dedekind/morphologies/sint.cppm |
| file | src/main/modules/dedekind/morphologies/uint.cppm |