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
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
use crateField;
use crateRingIso;
/// Marker trait asserting that a bidirectional `From` conversion between `Self`
/// and `T` is a field homomorphism — i.e. preserves addition, multiplication,
/// **and** multiplicative inverses for non-zero elements.
///
/// `FieldIso<T>` extends [`RingIso<T>`] and adds the multiplicative-inverse
/// law:
///
/// 1. **Ring homomorphism** — inherited from `RingIso<T>` (addition and
/// multiplication preserved).
/// 2. **Multiplicative inverse** — for every non-zero `a: Self`,
/// `T::from(a.inverse()) == T::from(a).inverse()`. The marker promises this
/// holds modulo floating-point representation; verified by property tests in
/// [`crate::iso::test_support::assert_field_iso_from_laws`].
///
/// The where-clauses promote `Self` and `T` to `Field`. The trait body is
/// empty.
///
/// # When this marker does not apply
///
/// Non-commutative algebraic structures (e.g. quaternions, Cl(3,0) rotors) are
/// `DivisionAlgebra<R>` but **not** `Field`. They satisfy the bidirectional
/// `From` and the multiplicative inverse law in their own algebraic structure,
/// but the where-clause `T: Field` rules this trait out. The correct marker
/// for those cases is [`crate::iso::DivisionAlgebraIso<T, R>`].