Current time:0:00Total duration:9:31
0 energy points

Surjective (onto) and injective (one-to-one) functions

Introduction to surjective and injective functions. Created by Sal Khan.
Video transcript
In this video I want to introduce you to some terminology that will be useful in our discussion of functions and invertibility. And this is, in general, terminology that you'll probably see in your mathematical careers. So let's say I have a function f, and it is a mapping from the set x to the set y. We've drawn this diagram many times, but it never hurts to draw it again. So that is my set x or my domain. And then this is the set y over here, or the co-domain. Remember the co-domain is the set that you're mapping to. You don't necessarily have to map to every element of the set, or none of the elements of the set. This is just all of the elements, the set that you might map elements in your co-domain to. So let's see. If I have some element there, f will map it to some element in y in my co-domain. So the first idea, or term, I want to introduce you to, is the idea of a function being surjective. And sometimes this is called onto. And a function is surjective or onto, if for every element in your co-domain-- so let me write it this way, if for every, let's say y, that is a member of my co-domain, there exists-- that's the little shorthand notation for exists --there exists at least one x that's a member of x, such that. And I can write such that, like that. Actually, let me just write the word out. Such that f of x is equal to y. So it's essentially saying, you can pick any y here, and every y here is being mapped to by at least one of the x's over here. So, for example, actually let me draw a simpler example instead of drawing these blurbs. Let's say that I have a set y that literally looks like this. Let's say that a set y-- I'll draw it very --and let's say it has four elements. It has the elements a, b, c, and d. This is my set y right there. And let's say my set x looks like that. And let's say it has the elements 1, 2, 3, and 4. Now, in order for my function f to be surjective or onto, it means that every one of these guys have to be able to be mapped to. So what does that mean? If every one of these guys, let me just draw some examples. Let's say that this guy maps to that. Let's say that this guy maps to that. Let's say that this guy maps to that. And let's say, let me draw a fifth one right here, let's say that both of these guys right here map to d. So f of 4 is d and f of 5 is d. This is an example of a surjective function. So these are the mappings of f right here. This function right here is onto or surjective. Why is that? Because every element here is being mapped to. Now, let me give you an example of a function that is not surjective. Let me add some more elements to y. Let's say element y has another element here called e. Now, all of a sudden, this is not surjective. And why is that? Because there's some element in y that is not being mapped to. If I tell you that f is a surjective function, it means if you take, essentially, if you map all of these values, everything here is being mapped to by at least one element here. So you could have it, everything could be kind of a one-to-one mapping. And I'll define that a little bit better in the future. So it could just be like that, and like that. And you could even have, it's at least one, so you could even have two things in here mapping to one thing in here. But the main requirement is that everything here does get mapped to. Another way to think about it, is that if you take the image. So surjective function-- let me write this here. Let me write it this way --so if I say that f is surjective or onto, these are equivalent terms, that means that the image of f. Remember the image was, all of the values that f actually maps to. So that means that the image of f is equal to y. Now, we learned before, that your image doesn't have to equal your co-domain. But if you have a surjective or an onto function, your image is going to equal your co-domain. Everything in your co-domain gets mapped to. Actually, another word for image is range. You could also say that your range of f is equal to y. Remember the difference-- and I drew this distinction when we first talked about functions --the distinction between a co-domain and a range, a co-domain is the set that you can map to. You don't have to map to everything. The range is a subset of your co-domain that you actually do map to. If you were to evaluate the function at all of these points, the points that you actually map to is your range. And that's also called your image. And the word image is used more in a linear algebra context. But if your image or your range is equal to your co-domain, if everything in your co-domain does get mapped to, then you're dealing with a surjective function or an onto function. Now, the next term I want to introduce you to is the idea of an injective function. And this is sometimes called a one-to-one function. So let me draw my domain and co-domain again. So let's say that that is my domain and this is my co-domain. So this is x and this is y. If I say that f is injective or one-to-one, that implies that for every value that is mapped to-- so let me write it this way --for every value that is mapped to-- so let's say, I'll say it a couple of different ways --there is at most one x that maps to it. Or another way to say it is that for any y that's a member of y-- let me write it this way --for any y that is a member y, there is at most one-- let me write most in capital --at most one x, such that f of x is equal to y. There might be no x's that map to it. So for example, you could have a little member of y right here that just never gets mapped to. Everyone else in y gets mapped to, but that guy never gets mapped to. So this would be a case where we don't have a surjective function. This is not onto because this guy, he's a member of the co-domain, but he's not a member of the image or the range. He doesn't get mapped to. But this would still be an injective function as long as every x gets mapped to a unique y. Now, how can a function not be injective or one-to-one? And I think you get the idea when someone says one-to-one. Well, if two x's here get mapped to the same y, or three get mapped to the same y, this would mean that we're not dealing with an injective or a one-to-one function. So that's all it means. Let me draw another example here. Let's actually go back to this example right here. When I added this e here, we said this is not surjective anymore because every one of these guys is not being mapped to. Is this an injective function? Well, no, because I have f of 5 and f of 4 both mapped to d. So this is what breaks its one-to-one-ness or its injectiveness. This is what breaks it's surjectiveness. Now if I wanted to make this a surjective and an injective function, I would delete that mapping and I would change f of 5 to be e. Now everything is one-to-one. I don't have the mapping from two elements of x, going to the same element of y anymore. And everything in y now gets mapped to. So this is both onto and one-to-one.