# What are $f\circ\emptyset$ and $\emptyset\circ f$ if $\circ$ is function composition and $f$ is any function?

My guess is that both are $$\emptyset$$ because if $$g\circ f=\{(x,z)\mid \exists y\in \text{Im}f:(x,y)\in f\land (y,z)\in g\}$$ then if $$f$$ or $$g$$ are the empty set then it doesn't exist any $$y$$ with such condition, so the set is empty. Am I right?

• +1 I've never seen such composition with the empty set..$\emptyset\circ f$, where did you see it?
– user486983
Oct 19, 2018 at 18:45
• Yes, you are right. Oct 19, 2018 at 18:50
• @Isah I need it for a project that I'm working on. Oct 19, 2018 at 18:56
• I'm a little confused but I think you are right? You are talking about function compositions so you have to talk about 2 functions.$\emptyset$ usually stands for the empty set, which isn't a function.Briefly looking this up, I found something about "empty functions" and empty set stuff but I didn't really read the material. (as an aside your definition of the composition $g\circ f$ is a little strange to me, but maybe I'm not familiar with the notation.It sounds like you are talking about the graph of $g \circ f$. I've never seen $(x,y) \in f$ before because $f$ isn't a set - but I understand) Oct 19, 2018 at 21:03
• @DWade64 The empty set is indeed a function. Oct 19, 2018 at 21:34

Yes, you are right.

Under the convention that a function is a set $$f$$ of ordered pairs such that

if $$(x,y)\in f$$ and $$(x,z)\in f$$, then $$y=z$$

we can define function composition in the following way.

Let $$f$$ and $$g$$ be functions; then $$g\circ f=\{(x,z):(x,y)\in f\text{ and }(y,z)\in g,\text{ for some }y\}$$ is a function.

The empty set is obviously a function in the sense described above and, for every function $$f$$, $$\emptyset\circ f=\emptyset=f\circ\emptyset$$ because $$(a,b)\in\emptyset$$ is false for every $$a$$ and $$b$$.

This is old, but I don't think I agree with the accepted answer.

In the usual interpretation of $$g\circ f$$, we assume that $$\mathrm{cod}(f) = \mathrm{dom}(g)$$, or at least $$\mathrm{Im}(f) \subseteq \mathrm{dom}(g)$$. Then $$g\circ f:\mathrm{dom}(f)\to\mathrm{cod}(g)$$. If we don't have $$\mathrm{Im}(f) \subseteq \mathrm{dom}(g)$$, then we must regard $$g$$ as a partial function to take the composition.

Since the empty function has domain $$\emptyset$$, I claim we have $$f\circ\emptyset = \emptyset,$$ but $$\emptyset\circ f\ \textrm{is undefined (unless f=\emptyset)}.$$ Taking instead the laxer definition of composition where we disregard domains and codomains, I of course agree with egreg, and the claim would be equivalent to $$\emptyset\circ_{\mathrm{lax}} f := \emptyset\circ \left(f\upharpoonright_{f^{-1}(\mathrm{dom}\ \emptyset)} \right) = \emptyset\circ\emptyset = \emptyset.$$