In mathematics, the restriction of a function f is a new function, denoted f\vert_A or f {\restriction_A}, obtained by choosing a smaller domain A for the original function f.
The function f is then said to extend f\vert_A.
Formal definition
Let f : E \to F be a function from a set E to a set F. If a set A is a subset of E, then the restriction of f to A is the function[1]
{f|}_A : A \to F
given by {f|}_A(x) = f(x) for x \in A. Informally, the restriction of f to A is the same function as f, but is only defined on A.
If the function f is thought of as a relation (x,f(x)) on the Cartesian product E \times F, then the restriction of f to A can be represented by its graph,
G({f|}_A) = \{ (x,f(x))\in G(f) : x\in A \} = G(f)\cap (A\times F),
where the pairs (x,f(x)) represent ordered pairs in the graph G.
Extensions
A function F is said to be an ' of another function f if whenever x is in the domain of f then x is also in the domain of F and f(x) = F(x).
That is, if \operatorname{domain} f \subseteq \operatorname{domain} F and F\big\vert_{\operatorname{domain} f} = f.
A Linear extension of a function (respectively, Continuous extension, etc.) of a function f is an extension of f that is also a linear map (respectively, a continuous map, etc.).
Examples
- The restriction of the non-injective function
f: \mathbb{R} \to \mathbb{R}, \ x \mapsto x^2to the domain\mathbb{R}_{+} = [0,\infty)is the injectionf:\mathbb{R}_+ \to \mathbb{R}, \ x \mapsto x^2. - The factorial function is the restriction of the gamma function to the positive integers, with the argument shifted by one:
{\Gamma|}_{\mathbb{Z}^+}\!(n) = (n-1)!
Properties of restrictions
- Restricting a function
f:X\rightarrow Yto its entire domainXgives back the original function, that is,f|_X = f. - Restricting a function twice is the same as restricting it once, that is, if
A \subseteq B \subseteq \operatorname{dom} f,then\left(f|_B\right)|_A = f|_A. - The restriction of the identity function on a set
Xto a subsetAofXis just the inclusion map fromAintoX.[2] - The restriction of a continuous function is continuous.[3][4]
Applications
Inverse functions
For a function to have an inverse, it must be one-to-one. If a function f is not one-to-one, it may be possible to define a partial inverse of f by restricting the domain. For example, the function
f(x) = x^2
defined on the whole of \R is not one-to-one since x^2 = (-x)^2 for any x \in \R. However, the function becomes one-to-one if we restrict to the domain \R_{\geq 0} = [0, \infty), in which case
f^{-1}(y) = \sqrt{y} .
(If we instead restrict to the domain (-\infty, 0], then the inverse is the negative of the square root of y.) Alternatively, there is no need to restrict the domain if we allow the inverse to be a multivalued function.
Selection operators
In relational algebra, a selection (sometimes called a restriction to avoid confusion with SQL's use of SELECT) is a unary operation written as
\sigma_{a \theta b}(R) or \sigma_{a \theta v}(R) where:
aandbare attribute names,\thetais a binary operation in the set\{<, \leq, =, \neq, \geq, >\},vis a value constant,Ris a relation.
The selection \sigma_{a \theta b}(R) selects all those tuples in R for which \theta holds between the a and the b attribute.
The selection \sigma_{a \theta v}(R) selects all those tuples in R for which \theta holds between the a attribute and the value v.
Thus, the selection operator restricts to a subset of the entire database.
The pasting lemma
The pasting lemma is a result in topology that relates the continuity of a function with the continuity of its restrictions to subsets.
Let X,Y be two closed subsets (or two open subsets) of a topological space A such that A = X \cup Y, and let B also be a topological space. If f: A \to B is continuous when restricted to both X and Y, then f 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
Sheaves provide a way of generalizing restrictions to objects besides functions.
In sheaf theory, one assigns an object F(U) in a category to each open set U of a topological space, and requires that the objects satisfy certain conditions. The most important condition is that there are restriction morphisms between every pair of objects associated to nested open sets; that is, if V\subseteq U, then there is a morphism \operatorname{res}_{V,U} : F(U) \to F(V) satisfying the following properties, which are designed to mimic the restriction of a function:
- For every open set
UofX,the restriction morphism\operatorname{res}_{U,U} : F(U) \to F(U)is the identity morphism onF(U). - If we have three open sets
W \subseteq V \subseteq U,then the composite\operatorname{res}_{W,V} \circ \operatorname{res}_{V,U} = \operatorname{res}_{W,U}. - (Locality) If
\left(U_i\right)is an open covering of an open setU,and ifs, t \in F(U)are such thats\big\vert_{U_i} = t\big\vert_{U_i}for each setU_iof the covering, thens = t; and - (Gluing) If
\left(U_i\right)is an open covering of an open setU,and if for eachia sectionx_i \in F\left(U_i\right)is given such that for each pairU_i, U_jof the covering sets the restrictions ofs_iands_jagree on the overlaps:s_i\big\vert_{U_i \cap U_j} = s_j\big\vert_{U_i \cap U_j},then there is a sections \in F(U)such thats\big\vert_{U_i} = s_ifor eachi.
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) A \triangleleft R of a binary relation R between E and F may be defined as a relation having domain A, codomain F and graph G(A \triangleleft R) = \{(x, y) \in F(R) : x \in A\}. Similarly, one can define a right-restriction or range restriction R \triangleright B. Indeed, one could define a restriction to n-ary relations, as well as to subsets understood as relations, such as ones of the Cartesian product E \times F for binary relations.
These cases do not fit into the scheme of sheaves.[clarification needed]
Anti-restriction
The domain anti-restriction (or domain subtraction) of a function or binary relation R (with domain E and codomain F) by a set A may be defined as (E \setminus A) \triangleleft R; it removes all elements of A from the domain E. It is sometimes denoted A ⩤ R.[5] Similarly, the range anti-restriction (or range subtraction) of a function or binary relation R by a set B is defined as R \triangleright (F \setminus B); it removes all elements of B from the codomain F. It is sometimes denoted R ⩥ B.
See also
- Function (mathematics) § Restriction and extension
- Binary relation § Restriction
- Relational algebra § Selection (σ)
References
- ^ Stoll, Robert (1974). Sets, Logic and Axiomatic Theories. 2nd ed. San Francisco: W. H. Freeman and Company. pp. [36]. ISBN 0-7167-0457-9.
- ^ Halmos, Paul (1960). Naive Set Theory. Princeton, NJ: D. Van Nostrand. 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).
- ^ Munkres, James R. (2000). Topology. 2nd ed. Upper Saddle River: Prentice Hall. ISBN 0-13-181629-2.
- ^ Adams, Colin Conrad & Franzosa, Robert David (2008). Introduction to Topology: Pure and Applied. Pearson Prentice Hall. ISBN 978-0-13-184869-6.
- ^ 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)