For a function to have an inverse, it must be one-to-one. If a function is not one-to-one, it may be possible to define a partial inverse of by restricting the domain. For example, the function
defined on the whole of is not one-to-one since for any However, the function becomes one-to-one if we restrict to the domain in which case
(If we instead restrict to the domain then the inverse is the negative of the square root of ) Alternatively, there is no need to restrict the domain if we allow the inverse to be a multivalued function.
Sheaves provide a way of generalizing restrictions to objects besides functions.
In sheaf theory, one assigns an object in a category to each open set 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 then there is a morphism satisfying the following properties, which are designed to mimic the restriction of a function:
For every open set of the restriction morphism is the identity morphism on
(Locality) If is an open covering of an open set and if are such that s|Ui = t|Ui for each set of the covering, then ; and
(Gluing) If is an open covering of an open set and if for each a section is given such that for each pair of the covering sets the restrictions of and agree on the overlaps: then there is a section such that for each
The collection of all such objects is called a sheaf. If only the first two properties are satisfied, it is a pre-sheaf.
More generally, the restriction (or domain restriction or left-restriction) of a binary relation between and may be defined as a relation having domain codomain and graph Similarly, one can define a right-restriction or range restriction Indeed, one could define a restriction to -ary relations, as well as to subsets understood as relations, such as ones of the Cartesian product for binary relations.
These cases do not fit into the scheme of sheaves.[clarification needed]
The domain anti-restriction (or domain subtraction) of a function or binary relation (with domain and codomain ) by a set may be defined as ; it removes all elements of from the domain It is sometimes denoted ⩤  Similarly, the range anti-restriction (or range subtraction) of a function or binary relation by a set is defined as ; it removes all elements of from the codomain It is sometimes denoted ⩥
^Munkres, James R. (2000). Topology (2nd ed.). Upper Saddle River: Prentice Hall. ISBN0-13-181629-2.
^Adams, Colin Conrad; Franzosa, Robert David (2008). Introduction to Topology: Pure and Applied. Pearson Prentice Hall. ISBN978-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)