There seems to be an interesting algebra of functions. Does it already exist in literature?
Given functions $f_1 : X_1 \to Y$ and $f_2 : X_2 \to Y$, if $f_1(x) = f_2(x)$ for all $x \in X_1 \cap X_2$, then their sum is defined as $(f_1 + f_2) : X_1 \cup X_2 \to Y$, where $ (f_1 + f_2)(x) = \begin{cases} f_1(x) & x \in X_1\\ f_2(x) & x \in X_2. \end{cases} $
Given functions $f : X \to Y$ and $g : Y \to Z$, their product is defined as $fg : X \to Z$, where $ (fg)(x) = g(f(x)). $
We immediately have the following:
- Addition is commutative and associative.
- The empty function with domain the empty set $\emptyset$ is the additive identity.
- Mutliplication is associative and distributes over addition.
- The identity function is the multiplicative identity.
These properties seem so nice that this algebra must have been investigated before - does anyone have some references for this?