---
tag: D31S3GR51T
kind: concept
name: Semiring
msc: [16Y60]
sources:
  - url: https://en.wikipedia.org/wiki/Semiring
same_as:
  wikidata: Q1333055
  wikipedia: Semiring
---

## Summary

A semiring is a set with an addition and a multiplication that obey the axioms of a [[ring|0B1261B5ED]], except that negatives need not exist.
The natural numbers with the usual operations are the first example.
Every ring is a semiring, but semirings also include the Boolean semiring and the tropical semirings.
Semirings appear in combinatorics, in tropical geometry and in computer science, for example in shortest path problems and formal languages.

## Explanations

### L1 human

A semiring is a place where you can add and multiply as usual, but you may not be able to subtract.
The counting numbers $0, 1, 2, \dots$ are the model: $3 - 5$ is not a counting number.
Another example uses "minimum" as addition and ordinary $+$ as multiplication on the real numbers together with $\infty$.
There, the "sum" of $3$ and $5$ is $3$, and their "product" is $8$.
This strange arithmetic is exactly what you need to compute shortest paths in a road network.
