I've always been taught to write $f : X \rightarrow Y$ as opposed to $f \in X \rightarrow Y$. This seems weird though, since $X \rightarrow Y$ can be viewed as the set of all functions with source $X$ and target $Y$, in which case the notation $f \in X \rightarrow Y$ has exactly its intended meaning.

Why do we write $f : X \rightarrow Y$? Is it habit? Notational prettiness? Historical accident?

Related. In category theory, we write $\mathrm{Hom}(X,Y)$ for the set of all arrows $X \rightarrow Y.$ Why do we not write $X \rightarrow Y$ for this set? Again, is this just historical inertia, or is there something deeper going on?

  • 6
    $\begingroup$ Who is "viewing X→Y as the set of all such functions with source X and target Y"? I thought this set was $Y^X$. $\endgroup$ – Did Nov 29 '13 at 20:44
  • 5
    $\begingroup$ But $X\to Y$ is not used to represent the set of functions from $X$ to $Y$, so the notation $f\in X\to Y$ can’t be justified on that basis. (I believe that there are some modern mathematical contexts in which the notation $[X\to Y]$ is used, but they’re limited.) The usual notations for that set of functions are $Y^X$ or, better, ${}^XY$. $\endgroup$ – Brian M. Scott Nov 29 '13 at 20:45
  • 3
    $\begingroup$ Personally, I write $f : X \to Y$ because I'm a type theorist not a set theorist :P $\endgroup$ – Ben Millwood Nov 29 '13 at 20:55
  • 2
    $\begingroup$ What kind of answer are you looking for with this question, exactly? $\endgroup$ – Najib Idrissi Nov 29 '13 at 23:18
  • 1
    $\begingroup$ I don't understand what you mean. "Fails to generalize nicely": do you mean would there be problems if we wrote $X \to Y$ instead of $\mathrm{Hom}(X,Y)$? It's a bit clunky with respect to operator priority, but otherwise no, what kind of problem could there be? It's just slightly different notation $\endgroup$ – Najib Idrissi Nov 29 '13 at 23:22

There would be at least two problems with the notation $f \in X \to Y$ instead of $f : X\to Y$ to mean "$f$ is a function from $X$ to $Y$."

  1. In general it's bad for clarity to write things that have initial segments that mean unrelated things. Here "$f \in X$" is an initial segment of "$f \in X \to Y$" and if $X$ is a long expression, the reader might be surprised upon reaching the arrow and need to go back and re-interpret what came before it in light of what is ultimately claimed about the relationship between $f$ and $X$.

  2. The arrow is also used sometimes for other things such as logical implication and convergence, so authors should make sure to provide contextual clues that enable the reader to resolve the ambiguity. The colon in the expression $f:X \to Y$ helps the reader understand what the arrow means. On the other hand, the notation "$f \in X \to Y$" is bad because $f \in X$ could be interpreted as a proposition, which is consistent with the use of "$\to$" to mean logical implication.

  • 2
    $\begingroup$ Yes, and imagine a sequence of functions from $x_n$ to $x$. $f_n\in x_n\to x$. As $n\to\infty$, $f_n\to f$ pointwise... $\endgroup$ – Asaf Karagila Nov 29 '13 at 23:53
  • $\begingroup$ Or, you know, worse. Consider $\varphi$ and $\psi$ to be two sets, now consider the following: $$f\in\varphi\to\psi\leftrightarrow\forall x\in\varphi\exists!y\in\psi:\langle x,y\rangle\in f$$ It's fun to come up with ways to make this notation very hard to parse! But I'll stop here (unless I come up with an amazing example next, which is unlikely). $\endgroup$ – Asaf Karagila Nov 29 '13 at 23:57
  • 1
    $\begingroup$ @Asaf Ack! Well, that's also a reason not to use $\varphi$ and $\psi$ as variable symbols in set theory. $\endgroup$ – Trevor Wilson Nov 30 '13 at 0:01
  • $\begingroup$ True. But in some places [in set theory] those are commonly used symbols for functions (e.g. Galvin-Hajnal theorem and related areas), and functions are sets. $\endgroup$ – Asaf Karagila Nov 30 '13 at 0:06
  • 1
    $\begingroup$ @ZhenLin That is a good point, so maybe (1) is only a valid reason in combination with (2). (And the superscript notation is less ambiguous than the arrows, at least in the kind of writing I've seen.) $\endgroup$ – Trevor Wilson Nov 30 '13 at 0:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.