Tutorials › Real Analysis › Injectivity and Composition

Sets and Functions · Tutorial 73 of 1000

Injectivity and Composition

The injectivity of a composite depends on the first function and on how the second function acts on values the first function actually reaches.

Beginner 15 min read

What You'll Learn

  • Why a noninjective first function cannot be repaired by a second function
  • How the range of the first function determines which values of the second matter
  • A necessary and sufficient condition for a composite to be injective
  • Why the second function need not be injective on its entire domain
  • How to test composition claims with equal-output arguments

Where Can a Composite Lose Injectivity?

Let \(f:A\to B\) and \(g:B\to C\). The composition \(g\circ f:A\to C\) first applies \(f\), then \(g\): $$ (g\circ f)(x)=g(f(x)) \qquad (x\in A). $$ Recall that \(f\) is injective when equal outputs of \(f\) can only come from equal inputs: if \(f(x_1)=f(x_2)\), then \(x_1=x_2\). For a composite, two inputs can end at the same output only if the intermediate values produced by \(f\) are sent by \(g\) to the same value.

The composition of injective functions is injective, as established in the earlier tutorial “Composition of Functions.” That result gives a useful sufficient condition: injectivity of each stage guarantees injectivity of the whole composition. The converse needs more care. In particular, injectivity of the composite forces \(f\) to be injective, but it does not always force \(g\) to be injective on all of \(B\). The composite only applies \(g\) to values in the range of \(f\).

Focus on attained intermediate values. For injectivity of \(g\circ f\), the relevant part of \(g\)'s domain is \(\operatorname{ran}(f)\), not necessarily all of \(B\). Values of \(B\) outside \(\operatorname{ran}(f)\) are never used by the composite.

To express this precisely, restrict \(g\) to \(\operatorname{ran}(f)\). Since \(\operatorname{ran}(f)\subseteq B\), this restriction is a function $$ g|_{\operatorname{ran}(f)}:\operatorname{ran}(f)\to C, \qquad g|_{\operatorname{ran}(f)}(y)=g(y). $$ Saying that this restriction is injective means that whenever \(y_1,y_2\in\operatorname{ran}(f)\) and \(g(y_1)=g(y_2)\), then \(y_1=y_2\).

A Necessary Condition on the Second Function

If the composite is injective, then \(g\) cannot identify two distinct values that \(f\) actually reaches. Otherwise, inputs producing those intermediate values would have the same composite output. This gives a condition on \(g\) limited to the range of \(f\).

Lemma (Injectivity on the Range of the First Function). Let \(f:A\to B\) and \(g:B\to C\). If \(g\circ f\) is injective, then \(g|_{\operatorname{ran}(f)}\) is injective.

Proof. Suppose \(g\circ f\) is injective. Let \(y_1,y_2\in\operatorname{ran}(f)\), and suppose \(g(y_1)=g(y_2)\). Since \(y_1\in\operatorname{ran}(f)\), the definition of range gives some \(x_1\in A\) such that \(f(x_1)=y_1\). Likewise, there is \(x_2\in A\) such that \(f(x_2)=y_2\). Therefore $$ (g\circ f)(x_1)=g(f(x_1))=g(y_1) =g(y_2)=g(f(x_2))=(g\circ f)(x_2). $$ The injectivity of \(g\circ f\) implies \(x_1=x_2\). Applying \(f\) to this equality gives $$ y_1=f(x_1)=f(x_2)=y_2. $$ Thus equal outputs of the restriction come only from equal inputs in \(\operatorname{ran}(f)\), so the restriction is injective. \(\square\)

This argument uses the definition of range to turn each intermediate value into an input of \(f\). It does not require \(f\) to be surjective onto \(B\): the values \(y_1\) and \(y_2\) only need to lie in its actual range.

Worked Example: A Noninjective Function Outside the Attained Range

Let \(A=\{1,2\}\), \(B=\{a,b,c\}\), and \(C=\{0,1\}\). Define \(f:A\to B\) and \(g:B\to C\) by $$ f(1)=a,\qquad f(2)=b, $$ and $$ g(a)=0,\qquad g(b)=1,\qquad g(c)=0. $$ The range of \(f\) is \(\{a,b\}\). The function \(g\) is not injective on all of \(B\), because \(g(a)=g(c)=0\) while \(a\ne c\). But \(c\) is not in \(\operatorname{ran}(f)\). On the attained values \(a,b\), the outputs are distinct: $$ g(a)=0\ne1=g(b). $$ The composite satisfies \((g\circ f)(1)=0\) and \((g\circ f)(2)=1\), so it is injective. This example shows why requiring \(g\) to be injective on all of \(B\) would be stronger than necessary.

An Exact Criterion for Injectivity

The preceding lemma gives a necessary condition on the second function. We also need the first function to be injective: if distinct inputs of \(f\) already have the same intermediate value, every later function receives the same value from both inputs. The Injectivity of a Composition result established earlier states that if \(g\circ f\) is injective, then \(f\) is injective. Combining that fact with the lemma gives one direction of the characterization below.

Theorem (Injectivity Criterion for a Composite). Let \(f:A\to B\) and \(g:B\to C\). Then $$ g\circ f\text{ is injective} \quad\Longleftrightarrow\quad f\text{ is injective and }g|_{\operatorname{ran}(f)}\text{ is injective}. $$

Proof. First suppose \(g\circ f\) is injective. By the Injectivity of a Composition result from “Composition of Functions,” \(f\) is injective. By the lemma just proved, \(g|_{\operatorname{ran}(f)}\) is injective. Hence both conditions on the right hold.

Conversely, suppose that \(f\) and \(g|_{\operatorname{ran}(f)}\) are injective. Let \(x_1,x_2\in A\), and suppose $$ (g\circ f)(x_1)=(g\circ f)(x_2). $$ By the definition of composition, this says \(g(f(x_1))=g(f(x_2))\). Both \(f(x_1)\) and \(f(x_2)\) belong to \(\operatorname{ran}(f)\), so the injectivity of \(g|_{\operatorname{ran}(f)}\) gives \(f(x_1)=f(x_2)\). The injectivity of \(f\) then gives \(x_1=x_2\). Thus the composite is injective by the equal-output criterion for injectivity. \(\square\)

Both requirements are essential. If \(f\) is not injective, its distinct inputs that share an \(f\)-value also share every subsequent composite value. If \(g\) identifies two distinct values in \(\operatorname{ran}(f)\), each of those values has at least one input that produces it, and the corresponding composite outputs agree. The two possible failures occur at different stages.

Worked Example: A Noninjective First Function Cannot Be Repaired

Define \(f:\mathbb R\to\mathbb R\) by \(f(x)=x^2\), and define \(g:\mathbb R\to\mathbb R\) by \(g(y)=y+4\). The function \(f\) is not injective because \(f(2)=4=f(-2)\) while \(2\ne-2\). The composite is $$ (g\circ f)(x)=x^2+4. $$ In particular, \((g\circ f)(2)=8=(g\circ f)(-2)\), so the composite is not injective. The issue is already present in the first function; applying \(g\) afterward does not distinguish inputs that \(f\) has already sent to the same value.

Applying the Criterion to Examples

The criterion can be used in either direction. To establish injectivity of a composite, check injectivity of \(f\) and then check whether \(g\) separates the values in \(\operatorname{ran}(f)\). To show the composite is not injective, it is enough to find a failure of either condition. If \(g\) fails to be injective only at values outside \(\operatorname{ran}(f)\), that failure alone says nothing against injectivity of the composite.

Worked Example: A Squaring Function After an Injective Map

Let \(A=(0,\infty)\), \(B=\mathbb R\), and \(C=\mathbb R\). Define \(f:A\to B\) by \(f(x)=x\), and define \(g:B\to C\) by \(g(y)=y^2\). Here \(f\) is injective and \(\operatorname{ran}(f)=(0,\infty)\). Although \(g\) is not injective on \(\mathbb R\), its restriction to \((0,\infty)\) is injective. Indeed, if \(y_1,y_2>0\) and \(y_1^2=y_2^2\), then $$ (y_1-y_2)(y_1+y_2)=0. $$ Since \(y_1+y_2>0\), it follows that \(y_1-y_2=0\), so \(y_1=y_2\). Therefore the criterion shows \(g\circ f\) is injective. Directly, \((g\circ f)(x)=x^2\) on the positive domain \(A\), where distinct inputs have distinct squares.

Changing the domain of the first function can change the range on which \(g\) must be tested. In the preceding example, the values of \(f\) are positive, so the collision \(g(-y)=g(y)\) for \(y>0\) does not involve two values in \(\operatorname{ran}(f)\). If instead \(f\) reached both a positive number and its negative, squaring could identify those intermediate values and the composite could fail to be injective.

Worked Example: A Collision Within the Attained Range

Let \(A=\{p,q\}\), \(B=\{u,v,w\}\), and \(C=\{0,1\}\). Define $$ f(p)=u,\qquad f(q)=v, $$ and $$ g(u)=0,\qquad g(v)=0,\qquad g(w)=1. $$ The first function is injective, and \(\operatorname{ran}(f)=\{u,v\}\). But \(g|_{\operatorname{ran}(f)}\) is not injective, since \(u\ne v\) and \(g(u)=g(v)\). Consequently, $$ (g\circ f)(p)=0=(g\circ f)(q) $$ even though \(p\ne q\), and the composite is not injective. The collision happens at the second stage: \(f\) separates \(p\) and \(q\), but \(g\) sends their distinct intermediate values to the same output.

Using the Criterion Reliably

For a proof, begin with the kind of conclusion required. If the aim is to prove the composite injective, start with two arbitrary inputs whose composite outputs are equal and work backward through the functions. If the aim is to disprove injectivity, a pair of distinct inputs with equal composite outputs is enough. The range condition tells you exactly which collisions of \(g\) can matter.

1
Check the first map: determine whether \(f\) is injective on all of \(A\).
2
Find the attained values: identify \(\operatorname{ran}(f)\subseteq B\), rather than assuming every value of \(B\) is reached.
3
Check the second map where it is used: test whether equal \(g\)-values for inputs in \(\operatorname{ran}(f)\) force those inputs to be equal.
4
Conclude for the composite: the Injectivity Criterion for a Composite says that both checks succeed exactly when \(g\circ f\) is injective.

A common overstatement is that a composite is injective only when both functions are injective on their full domains. The criterion shows the correct qualification: \(f\) must be injective, while \(g\) must be injective only on \(\operatorname{ran}(f)\). If \(f\) happens to be surjective onto \(B\), then \(\operatorname{ran}(f)=B\), so in that special case the restriction condition is exactly injectivity of \(g\) on all of \(B\). Without surjectivity, that stronger requirement need not hold.

Key takeaway. For \(f:A\to B\) and \(g:B\to C\), the composite \(g\circ f\) is injective exactly when \(f\) is injective and \(g\) is injective on the attained intermediate values \(\operatorname{ran}(f)\). The range identifies which part of the second function can affect the composite.

Check Your Understanding

  1. State the Injectivity Criterion for a Composite, including the set on which \(g\) must be injective.
  2. Why does injectivity of \(g\circ f\) imply that \(g|_{\operatorname{ran}(f)}\) is injective?
  3. Can \(g\) fail to be injective on \(B\) while \(g\circ f\) is injective? Explain what must be true of the relevant collision of \(g\).
  4. Let \(A=\{1,2\}\), \(B=\{a,b,c\}\), with \(f(1)=a\), \(f(2)=b\), \(g(a)=0\), \(g(b)=1\), and \(g(c)=0\). Is \(g\circ f\) injective? Explain using the range of \(f\).
  5. Let \(f:\mathbb R\to\mathbb R\) be \(f(x)=x^2\). What does the injectivity of the composite \(g\circ f\), if it were to hold, imply about \(f\)? Can any choice of \(g\) make this composite injective?