24 - Functions

!Screenshot 2023-11-06 at 12.27.16 PM.png
!Screenshot 2023-11-06 at 12.28.15 PM.png

In class Practice

f:A⟹B is a function if

  1. f⊆A×B
  2. ∀a∈A,a is the first coordinate of exactly one ordered pair in f thought of as a subset of A×B.

Not well-defined means it's not a function.



HW 24

Ben Finch

E 24.1
a) Yes, it is a function
b) No, it's not a function since (4,6)∉A×B.
c) Not a function, doesn't have (3,b)
d) Not a function, 1 is assigned to two items in B
e) Not a function, doesn't have (3,b)
f) Yes, it is a function.

E 24.2
a) R
b) R−{π2+kπ:k∈Z}
c) {x∈R:x>0}
d) {n∈R:n≤1}
e) R−{−2}

E 24.3
Let A be a finite set and let B be any set. Let f:A→B be a function. Considering f as a set of ordered pairs, prove that |f|=|A|.

Proof. Let A be a finite set and let B be any set. Let f:A→B be a function. By definition 24.1, each a∈A must be the first coordinate of exactly one element in f. Also, f cannot have some element (m,n) where m∉A. Thus if each a∈A is the first element of one element in f, we know that |A|=|f|. ◻

E 24.4
a) The function is well defined
Proof.
Let X∈Z8. Let a,b∈X. Then a≡bmod8. Then a−b=8k for some k∈Z. Now f(a―)=[a]. Thus a−b=2(4k). Thus a≡bmod4. So [a]=[b]. Thus f(a―)=f(b―). ◻

b) [0] and [4] are the same in Z4 but g([0])=0― and g([4])=4― are different in Z8. So the function is not well defined.

c) The function is well defined.
Proof.
Let X∈Z4. Let a,b∈X. Then a≡bmod4. Then a−b=4k for some k∈Z. Now h([a])=2a―. Thus a−b=2(4k)=8k. Thus a≡bmod8. So [a]=[b].Thus h([a])=h([b]). ◻

d) [1] and [5] are the same in Z4, but j([1])=3― and g([5])=15―=7―. So the function is not well defined

E 24.5
Define f:Z5→Z5 by f(a―)=a―5. Define g:Z5→Z5 by g(a―)=a―. You may assume that f and g are both well-defined (which they are). Are f and g equal?

Proof.
We can check if f and g are equal by checking every element in Z5:

  1. When a―=0―, f(0―)=0―5=0― and g(0―)=0―, so f(0―)=g(0―).
  2. When a―=1―, f(1―)=1―5=1― and g(1―)=1―, so f(1―)=g(1―).
  3. When a―=2―, f(2―)=2―5=(2―4)2―=1―2―=2― and g(2―)=2―, so f(2―)=g(2―).
  4. When a―=3―, f(3―)=3―5=(3―4)3―=1―3―=3― and g(3―)=3―, so f(3―)=g(3―).
  5. When a―=4―, f(4―)=4―5=(4―4)4―=1―4―=4― and g(4―)=4―, so f(4―)=g(4―).

Since f(a―)=g(a―) for every a―∈Z5, the functions f and g are indeed equal. ◻

E 24.6
A is a set.
S1,S2⊆A
χ - characteristic function

a) If T=S1∪S2 and S1∩S2=∅, then χT(a)=χS1(a)+χS2(a).

Let a∈A and consider the value of χT(a). There are two cases:

  1. If a∈S1, then a∉S2 because S1∩S2=∅. Thus, χS1(a)=1 and χS2(a)=0. The sum χS1(a)+χS2(a)=1+0=1, which is equal to χT(a) because a is in the union T.

  2. If a∈S2, a similar argument shows that χS1(a)=0 and χS2(a)=1. Again, χS1(a)+χS2(a)=0+1=1, which equals χT(a) because a is in the union T.

  3. If a∉S1 and a∉S2, then χS1(a)=0 and χS2(a)=0. Therefore, χS1(a)+χS2(a)=0+0=0, which matches χT(a) because a is not in T.

In all cases, χT(a)=χS1(a)+χS2(a). ◻

b)

If T=S1∩S2, then χT(a)=χS1(a)⋅χS2(a)

Proof.
Let a∈A. There are 4 cases:

Case 1. a∈S1∩S2
Note that χT(a)=1 because a is in both S1 and S2.
χS1(a)=1, and χS2(a)=1. Thus χT(a)=1⋅1=χS1(a)⋅χS2(a).

Case 2. a∈S1−S2
Here, χT(a)=0 because a is not in S2, hence not in the intersection T.
χS1(a)=1, and χS2(a)=0. Thus χT(a)=1⋅0=χS1(a)⋅χS2(a).

Case 3. a∈S2−S1.
Here, χT(a)=0 because a is not in S1, hence not in the intersection T.
χS1(a)=0, and χS2(a)=1. Thus χT(a)=0⋅1=χS1(a)⋅χS2(a).

Case 4. a∈A−(S1∪S2)
Here, a is in neither S1 nor S2, so it is not in their intersection.
χS1(a)=0, and χS2(a)=0. Thus χT(a)=0⋅0=χS1(a)⋅χS2(a).

In each case, χT(a)=χS1(a)⋅χS2(a). This completes the proof.

c)

If T=S1∪S2, then χT(a)=χS1(a)+χS2(a)−χS1(a)⋅χS2(a)

Proof.
Let a∈A. There are two cases for each set S1 and S2:

Case 1: a∈S1
In this case, χS1(a)=1.

Case 1a: a∈S2
Here, χS2(a)=1. Since a is in both S1 and S2, it is also in their union T. Hence, χT(a)=1.
The right-hand side of the equation becomes 1+1−1⋅1=1, which is equal to χT(a).

Case 1b: a∉S2
Here, χS2(a)=0. Since a is in S1, it is in their union T. Hence, χT(a)=1.
The right-hand side of the equation becomes 1+0−1⋅0=1, which is equal to χT(a).

Case 2: a∉S1
In this case, χS1(a)=0.

Case 2a: a∈S2
Here, χS2(a)=1. Since a is in S2, it is in their union T. Hence, χT(a)=1.
The right-hand side of the equation becomes 0+1−0⋅1=1, which is equal to χT(a).

Case 2b: a∉S2
Here, χS2(a)=0. Since a is in neither S1 nor S2, it is not in their union T. Hence, χT(a)=0.
The right-hand side of the equation becomes 0+0−0⋅0=0, which is equal to χT(a).

In each case, χT(a)=χS1(a)+χS2(a)−χS1(a)⋅χS2(a). ◻

E 24.7

Proof.
Since each fi is a function from Pi to B, it is a subset of Pi×B, and since each Pi is a subset of A, it follows that each fi is a subset of A×B. Thus, their union, f, is also a subset of A×B, so f is a relation from A to B.

To prove that f is a function, we aim to demonstrate that for every element a∈A, there is exactly one ordered pair in f with a as its first coordinate. Consider an arbitrary element a∈A. Because {Pi: i∈I} is a partition of A, there exists a unique index j∈I such that a∈Pj and a∉Pi for all i≠j. Therefore, a is the first coordinate of exactly one ordered pair in fj, namely (a,fj(a)), because fj:Pj→B is a function.

For all i≠j, a∉Pi, so a is not the first coordinate of any ordered pair in fi. This means that (a,fj(a)) is the unique ordered pair in f with first coordinate a. Hence, f(a)=fj(a) when a∈Pj for some j∈I.

Since a was an arbitrary element of A and we have shown that for each such a there is exactly one ordered pair in f, it follows that f is a function from A to B. ◻