Remark. Functions out of unions and disjoint unions [01H1]
When U,V are disjoint subsets of a set A, there is a simple way to define any function f\colon U\mathbin {\dot \cup }V\to B:
- First define a function f_U\colon U\to B;
- Then define a a function f_V\colon V\to B.
Then f\colon U\mathbin {\dot \cup }V\to B is defined to use f_U on elements in U and to use f_V on elements in V:
f{\mathopen {}\left (x\right )\mathclose {}} \coloneqq \begin {cases} f_U{\mathopen {}\left (x\right )\mathclose {}}&\textbf {when } x\in U \\ f_V{\mathopen {}\left (x\right )\mathclose {}}&\textbf {when } x\in V \end {cases}What is U and V are not disjoint? Then the definition of f\colon U\cup V\to B might not be well-defined on inputs that lie in both U and V. In the case of unions that we do not know to be disjoint, defining a function f\colon U\cup V\to B has three steps:
- First define a function f_U\colon U\to B;
- Then define a function f_V\colon V\to B;
- Finally check that the two functions agree on the intersection of U and V, i.e. that \forall x\in U\cap V\mathpunct {.} f_U{\mathopen {}\left (x\right )\mathclose {}} = f_V{\mathopen {}\left (x\right )\mathclose {}}\text {.}