A function which is both surjective and injective is said to be **bijective**.

This is an important property because it guarantees that $f: A \\mapsto B$ has an inverse function $f^{-1} : B \\mapsto A$.

\n\n

Let's prove that the function $f: \\mathbb R \\mapsto \\mathbb R$ defined by

\n$ f(x) = \\left\\{ \\begin{array}{cl} \\frac{1}x & x \\neq 0 \\\\ 0 & x = 0.\\end{array}\\right.$

\nhas an inverse.

\n", "advice": "This question summarizes the definitions of surjective and injective, and applies them to prove the existence of an inverse.

\n\n

It is possible to prove that a continuous function is injective by using the derivative to show that it is either strictly increasing or strictly decreasing. But $f$ is not continuous, and nor is it strictly increasing or strictly decreasing. In fact it is strictly decreasing for $x<0$ and strictly increasing for $x>0$.

\n{myscript()}

\nSo we have to prove that $f$ is injective directly from the definition.

\n\n

By showing that $f$ is a bijection we prove that an inverse exists, but we have not constructed the inverse function. This is an interesting case because we are able to explicitly construct the inverse, which also proves that the inverse exists.

", "metadata": {"description": "This question summarizes the definitions of surjective and injective, and applies them to prove the existance of an inverse.

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "preamble": {"css": "", "js": ""}, "parts": [{"marks": 0, "showFeedbackIcon": true, "prompt": "**Prove that $f(x)$ surjective.**

Assume that $b \\in \\mathbb R$. We must find some $a$ such that $f(a) = b$. There are two cases to consider.

\nIf $b=0$ then choose $a = 0$.

\nOtherwise, $b \\neq 0$ and then choose $a = $ [[0]].

\nIn either case, $f(a) = b$ and so the function is surjective.

", "gaps": [{"checkvariablenames": false, "showpreview": true, "checkingtype": "absdiff", "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "showCorrectAnswer": true, "answer": "1/b", "marks": 1, "showFeedbackIcon": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "vsetrangepoints": 5, "scripts": {}, "type": "jme", "variableReplacements": []}], "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true}, {"marks": 0, "showFeedbackIcon": true, "prompt": "**Prove that $f(x)$ is injective.**

Assume that $f(x_0) = f(x_1)$. We must prove that $x_0 = x_1$. There are two cases to consider.

\nIf $f(x_0) = f(x_1) = 0$ then $x_0 = x_1 = $ [[0]].

\nOtherwise, $f(x_0) = f(x_1) \\neq 0$ and then

\n$x_0 = \\frac{1}{f(x_0)} = \\frac{1}{f(x_1)} = x_1$.

\nIn either case, $x_0 = x_1$ and so the function is injective.

", "gaps": [{"maxValue": "0", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReduced": false, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "scripts": {}, "minValue": "0", "variableReplacements": [], "correctAnswerFraction": false}], "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true}, {"marks": 0, "showFeedbackIcon": true, "prompt": "Because $f$ is surjective and injective, it is bijective and therefore has an inverse.

\nIn this case we can actually see that $f$ is its own inverse because $f(f(x)) = $ [[0]].

", "gaps": [{"checkvariablenames": false, "showpreview": true, "checkingtype": "absdiff", "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "showCorrectAnswer": true, "answer": "x", "marks": 1, "showFeedbackIcon": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "vsetrangepoints": 5, "scripts": {}, "type": "jme", "variableReplacements": []}], "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true}], "name": "Gareth's copy of Lois's copy of Functions: bijective", "extensions": ["jsxgraph"], "type": "question", "contributors": [{"name": "Gareth Woods", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/978/"}]}]}], "contributors": [{"name": "Gareth Woods", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/978/"}]}