# Restriction (mathematics)

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Restriction_(mathematics)
> Markdown URL: https://mediated.wiki/source/Restriction_(mathematics).md
> Source: https://en.wikipedia.org/wiki/Restriction_(mathematics)
> Source revision: 1350542559
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Function with a smaller domain}}
{{Other uses|Restriction (disambiguation)}}
[[File:Inverse square graph.svg|thumb|The function <math>x^2</math> with domain <math>\mathbb{R}</math> does not have an [inverse function](/source/inverse_function). If we restrict <math>x^2</math> to the non-negative [real number](/source/real_number)s, then it does have an inverse function, known as the [square root](/source/square_root) of <math>x.</math>]]
{{Functions}}

In [mathematics](/source/mathematics), the '''restriction''' of a [function](/source/Function_(mathematics)) <math>f</math> is a new function, denoted <math>f\vert_A</math> or <math>f {\restriction_A},</math> obtained by choosing a smaller [domain](/source/Domain_of_a_function) <math>A</math> for the original function <math>f.</math> 
The function <math>f</math> is then said to '''extend''' <math>f\vert_A.</math>

==Formal definition==

Let <math>f : E \to F</math> be a function from a [set](/source/Set_(mathematics)) <math>E</math> to a set <math>F.</math> If a set <math>A</math> is a [subset](/source/subset) of <math>E,</math> then the '''restriction of '''<math>f</math> '''to '''<math>A</math>  is the function<ref name="Stoll">
{{Cite book|last=Stoll|first=Robert|title=Sets, Logic and Axiomatic Theories|publisher=W. H. Freeman and Company|date=1974|location=San Francisco|pages=[36]|edition=2nd|isbn=0-7167-0457-9|url=https://archive.org/details/setslogicaxiomat0000stol/page/5}}</ref>
<math display=block>{f|}_A : A \to F</math>
given by <math>{f|}_A(x) = f(x)</math> for <math>x \in A.</math> Informally, the restriction of <math>f</math> to <math>A</math> is the same function as <math>f,</math> but is only defined on <math>A</math>.

If the function <math>f</math> is thought of as a [relation](/source/Relation_(mathematics)) <math>(x,f(x))</math> on the [Cartesian product](/source/Cartesian_product) <math>E \times F,</math> then the restriction of <math>f</math> to <math>A</math> can be represented by its [graph](/source/Graph_of_a_function),
:<math>G({f|}_A) = \{ (x,f(x))\in G(f) : x\in A \} = G(f)\cap (A\times F),</math>
where the pairs <math>(x,f(x))</math> represent [ordered pair](/source/ordered_pair)s in the graph <math>G.</math>

===Extensions===

A function <math>F</math> is said to be an ''{{visible anchor|Extension of a function|text=extension}}'' of another function <math>f</math> if whenever <math>x</math> is in the domain of <math>f</math> then <math>x</math> is also in the domain of <math>F</math> and <math>f(x) = F(x).</math> 
That is, if <math>\operatorname{domain} f \subseteq \operatorname{domain} F</math> and <math>F\big\vert_{\operatorname{domain} f} = f.</math>

A ''[{{visible anchor|linear extension}}](/source/Linear_extension_of_a_function)'' (respectively, ''[{{visible anchor|continuous extension}}](/source/Continuous_extension)'', etc.) of a function <math>f</math> is an extension of <math>f</math> that is also a [linear map](/source/linear_map) (respectively, a [continuous map](/source/Continuous_function), etc.).

==Examples==

# The restriction of the [non-injective](/source/injective_function) function<math>f: \mathbb{R} \to \mathbb{R}, \ x \mapsto x^2</math> to the domain <math>\mathbb{R}_{+} = [0,\infty)</math> is the injection<math>f:\mathbb{R}_+ \to \mathbb{R}, \ x \mapsto x^2.</math>
# The [factorial](/source/factorial) function is the restriction of the [gamma function](/source/gamma_function) to the positive integers, with the argument shifted by one: <math>{\Gamma|}_{\mathbb{Z}^+}\!(n) = (n-1)!</math>

==Properties of restrictions==

* Restricting a function <math>f:X\rightarrow Y</math> to its entire domain <math>X</math> gives back the original function, that is, <math>f|_X = f.</math>
* Restricting a function twice is the same as restricting it once, that is, if <math>A \subseteq B \subseteq \operatorname{dom} f,</math> then <math>\left(f|_B\right)|_A = f|_A.</math>
* The restriction of the [identity function](/source/identity_function) on a set <math>X</math> to a subset <math>A</math> of <math>X</math> is just the [inclusion map](/source/inclusion_map) from <math>A</math> into <math>X.</math><ref>{{cite book|author-link=Paul Halmos|last=Halmos|first=Paul|title=[Naive Set Theory](/source/Naive_Set_Theory_(book))|location=Princeton, NJ|publisher=D. Van Nostrand|year=1960}} Reprinted by Springer-Verlag, New York, 1974. {{isbn|0-387-90092-6}} (Springer-Verlag edition). Reprinted by Martino Fine Books, 2011. {{isbn|978-1-61427-131-4}} (Paperback edition).</ref>
* The restriction of a [continuous function](/source/continuous_function) is continuous.<ref>{{cite book|last=Munkres|first=James R.|author-link=James Munkres|title=Topology|edition=2nd|location=Upper Saddle River|publisher=Prentice Hall|year=2000|isbn=0-13-181629-2}}</ref><ref>{{cite book|last=Adams|first=Colin Conrad|first2=Robert David|last2=Franzosa|title=Introduction to Topology: Pure and Applied|publisher=Pearson Prentice Hall|year=2008|isbn=978-0-13-184869-6}}</ref>

==Applications==
===Inverse functions===

{{main|Inverse function}}
For a function to have an inverse, it must be [one-to-one](/source/Injective_function). If a function <math>f</math> is not one-to-one, it may be possible to define a '''partial inverse''' of <math>f</math> by restricting the domain.  For example, the function
<math display=block>f(x) = x^2</math>
defined on the whole of <math>\R</math> is not one-to-one since <math>x^2 = (-x)^2</math> for any <math>x \in \R.</math>  However, the function becomes one-to-one if we restrict to the domain <math>\R_{\geq 0} = [0, \infty),</math> in which case
<math display=block>f^{-1}(y) = \sqrt{y} .</math>

(If we instead restrict to the domain <math>(-\infty, 0],</math> then the inverse is the negative of the square root of <math>y.</math>)  Alternatively, there is no need to restrict the domain if we allow the inverse to be a [multivalued function](/source/multivalued_function).

===Selection operators===
{{main|Selection (relational algebra)}}

In [relational algebra](/source/relational_algebra), a [selection](/source/Selection_(relational_algebra)) (sometimes called a restriction to avoid confusion with [SQL](/source/SQL)'s use of SELECT) is a [unary operation](/source/unary_operation) written as
<math>\sigma_{a \theta b}(R)</math> or <math>\sigma_{a \theta v}(R)</math> where:
* <math>a</math> and <math>b</math> are attribute names,
* <math>\theta</math> is a [binary operation](/source/binary_operation) in the set <math>\{<, \leq, =, \neq, \geq, >\},</math>
* <math>v</math> is a value constant,
* <math>R</math> is a [relation](/source/Relation_(database)).

The selection <math>\sigma_{a \theta b}(R)</math> selects all those [tuple](/source/tuple)s in <math>R</math> for which <math>\theta</math> holds between the <math>a</math> and the <math>b</math> attribute.

The selection <math>\sigma_{a \theta v}(R)</math> selects all those tuples in <math>R</math> for which <math>\theta</math> holds between the <math>a</math> attribute and the value <math>v.</math>

Thus, the selection operator restricts to a subset of the entire database.

===The pasting lemma===
{{main|Pasting lemma}}

The pasting lemma is a result in [topology](/source/topology) that relates the continuity of a function with the continuity of its restrictions to subsets.

Let <math>X,Y</math> be two closed subsets (or two open subsets) of a topological space <math>A</math> such that <math>A = X \cup Y,</math> and let <math>B</math> also be a topological space. If <math>f: A \to B</math> is continuous when restricted to both <math>X</math> and <math>Y,</math> then <math>f</math> is continuous.

This result allows one to take two continuous functions defined on closed (or open) subsets of a topological space and create a new one.

===Sheaves===
{{main|Sheaf theory}}

[Sheaves](/source/Sheaf_theory) provide a way of generalizing restrictions to objects besides functions.

In [sheaf theory](/source/sheaf_theory), one assigns an object <math>F(U)</math> in a [category](/source/Category_(category_theory)) to each [open set](/source/open_set) <math>U</math> of a [topological space](/source/topological_space), and requires that the objects satisfy certain conditions. The most important condition is that there are ''restriction [morphism](/source/morphism)s'' between every pair of objects associated to nested open sets; that is, if <math>V\subseteq U,</math> then there is a morphism <math>\operatorname{res}_{V,U} : F(U) \to F(V)</math> satisfying the following properties, which are designed to mimic the restriction of a function:
* For every open set <math>U</math> of <math>X,</math> the restriction morphism <math>\operatorname{res}_{U,U} : F(U) \to F(U)</math> is the identity morphism on <math>F(U).</math>
* If we have three open sets <math>W \subseteq V \subseteq U,</math> then the [composite](/source/Function_composition) <math>\operatorname{res}_{W,V} \circ \operatorname{res}_{V,U} = \operatorname{res}_{W,U}.</math>
* (Locality) If <math>\left(U_i\right)</math> is an open  [covering](/source/Cover_(topology)) of an open set <math>U,</math> and if <math>s, t \in F(U)</math> are such that <math>s\big\vert_{U_i} = t\big\vert_{U_i}</math> for each set <math>U_i</math> of the covering, then <math>s = t</math>; and
* (Gluing) If <math>\left(U_i\right)</math> is an open covering of an open set <math>U,</math> and if for each <math>i</math> a section <math>x_i \in F\left(U_i\right)</math> is given such that for each pair <math>U_i, U_j</math> of the covering sets the restrictions of <math>s_i</math> and <math>s_j</math> agree on the overlaps: <math>s_i\big\vert_{U_i \cap U_j} = s_j\big\vert_{U_i \cap U_j},</math> then there is a section <math>s \in F(U)</math> such that <math>s\big\vert_{U_i} = s_i</math> for each <math>i.</math>

The collection of all such objects is called a '''sheaf'''. If only the first two properties are satisfied, it is a '''pre-sheaf'''.

==Left- and right-restriction==

More generally, the restriction (or '''domain restriction''' or  '''left-restriction''') <math>A \triangleleft R</math> of a [binary relation](/source/binary_relation) <math>R</math> between <math>E</math> and <math>F</math> may be defined as a relation having domain <math>A,</math> codomain <math>F</math> and graph <math>G(A \triangleleft R) = \{(x, y) \in F(R) : x \in A\}.</math>  Similarly, one can define a '''right-restriction''' or '''range restriction''' <math>R \triangleright B.</math> Indeed, one could define a restriction to [<math>n</math>-ary](/source/arity) relations, as well as to [subset](/source/subset)s understood as relations, such as ones of the [Cartesian product](/source/Cartesian_product) <math>E \times F</math> for binary relations.
These cases do not fit into the scheme of [sheaves](/source/Sheaf_(mathematics)).{{clarify|date=July 2013}}

==Anti-restriction==

The '''domain anti-restriction''' (or '''domain subtraction''') of a function or binary relation <math>R</math> (with domain <math>E</math>  and codomain <math>F</math>) by a set <math>A</math> may be defined as <math>(E \setminus A) \triangleleft R</math>; it removes all elements of <math>A</math> from the domain <math>E.</math>  It is sometimes denoted <math>A</math>&nbsp;⩤&nbsp;<math>R.</math><ref>Dunne, S. and Stoddart, Bill ''Unifying Theories of Programming: First International Symposium, UTP 2006, Walworth Castle, County Durham, UK, February 5–7, 2006, Revised Selected ... Computer Science and General Issues)''. Springer (2006)</ref>  Similarly, the '''range anti-restriction''' (or '''range subtraction''') of a function or binary relation <math>R</math> by a set <math>B</math> is defined as <math>R \triangleright (F \setminus B)</math>; it removes all elements of <math>B</math> from the codomain <math>F.</math> It is sometimes denoted <math>R</math>&nbsp;⩥&nbsp;<math>B.</math>

==See also==

* {{annotated link|Constraint (mathematics)|Constraint}}
* {{annotated link|Deformation retract}}
* {{annotated link|Local property}}
* {{section link|Function (mathematics)|Restriction and extension}}
* {{section link|Binary relation|Restriction}}
* {{section link|Relational algebra|Selection (σ)}}

==References==

{{reflist}}

{{DEFAULTSORT:Restriction (Mathematics)}}

Category:Sheaf theory

---
Adapted from the Wikipedia article [Restriction (mathematics)](https://en.wikipedia.org/wiki/Restriction_(mathematics)) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Restriction_(mathematics)?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
