In abstract algebra, a semiring is an algebraic structure similar to a ring, but without the requirement that each element must have an additive inverse.

The term rig is also used occasionally[1]—this originated as a joke, suggesting that rigs are rings without negative elements, similar to using rng to mean a ring without a multiplicative identity.

Tropical semirings are an active area of research, linking algebraic varieties with piecewise linear structures.[2]

Compared to a ring, a semiring omits the requirement for inverses under addition; that is, it requires only a commutative monoid, not a commutative group. In a ring, the additive inverse requirement implies the existence of a multiplicative zero, so here it must be specified explicitly. If a semiring's multiplication is commutative, then it is called a commutative semiring.[6]

There are some authors who prefer to leave out the requirement that a semiring have a 0 or 1. This makes the analogy between ring and semiring on the one hand and group and semigroup on the other hand work more smoothly. These authors often use rig for the concept defined here.[note 1]

One can generalize the theory of (associative) algebras over commutative rings directly to a theory of algebras over commutative semirings.[citation needed]

Examples of a complete semiring are the power set of a monoid under union and the matrix semiring over a complete semiring.[22]

Any continuous semiring is complete:[19] this may be taken as part of the definition.[22]

A star semiring (sometimes spelled starsemiring) is a semiring with an additional unary operator ,[7][17][24][25] satisfying

A Kleene algebra is a star semiring with idempotent addition and some additional axioms. They are important in the theory of formal languages and regular expressions.[17]

In a complete star semiring, the star operator behaves more like the usual Kleene star: for a complete semiring we use the infinitary sum operator to give the usual definition of the Kleene star:[17]

A Conway semiring is a star semiring satisfying the sum-star and product-star equations:[7][26]

An iteration semiring is a Conway semiring satisfying the Conway group axioms,[7] associated by John Conway to groups in star-semirings.[28]

The term dioid (for "double monoid") has been used to mean various types of semirings:

A generalization of semirings does not require the existence of a multiplicative identity, so that multiplication is a semigroup rather than a monoid. Such structures are called hemirings[32] or pre-semirings.[33] A further generalization are left-pre-semirings,[34] which additionally do not require right-distributivity (or right-pre-semirings, which do not require left-distributivity).

Yet a further generalization are near-semirings: in addition to not requiring a neutral element for product, or right-distributivity (or left-distributivity), they do not require addition to be commutative. Just as cardinal numbers form a (class) semiring, so do ordinal numbers form a near-semiring, when the standard ordinal addition and multiplication are taken into account. However, the class of ordinals can be turned into a semiring by considering the so-called natural (or Hessenberg) operations instead.

In category theory, a 2-rig is a category with functorial operations analogous to those of a rig. That the cardinal numbers form a rig can be categorified to say that the category of sets (or more generally, any topos) is a 2-rig.