Commutative Semifield
A commutative semifield is a semifield with commutative multiplication.
The following laws must hold for a commutative semifield:
- Additive closure (closure): for \(\forall x, y \in S\), \(x + y \in S\).
- Additive associativity (associativity): for \(\forall x, y, z \in S\), \((x + y) + z = x + (y + z)\).
- Existence of zero element: there exists \(\exists 0 \in S\) such that for \(\forall x \in S\), \(0 + x = x + 0 = x\)
- Additive commutativity (commutative): for \(\forall x, y \in S\), \(x + y = y + x\).
- Multiplicative closure (closure): for \(\forall x, y \in S\), \(x * y \in S\).
- Multiplicative associativity (associativity): for \(\forall x, y, z \in S\), \((x * y) * z = x * (y * z)\).
- Multiplicative commutativity: for \(\forall x, y \in R\), \(x * y = y * x\).
- Distributivity (distributivus, distributive law): for \(\forall x, y, z \in S\), \(x * (y + z) = x * y + x * z\) and \((x + y) * z = x * z + y * z\).
- Multiplicative zero property: \(a * 0 = 0 * a = 0\)
- Existence of unit element: \(\exists 1 \in S \quad \forall x \in S \quad x * 1 = 1 * x = x\)
- Existence of inverse element: for any \(a \in F\), \(a \neq 0\), there exists an element \(a^{-1} \in F\) such that \(a \cdot a^{-1} = 1\).
Code
trait CommutativeSemifield[A] extends Semifield[A], CommutativeRig[A]
Diagram
classDiagram
class Semigroup~A~{
+combine(x: A, y: A) A
}
class Monoid~A~{
+empty() A
}
Semigroup <|-- Monoid
class CommutativeSemigroup~A~
Semigroup <|-- CommutativeSemigroup
class CommutativeMonoid~A~
Monoid <|-- CommutativeMonoid
CommutativeSemigroup <|-- CommutativeMonoid
class Semiring~A~
CommutativeMonoid <|-- Semiring
class MultiplicativeSemigroup~A~{
+times(x: A, y: A) A
}
MultiplicativeSemigroup <|-- Semiring
Semigroup .. MultiplicativeSemigroup
class Rig~A~{
+one() A
}
Semiring <|-- Rig
class Semifield~A~{
+reciprocal(x: A) A
+div(x: A, y: A) A
}
Rig <|-- Semifield
class CommutativeSemiring~A~
Semiring <|-- CommutativeSemiring
class CommutativeRig~A~
Rig <|-- CommutativeRig
CommutativeSemiring <|-- CommutativeRig
class CommutativeSemifield~A~
Semifield <|-- CommutativeSemifield
CommutativeRig <|-- CommutativeSemifield
References: