If $f$ a is a function and $A$ is a set, what could the notation


mean? Is it perhaps "restricted to set $A$"?

  • 6
    $\begingroup$ Yes, if $f$ is a function with domain $D$, then for a set $A \subseteq D$, $f|_A$ is used for the restriction of $f$ to $A$. $\endgroup$
    – StackTD
    Feb 2, 2016 at 15:43
  • 1
    $\begingroup$ That's what I would assume. You might have two functions $f$ and $g$ for which $f \neq g$ but $f|_A = g|_A$ for some $A$. $\endgroup$
    – Théophile
    Feb 2, 2016 at 15:43

4 Answers 4


It means that I am constricting the domain of the function $f$. If $f:X\to Y$, then $g=f|_A$ means that $g:A\to Y$ where $A\subseteq X$.


Intuitively speaking, a function $f$ is constituted of three ingredients:

  • a domain;
  • a codomain;
  • a rule (that, for each element in the domain, assigns a unique element in the codomain).

If we change any of these three ingredients, we obtain a different function. In particular, if we change the domain by a subset $A$ of the original domain (keeping the codomain and the rule), we get a new function which is represented by $f|_A$.

In other words: given a function $f:X\to Y$ and a set $A\subset X$, the notation $f|_A$ denotes the function $g:A\to Y$ given by $$g(x)=f(x),\quad \forall \ x\in A.$$

This is the usual meaning but, maybe, there are different meanings in other contexts.


That's correct.

Suppose we have a function $$f : Y \leftarrow X,$$ and a subset $A$ of $X$.

Approach 0. Then $f \restriction_A$ is defined as the unique function $Y \leftarrow A$ that agrees with $f$ on $A$. That is: $$\mathop{\forall}_{a \in A} ((f \restriction_A)(a) = f(a))$$

However, there's a cleaner way of formalizing this.

Approach 1. Write $$\mathrm{incl}_A : X \leftarrow A$$ for the inclusion of $A$ into $X$. Then we can form the composite $$f \circ \mathrm{incl}_A : Y \leftarrow A.$$ Write $f\restriction_A$ as a shorthand for this composite.

The nice thing about Approach 1 is that it makes proving the basic properties of the restriction operator trivial. In particular:

Claim. $(g \circ f)\restriction_A = g \circ (f \restriction_A)$


$$(g \circ f)\restriction_A = (g \circ f) \circ \mathrm{incl}_A = g \circ (f \circ \mathrm{incl}_A) = g \circ (f \restriction_A)$$

Approach 1 is especially appealing from a category-theory perspective. In that context:

  • $X$ is an object of some category
  • a subobject of $X$ is by definition an object $\underline{A}$ together with a monomorphism $\mathrm{incl}_A : X \leftarrow \underline{A}$.
  • a partial morphism $Y \leftarrow X$ consists of a subobject $A$ of $X$ together with a morphism $Y \leftarrow \underline{A}$.

Hence, if we're given a morphism $f : Y \leftarrow X$ and a subobject $A$ of $X$, then we get a partial morphism $f \restriction_A : Y \leftarrow X$ by forming the obvious composite.


The notation $f|_A$ is probably best understood via a meaningful example. Before giving one (I hope it will be useful, anyway), it would probably be good to consult two decent references:

1) The Wikipedia page on the restriction of a function.

2) Abstract Algebra by Dummit and Foote (p. 3, 3rd Ed.).

The relevant portion from the Wiki blurb:

Let $f\colon E\to F$ be a function from a set $E$ to a set $F$, so that the domain of $f$ is in $E$ (i.e., $\operatorname{dom}f\subseteq E$). If $A\subseteq E$, then the restriction of $f$ to $A$ is the function $f|_A\colon A\to F$.

Informally, the restriction of $f$ to $A$ is the same function as $f$, but is only defined on $A\cap\operatorname{dom} f$.

Wiki's "informal" remark is the key part in my opinion. The following excerpt from Dummit and Foote's Abstract Algebra may be slightly more abstract, but I think a meaningful example will clear everything up.

If $A\subseteq B$, and $f\colon B\to C$, we denote the restriction of $f$ to $A$ by $f|_A$. When the domain we are considering is understood we shall occasionally denote $f|_A$ again simply as $f$ even though these are formally different functions (their domains are different).

If $A\subseteq B$ and $g\colon A\to C$ and there is a function $f\colon B\to C$ such that $f|_A=g$, we shall say $f$ is an extension of $g$ to $B$ (such a map $f$ need not exist nor be unique).

Example: Let $g\colon\mathbb{Z}^+\to\{1\}$ be defined by $g(x)=1$ and let $f\colon\mathbb{Z}\setminus\{0\}\to\{1\}$ be defined by $f(x)=\dfrac{|x|}{x}$. Using the notation from the second paragraph above, we have $g\colon A\to C$ and $f\colon B\to C$, where

  • $A = \mathbb{Z^+}$
  • $B=\mathbb{Z}\setminus\{0\}$
  • $C=\{1\}$

and, clearly, $A\subseteq B$. Thus, we have the following: \begin{align} f|_A &\equiv f\colon\mathbb{Z^+}\to\{1\}\tag{by definition}\\[0.5em] &= \frac{|x|}{x}\tag{by definition}\\[0.5em] &= \frac{x}{x}\tag{if $x\in\mathbb{Z^+}$, then $|x|=x$ }\\[0.5em] &= 1\tag{simplify}\\[0.5em] &\equiv g\colon\mathbb{Z^+}\to\{1\}\tag{by definition}\\[0.5em] &= g. \end{align} Apart from some slight notational abuse, perhaps, the above example shows that $f$ is an extension of $g$ to $B$ since $f|_A=g$.


Not the answer you're looking for? Browse other questions tagged or ask your own question.