Library / Mathematical Thinking DPF
Jump to passage
In this reading

Link to current text

Published source confirmed at last check

Source changed 2026-10-03 08:25:59 UTC · snapshot created 2026-10-03 10:17:34 UTC · last check 2026-10-03 10:35:10 UTC

MATH.16:5.4 - Construct an object that can itself be applied

A function can be prepared by supplying a setting, then used with different inputs. We want a mathematical object representing the prepared function. Fix the input set A and output set B. A possible set of settings X supplies behavior eX:X x A -> B: it returns an output for a setting x and input a. Different X and eX describe different ways to prepare such behavior.

Seek a set E of prepared functions and an evaluation rule ev:E x A -> B for applying them. Preparing from a setting should give a map h:X -> E. To retain the original behavior, require:

ev(h(x),a)=eX(x,a) for every x and a.

Here prepared functions are equal when they give the same answer for every input. Thus the behavior specified by eX should determine h completely. Require a unique such h for every X and eX.

Construct E=B^A, the set of all functions from A to B. Define ev(k,a)=k(a), and let h(x) be the function sending a to eX(x,a). The required equation follows by evaluation. Any other proposed value for h(x) must give that same answer at every a, so it is the same function. This proves uniqueness.

For example, take A, B and X to be the integers and eX(n,a)=n+a. Then h(3) is the function that adds 3; ev(h(3),6)=9. The construction allows us to pass, apply and compare that function as an object. The conversion from a two-input function to a function returning a function is called currying. Distinguishing procedures with the same answers but different costs requires a further computational description of those procedures.