 Welcome back to another screencast on functions where we're exploring the concept of representing functions as lists of ordered pairs. In the last video, we saw that given a subset F of A cross B where A and B are non-empty sets, this set F might define a function from A to B if two important properties are satisfied. Let's put this idea to work right away with two quick concept checks. First, let's look at the subset F of Z4 cross Z4 given by the following set of ordered pairs. And what can we say about F? Pause the video and come back when you have your choice made. So the correct answer here is D. F is a function this time because the two properties from our theorem in the last video are satisfied. Every point in the domain copy of Z4 does get mapped to something. 0 maps to 1, 1 maps to 2, 2 maps to 0, and 3 also maps to 0. And we never encounter two pairs in this set with the same first coordinate but different second coordinates. That's our way of saying that inputs do not split. So this really is actually a function. However, it's not injective because as you see 2 and 0, 2 and 3 both map to 0. And it's not surjective because nothing maps to 3. I never see a pair with 3 in the second coordinate. So that's a function. Now for the second concept check, we're going to take this set of pairs and create a related set out of it. We're going to define G as another subset of Z4 cross Z4 by this set. Now notice importantly that what I did here was I took the ordered pairs from F in the previous slide and just swapped the first and second coordinates for all of them. So we had 0, 1 in F previously, so now 1, 0 is in G and 1, 2 was in F, so now I have 2, 1 in G. So now that I've swapped the coordinates on each of the pairs of F, I have this new set of ordered pairs G. So what can you tell me about that new set? Think about it and pause the video and come back when you are ready. So this time the answer is E. G is not a function. There's a couple of reasons why. First of all, not all points in the domain map to something. For example, 3 doesn't map to anything. Second of all, there is some input splitting going on here. You see 0 actually maps to 2 things, both 2 and 3. So although F was a function and I created G out of it, G is not a function in its own right. So you might notice something here. One of the reasons that G was not a function was because that 3 didn't map to anything. Now why was that? Well, it really boils down to the fact that in the original set of pairs F, nothing map to 3. Because we form G by reversing the order in the pairs that belong to F, if nothing maps to 3 in F, the original, then 3 won't map to anything in G, the reverse. So more generally, if F is not surjective, then G, which we would get again by reversing the order of the pairs, is not going to be a function. Because the point that was left uncovered by F will be a point that doesn't map to anything in G. Second, the other reason G was not a function was because the input 0 split and mapped to both 2 and to 3. Now why did that happen? Well, it's because in F, the original set of pairs, we had a collision, 2 and 3 both mapped to 0. So when we turn that around by reversing the order of the pairs, that collision turns into a split. So if F is an injective, F is not injective, then the reverse order set G will not be a function because the collisions will turn into splits. Now let's explore this idea a little further of taking a function and reversing it. Because this idea, this concept comes up a lot in real life. I don't know about you, but I think the undo function in computer programs is the best thing that ever happened. If I'm using a program and I screw up, I just click undo or hit control Z, whatever the case may be, and whatever process I did is just undone, just like that. It's very important, if possible, any process we create needs to have, if possible, some way of reversing it. So let's make a formal definition for what we mean by reversing a function process. Rather than reverse, we're going to use the term inverse. So let F be from A to B be a function. And we think of this function as a set of ordered pairs. Then the inverse of F, and we're going to denote this with some very unfortunate choice of notation. F with a little negative 1 upstairs here is the set of ordered pairs given by the following. F inverse, which is how we pronounce this symbol, F inverse is equal to the set of all points B comma A in B cross A such that F of A equals B. So in other words, F inverse is the set of all ordered pairs B comma A and B cross A, such that the reverse A comma B belongs to F. This means that F inverse is just the set of ordered pairs we get by taking the ordered pairs in F and switching the coordinates. So for example, earlier we had the function F being the set of ordered pairs 0, 1, 1, 2, 2, 0, 3, 0. This was a function from Z 4 to Z 4, remember, that obeyed all the five rules for being a function. Then what I was calling G, the set of pairs we got by reversing the coordinates, we're now going to call F inverse. So F inverse is the set that consists of 1, 0, 2, 1, 0, 2, and 0, 3. So two quick notes on this. Instead of the choice of notation F inverse, F with a little negative 1 upstairs is unfortunate because a lot of students get the wrong idea about this negative 1 superscript. Let me be very clear, this is not a negative exponent. That would indicate some sort of fraction is taking place. This is just a symbol that indicates I'm taking the ordered pairs that belong to F and switching the order. Repeat, this is not a negative exponent. We are not introducing anything like fractions when I introduce this notation. Very importantly, second of all, notice that if F is a function, then F inverse may or may not be a function. In the case above, F was a function but F inverse wasn't. In fact, the next item in the agenda is to think about the conditions under which F inverse would be a function. Now a partial answer of course would be not always because as we saw above, even when we start with F, F inverse could be something that isn't a function. So beware of calling F inverse the quote unquote inverse function for F as you might have heard in your high school classes. Because saying inverse function presupposes that F inverse is actually a function. And that just may not be the case. So just call it the inverse. Let's check our understanding of the concept of inverses with a concept check. Let F be the function defined by the following set of ordered pairs. F is the set of all pairs A, B, and Z cross N union 0. That's the set of all natural numbers and throw in 0, 2. Defined by B is equal to the absolute value of A. So it's a set of all ordered pairs where A belongs to the integers. B is either a natural number or 0 and B is the absolute value of A. So we'll take it for granted or you can prove that this is actually a function. Which of the following pairs are in F inverse? So look at that list and select all that apply. And for bonus brownie points you can answer the following question yes or no. Is F inverse a function in its own right? So the answers here are A, C, and D. Now the way to know whether a pair say U comma V belongs to F inverse is to ask, is V comma U the reverse order in the original function F? If so, then UV belongs to F inverse. Now what this means here in our context is that UV belongs to F inverse if and only if VU belongs to F. But that happens if and only if the absolute value of V is equal to U. So for F inverse we're looking for pairs where the first coordinate is the absolute value of the second coordinate. That's exactly the opposite of F. And that happens only in choices A, C, and D. Choice B is a pair that belongs to F because the second coordinate is the absolute value of the first one. But it does not belong to F inverse because the vice versa is not true. And we can rule out E without doing any math at all because the pair is not even an element of Z cross N union 0 due to the fact that the second coordinate is negative. If it's not in the set, in the Cartesian product Z cross N union 0, then there's no way it can be a member of a subset of that. As for the bonus question, is the inverse of F a function in its own right? The answer is no because we said that C and D are both points in F inverse. But those points have the same first coordinate but different second coordinates. So that violates one of the basic ingredients of functions which is that they must not split inputs. So that brings up a question that's very important. When exactly is the inverse of a function going to be a function in its own right? We've seen that the answer is not always, but what are the conditions under which the inverse of a function will be a function? So think back to the reason why we got split inputs in some of the previous examples, the one in the concept check and in the G example from earlier. That was because the original function was not injective. We had a collision in both cases, and when we reverse the order of points, that collision turns into a split. So if I ever wanted the inverse of a function to actually be a function in its own right, the original function would have to be injective. There could be no collisions. Otherwise, this splitting would happen in the inverse. Now likewise, if the original function is not surjective, then there's a point in the co-domain that is not covered by the function. And when we reverse order, that uncovered point in the co-domain, which is a point which does not have an input associated with it, it turns out to be a point in the domain that doesn't have any output associated with it. So if I want the inverse of a function to be a function, the original function also has to be surjective. So that conceptual explanation is the basic reason why the following theorem is true. Let A and B be non-empty sets, and let F be a function from A to B. Then the inverse of F is a function from B to A, if and only if F is a bijection. Now this makes sense because we saw that if F fails to be injective, then the inverse splits inputs. And if F fails to be surjective, then the inverse doesn't assign each point to an output. So F must be both injective and surjective for its inverse to be a function. Let me stress again that F inverse always exists, okay? You can always form F inverse because it's just a set of ordered pairs that you get by reversing the order of the pairs in F. It's just that F inverse may not have all the ingredients to be a function. That only happens when F is bijective. So now we know what an inverse for a function is, and when that inverse is a bijection, or a function in its own right. In the next and final video about inverses, we'll explore how to work with inverses and how to prove results involving them. Thanks for watching.