First, what everyone knows.

Definition: \(x\) is an inverse of \(a\) iff \(a x = 1\) and \(x a = 1\).

Theorem: 0 does not have an inverse.

Proof: Suppose 0 has an inverse. Call it \(x\). By the definition of inverse, \(0 x = 1\). But 0 is an annihilator. Thus \(0 x = 0\). Thus \(0 = 1\). Contradiction. ∎


Now, let's go beyond.

Definition: \(^*\) is a pseudo-inverse iff it satisfies the following properties:

Theorem: If \(^*\) is a pseudo-inverse, then \(0^* = 0\).

Proof: By property 1, \(0^* (0^*)^* 0^* = 0^*\). By property 2, \(0^* 0 0^* = 0^*\). By the annihilation property of 0, \(0 = 0^*\). ∎

Theorem: If \(^*\) is a pseudo-inverse and \(x \neq 0\), then \(x^* = x^{-1}\).

Proof: By property 1, \(x x^* x = x\). Thus \(x^{-1} x x^* x = x^{-1} x\). By the definition of inverse, \(x^* x = 1\). Thus \(x^* x x^{-1} = 1 x^{-1}\). By the definition of inverse, \(x^* = 1 x^{-1}\). By the identity property, \(x^* = x^{-1}\). ∎

Conclusion: There is a meaningful way to define the "inverse" (in a generalized sense) of 0.

The "inverse" of 0 is 0.

In abstract algebra terms, we can replace the concept of a field with the concept of a meadow, which has a purely equational axiomatization.

Definition: A meadow is a commutative and unitary ring equipped with a pseudo-inverse.

Integer division by zero

Definition: The integer quotient of \(n\) by \(d\) is the number of integer multiples of \(d\) in \(\{1, 2, \ldots, n\}\). That is, \(n \div d = |[1, n] \cap d \mathbb{Z}|\).

Theorem: The integer quotient of \(n\) by 0 is 0.

Proof: By the above definition, \(n \div 0 = |[1, n] \cap 0 \mathbb{Z}| = |[1, n] \cap \{0\}| = |\{\}| = 0\). ∎

Definition: Let \(f : \mathbb{N}^2 \to \mathbb{N}^2\) where \[ f(q, r) = \begin{cases} (q + 1, 0) & r + 1 = d \\ (q, r + 1) & r + 1 < d \end{cases} \] Intuition: This function is like going around a clock with \(d\) ticks. Every time the hand (\(r\)) enters the start (i.e., \(r + 1 = d\)), increment the quotient (\(q\)).

Definition: \(\operatorname{divmod}(n, d) = f^{\circ n}(0, 0)\). This is a primitive recursive definition for integer division.

Theorem: \(\operatorname{divmod}(n, 0) = (0, n)\).

Proof: Suppose \(d = 0\). Then \(r + 1 \neq d\). Thus \(f = (q, r) \mapsto (q, r + 1)\). Thus \(f^{\circ n} = (q, r) \mapsto (q, r + n)\). Thus \(f^{\circ n}(n, 0) = (0, n\).

Conclusion: \(n \div 0 = 0\) and \(n \bmod 0 = n\).

The latter makes sense, because \(n\) is the only number congruent to itself modulo 0 (i.e., differing by an integer multiple of 0, i.e., exactly equal).