25

I am self-studying and have a basic or naive question that follows from a simple observation. I have also included tags for type theory, etc because "evaluation" probably has a different meaning in these constructive approaches, which I'm also curious about.

Any set $X$ with elements $x_i$ can be characterized by a set denoted $(X)$ of pairs $(\star, x_i)$, alternatively denoted $(\star \mapsto x_i)$ (for all $x_i \in X$). Each one of these latter pairs encodes a distinct function from common domain $\{ \star \}$ to (each different element of) $X$. If we name such functions after their image, i.e. $(x_i):\star \mapsto x_i$, then the symbol "$f(x_i)$", traditionally interpreted as function evaluation, is reinterpreted as function composition, i.e. $f\circ (x_i)$ and the $\circ$ is often notationally suppressed. And roughly, $f = \cup_xf(x)$, every function decomposes to a unique set of singleton functions (better word?).

Question: Is there anything more to evaluation, or can I exactly equate evaluation with composition and forever de-clutter my mind of the term "evaluation"? Is the above perspective unusual or fruitful beyond reducing terminological clutter?

The notion of evaluation above - perhaps "extensional" is the right term? - means essentially subsetting the function at the chosen argument $x$. Perhaps I will see that a full answer to my question requires considering an intentional (?) or constructive perspective on "evaluation" (as in lambda calculus, etc). Perhaps only there will composition and evaluation legitimately have distinct meanings.

Edit: The notation $(x)$ seemed the most natural way to denote any function with singleton domain because it coheres with the conventional way to write evaluation as $f(x)$. The notation seems unambiguous because there is no context I can think of, other than "evaluation", where a single symbol, say $x$, is enclosed in brackets "()"? It does seem useful to notationally distinguish functions on singleton domain in some way: I would like the notation to be a mnemonic for whether the resulting function composite is a singleton function (i.e. a "value" like $f(x_i) = f \circ (x_i) = (\star, y_j)$) versus a non-singleton function. Perhaps there is a conventional notation for functions from singleton domain, other than $(x)$ and a conventional name for such functions, other than "singleton functions"?

JRC
  • 516

3 Answers3

17

That’s right, evaluation is not in any serious way distinct from composition with a function with singleton domain—or to remove all talk of elements entirely, a function whose domain is a terminal object. This kind of function can entirely replace the role of elements, which is at the heart of the categorical axiomatization of set theory called ETCS.

Kevin Carlson
  • 52,457
  • 4
  • 59
  • 113
  • 1
    Thanks for the sanity check! – JRC Feb 01 '21 at 09:16
  • RE: my edit, I wonder if there is another notation for functions from singleton domain, other than "()" and an official name for such functions, other than "singleton functions". – JRC Feb 01 '21 at 09:33
13

Basically, yes, what you are saying is that in the category of sets and functions the action of composition of $f\colon A\to B$ with $(a)\colon \star \to A$ is precisely encoding function evaluation $f(a)$. So this can indeed neatly be written as $f(x)=f\circ (x)$. This paves the way to thinking about functions and elements in a dual way: a function $f\colon A\to B$ is a machine that converts elements of type $A$ into elements of type $B$; dually an element of type $A$ is a thing that any machine $f\colon A\to B$ can act on to turn into something of type $B$. This tells us that we can take elementhood as primitive and define functions in terms of elements (as is classically done) or that we can treat functions as primitive and define elementhood in terms of functions (as is categorically done). In some sense, for sets and functions (at least naively) the two approaches agree.

However, in many other situations the two options are very different. Suppose that instead of sets and functions your world consists of the non-negative reals $[0,\infty ]$ (with $\infty $ thrown in) and you keep track of magnitude by means of $x\to y$ iff $x\ge y$. The special element $0$, the additive neutral element, serves here as the 'singleton' $\star$ (the reason is that a singleton set is neutral (up to isomorphism) with respect to the cartesian product of sets; similarly $0$ is neutral with respect to addition of real numbers). Now, in the world of sets the arrows $\star\to A$ encode the elements of $A$. What is encoded in the world of non-negative reals? Well, $\star \to a$ is no simply saying that $a=0$. So, if $a=0$, then it has a unique 'element' while any $a>0$ has no elements at all.

This is probably not surprising since real numbers are quite different from sets. Places that behave more like sets than real numbers are called toposes. But there is really no need to abandon the "composition=evaluation" paradigm in non-toposes. Indeed, evaluation can further be understood in terms of a much simpler operation. Going back to sets, if $[A,B]$ is the set of all functions $f\colon [A\to B]$, then the evaluation mapping is $\mathrm {ev}\colon [A,B]\times A\to B$ given by $\mathrm {ev}(f,a)=f(a)$. This evaluation function has a very special universal property. If $f\colon T\to [A,B]$ is any function from any set $T$ we can form the composition $\mathrm {ev}\circ (f\times \mathrm {Id}_A)$ to get a function $h\colon T\times A\to B$. But also conversely, any such function $h$ arises uniquely in this way from a function $f\colon T\to [A,B]$.

In other words, there is a natural bijection between functions $f\colon T\to [A,B]$ and functions $h\colon T\times A\to B$. The translation is performed universally by the evaluation function. So, we observe that the internal notion of the set of all functions $[A,B]$ together with the notion of evaluation is fully encoded by the much simpler notion of the cartesian product of sets. The encoding is done by stating the natural bijectiveness above. The technical way of saying it is that evaluation is the counit of an adjunction whose right adjoint is cross multiplying with a fixed set $A$.

Now we can replace the world of sets and functions with their cartesian product by other things. For instance, non-negative real numbers, magnitude comparison, and addition. It turns one (nice exercise) that there is here too an internal notion of "the real numbers of all magnitudes from $a$ to $b$", namely $[a,b]$, complete with an evaluation mapping with formally the same properties as for sets. Such places are called closed monoidal categories.

Ittay Weiss
  • 79,840
  • 7
  • 141
  • 236
  • Thanks very much. There is so much meat here. Just to connect two ideas, I guess from within the "functional" perspective, your evaluation mapping - given by ev(,)=() can be expanded to explicitly reference maps from ⋆, i.e. ev(,)=∘() with the "∘"? Also, to clarify: by the "internal notion of the set of all functions [,] together with the notion of evaluation is fully encoded by the much simpler notion of the cartesian product of sets" you mean the product × in ℎ:×→? I'd have to digest this. – JRC Feb 01 '21 at 09:14
  • 1
    You're very welcome @JRC. The intention of the answer was precisely to attract one's (inclined) mind to the meatyness of the situation. To answer the two followups: yes and yes. The first yes is straightforward. The second yes is too but perhaps in a simpler way than you currently perceive. What I'm saying is that the internal notion of mappings and evaluation is already encoded in the notion of cartesian product. The latter determines the former via the notion of adjunction. This is really the beginning of topos theory. Lawver's "conceptual mathematics" book should be a good further read. – Ittay Weiss Feb 01 '21 at 11:11
  • Fantastic. Thanks again. – JRC Feb 01 '21 at 11:23
  • 2
    Although this is not a new concept for me, the fact that $f(a)$ can be interpreted as $f\circ (a)$ by choosing suitable notation is the coolest thing I've seen in the past few months. – Lukas Juhrich Feb 03 '21 at 12:47
5

Is there anything more to evaluation, or can I exactly equate evaluation with composition and forever de-clutter my mind of the term "evaluation"?

Frankly, there is no way to non-circularly 'get rid' of the notion of "evaluation". A rose by any other name is still a rose. Even Lawvere's axiomatization of ETCS explicitly axiomatizes the evaluation mapping in Axiom 2, just phrased in category theory terms.

I think what you must realize is that certain mathematical notions are core notions and whatever implementation you use for them does not make them disappear at all. For example, it makes no sense to try to argue that ZFC set theory has eliminated the notion of function application because instead of "$f(x)$" we can use "$\bigcup \{ y : ⟨x,y⟩∈f \}$" given by the Union axiom and the Replacement schema (or a slightly more complicated expression if you use Specification and Powerset instead of Replacement).

The whole point is that we design foundational systems to be able to do the mathematics that we want to do. Since we want to have the usual natural numbers with the usual induction, we also want our foundational system to be able to construct a model of PA (for suitable encoding of "model"). And since we want to be able to reason about functions on $ℕ$, functions on $ℝ$ and so on, with the usual notion of "function", including evaluation, composition, function types and equality, we make sure that our foundational system is able to construct representations of the usual functions and prove those usual properties! See also this related post explaining why we care about abstractions rather than how things are concretely implemented in the foundational system.

There is nothing wrong with thinking about weaker systems that cannot do some of these things, but most logicians would not consider these systems viable as foundations for all mathematics, precisely for that reason!

user21820
  • 57,693
  • 9
  • 98
  • 256
  • Yes thanks. This is very helpful. Point well-taken. – JRC Feb 01 '21 at 08:47
  • @JRC: You're welcome! =) – user21820 Feb 01 '21 at 08:54
  • While I agree with the spirit presented I would argue that it is not a-priori clear that we want to have the usual natural numbers, the usual reals, or the usual functions on them. In some sense, topos theory is trying to be agnostic as possible and only force you to decide which variant of natural numbers, reals, and functions you really want only at the very last minute. Some times we want infinitely large natural numbers. Some times we want infinitesimal reals. Some times we want all functions to be continuous. There are toposes where these happen. – Ittay Weiss Feb 03 '21 at 12:33
  • @IttayWeiss: What I meant was that we always want to be able to get at least concrete real analysis (as used in applied mathematics in engineering design), and basic number theory (as used in applied cryptography), otherwise we would not consider such a system foundational. We certainly can be interested in unusual systems as mathematical objects, just as logicians who completely accept ZFC are still interested in weak fragments of PA such as IΣ1, or weak subsystems of Z2 such as WKL0, but none of those are ever considered to be foundational. – user21820 Feb 03 '21 at 12:46
  • @user21820 I don't think it is very clear which real numbers are the concrete ones used in applied mathematics. – Ittay Weiss Feb 03 '21 at 12:50
  • @IttayWeiss: It is very clear... Look up Reverse Mathematics, where it is well established that all applied real analysis can be done within the system ACA0, which itself is conservative over PA (for arithmetical sentences). So any system that one wants to consider foundational must be able to interpret ACA0 (and here "interpret" is a technical but completely well-defined syntactic notion). – user21820 Feb 03 '21 at 13:05
  • I would not say that it's clear in the sense that there is more to the completeness of a system (as in enabling the construction of everything you want) and its suitability as a foundation. A bit like all programming languages being equipotent (under mild conditions) but they all have very different characters. Anything you can do in one can be done in another, so any one can serve as a foundation. But that misses many other points of consideration. In the same way, the suitability of a mathematical foundation relies on more than just its ability to model stuff of interest. – Ittay Weiss Feb 03 '21 at 13:19
  • @IttayWeiss: I'm not talking about 'suitability' here. My criterion (being able to interpret ACA0) is so permissive that I can't be 'faulted' for asserting that any system that cannot even meet that criterion cannot be considered foundational. The point is that any system that interprets ACA0 will necessarily have at least the ingredients in ACA0, whether in some convoluted form or not. Calling "functions" something else won't make them stop behaving like functions. One must realize that one really cannot get away from certain core principles in every foundational system. – user21820 Feb 03 '21 at 13:45
  • Why else do you think people came up with the Infinity axiom in ZFC (if not to make it so that we can obtain an inductive set, and hence a model of PA)? Or inductive types? Or the notion of 'natural numbers object'? Precisely because we all want a foundational system to be able to interpret at least PA. – user21820 Feb 03 '21 at 13:49
  • I'm very happy to agree that functions will behave like functions. – Ittay Weiss Feb 03 '21 at 14:06