Mathematical-Reasoning ยท Unit 22 ยท Video 2 ยท Interactive Practice

Injections: Proving a Function Is One-to-One

IKey Formulas

Statement (for a function f:Aโ†’Bf : A \to B)Role
โˆ€x1,x2โˆˆA,ย (x1โ‰ x2โ†’f(x1)โ‰ f(x2))\forall x_1, x_2 \in A,\ \big(x_1 \ne x_2 \to f(x_1) \ne f(x_2)\big)Definition: ff is an injection (one-to-one, injective) โ€” different inputs give different outputs
โˆ€x1,x2โˆˆA,ย (f(x1)=f(x2)โ†’x1=x2)\forall x_1, x_2 \in A,\ \big(f(x_1) = f(x_2) \to x_1 = x_2\big)Contrapositive, logically equivalent to the definition: the form used in proofs, because its hypothesis is an equation
โˆƒx1,x2โˆˆA,ย (x1โ‰ x2โˆงf(x1)=f(x2))\exists x_1, x_2 \in A,\ \big(x_1 \ne x_2 \wedge f(x_1) = f(x_2)\big)Negation: ff is not an injection โ€” one such pair is enough
โˆ€x1,x2โˆˆA,ย (x1=x2โ†’f(x1)=f(x2))\forall x_1, x_2 \in A,\ \big(x_1 = x_2 \to f(x_1) = f(x_2)\big)True for every function (each input has exactly one output), so proving it shows nothing about injections

Key Insight: To disprove, exhibit one pair of different inputs with the same output. To prove, list every output when AA is finite; when AA is infinite, assume f(x1)=f(x2)f(x_1) = f(x_2) and derive x1=x2x_1 = x_2. Elements of BB that are never outputs do not affect injectivity.

IIOne Pair Is Enough

Every input of h(x)=x2โˆ’3xh(x) = x^2 - 3x except 32\tfrac{3}{2} shares its output with the input 3โˆ’x3 - x.

IIIFinite Domains: List Every Output

On a finite domain, one repeated output disproves injectivity, and a list with no repeats proves it.

IVThe Contrapositive Proof, Step by Step

The same contrapositive algebra either forces the inputs to be equal or exposes the pairs that break injectivity.

Claim. For all m,nโˆˆZm, n \in \mathbb{Z}, if F(m)=F(n)F(m) = F(n), then m=nm = n.

(1) Let m,nโˆˆZm, n \in \mathbb{Z} and assume F(m)=F(n)F(m) = F(n).

VQuiz Questions

Problem 1 ยท Cubes on R7R_7

Given: R7={0,1,2,3,4,5,6}R_7 = \{0, 1, 2, 3, 4, 5, 6\} and f:R7โ†’R7f : R_7 \to R_7, f(x)=x3โ€Šmodโ€Š7f(x) = x^3 \bmod 7. Which statement is correct?

โœ… Correct! Two different inputs with the same output satisfy the negation of the definition, and one such pair is enough.
โŒ Not quite. "Each input has exactly one output" says only that ff is a function. Injectivity asks whether two different inputs can share an output โ€” and f(1)=f(2)f(1) = f(2).
โŒ Not quite. Every function Aโ†’BA \to B has its outputs in BB; that is part of being a function, not injectivity. Compute the outputs: 23=82^3 = 8 leaves remainder 11, the same as 131^3.
โŒ Right verdict, wrong reason. Elements of the codomain that receive no arrow do not affect injectivity โ€” an injection may leave part of the codomain unused. The reason is a repeated output: f(1)=f(2)=1f(1) = f(2) = 1.
Show solution

The domain is finite, so list every output:

xx00112233445566
x3x^300118827276464125125216216
f(x)f(x)00111166116666

For example 8=7โ‹…1+18 = 7 \cdot 1 + 1, so f(2)=1=f(1)f(2) = 1 = f(1) while 1โ‰ 21 \ne 2. This pair satisfies โˆƒx1,x2โˆˆR7,ย (x1โ‰ x2โˆงf(x1)=f(x2))\exists x_1, x_2 \in R_7,\ \big(x_1 \ne x_2 \wedge f(x_1) = f(x_2)\big), so ff is not an injection. (Other pairs work too, such as f(3)=f(5)=6f(3) = f(5) = 6.)

Problem 2 ยท Opening the Proof

Given: g:Rโˆ’{3}โ†’Rg : \mathbb{R} - \{3\} \to \mathbb{R}, g(x)=x+1xโˆ’3g(x) = \dfrac{x + 1}{x - 3}. Which opening sets up a valid proof that gg is an injection?

โœ… Correct! That is the contrapositive form: its hypothesis g(x1)=g(x2)g(x_1) = g(x_2) is an equation we can work on with algebra.
โŒ Not quite. "If x1=x2x_1 = x_2, then g(x1)=g(x2)g(x_1) = g(x_2)" is the converse of the contrapositive. It holds for every function, because each input has exactly one output, so proving it shows nothing about injections.
โŒ Not quite. That is the opening for proving gg is a surjection (every element of the codomain is an output) โ€” a different property. It would fail here anyway: x+1xโˆ’3=1\dfrac{x + 1}{x - 3} = 1 gives x+1=xโˆ’3x + 1 = x - 3, which no xx satisfies. Injectivity is about two inputs sharing an output.
โŒ Not quite. The domain is infinite. Checking a few inputs says nothing about the inputs you did not check; a proof must handle all x1,x2x_1, x_2 at once.
Show solution

Proof. Let x1,x2โˆˆRโˆ’{3}x_1, x_2 \in \mathbb{R} - \{3\} and assume g(x1)=g(x2)g(x_1) = g(x_2), that is,

x1+1x1โˆ’3=x2+1x2โˆ’3.\frac{x_1 + 1}{x_1 - 3} = \frac{x_2 + 1}{x_2 - 3}.

Since x1โ‰ 3x_1 \ne 3 and x2โ‰ 3x_2 \ne 3, both denominators are nonzero, so we may multiply both sides by (x1โˆ’3)(x2โˆ’3)(x_1 - 3)(x_2 - 3):

(x1+1)(x2โˆ’3)=(x2+1)(x1โˆ’3)(x_1 + 1)(x_2 - 3) = (x_2 + 1)(x_1 - 3) x1x2โˆ’3x1+x2โˆ’3=x1x2โˆ’3x2+x1โˆ’3x_1 x_2 - 3x_1 + x_2 - 3 = x_1 x_2 - 3x_2 + x_1 - 3

Cancel x1x2x_1 x_2 and โˆ’3-3 from both sides:

โˆ’3x1+x2=โˆ’3x2+x1,so4x2=4x1.-3x_1 + x_2 = -3x_2 + x_1, \quad\text{so}\quad 4x_2 = 4x_1.

Dividing by 44 gives x1=x2x_1 = x_2. Hence for all x1,x2โˆˆRโˆ’{3}x_1, x_2 \in \mathbb{R} - \{3\}, if g(x1)=g(x2)g(x_1) = g(x_2), then x1=x2x_1 = x_2, and gg is an injection. โˆŽ

Problem 3 ยท When the Algebra Splits

Given: r:Rโˆ’{0}โ†’Rr : \mathbb{R} - \{0\} \to \mathbb{R}, r(x)=x+1xr(x) = x + \dfrac{1}{x}. Assume r(x1)=r(x2)r(x_1) = r(x_2), multiply both sides by x1x2x_1 x_2 (nonzero), and move every term to one side.

Which factored equation do you reach?

What does it show about rr?

โœ… Correct! The factor x1x2โˆ’1x_1 x_2 - 1 can vanish with x1โ‰ x2x_1 \ne x_2, and any reciprocal pair such as 22 and 12\tfrac{1}{2} is a counterexample.
โŒ Not quite. That is the factoring of x12โˆ’x22x_1^2 - x_2^2, not of this equation. Here the terms are x12x2โˆ’x1x22+x2โˆ’x1=x1x2(x1โˆ’x2)โˆ’(x1โˆ’x2)x_1^2 x_2 - x_1 x_2^2 + x_2 - x_1 = x_1 x_2 (x_1 - x_2) - (x_1 - x_2).
โŒ Check the sign. x1x2(x1โˆ’x2)โˆ’(x1โˆ’x2)x_1 x_2 (x_1 - x_2) - (x_1 - x_2) factors as (x1โˆ’x2)(x1x2โˆ’1)(x_1 - x_2)(x_1 x_2 - 1): the second term is subtracted.
โŒ Not quite. Factoring x1โˆ’x2x_1 - x_2 out of x1x2(x1โˆ’x2)โˆ’(x1โˆ’x2)x_1 x_2 (x_1 - x_2) - (x_1 - x_2) leaves a second factor, x1x2โˆ’1x_1 x_2 - 1, which can also be zero.
โŒ Not quite. The product is zero when either factor is zero. The factor x1x2โˆ’1x_1 x_2 - 1 is zero for x1=2x_1 = 2, x2=12x_2 = \tfrac{1}{2}, so the proof cannot force x1=x2x_1 = x_2, and that pair is a counterexample.
โŒ Check the values. r(1)=1+1=2r(1) = 1 + 1 = 2 but r(โˆ’1)=โˆ’1โˆ’1=โˆ’2r(-1) = -1 - 1 = -2. The colliding pairs satisfy x1x2=1x_1 x_2 = 1, and 1โ‹…(โˆ’1)=โˆ’11 \cdot (-1) = -1.
โŒ Check the values. r(2)=52r(2) = \tfrac{5}{2} but r(โˆ’2)=โˆ’52r(-2) = -\tfrac{5}{2}. The colliding pairs satisfy x1x2=1x_1 x_2 = 1, and 2โ‹…(โˆ’2)=โˆ’42 \cdot (-2) = -4.
Show solution

Let x1,x2โˆˆRโˆ’{0}x_1, x_2 \in \mathbb{R} - \{0\} and assume r(x1)=r(x2)r(x_1) = r(x_2):

x1+1x1=x2+1x2.x_1 + \frac{1}{x_1} = x_2 + \frac{1}{x_2}.

Multiply both sides by x1x2โ‰ 0x_1 x_2 \ne 0 and move every term to the left:

x12x2+x2=x1x22+x1x_1^2 x_2 + x_2 = x_1 x_2^2 + x_1 x1x2(x1โˆ’x2)โˆ’(x1โˆ’x2)=0x_1 x_2 (x_1 - x_2) - (x_1 - x_2) = 0 (x1โˆ’x2)(x1x2โˆ’1)=0(x_1 - x_2)(x_1 x_2 - 1) = 0

So x1=x2x_1 = x_2 or x1x2=1x_1 x_2 = 1. The second case allows different inputs: take x1=2x_1 = 2, x2=12x_2 = \tfrac{1}{2}. Then

r(2)=2+12=52,r(12)=12+2=52,r(2) = 2 + \tfrac{1}{2} = \tfrac{5}{2}, \qquad r\big(\tfrac{1}{2}\big) = \tfrac{1}{2} + 2 = \tfrac{5}{2},

with 2โ‰ 122 \ne \tfrac{1}{2}. This pair satisfies the negation of the definition, so rr is not an injection.

Problem 4 ยท Which One Is One-to-One?

Given: four functions R6โ†’R6R_6 \to R_6, where R6={0,1,2,3,4,5}R_6 = \{0, 1, 2, 3, 4, 5\}. Which one is an injection?

โœ… Correct! The outputs of f1f_1 are 11, 00, 55, 44, 33, 22 โ€” six inputs, six different outputs.
โŒ Not quite. f2(0)=1f_2(0) = 1 and f2(3)=7โ€Šmodโ€Š6=1f_2(3) = 7 \bmod 6 = 1, with 0โ‰ 30 \ne 3. Every output of 2x+12x + 1 is odd, so only 11, 33, 55 are reached and six inputs must share them.
โŒ Not quite. f3(1)=1f_3(1) = 1 and f3(5)=25โ€Šmodโ€Š6=1f_3(5) = 25 \bmod 6 = 1, with 1โ‰ 51 \ne 5 โ€” the squares of xx and 6โˆ’x6 - x always agree mod 66.
โŒ Not quite. f4(0)=2f_4(0) = 2 and f4(2)=8โ€Šmodโ€Š6=2f_4(2) = 8 \bmod 6 = 2, with 0โ‰ 20 \ne 2: adding 22 to xx adds 66 to 3x+23x + 2.
Show solution

The domain is finite, so list every output of each function:

xx001122334455verdict
f1f_1110055443322no repeats: injection
f2f_2113355113355f2(0)=f2(3)f_2(0) = f_2(3)
f3f_3001144334411f3(1)=f3(5)f_3(1) = f_3(5)
f4f_4225522552255f4(0)=f4(2)f_4(0) = f_4(2)

For f1f_1: 5โ‹…2+1=11=6โ‹…1+55 \cdot 2 + 1 = 11 = 6 \cdot 1 + 5, 5โ‹…3+1=16=6โ‹…2+45 \cdot 3 + 1 = 16 = 6 \cdot 2 + 4, and so on; the six outputs are all different, so no two inputs share an output and f1f_1 is an injection. Each of the others has a pair of different inputs with the same output, so none of them is an injection.

Solved: 0 / 4