240 likes | 340 Views
Functions (Mappings). Definitions. A function (or mapping) from a set A to a set B is a rule that assigns to each element a of A exactly one element b of B . The set A is called the domain of , and B is called the range of .
E N D
Definitions • A function (or mapping) from a set A to a set B is a rule that assigns to each element a of A exactly one element b of B. • The set A is called the domain of , and B is called the range of. • If assigns b to a, then b is called the image of a under. • The subset of B comprising all the images of elements of A is called the image of A under
Notation • A –> B means is a mapping from set A to set B. • (a) = b or : a –> b means that function maps element a to element b (i.e. the image of a is b).
domain of is R range of is R Example 1 • Let : R –> R be given by (x) = sin(x). • The image of /2 under is 1 • The image of R under is [-1,1]. (R) = [-1,1]
Example 2 • : Q –> Z given by : p/q –> p+q • (1/2) = 1 + 2 = 3 (2/4) = 2 + 4 = 6 Since 1/2 = 2/4, but (1/2) ≠ (2/4) is not a function!
To prove a rule is a function • Assume x1 = x2 • Show (x1) = (x2) • In this case we say that is well-defined.
Show is well-defined • Let :Z –> Z be given by (n) = n2 mod 2 • Suppose n1 = n2. • (n1)–(n2) = n12 mod 2 –n22 mod 2 = (n1 – n2)(n1+n2) mod 2 = 0 since (n1 – n2) = 0 • So (n1) = (n2) • Therefore, is well-defined.
f a (a) (a) C A B Composition of functions • Let : A –> B and : B –> C. The composition is the mapping from A to C defined by (a) = ((a)).
f a (a) (a) C A B Order matters! • When we compose and , we must write • Unless A = C, does not make sense.
One to one functions • A function from a set A is called one-to-one if • Note: This is the converse to the well-defined condition.
Show not one-to-one • Show :R –> R given by (x) = x2 is not one–to–one. • (–2)= 4 = (2), but –2 ≠ 2 • So is not one-to-one.
Show one-to-one • Show :[0,∞) –> R given by (x) = x2 is one–to–one. • Suppose (x1)= (x2). • Then 0 =(x1)–(x2) = x12–x22 = (x1–x2)(x1+x2) • So either (x1–x2) = 0 or (x1+x2) = 0 • If (x1–x2) = 0, then x1= x2 • If (x1+x2) = 0, then x1= x2 = 0 since the domain is [0,∞) • In either case, x1 = x2, so is one-to-one.
Onto functions • A function from a set A to a set B is said to be onto B if each element of B is the image of at least one element of A.
Show not onto • Show :[0,∞) –> R given by (x) = x2 is not onto. • Suppose –1 = (x) for some x in [0,∞). • Then -1 = x2 ≥ 0 • This counterexample shows is not onto.
Show onto • Show :[0,∞) –> [0,∞) given by (x) = x2 is onto. • Proof: Choose any number b ≥ 0. • Let a = √b. • Then (a) = (√b)2 = b. • So is onto.
Properties of functions • Given :A–>B, :B–>C, and :C–>D, then • g(ba) = (gb)a. (Associativity) • If a and b are one-to-one, then is one-to-one. • If a and b are onto, then is onto. • If a is one-to-one and onto, then there is a function a-1 from B to A such that a-1a(a)=a for all a in A and aa-1(b)=b for all b in B.
Proof of Associativity • Choose any a in A. • Let b = (a), c = b(b), and d = g(c). • Notice that ba(a) = c and gb(b) = d. • Then (gb)a(a) = gb(b) = d • Also, g(ba)(a) = g(c) = d • Since (gb)a(a) = g(ba)(a) for all a in A, (gb)a = g(ba)
Prove one-to-one • Suppose (x1) = (x2) • Set y1 = a(x1) and y2 = a(x2). Then b(y1) = b(y2) • Since b is one-to-one, y1=y2 But then a(x1) = a(x2). • Since a is one-to-one, x1 = x2. • Therefore, ba is one-to-one.
Prove onto • Choose any c in C • Since is onto, there is a b in B with (b)=c. • Since is onto, there is an a in A with (a)=b. • Then (a) = b(b) = c • Therefore, ba is onto.
Proof of inverse functions • The proof consists of three steps. • Construct the inverse function. • Show that the inverse is well-defined. • Show that the inverse function has the required cancellation properties.
1. Construction • Given :A->B is one-to-one and onto. • Choose any b in B. Since is onto, there is an a in A with (a)=b. Set -1(b) = a.
2. Well-defined • Suppose b1 = b2 in B. • Let a1 = -1(b1) and a2 = -1(b2) • Then (a1) = b1 = b2 = (a2) • Since is one-to-one, a1 = a2 That is, -1(b1) = -1(b2) • Therefore, -1 is well-defined.
3. Cancellation • Choose any a in A. • Set b = f(a) and note that -1(b) = a. • Then -1(a) = -1 (b) = a, and -1(b) = (a) = b. • Since -1 is well-defined and the cancellation laws hold, we are done.