Skip to content

Mathematics · Ch 1 — Sets, Relations and Functions

Functions

1.6

Functions

Motivating example. Suppose AA is the set of students who wrote a test and B={0,1,…,100}B=\{0,1,\dots,100\} is the set of possible marks; relate a student aa to a mark bb if aa scored bb. Two facts hold: (1) every student got some mark -- every a∈Aa\in A has some bb with (a,b)∈R(a,b)\in R; and (2) no student got two different marks -- if (a,b),(a,c)∈R(a,b),(a,c)\in R then b=cb=c. Relations with exactly these two properties are functions.

Definition. A relation f⊆A×Bf\subseteq A\times B is a function from AA to BB if:

  1. for every a∈Aa\in A, there is some b∈Bb\in B with (a,b)∈f(a,b)\in f (every domain element has an image), and
  2. if (a,b)∈f(a,b)\in f and (a,c)∈f(a,c)\in f then b=cb=c (that image is unique). AA is the domain, BB the co-domain. If (a,b)∈f(a,b)\in f, write f(a)=bf(a)=b: bb is the image of aa, aa is a pre-image of bb (the article changes: an element has exactly one image but can have several pre-images), and f(a)f(a) is "the value of ff at aa". The range is {b:(a,b)∈f for some a}⊆B\{b:(a,b)\in f\text{ for some }a\}\subseteq B. If B⊆RB\subseteq R, ff is a real-valued function. Two functions f,gf,g are equal if they share the same domain and f(a)=g(a)f(a)=g(a) for every aa in it. We write f:A→Bf:A\to B ("ff is from AA to BB", or "ff maps AA into BB"). There is no requirement that every co-domain element have a pre-image (that property is studied separately, as "onto"), and there is no restriction on how many pre-images a co-domain element may have (that is what makes "one-to-one" a separate, extra property) -- both of these follow from asymmetry already built into the definition: only the domain side is required to be fully and uniquely covered. Every function is a relation, but not every relation is a function. f={(a,1),(b,2),(c,2),(d,4)}f=\{(a,1),(b,2),(c,2),(d,4)\} is a function from {a,b,c,d}\{a,b,c,d\} to {1,2,4}\{1,2,4\}; it is not a function from {a,b,c,d,e}\{a,b,c,d,e\} to {1,2,3,4}\{1,2,3,4\} (element ee has no image), and not a function into {1,2,3,5}\{1,2,3,5\} either (the image 44 of dd is not in that co-domain) -- so both domain and co-domain must always be stated explicitly. …