The operations on the log semiring can be defined extrinsically by mapping them to the non-negative real numbers, doing the operations there, and mapping them back. The non-negative real numbers with the usual operations of addition and multiplication form a semiring (there are no negatives), known as the probability semiring, so the log semiring operations can be viewed as pullbacks of the operations on the probability semiring, and these are isomorphic as rings.
Formally, given the extended real numbers R ∪ {–∞, +∞}2 and a base b ≠ 1, one defines:
Regardless of base, log multiplication is the same as usual addition, x ⊗ b y = x + y {\displaystyle x\otimes _{b}y=x+y} , since logarithms take multiplication to addition; however, log addition depends on base. The units for usual addition and multiplication are 0 and 1; accordingly, the unit for log addition is log b 0 = − ∞ {\displaystyle \log _{b}0=-\infty } for b > 1 {\displaystyle b>1} and log b 0 = − log 1 / b 0 = + ∞ {\displaystyle \log _{b}0=-\log _{1/b}0=+\infty } for b < 1 {\displaystyle b<1} , and the unit for log multiplication is log 1 = 0 {\displaystyle \log 1=0} , regardless of base.
More concisely, the unit log semiring can be defined for base e as:
with additive unit −∞ and multiplicative unit 0; this corresponds to the max convention.
The opposite convention is also common, and corresponds to the base 1/e, the minimum convention:3
with additive unit +∞ and multiplicative unit 0.
A log semiring is in fact a semifield, since all numbers other than the additive unit −∞ (or +∞) has a multiplicative inverse, given by − x , {\displaystyle -x,} since x ⊗ − x = log b ( b x ⋅ b − x ) = log b ( 1 ) = 0. {\displaystyle x\otimes -x=\log _{b}(b^{x}\cdot b^{-x})=\log _{b}(1)=0.} Thus log division ⊘ is well-defined, though log subtraction ⊖ is not always defined.
A mean can be defined by log addition and log division (as the quasi-arithmetic mean corresponding to the exponent), as
This is just addition shifted by − log b 2 , {\displaystyle -\log _{b}2,} since logarithmic division corresponds to linear subtraction.
A log semiring has the usual Euclidean metric, which corresponds to the logarithmic scale on the positive real numbers.
Similarly, a log semiring has the usual Lebesgue measure, which is an invariant measure with respect to log multiplication (usual addition, geometrically translation) with corresponds to the logarithmic measure on the probability semiring.
Since b − x = ( b − 1 ) x = ( 1 / b ) x {\displaystyle b^{-x}=\left(b^{-1}\right)^{x}=(1/b)^{x}} ↩
Usually only one infinity is included, not both, since ∞ ⊗ − ∞ = ∞ + ( − ∞ ) {\displaystyle \infty \otimes -\infty =\infty +(-\infty )} is ambiguous, and is best left undefined, as is 0/0 in real numbers. ↩
Lothaire 2005, p. 211. - Lothaire, M. (2005). Applied combinatorics on words. Encyclopedia of Mathematics and Its Applications. Vol. 105. A collective work by Jean Berstel, Dominique Perrin, Maxime Crochemore, Eric Laporte, Mehryar Mohri, Nadia Pisanti, Marie-France Sagot, Gesine Reinert, Sophie Schbath, Michael Waterman, Philippe Jacquet, Wojciech Szpankowski, Dominique Poulalhon, Gilles Schaeffer, Roman Kolpakov, Gregory Koucherov, Jean-Paul Allouche and Valérie Berthé. Cambridge: Cambridge University Press. ISBN 0-521-84802-4. Zbl 1133.68067. https://archive.org/details/appliedcombinato0000loth ↩