Rings vs semirings
Overview A semiring is an algebraic structure with two binary operations (usually called “addition” and “multiplication”) satisfying most of the familiar ring axioms except that additive inverses need not exist. A ring, by contrast, does require that every element have an additive inverse. Below is a side-by-side comparison of their defining properties, followed by examples and some remarks on when each arises in mathematics and computer science.
1. Definitions and Axioms
Property | Semiring | Ring |
---|---|---|
Underlying set | ||
Addition |
Commutative monoid: |
Abelian group:All semiring properties plus |
Multiplication |
Monoid: |
Monoid:Same as semiring. Often required to have |
Distributivity | Same as semiring. | |
Zero-absorption | Same as semiring. | |
Additive inverses | Not required | Required |
Note on terminology:
- Some authors require a multiplicative identity
in both structures; others call a structure without a “hemiring” (for semirings without identity) or a “rng” (for rings without unity). - In this summary we assume both have
, unless noted otherwise.
2. Key Differences
-
Additive inverses
-
Ring: Every element
has an inverse so that . - Semiring: May lack inverses; subtraction need not be defined.
-
Ring: Every element
-
Examples
-
Semiring but not Ring:
with usual and .- The Boolean semiring
with = OR, = AND.
-
Ring:
, , , .- Matrix rings
.
-
-
Subtraction vs. cancellation
- In rings you can “cancel” addition using inverses: from
infer . - In semirings, one often works with cancellative semirings to get a weak form of cancellation, but it’s not automatic.
- In rings you can “cancel” addition using inverses: from
-
Applications
-
Semirings:
- Automata theory & formal languages (e.g.\ shortest-path semirings).
- Tropical geometry (min-plus semiring).
- Quantitative program analysis (probabilities, costs).
-
Rings:
- Core algebra and number theory.
- Algebraic geometry, homological algebra.
-
3. Examples in More Detail
-
Natural numbers
- Satisfies all semiring axioms:
is additive identity, is multiplicative identity. - Fails ring axioms because there is no
with .
- Satisfies all semiring axioms:
-
Tropical semiring
- Underlying set
. - “Addition” is
, “multiplication” is . - Used for shortest-path computations (Dijkstra, Bellman–Ford).
- Underlying set
-
Boolean semiring
(logical OR), (logical AND).- Fundamental in logic, circuit design, and automata.
-
Integer ring
- Every integer has an additive inverse.
- Ring of central importance in algebra and number theory.
4. When to Use Which?
- Use a semiring when only nonnegative (or otherwise “one-sided”) quantities make sense and subtraction would be inappropriate or undefined.
- Use a ring when a full-fledged additive group structure (including negatives) is needed for constructions like modules, ideals, and homological tools.
Further Reading
- Golan, J. S. Semirings and their Applications (Kluwer, 1999)
- Dummit & Foote, Abstract Algebra (especially the sections on rings and modules)
By focusing on the presence or absence of additive inverses, you can quickly tell whether an algebraic system is a semiring or a ring—and choose the right framework for your application.