2

This question is related to What is the correct notation for a multivariable function?

Consider a function $f(x, y)$ with codomain $C$, such that both $x$ and $y$ belong to ${D}_{1}$. In this case we can denote $f: {D}_{1}^{2} \rightarrow C$. Now, if $x$ belongs to ${D}_{1}$ and $y$ belongs to ${D}_{2}$, we no longer can define the function that way, because the domain is actually a set of heterogeneous tuples. In functional programming languages, such as Haskell, one can define such a function as either $f: ({D}_{1}, {D}_{2}) \rightarrow C$ or a curried function $f: {D}_{1} \rightarrow {D}_{2} \rightarrow C$. At the same time in mathematical notation a function is usually depicted as a mapping between two sets, which raises concern over the acceptability of Haskell'ish notation in mathematical texts?

  • 2
    Formally, $f : A \times B \to C$ is a function with two "inputs" from the sets $A$ and $B$ respectively, where the cartesian product $A \times B$ is the set of all pairs: $A \times B = { (x,y) \mid x \in A \text { and } y \in B }$. – Mauro ALLEGRANZA Sep 18 '17 at 07:13
  • 1
    @Mauro You should post that as an answer when you get the chance. – Mark S. Sep 18 '17 at 09:10

2 Answers2

5

Formally, $f:A \times B \to C$ is a function with two "inputs" from the sets $A$ and $B$ respectively, where the cartesian product $A \times B$ is the set of all pairs: $A \times B = \{ (x,y) \mid x \in A \text { and } y \in B \}$.

This is not in contrast with "currying": we can think at $f$ as a single-input function $f$ from $A$ to the collection of fucntions from $B$ to $C$. In this way, the output of $f$ for input $a \in A$ will be $f(a)=f_a$, i.e. a new single-input function: $f_a : B \to C$.

1

There is no actual problem. The second approach just defines a new function $f_x$ for any $x \in D_1$, i.e. $f_x : D_2 \to C$ and $f : D_1 \to C^{D_2}$, which maps $x \mapsto f_x$.

With $A^B$ means functions from $B$ to $A$.

dEmigOd
  • 3,390