| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Coya
Description
Consider some log-semiring R. Then, for any two x,y :: R, the following holds:
x ^ log y == y ^ log x == e ^ (log x * log y)
Coya is a commutative monoid (R, y = x ^ log y.
The following laws hold:
- Left Identity
e # x == x- Right Identity
x # e == x- Associativity
(x # y) # z == x # (y # z)- Commutativity
x # y == y # x
If R is a poset where all elements in R are greater than one, then R also forms a group:
x # (exp (1 / log x)) = x
Documentation
The Coya monoid. Its semigroup instance
is a binary operation that distributes over multiplication, i.e:
Coyax<>(Coyay*Coyaz)==(Coyax <>Coyay)*(Coyax <>Coyaz)
The Semiring and Num instances simply lift the underlying type's.
Instances
The Coya monoid constrained to numbers which are greater than
1. This ensures that the group property of inversion holds:
x<>(exp(1/logx))==x
Constructors
| CoyaGroup | |
Fields
| |