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
57
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
//! Tier 2 witness-typed isomorphism traits.
//!
//! This module hosts the [`Iso<S, T>`] trait — a witness-typed isomorphism
//! with explicit `to_target` / `to_source` methods — and its
//! structure-preserving marker subtraits ([`GroupIso<S, T>`],
//! [`RingIso<S, T>`], [`FieldIso<S, T>`], [`AlgebraIso<S, T, R>`],
//! [`DivisionAlgebraIso<S, T, R>`]).
//!
//! Tier 2 is used when bidirectional `From` cannot be implemented because
//! source and target live in different crates with an asymmetric dependency
//! (the common case for cross-crate isos). The impl is hung on whichever of
//! `S` or `T` is local to the crate writing the impl.
//!
//! For in-crate isos where bidirectional `From` is implementable, **prefer
//! Tier 1** ([`crate::iso`]) — the marker subtraits there are bounded on
//! `From`/`Into` directly and require no new trait surface.
//!
//! # `StandardIso<S, T>` default witness
//!
//! [`StandardIso<S, T>`] is a generic zero-sized witness with blanket impls
//! covering [`Iso<S, T>`] and every Tier 2 marker subtrait. The blanket impls
//! fire automatically when `S` and `T` satisfy bidirectional `From` plus the
//! relevant algebraic-structure trait — no manual marker impl required for
//! the common case.
//!
//! # Namespace
//!
//! Tier 1 (`crate::iso::*`) and Tier 2 (`crate::iso::witness::*`) marker
//! subtraits share short names (`GroupIso`, `RingIso`, etc.). Disambiguate by
//! module path:
//!
//! ```ignore
//! use deep_causality_num::iso::GroupIso; // Tier 1 (one parameter)
//! use deep_causality_num::iso::witness::GroupIso; // Tier 2 (two parameters)
//! ```
pub use AlgebraIso;
pub use DivisionAlgebraIso;
pub use FieldIso;
pub use GroupIso;
pub use Iso;
pub use RingIso;
pub use StandardIso;