[[!redirects Sandbox > history]] [[!redirects Sandbox]] < [[nlab:Sandbox]] ## Definition ### In type theory In [[intensional type theory|intensional]] ([[Martin-Löf type theory|Martin-Löf]]) [[dependent type theory]] the existence of [[identity types]] induces a notion on [[path space objects|paths]] between [[terms]] of a given type. In particular for two [[terms]] $f, g \in [X,Y]$ f g: X -> Y of _[[function type]]_, a path/[[morphism]] $f \stackrel{p}{\to} g$ p: f == g between them is to be thought of as a [[homotopy]] or [[natural transformation]] (a $1$-[[transfor]]). In particular it implies, one can prove, that there are families of paths $happly_{f,g,p}$ between all the values of the functions happly f g p: forall x: X, f x == g x . However, from general [[intensional type theory|intensional]] [[dependent type theory]] one cannot prove the converse: * the existence of paths between all pairs of values does not imply that there is a path between the functions. From a purely intensional point of view, this is to be expected --- two functions could be defined in different ways, and thus be intensionally different, yet produce the same values on all inputs (i.e. be extensionally the same). However, in many contexts one wants to treat functions extensionally, such as when regarding type theory as the [[internal language]] of some [[category]]. In particular, this is the case in [[homotopy type theory]], where one wants to interpret the type theory as the [[internal language of an (∞,1)-topos]], for instance of [[Top]] $\simeq$ [[∞Grpd]]. In such an [[internal logic]] context, a _family_ of anything must always mean "continuous family", so that a family of paths between the values of two functions is a continuous homotopy between them, and hence ought to induce a path between them in the function-space. Thus, one wants to impose the condition that from a term eta: forall x: X, f x == g x . we can deduce an actual path between $f$ and $g$. Translating this into direct [[categorical semantics|categorical terms]], the term $\eta$ gives a map $$1 \to \Pi_{X \to 1} [f x = g x]$$ into the [[dependent product]], which (as discussed there), in turn corresponds to a [[section]] $\sigma \colon X \to [f x = g x]$ of the [[display map]] on the left side of the [[pullback]] $$\array{ [f x = g x] & \to & P(Y) \\ \downarrow & & \downarrow \\ X & \underset{\langle f, g \rangle}{\to} & Y \times Y } \,, $$ where $P(Y)$ is the [[identity type]] or space of paths in $Y$. Such a section is tantamount to a lift $X \to P(Y)$ of $\langle f, g \rangle \colon X \to Y \times Y$. From this we would like to deduce an actual path $p \colon 1 \to P(Y^X)$. So, very simply, function extensionality means we are able to lift elements $h \colon 1 \to P(Y)^X$ through a canonical map $\phi \colon P(Y^X) \to P(Y)^X$ that is obtained from a [[dependent eliminator]]. Of course we are not just interested in [[global element|global elements]] here. What we really want is an actual section $P(Y)^X \to P(Y^X)$ of $\phi$ in the [[slice category|slice]] over $(Y \times Y)^X$ (although this can be derived from the global element formulation by using the [[Yoneda lemma]] together with [[currying]] and uncurrying tricks). This condition may be called "naive" or "weak" function extensionality, in view of an apparently stronger condition that this section (and therefore also $\phi$) be _equivalences_. This latter condition might be called "strong function extensionality". Under reasonable assumptions on the type theory, it turns out that these and other versions of function extensionality are equivalent; for now see ([Lumsdaine](#Lumsdaine)) below. In any case, if the type theory has an extra [[axiom]] that implies some such version, one says that **function extensionality** holds. ### In category theory Function extensionality in category theory is true in any [[concrete category]] $\mathcal{C}$. The axiom could be called "morphism extensionality"; however, in all concrete categories, the morphisms are functions between sets. category: redirected to nlab