nLab function

Context

Set theory

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism = \linebreak propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
propositional equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Category theory

Contents

Idea

A function f:STf \colon S \to T from a set SS (the domain) to a set TT (the codomain) is a prescription which takes any element sSs \in S to a unique element f(s)Tf(s) \in T. One also says that:

and the process of assigning f(s)f(s) to ss is also called function application.

For emphasis one sometimes speaks of total functions to distinguish from partial functions which need not be defined for all elements ss of their domain set SS.

Famous and historically important examples of functions map specifically between sets of numbers (such as the trigonometric functions, zeta functions, etc.). This specialization of the term goes so far that the term function theory is generally understood to refer specifically to analysis over the real or complex numbers (cf. complex analysis).

Instead of “functions” one also speaks of maps or mappings, but these terms are often understood to refer to functions which respect extra structure, hence which are homomorphisms (for instance continuous maps are functions that respect topological structure). See also further alternative terminology below.

Hence one may say that functions are homomorphisms of plain sets. Indeed, functions are the morphisms 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 STS \to T such that the judgement f:STf \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

\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:Ac(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

The first four definitions are interdefinable with each other in dependent type theories with identity types and dependent sum types:

The first and fifth definitions are interdefinable by the following

If the dependent type theory has function types, then

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=yf(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:ABf: 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 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:CDF: 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).

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: