Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example $f:\mathbb{R}\to\mathbb{R}$ is a function. How to simply express a correspondent function $g:\mathbb{Q}\to\mathbb{R}$ such that $g(x)=f(x)$, $\forall x\in\mathbb{Q}$?

share|cite|improve this question
up vote 2 down vote accepted

Other notations could also be

$$g=f\mid \mathbb Q$$ and $$g=f\mid_{\mathbb Q}$$

In general if we restrict a function $f$ to a set $A$ we may write

$$f\mid A\text{ or } f\mid_A$$

(apart from Asaf's notation)

In reply to the comment: It is called an extension of $f$. "Let $f\colon X \to Y$ be a function and $A$ and $B$ be sets such that $X\subseteq A$ and $Y\subseteq B$. An extension of $f$ to $A$ is a function $g\colon A \to B$ such that $f(x)=g(x)$ for all $x\in X $. Alternatively, $g$ is an extension of $f$ to $A$ if $f$ is the restriction of $g$ to $X$". The TeX was missing so I pasted here

share|cite|improve this answer
What is it called when I go the other way around? “Expansion”? – Voldemort Oct 6 '12 at 23:45
See above. ${}$ – Pedro Tamaroff Oct 6 '12 at 23:55

This is known as the restriction of $f$ to $\mathbb Q$. The common notation is: $$f\upharpoonright_{\mathbb Q}\colon\mathbb Q\to\mathbb R$$

share|cite|improve this answer
Or my preferred version, $f\upharpoonright\Bbb Q$. – Brian M. Scott Oct 7 '12 at 9:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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