If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

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

## 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 and 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 codomain remember the codomain 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 in the set this is just all the elements the set that you might map a element in your codomain to so let's see if I have some element there f will map it to some element in Y in my co domain in my co domain so the first idea or or term I want to introduce you to is the idea of a function being surjective surjective and sometimes this is called on two on two and a function is surjective or onto if for every every element in your co-domain so let me write it this way if for every every let's say Y that is a member of my co domain there exists there exists that's the that's the little shorthand notation for exists there exists at least one at least one 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 such that f of X f of X is equal to Y so it's essentially saying look 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 exam both 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 4 elements it has the elements a B C and D this is my set Y right there now let's say my set X my set X looks like that and let's say it has the elements I don't know 1 2 3 & 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 what does that mean so 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 on 2 is on 2 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 not not surjective and why is that because there's some element in Y that is not being mapped to so if something if I tell you that F is a surjective function it means that 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 you know it could 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 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 is that if you take the image the image so surjective function let me write this here let's objective function well let me write it this way so if I say that f is surjective or on to these are equivalent terms that means that the image 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 is equal to Y now we learn before you know your image doesn't have to equal your codomain but if your you have a surjective or an onto function your image is going to equal your codomain everything in your codomain gets mapped to and 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 a range is a subset of Co domain of your code may that you actually do map to if you were to evaluate the function at all of these points the points that you actually mapped to is your range and that's also called your image and we use the image the word images use more in a linear algebra context but if your image or your range is equal to your codomain if everything in your codomain 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 injective injective injective function and this is sometimes called a 1 one-to-one function so let me draw my domain and codomain 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 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 write it I'll say it a couple of different ways there is at most one X that maps to it there's at most one X that maps to it or another way to say is that any for any Y that's a member of Y let me write it this way for any Y that is a member of Y there is at most there is at most one at most let me write most in capital at most one X such that such that f of X is equal to Y there might be no X's in map to it so for example you could have a little a member of Y right here that just never gets mapped to you know 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 on two because this guy is not 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 every X gets mapped to you a unique Y now how can the 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 if two X's here get mapped to the same Y or 3 get mapped to the same Y this would mean that we are not dealing not dealing with an injective or a one-to-one function injective function so that's all it means let me draw another example here so if I take let's actually go back to this example right here when I added this a here we said this is not surjective anymore because every one of these guys is not being apt to is this an injective function well no because I have five F of 5 and F of for both map to D so this is what breaks it's one to oneness or it's injective nough sits surjective nasai wanted to make this a surjective and an injective function i would delete that mapping and I would change F of five to be e now everything is one-to-one I don't have to the function 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 on 2 & 1 2 1