# Defining functions in terms of relations

I've never actually seen a definition of a function in terms of relations, but I do know that functions are essentially special types of relations (I don't like to use this terminology, is it correct to instead say functions are subsets of relations?)

Definition (Relation):

Let $A$ and $B$ be two sets. A binary relation $R$ between $A$ and $B$ is a subset of $A \times B$. $$R \subset A \times B = \{ (a, b) | \ a \in A \ \text{and} \ b \in B \}$$

Now I attempt to define a function (as I have not yet seen a definition in terms of relations) as follows.

Definition (Functions):

Let $A$, $B$ be two sets, and $R$ a binary relation, then define $f : A \to B$, such that $$f \subset R \subset A \times B \ \ \text{ such that} \ \ (a, b) \in f \ \text{and} \ (a, b') \in f \implies b = b'$$ And notation-wise we put $$f(a) = b$$

Now I don't know if this is an actual concept (if it is please let me know), but it would seem that the set of all functions from $A \to B$, would be defined as follows

Definition (Set of all possible Functions):

Given the above definition, the set $S$ of all possible functions from $A \to B$ is as follows. $$S = \{ f \ | \ (a, b) \in f \ \text{and} \ (a, b') \in f \implies b = b' \}$$

First off, is my attempted definition of a function correct (and is it correct to say that functions are just subsets of relations)?

Secondly is my definition of the set of all possible functions correct?

Finally is my definition of the set of all possible functions, the definition of a function space?

• Your definition for function does indeed contain the notion of being well-defined (i.e. $a=a'\implies f(a)=f(a')$) but it is missing the notion of being everywhere-defined. You must also stipulate that $a\in A\implies \exists b~\text{such that}~(a,b)\in f$. I.e. $f(a)$ must make sense to talk about for every $a$ in the domain. – JMoravitz Dec 5 '16 at 19:10
• As for the set of all functions, once you add the missing condition I mention, then yes, though you should clarify that each $f$ is a subset of $A\times B$ in the definition of $S$. In fact, the set of all functions is regularly used, even sometimes as a domain for yet another function. – JMoravitz Dec 5 '16 at 19:14

Functions are, as you might already noticed, relations themselves. In fact $$f=\{ (a,b_a) |\; a\in A, \; \; b_a \in B \}$$ i.e. to each $a$ from set $A$ exists unique $b_a \in B$ such that $(a,b_a)\in f$. Hence $f\subset A\times B$ is a relation. As far as set of all possible functions is concerned, I'd put it like this: $$S=\{f \subset A\times B |\; (a,b)\in f \text{ and } (a,b')\in f \implies b=b' \}.$$ And lastly, S is a function space, but without placing some requirements on those functions, like continuity for example, it usually won't have many useful properties in general.