nLab prefunction

Contents

Context

Foundations

foundations

The basis of it all

 Set theory

set theory

Foundational axioms

foundational axioms

Removing axioms

Category theory

(,1)(\infty,1)-Category theory

(,1)(\infty,1)-Topos Theory

(∞,1)-topos theory

structures in a cohesive (∞,1)-topos

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 =
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

Contents

Idea

In certain foundations of mathematics, the “functions” between sets or types or presets do not preserve the equality in the set/type/preset. Many times, the functions that do not preserve equality are called “prefunctions”, and a function is then defined to be a prefunction that satisfies function extensionality.

Definition

In set theory

Suppose that XX and YY are sets, a prefunction from XX to YY is a mapping that does not preserve equality: it is not true that a=ba = b always implies f(a)=f(b)f(a) = f(b). A function is defined as a prefunction that preserves equality; such a prefunction is said to be extensional.

For example, consider the identity prefunction on the set of pairs of positive numbers, Z +×Z +Z^+ \times Z^+ and the set of positive fractions Q +Q^+. From Z +×Z +Z^+ \times Z^+ to Q +Q^+, this is a function, since a/b=c/da/b = c/d if (a,b)=(c,d)(a,b) = (c,d). But from Q +Q^+ to Z +×Z +Z^+ \times Z^+, it is not a function, since (for example) 2/4=3/62/4 = 3/6 but (2,4)(3,6)(2,4) \neq (3,6). A related example is the operation of taking the numerator of a (positive) fraction; from Q +Q^+ to Z +Z^+, we may view this as a prefunction but not as a function, although it is a function on Z +×Z +Z^+ \times Z^+.

Given sets XX and YY, the function set from XX to YY is a subset of this set of prefunctions between XX and YY. Composition of prefunctions is also possible, but likewise does not preserve equality.

In type theory

In many foundations based on type theory, such as in Martin-Löf type theory, all types come equipped with an identity type which behaves similarly as equality does in sets. These types, therefore, are not presets in the strict sense, in that the latter do not carry any equality at all. The functions between such sets are also not prefunctions because function application on identifications implies that functions preserve identifications.

However, there is a way to formalize presets and prefunctions in dependent type theory even with identity types: by instead defining propositional equality as the predicate that the identity type is contractible

x=yisContr(Id A(x,y))x = y \coloneqq \mathrm{isContr}(\mathrm{Id}_A(x, y))

Expanding out the definition of a contractible type, a witness of propositional equality consists of an identification and a contraction showing that the identification is the center of contraction of the identity type.

By this definition of equality, propositional equality is always a binary relation, because isContr is always a proposition in dependent type theory. In fact, if all identifications in an identity type are unique (i.e. there is a function Id A(x,y)x=y\mathrm{Id}_A(x, y) \to x = y), then the identity type is an h-proposition, and if the identity type is an h-proposition, then all identifications in the identity type are unique; hence the name propositional equality for unique identifications and the relation x=yx = y for the type isContr(Id A(x,y))\mathrm{isContr}(\mathrm{Id}_A(x, y)).

A set is then precisely a type where all identifications are unique. The uniqueness of identity proofs states that all identity types are propositions and all identifications are unique.

Propositional equality satisfies the principle of substitution by transport of the unique identification across predicates, and satisifes the identity of indiscernibles because propositional equality is always a proposition, and so we have:

x:A y:AisContr(Id A(x,y)) x:APropP(x)P(y)\prod_{x:A} \prod_{y:A} \mathrm{isContr}(\mathrm{Id}_A(x, y)) \simeq \prod_{x:A \to \mathrm{Prop}} P(x) \simeq P(y)

However, propositional equality is not an equivalence relation because it is not a reflexive relation: for any loop space type which is not a contractible type, the proposition isContr(Id A(x,x))\mathrm{isContr}(\mathrm{Id}_A(x, x)) is an empty type. The only such types with a reflexive propositional equality are thus those that satisfy axiom K: the h-sets, thus making non-set types presets.

Furthermore, every function can still be interpreted as a prefunction in the following sense: while functions do preserve identifications, they do not preserve propositional equality in the sense of the uniqueness of identifications. Any identification is given by a function out of the interval type 𝕀\mathbb{I}, and the inductively generated identification p:Id 𝕀(0,1)p:\mathrm{Id}_\mathbb{I}(0, 1) in the interval type is unique in Id 𝕀(0,1)\mathrm{Id}_\mathbb{I}(0, 1), but not all identifications are unique in the absence of uniqueness of identity proofs. One can define an extensional function as one that does preserve the uniqueness of identifications, and prove that functions between h-sets preserve the uniqueness of identifications, and that h-sets are precisely the types between which all functions preserve uniqueness of identifications. To say that all functions are extensional along the lines of the preset approach to set theory is equivalent to the uniqueness of identity proofs that implies that all types are h-sets.

Categorical semantics

The difference between functions and prefunctions in sets is modeled in category theory (categorical semantics) as the difference between a concrete category and a category with a functor U:CSetU:C \to Set which is not faithful.

See also

Last revised on June 16, 2025 at 04:10:06. See the history of this page for a list of all contributions to it.