2020 James B. Wilson
Colorado State University
A function of type \[A\to (B\to C)\] expects two inputs, the first of type \(A\) the second of type \(B\).
This is nearly identical to functions of type \[A\times B\to C\] given how \(A\times B\) was defined in our class discussion.
These are essentially interchangeable.
"Currying" means swapping \(A\times B\to C\) with \(A\to (B\to C)\).
"Uncurrying" swaps \(A\to (B\to C)\) with \(A\times B\to C\).
Many authors abbreviate \(A\to B\to C\) for \(A\to (B\to C)\).
In algebra that gets confused with a later concept called "exact sequences". So we mostly avoid that shortcut.
As a function \(+\) must take in data on the left that is the same as on the right.
Formally, we have this implied function
\[x\mapsto (y\mapsto (x+y))\quad \equiv \quad (x,y)\mapsto x+y.\]
In general this could have type
\[A\to (B\to C) \quad\equiv \quad A\times B\to C.\]
But to permit \(x+x\) requires \(A=B\); so,
\[A\to (A\to C)\quad \equiv\quad A\times A\to C.\]
As a function \(+\) must produce a type of data equal to the input type.
Form before, we still consider
\[x\mapsto (y\mapsto (x+y))\quad \equiv \quad (x,y)\mapsto x+y\]
of type \(A\to (B\to C)\), equivalently \(A\times B\to C\).
\(x+x\) forced \(A=B\), and now \(x+x=x\) forces \(A=C\); so,
\[A\to (A\to A)\quad \equiv\quad A\times A\to A.\]
Polynomial equations requires that all the operations start and end with the same type of data.
Given a set or type \(A\),
Given a set or type \(A\), an \(n\)-operator
Recall our type \(A\times B\) in our assignment.
The technically imprecise, we often write \(A^n=\overbrace{A\times \cdots\times A}^n\)
\(7\in \mathbb{N}\)
We may interpret this as an operator, i.e. let \(\mathbb{N}^0=\{\bot\}\) be a set of size 1. Then we can type this as a function
\[\bot\mapsto 7\]
which can be typed as \(\mathbb{N}^0\to \mathbb{N}\), i.e.: a \(0\)-operator.
\(m+n\) where \(m,n\in \mathbb{N}\)
Formally we have the following compound anonymous function
\[m\mapsto (n\mapsto (m+n))\]
which can be typed as \[\mathbb{N}\to (\mathbb{N}\to \mathbb{N}).\]
\(m-n\) where \(m,n\in \mathbb{N}\)
Formally we have the following compound anonymous function
\[m\mapsto (n\mapsto (m-n))\]
but \(m-n\) may be negative so this is \[\mathbb{N}\to (\mathbb{N}\to \mathbb{Z}).\]
These are not all the same type, so not an operator.
\(m/n\) where \(m,n\in \mathbb{N}\)
No. Formally we have the following compound anonymous function
\[m\mapsto (n\mapsto (m/n))\]
but, we cannot type this as \[\mathbb{N}\to (\mathbb{N}\to \mathbb{N}).\]
Instead we might type this as
\[\mathbb{N}\to (\mathbb{N}\to \mathbb{Q}).\]
So it is not an operator on \(\mathbb{N}\).
\(m+0=m\) where \(m,0\in \mathbb{N}\)
No. This is an equation, not an "traditional" function.
We could say \(m+0=m\) is a type---the type of all evidence for the equation. E.g. the reflexive law is evidence \[refl_m:(m+0=m).\]
Hence we have
\[m\mapsto refl_m\]
with type \[\prod_{m\in \mathbb{N}} (m+0=m).\]
Still not an operator on \(\mathbb{N}\), i.e., not of type \(\mathbb{N}^n\to \mathbb{N}\).
\(X+Y\) where \(X,Y\) are real matrices.
No/Yes. The subtle point is we are imprecise, e.g. this is nonsense
\[\begin{bmatrix} 1 & 2 \end{bmatrix}+\begin{bmatrix} 1 & 0 \\ -1 & 1\end{bmatrix}\]
However, if we narrow focus to \((m\times n)\)-matrices then the implied map is
\[X\mapsto (Y\mapsto (X+Y))\]
and can be typed
\[\mathbb{M}_{m\times n}(\mathbb{R})\to (\mathbb{M}_{m\times n}(\mathbb{R})\to \mathbb{M}_{m\times n}(\mathbb{R})).\]
So this is a binary operator.
\(XY\) where \(X,Y\) are real matrices.
As before \(XY\) is not everywhere defined as a matrix, so we cannot force \(X\mapsto (Y\mapsto XY))\) to always have a type \(A\to (A\to A)\).
Even when when it is defined the general type is
\[\mathbb{M}_{a\times b}(\mathbb{R})\to (\mathbb{M}_{b\times c}(\mathbb{R})\to \mathbb{M}_{a\times c}(\mathbb{R})).\]
Finally only if \(a=b=c\), i.e. square matrices, do we get an actual operator on one type \(\mathbb{M}_{a}(\mathbb{R})=\mathbb{M}_{a\times a}(\mathbb{R})\).
Is the reciprocal an operator on \(\mathbb{Q}\)?
Consider the function.
\[x\mapsto 1/x\]
Consider its type
\[(\mathbb{Q}-\{0\})\to \mathbb{Q}\]
Technically no, the domain is different from the codomain, this is not a unary operator on \(\mathbb{Q}\).
Some like to call these partial-operators.
Operators like general rectangular matrix multiplication are not operators in the sense here.
Functions of type
\[A\to (B\to C)\quad\equiv\quad A\times B\to C\]
can still be part of algebra.
In those cases, we must have operators on one of \(A\), \(B\) or \(C\) and we study the interaction.
Vector spaces \(V\) have a scalar multiplication:
\[\cdot:\mathbb{R}\to (V\to V)\quad\equiv\quad \mathbb{R}\times V\to V.\]