WithAbs #
WithAbs v
is a type synonym for a semiring R
which depends on an absolute value. The point of
this is to allow the type class inference system to handle multiple sources of instances that
arise from absolute values.
Main definitions #
WithAbs
: type synonym for a semiring which depends on an absolute value. This is a function that takes an absolute value on a semiring and returns the semiring. This can be used to assign and infer instances on a semiring that depend on absolute values.WithAbs.equiv v
: the canonical (type) equivalence betweenWithAbs v
andR
.WithAbs.ringEquiv v
: The canonical ring equivalence betweenWithAbs v
andR
.
Type synonym for a semiring which depends on an absolute value. This is a function that takes an absolute value on a semiring and returns the semiring. We use this to assign and infer instances on a semiring that depend on absolute values.
This is also helpful when dealing with several absolute values on the same semiring.
Instances For
Equations
Equations
Equations
- WithAbs.instInhabited v = { default := 0 }
The canonical (semiring) equivalence between WithAbs v
and R
.
Equations
- WithAbs.equiv v = RingEquiv.refl (WithAbs v)
Instances For
WithAbs.equiv
as a ring equivalence.
Equations
Instances For
Equations
Equations
- WithAbs.instRing v = inferInstanceAs (Ring R)
Equations
Equations
Equations
- WithAbs.instModule_left v = inferInstanceAs (Module R R')
Equations
- WithAbs.instModule_right v = inferInstanceAs (Module R R')
Equations
- WithAbs.instAlgebra_left v = inferInstanceAs (Algebra R R')
Equations
- WithAbs.instAlgebra_right v = inferInstanceAs (Algebra R R')
The canonical algebra isomorphism from an R
-algebra R'
with an absolute value v
to R'
.
Equations
Instances For
WithAbs.equiv
preserves the ring structure. #
These are deprecated as they are special cases of the generic map_zero
etc. lemmas
after WithAbs.equiv
is defined to be a ring equivalence.