function (changes) in nLab
Showing changes from revision #40 to #41: Added | Removed | Changed
Context
Set theory
- fundamentals of set theory
- material set theory
- presentations of set theory
- structuralism in set theory
- class-set theory
- constructive set theory
- algebraic set theory
Type theory
natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism = \linebreak propositions as types +programs as proofs +relation type theory/category theory
Category theory
Contents
Idea
In A a strict sense of the term, afunctionfunction is ahomomorphismf:S→Tf \colon S \to T from af:S→Tf \colon S \to Tset ofsetsSS : a (the prescription which takes anydomain) to a set TT (the codomain) is a prescription which takes any element s∈Ss \in S to a unique element f(s)∈Tf(s) \in T , . this One also called says the that:value of the function at ss.
Instead of “function” one also speaks of map or mapping, but those terms are used in other ways in other contexts.
-
f(s)f(s) is the value of the function at ss,
-
f(s)∈Tf(s) \in T is a function of s∈Ss \in S,
A and function the from process a of assigningsetf(s)f(s) to A s A s to is a also set calledBBfunction application is determined by giving, for each element of AA, a specified element of BB. The process of passing from elements of AA to elements of BB is called function application. The set AA is called the domain of ff, and BB is called its codomain.
A For function emphasis is one sometimes called speaks a oftotal functiontotal functions to distinguish it from apartial functionpartial functions which need not be defined for all elements ss of their domain set SS.
More Famous generally, and every historically important examples of functions map specifically between sets of morphism numbers between (such as theobjectstrigonometric functions , in acategoryzeta functions , may etc.). be thought of as a function in a generalized sense. This generalized specialization use of the word term is goes wide so spread far (and that justified) the in termtype theoryfunction theory , where is for generally understood to refer specifically toSSanalysis and over theTTreal two or types complex numbers , there (cf. is afunction typecomplex analysis ). denotedS→TS \to T and then the expression f:S→Tf : S \to T means that ff is a term of function type, hence is a function.
In Instead this of generalized “functions” sense, one functions also between speaks sets of are themorphismsmaps in or thecategorymappings , but these terms are often understood to refer to functions which respect Set extra structure . , This hence is which are cartesian homomorphisms closed , and (for the instancefunction typecontinuous maps are functions that respectS→TS \to Ttopological is structure). then See the also function further set alternative terminology . below.
For Hence more one on may this say more that general functions use are of “function” see atfunction typehomomorphisms of plain sets . Indeed, functions are themorphisms in the category Set whose objects are sets. Conversely this means that every morphism between objects in any category may be thought of as a function in a generalized sense.
This generalized use of the word is wide spread (and justified) in type theory, where for SS and TT two types, there is a function type denoted S→TS \to T such that the judgement f:S→Tf \colon S \to T means that ff is a term of function type, hence is a function.
Back in categorical semantics, the function type becomes the internal hom, which in Set is the function set of all functions with given domain and codomain. From this perspective a function is an element of a function set or generally a generalized element of an internal hom-object (exponential object).
Foundations
The formal definition of a function depends on the foundations chosen.
In set theory
-
In material set theory, a function ff is often defined to be a set of ordered pairs such that for every xx, there is at most one yy such that (x,y)∈f(x,y)\in f. The domain of ff is then the set of all xx for which there exists some such yy. This definition is not entirely satisfactory since it does not determine the codomain (since not every element of the codomain may be in the image); thus to be completely precise it is better to define a function to be an ordered triple (f,A,B)(f,A,B) where AA is the domain and BB the codomain.
-
In structural set theory, the role of functions depends on the particular axiomatization chosen. In ETCS, functions are among the undefined things, whereas in SEAR, functions are defined to be particular relations (which in turn are undefined things).
\begin{remark} \label{FunctionsOfSetsAsTrees} (functions as trees) \linebreak Functions of sets may be identified with rooted trees of height 2 by treating the domain as the vertices of height 2, the codomain as the vertices of height 1, and letting every height 2 vertex have a single edge to (have its parent be) the value it is sent to by the function.
This is a special case of the equivalence between rooted trees and presheaves on ℕ\mathbb{N} (see there). \end{remark}
In dependent type theory
In dependent type theory, a type AA is a contractible type if it comes with an element a:Aa:A and a family of identities x:A⊢c(x):a= Axx:A \vdash c(x):a =_A x indicating that aa is a center of contraction. A function between types AA and BB could be defined as
- a family of elements x:A⊢f(x):Bx:A \vdash f(x):B
- a span (C;z:C⊢g(z):A;z:C⊢h(z):B)(C; z:C \vdash g(z):A; z:C \vdash h(z):B) for which the dependent type ∑ z:Cg(z)= Ax\sum_{z:C} g(z) =_A x is a contractible type for all x:Ax:A
- a multivalued partial function (x:A⊢P(x);x:A,p:P(x)⊢f(x,p):B)(x:A \vdash P(x); x:A, p:P(x) \vdash f(x, p):B) for which the dependent type P(x)P(x) is a contractible type for all x:Ax:A
- a correspondence x:A,y:B⊢R(x,y)x:A, y:B \vdash R(x, y) for which the dependent type ∑ y:BR(x,y)\sum_{y:B} R(x, y) is a contractible type for all x:Ax:A.
- a family of types y:B⊢A′(y)y:B \vdash A'(y)
- an element of the function type f:A→Bf:A \to B, in dependent type theories with function types.
The first four definitions are interdefinable with each other in dependent type theories with identity types and dependent sum types:
-
From every family of elements x:A⊢f(x):Bx:A \vdash f(x):B, one could define a span by defining the type CC to be a copy of AA, C≔Copy(A)C \coloneqq \mathrm{Copy}(A), the family of elements z:C⊢g(z):Az:C \vdash g(z):A to be g(z)≔π 1(α(x))g(z) \coloneqq \pi_1(\alpha(x)) since for all elements z:Cz:C, the dependent type ∑ x:Acopy(x)= Cz\sum_{x:A} \mathrm{copy}(x) =_C z is contractible and with center of contraction z:C⊢α(z):∑ x:Acopy(x)= Czz:C \vdash \alpha(z):\sum_{x:A} \mathrm{copy}(x) =_C z, and the family of elements x:C⊢h(x):Bx:C \vdash h(x):B to be h(x)≔f(g(x))h(x) \coloneqq f(g(x)). For every element x:Ax:A, the dependent type ∑ z:Cg(z)= Ax\sum_{z:C} g(z) =_A x is always a contractible type.
-
From every span (C;z:C⊢g(z):A;z:C⊢h(z):B)(C; z:C \vdash g(z):A; z:C \vdash h(z):B) for which the dependent type ∑ z:Cg(z)= Ax\sum_{z:C} g(z) =_A x is a contractible type for all x:Ax:A, one can define a family of elements x:A⊢f(x):Bx:A \vdash f(x):B as f(x)≔h(π 1(α(x)))f(x) \coloneqq h(\pi_1(\alpha(x))) for all centers of contraction x:A⊢α(x):∑ z:Cg(z)= Axx:A \vdash \alpha(x):\sum_{z:C} g(z) =_A x.
-
From every family of elements x:A⊢f(x):Bx:A \vdash f(x):B, one could define a multivalued partial function by defining x:A⊢P(x)x:A \vdash P(x) to be P(x)≔∑ y:Ax= AyP(x) \coloneqq \sum_{y:A} x =_A y and x:A,p:P(x)⊢f′(x,p):Bx:A, p:P(x) \vdash f'(x, p):B to be f′(x,p)≔f(x)f'(x, p) \coloneqq f(x). For every element x:Ax:A, the dependent type ∑ y:Ax= Ay\sum_{y:A} x =_A y is always a contractible type.
-
From every multivalued partial function (x:A⊢P(x);x:A,p:P(x)⊢f(x,p):B)(x:A \vdash P(x); x:A, p:P(x) \vdash f(x, p):B) for which the dependent type P(x)P(x) is a contractible type for all x:Ax:A, one could define a family of elements x:A⊢f′(x):Bx:A \vdash f'(x):B as f′(x)≔f(x,α(x))f'(x) \coloneqq f(x, \alpha(x)) for all centers of contraction x:A⊢α(x):P(x)x:A \vdash \alpha(x):P(x).
-
From every family of elements x:A⊢f(x):Bx:A \vdash f(x):B, one could define a correspondence by defining x:A,y:B⊢R(x,y)x:A, y:B \vdash R(x, y) to be R(x,y)≔f(x)= ByR(x, y) \coloneqq f(x) =_B y. For every element x:Ax:A, the dependent type ∑ y:Bf(x)= By\sum_{y:B} f(x) =_B y is always a contractible type.
-
From every correspondence x:A,y:B⊢R(x,y)x:A, y:B \vdash R(x, y) for which the dependent type ∑ y:BR(x,y)\sum_{y:B} R(x, y) is a contractible type for all x:Ax:A, one could define a family of elements x:A⊢f(x):Bx:A \vdash f(x):B as f(x)≔π 1(α(x))f(x) \coloneqq \pi_1(\alpha(x)) for all centers of contraction x:A⊢α(x):∑ y:BR(x,y)x:A \vdash \alpha(x):\sum_{y:B} R(x, y).
-
The second, third, and fourth definitions of a function are interdefinable via the following relations between spans, multivalued partial functions, and correspondences:
-
From every span one could get a multivalued partial function by defining the type family x:A⊢P(x)x:A \vdash P(x) as P(x)≔∑ y:Cg(y)= AxP(x) \coloneqq \sum_{y:C} g(y) =_A x and the family of elements x:A,p:P(x)⊢f(x,p):Bx:A, p:P(x) \vdash f(x, p):B as f(x,p)≔h(π 1(x))f(x, p) \coloneqq h(\pi_1(x)).
-
From every multivalued partial function one could get a span by defining the type CC as C≔∑ x:AP(x)C \coloneqq \sum_{x:A} P(x) and the family of elements x:C⊢g(x):Ax:C \vdash g(x):A as g(x)≔π 1(x)g(x) \coloneqq \pi_1(x).
-
From every multivalued partial function one could get a correspondence by defining the type family x:A,y:B⊢R(x,y)x:A, y:B \vdash R(x, y) as R(x,y)≔∑ p:P(x)f(x,p)= ByR(x, y) \coloneqq \sum_{p:P(x)} f(x, p) =_B y.
-
From every correspondence one could get a multivalued partial function by defining the type family x:A⊢P(x)x:A \vdash P(x) as P(x)≔∑ y:BR(x,y)P(x) \coloneqq \sum_{y:B} R(x, y), and the family of elements x:A,p:P(x)⊢h(x,p):Bx:A, p:P(x) \vdash h(x, p):B as h(x,p)≔π 1(p)h(x, p) \coloneqq \pi_1(p)
-
From every span one could get a correspondence by defining the type family x:A,y:B⊢R(x,y)x:A, y:B \vdash R(x, y) as R(x,y)≔∑ z:C(g(z)= Ax)×(h(z)= By)R(x, y) \coloneqq \sum_{z:C} (g(z) =_A x) \times (h(z) =_B y).
-
From every correspondence one could get a span by defining the type CC as C≔∑ x:A∑ y:BR(x,y)C \coloneqq \sum_{x:A} \sum_{y:B} R(x, y), the family of elements z:C⊢g(z):Az:C \vdash g(z):A as g(z)≔π 1(z)g(z) \coloneqq \pi_1(z), and the function z:C⊢h(z):Bz:C \vdash h(z):B as h(z)≔π 1(π 2(z))h(z) \coloneqq \pi_1(\pi_2(z))
-
The first and fifth definitions are interdefinable by the following
-
From every family of elements x:A⊢f(x):Bx:A \vdash f(x):B one could get a family of types by y:B⊢∑ x:Af(x)= Byy:B \vdash \sum_{x:A} f(x) =_B y where A′(y)≔∑ x:Af(x)= ByA'(y) \coloneqq \sum_{x:A} f(x) =_B y.
-
From every family of types y:B⊢A′(y)y:B \vdash A'(y) one could get a family of elements x:∑ y:BA′(y)⊢π 1(x):Bx:\sum_{y:B} A'(y) \vdash \pi_1(x):B where A≔∑ y:BA′(y)A \coloneqq \sum_{y:B} A'(y).
If the dependent type theory has function types, then
-
From every element of the function type f:A→Bf:A \to B, one could define a family of elements x:A⊢f′(x):Bx:A \vdash f'(x):B as f′(x)≔ev(f,x)f'(x) \coloneqq \mathrm{ev}(f, x), where f:A→B,x:A⊢ev(f,x):Bf:A \to B, x:A \vdash \mathrm{ev}(f, x):B appears in the elimination rules for function types.
-
From every family of elements x:A⊢f(x):Bx:A \vdash f(x):B, one could define an element of the function type f′:A→Bf':A \to B as f′≔x↦f(x)f' \coloneqq x \mapsto f(x), where x:A,f(x):B⊢x↦f(x):A→Bx:A, f(x):B \vdash x \mapsto f(x):A \to B appears in the introduction rules for function types.
In formal category theory
In formal category theory, sets are discrete categories, and a function is a functor between sets. The functoriality structure becomes the property that a function preserves equality:
(1)x=y⇒f(x)=f(y). x = y \Rightarrow f(x) = f(y) .
For classes
One can also speak of functions between proper classes, although the precise details may vary depending on the status of classes with respect to the formal theory.
In ZFC for example, proper classes are by design not formal objects in the theory; rather they are proxied by a formula in the language (for instance, the class VV of all sets is proxied by the formula x=xx = x; intuitively we may think of VV as consisting of all xx satisfying that formula). Then functions f:A→Bf: A \to B between classes are again classes given by suitable formulas; see for example the MathOverflow discussion what-are-maps-between-proper-classes. If (as described above for material set theory) one wants to describe a function as an ordered triple (f,A,B)(f, A, B), then this too can be accommodated if one defines ordered triples/pairs of classes appropriately; see here for one possibility. Thus functors between categories whose objects and morphisms form proper classes can similarly be described in the language.
Such technical hacks can be avoided by choosing a different foundations. For example, Mac Lane in his Categories for the Working Mathematician assumes ZFC with a universe in which some sets are considered large, such as the set of small sets, so that a category like SetSet (the category of small sets) is again a formal object of the theory.
Alternative terms terminology
Useful terms, more or less synonymous with function, are assignment, assignation or more specifically assignation on objects. These do not have standard meanings but are useful to signal to readers that the domain of the ‘function’ under consideration is large, or that one is more interested in functorial extensions of this partial assignation (cf. e.g. Richard Garner, Homomorphisms of higher categories, Adv. Math. 224 (2010) 2269-2311 for many examples). In mathematical writing “assignment” is usually synonymous with function or map or “mapping”. For example one might speak of “assigning to each positive number its square root” to refer to the function (−):ℝ ≥0→ℝ\sqrt{(-)} \colon \mathbb{R}_{\geq 0} \to \mathbb{R}.
Authors may resort to verb forms such as “assigns” or “associates” or “sends” in informal writing, perhaps to avoid the bother of specifying an axiomatic framework in which a formal notion like “function” is ensconced. For example, according to Wikipedia, Jacobson defines a functor F:C→DF: C \to D between categories as a “mapping” that “associates” to each object XX in CC an object F(X)F(X) in DD, etc. No clarity would be gained by making this any more formal (which as we saw in the case of functions between classes, such as classes of objects of categories, may involve annoyingly technical hacks).
Sometimes the word “assignment” is understood more generally as relation, often when authors define a function to be something that “assigns unique values” (for instance here).
As Trees
Functions can also be viewed as rooted trees of height 2 by treating the domain as the vertices of height 2, the codomain as the vertices of height 1, and letting every height 2 vertex have its parent be the value it is sent to by the function. This is a special case of the equivalence between rooted trees and presheaves on ℕ\mathbb{N}.
Examples
Many functions that carry special names map some ring or field like the real numbers or complex numbers to itself:
-
…
Special properties these may have:
Last revised on June 23, 2024 at 16:02:16. See the history of this page for a list of all contributions to it.