Declared zero in exact numerical domains #
Checked arithmetic needs a domain-specific way to recognize every representation that should
behave as zero. Structural equality is enough for ordinary exact domains, but a carrier may
deliberately retain distinctions that its arithmetic forgets. For example, SignedRat has
separate positive and negative zeros.
ExactZero keeps that choice explicit and executable. The class guarantees only that canonical
0 is included; concrete domains provide bridge theorems connecting their declared predicate to
the representation's numerical meaning. Generic algorithms branch only on this capability.
A decidable predicate declaring which exact values checked arithmetic treats as zero.
- isZero : Exact → Prop
Proposition saying that checked arithmetic should treat an exact value as zero.
- zero_is_zero : isZero 0
The domain's canonical
0is included in the declared zero values. - decidableIsZero : DecidablePred isZero
Executable decision procedure for the declared zero predicate.
Instances
Use ordinary equality when the domain's Boolean equality is lawful.
The low priority lets a domain with several zero representations install its own declared-zero relation.