0
$\begingroup$

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?

$\endgroup$
  • 2
    $\begingroup$ 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 \}$. $\endgroup$ – Mauro ALLEGRANZA Sep 18 '17 at 7:13
  • 1
    $\begingroup$ @Mauro You should post that as an answer when you get the chance. $\endgroup$ – Mark S. Sep 18 '17 at 9:10
1
$\begingroup$

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$.

| cite | improve this answer | |
$\endgroup$
4
$\begingroup$

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$.

| cite | improve this answer | |
$\endgroup$

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.