Every function $f: X \rightarrow Y$ is actually a relation between $X$ and $Y$: $$R_f = \{ (x, f(x)) : x \in X \}$$
If $X$ and $Y$ are fields, we can take sums and products of two functions and say $$R_f + R_g = R_{f + g} = \{ (x, f(x) + g(x)) : x \in X\}$$ $$R_f * R_g = \{ (x, f(x) g(x)) : x \in X\}$$
But not every relation is a function, so it would be nice to add and multiply relations that are not functions. I suspect we can define the sum of two arbitrary relations between X and Y by $$R + S = \{ (x, y_1 + y_2): (x, y_1) \in R, (x, y_2) \in S \}$$ and the product by $$R S = \{ (x, y_1 y_2): (x, y_1) \in R, (x, y_2) \in S \}.$$
Is this a good/correct definition? I assume this has been done before somewhere but I can't find it.