Definition 0. Given a category $\mathbf{C}$ with objects $X$ and $Y$, lets define that an algebraic set $X \nrightarrow Y$ is a subset $\Phi$ of $\mathbf{C}(X,Y)$ such that there exists an object $I$ together with morphisms $f:I \rightarrow X$ and $g:I \rightarrow Y$ such that $$\forall \varphi : X \rightarrow Y \qquad \varphi \in \Phi \iff \varphi \circ f = g.$$
If I'm not mistaken, algebraic sets $\mathbb{R}[x_1,\ldots,x_n] \nrightarrow \mathbb{R}$ in the above sense are in canonical bijective correspondence with algebraic subsets of $n$-dimensional affine space in the classical sense. For example, in the category of $\mathbb{R}$-algebras, there's an algebraic set $x^2+y^2=1:\mathbb{R}[x,y] \nrightarrow \mathbb{R}$ consisting of all morphisms $\varphi : \mathbb{R}[x,y] \rightarrow \mathbb{R}$ such that $\varphi(x)^2+\varphi(y)^2=1_\mathbb{R}.$ To see that this an algebraic set, let $I=\mathbb{R}[\alpha]$ and define $f(\alpha) = x^2+y^2$ and $g(\alpha)=1,$ then extend $f$ and $g$ to morphisms of $\mathbb{R}$-algebras.
Now, I don't know anything about algebraic geometry, but I'm interested in using the notion of an "algebraic set" given above to formalize certain concepts in basic linear algebra. The way I see it, a system of linear equations like
\begin{align*} \alpha : 2x - 5y &= 8 \\ \beta : 3x + 9y &= -12 \end{align*}
"is" a span in $\mathbb{R}\mathbf{Mod}$. Define
- $I = \mathbb{R}\langle \alpha,\beta\rangle$
- $X = \mathbb{R}\langle x,y\rangle$
- $Y = \mathbb{R}$
- $f(\alpha) = 2x-5y, f(\beta) = 3x+9y$
- $g(\alpha) = 8, g(\beta) = -12$
Then the above system "is" the span $(I,f,g) : X \nrightarrow Y.$ And, a solution to this system "is" an element of the corresponding algebraic set.
Now recall that two systems of linear equations are equivalent iff their solution sets are equal. We can generalize as follows:
Definition 1. Given a category $\mathbf{C}$ with objects $X$ and $Y$, two spans $S,T : X \nrightarrow Y$ are equivalent iff the corresponding algebraic sets are equal.
Long story short, I plan to use these notions to get a better grasp on so-called "elementary" linear algebra. But something's bothering me, namely that I can't quite tell whether there's a category here with objects equal to $\mathrm{obj}(\mathbf{C})$ and arrows being algebraic sets:
Question. Is there a sensible way to compose "algebraic sets" between objects, and if so, is it associative?