Nullary operation (source code)

= Nullary operation
{title2=$c\in S$}

A nullary operation on a <set> $S$ has no inputs: formally it is a <function> $S^0\to S$. The Cartesian power $S^0$ is the singleton consisting of the empty tuple, so such a <function> selects exactly one distinguished element $c\in S$.

The zero and identity elements of a unital <ring> can be encoded as nullary operation symbols. A <homomorphism> preserving those operations must carry their selected constants to the corresponding constants in the target structure. This is why constants fit naturally into the same signature language as <unary operations> and <binary operations>.

There is no nullary operation on the <empty set>: its source $S^0$ still has one element, while its target has none. Allowing constants therefore affects whether empty algebraic structures are possible.