Given a relation $f : X \rightarrow Y$, lets define that the source of $f$ is $X$, and that the domain of $f$ is the set of all $x$ such that there exists $y \in Y$ satisfying $(x,y) \in f$. Thus the domain of a partial function is the set of all inputs for which it is defined.
Now given a set $X$, a subset of $X$ can be characterized as a partial function $f : X \rightarrow 1$. (Intuitively, the subset represented by $f$ is precisely the domain of $f$). This is rather convenient, because the preimage of a "subset" $f$ under a relation $g$ can simply by written $f \circ g$, where $\circ$ denotes the composition of relations.
Similarly, given a group $G$, a subgroup of $G$ can be characterized as a partial function $f : G \rightarrow 1$ with the property that the domain of $f$ is in fact a subgroup of $G$ in the classical sense.
My question is, do the above observations have any interesting category-theoretic applications or interpretations? And is there a "partial function" approach to subobjects in category theory, whatever that may mean?
