Let \(A\) and \(B\) be sets, and let \(f : A \to B\) be a function.
The function \(f\) is injective (also called one-to-one or monic) if \(x \neq y\) implies \(f (x) \neq f (y)\) for all \(x, y\in A\text{;}\) equivalently, if \(f (x) = f (y)\) implies \(x = y\) for all \(x, y\in A\text{.}\)
The function \(f\) is surjective (also called onto or epic) if for every \(b\in B\text{,}\) there exists some \(a\in A\) such that \(f(a) = b\text{;}\) equivalently, if \(f(a) = B\text{.}\)
The function \(f\) is bijective if it is both injective and surjective.
Example5.16.
Let \(k : [0, ∞) \to [0, ∞)\) be defined by \(k(x) = x2\) for all \(x\in [0, ∞)\text{.}\) This function is surjective and injective, and hence bijective. First, we show that \(k\) is injective. Let \(x, y\in [0, ∞)\text{.}\) Suppose that \(k(x) = k(y)\text{.}\) Then \(x2 = y2\text{.}\) It follows that \(√x2 = √y2\text{,}\) and because \(x ≥ 0\) and \(y ≥ 0\text{,}\) we deduce that \(x = √x2 = √y2 = y\text{.}\) Hence \(k\) is injective. Second, we show that \(k\) is surjective. Let \(b\in [0, ∞)\text{.}\) Then \(√b\in [0, ∞)\text{,}\) and so \(k(√b) = (√b)2 = b\text{.}\) Hence k is surjective.
Let \(g : [0, ∞) \to R\) be defined by \(g(x) = x2\) for all \(x\in [0, ∞)\text{.}\) This function is injective but not surjective. The proof of the injectivity of \(g\) is the same as the proof of the injectivity of the function \(k\) in Part (1) of this example. The reason that \(g\) is not surjective is that \(g(a) \neq -2\) for any \(a\in [0, ∞)\text{,}\) though \(-2\) is in the codomain of \(g\text{.}\)
Let \(h : R \to [0, ∞)\) be defined by \(h(x) = x2\) for all \(x\in R\text{.}\) This function is surjective but not injective. The proof of the surjectivity of \(h\) is the same as the proof of the surjectivity of the function \(k\) in Part (1) of this example. The reason \(h\) is not injective is because \(h(-3) = 9 = h(3)\) even though \(-3 \neq 3\text{.}\) (Observe that instead of \(±3\) we could have used \(±a\) for any positive number \(a\text{,}\) but a single instance where the definition of injectivity fails is sufficient.)
Let \(f : R \to R\) be defined by \(f (x) = x2\) for all \(x\in R\text{.}\) This function is neither injective nor surjective, which is seen using the same arguments as the corresponding arguments for \(g\) and \(h\) in Parts (2) and (3) of this example.
Lemma5.17.
Let \(A\text{,}\)\(B\) and \(C\) be sets, and let \(f : A \to B\) and \(g : B \to C\) be functions.
If \(f\) and \(g\) are injective, then \(g \circ f\) is injective.
If \(f\) and \(g\) are surjective, then \(g \circ f\) is surjective.
If \(f\) and \(g\) are bijective, then \(g \circ f\) is bijective.
Theorem5.18.
Let \(A\) and \(B\) be non-empty sets, and let \(f : A \to B\) be a function.
The function \(f\) has a right inverse if and only if \(f\) is surjective.
The function \(f\) has a left inverse if and only if \(f\) is injective.
The function \(f\) has an inverse if and only if \(f\) is bijective.
Theorem5.19.
Let \(A\) and \(B\) be non-empty sets, and let \(f : A \to B\) be a function.
The function \(f\) is injective if and only if \(f \circ g = f \circ h\) implies \(g = h\) for all functions g\(, h : Y \to A\) for all sets \(Y\) .
The function \(f\) is surjective if and only if \(g \circ f = h \circ f\) implies \(g = h\) for all functions \(g, h : B \to X\) for all sets \(X\text{.}\)
Let \(A\) and \(B\) be sets, and let \(S \subseteq A\) be a subset
Prove that the identity map \(1A : A \to A\) is bijective.
Prove that inclusion map \(j : S \to A\) is injective.
Let \(f : A \to B\) be a function. Suppose that \(f\) is injective. Is the restriction \(f |S\) necessarily injective? Give a proof or a counterexample.
Let \(g : A \to B\) be a function. Suppose that \(g\) is surjective. Is the restriction \(g|S\) necessarily surjective? Give a proof or a counterexample.
Let \(h : S \to B\) be a function, and let \(H : A \to B\) be an extension of \(h\text{.}\) Suppose that \(h\) is injective. Is \(H\) necessarily injective? Give a proof or a counterexample.
Let \(k : S \to B\) be a function, and let \(K : A \to B\) be an extension of \(k\text{.}\) Suppose that \(k\) is surjective. Is \(K\) necessarily surjective? Give a proof or a counterexample.
Prove that the projection maps \(π_1 : A \times B \to A\) and \(π_2 : A \times B \to B\) are surjective. Are the projection maps injective?
Let \(A\) and \(B\) be sets, let \(P, Q \subseteq A\) be subsets and let \(f : A \to B\) be a function. Suppose that \(f\) is injective. Prove that \(f (P - Q) = f (P) - f (Q)\text{.}\)
Let \(A\text{,}\)\(B\) and \(C\) be sets, and let \(f : A \to B\) and \(g : B \to C\) be functions.
Prove that if \(g \circ f\) is injective, then \(f\) is injective.
Prove that if \(g \circ f\) is surjective, then \(g\) is surjective.
Prove that if \(g \circ f\) is bijective, then \(f\) is injective, and \(g\) is surjective.
Find an example of functions \(f : A \to B\) and \(g : B \to C\) such that \(g \circ f\) is bijective, but \(f\) is not surjective, and \(g\) is not injective. Hence Parts (1)-(3) of this exercise are the best possible results.