Skip to content

Injective & Surjective

Composition of Functions – (GATE Detailed Notes)

Section titled “Composition of Functions – (GATE Detailed Notes)”

Function

A function f:ABf: A \to B maps each element of set A to exactly one element of set B.

A f B
| a ─────────▶ b |

Injective (One-to-One)

A B
| |
| a1 ─────────▶ b1 |
| a2 ─────────▶ b2 |
| a3 ─────────▶ b3 |
| |

A function f:ABf: A \to B is injective if:

f(a1)=f(a2)a1=a2f(a_1) = f(a_2) \Rightarrow a_1 = a_2

-> Different inputs give different outputs.

Surjective (Onto)

A B
| |
| a1 ─────────▶ b1 |
| a2 ─────┐ |
| └────▶ b2 |

A function f:ABf: A \to B is surjective if:
bB,aA such that f(a)=b\forall b \in B, \exists a \in A \text{ such that } f(a) = b

-> Every element of the codomain is covered.

Bijective

A function that is both injective and surjective.


Cardinality Rules for Functions (Finite Sets): Injective / Surjective / Bijective (Made by me) ⭐

Section titled “Cardinality Rules for Functions (Finite Sets): Injective / Surjective / Bijective (Made by me) ⭐”
A f B (finite sets)
| a ─────────▶ b |

Let A=m|A| = m B=n|B| = n

Necessary Conditions for Injective & Surjective Functions (Size Constraints)

1. if f is Surjective (Onto)

  • A>=B|A| >= |B| (m >= n) Reason: Surjective means f(A)=Bf(A) = B So number of distinct outputs = n
    But distinct outputs ≤ number of inputs = m
    => n ≤ m

2. if f is Injective (One-One)

  • A<=B|A| <= |B| (m <= n) Reason: Injective means all inputs give distinct outputs
    So number of distinct outputs = m
    But outputs are inside B which has size n
    => m ≤ n

3. if f is both Injective and Surjective (Bijective)

  • A=B|A| = |B| (m = n) Reason: From surjective => m >= n
    and from injective => m <= n
    So m = n

Possibility Table using Sizes of Sets (m<n, m>n, m=n) + Pigeonhole Principle

1. if A<B|A| < |B| (m < n)

  • Can not be Surjective.
    Reason: Surjective means every element of B must be hit. But A has only m elements, so f(A) has at most m images. If m < n, cannot cover all n elements of B.
  • Can or cannot be Injective.
    Reason: Injective only needs different A elements go to different B elements. Since B is larger, it is possible. (Example: A={1,2}, B={a,b,c}, f(1)=a, f(2)=b is injective)

2. if A>B|A| > |B| (m > n)

  • Can ==not be Injective.
    Reason: By
    pigeonhole principle==: more elements in A than B, so at least two elements of A must map to same element of B.
  • Can or cannot be Surjective.
    Reason: Surjective is possible if all elements of B are covered. (Example: A={1,2,3}, B={a,b}, f(1)=a, f(2)=b, f(3)=a is surjective)

3. if A=B|A| = |B| (m = n)

  • Can be Surjective. also, If surjective then injective otherwise not injective.
    Reason: For finite sets with same size, surjective ⇒ injective. If it was not injective, two A map to same B, then some B would be missed, so not surjective.
  • Can be Injective. also, If injective then surjective otherwise not surjective.
    Reason: For finite sets with same size, injective ⇒ surjective. If some b in B is not hit, then only n-1 elements are hit, impossible with injective mapping of n elements.
  • Key fact (only for finite sets):
    |A|=|B|⇒ Injective ⇔ Surjective (and both mean Bijective).

Note:

Pigeonhole Principle

  • If you put more objects than boxes, then at least one box will contain 2 or more objects.
  • Mathematically: If m > n and m items are distributed into n boxes, then some box has ≥ 2 items.
  • In functions: If |A| > |B| then f cannot be injective (two elements of A must map to same element of B).


A g B f C
| a ─────────▶ b ─────────▶ c |

If:

  • g:ABg: A \to B
  • f:BCf: B \to C

Then the composition:
(fg)(a)=f(g(a))(f \circ g)(a) = f(g(a))

is a function from A to C.

Properties of Composition ⭐

Injectivity

  • If both ( f ) and ( g ) are injective → ( fgf \circ g ) is injective
  • If (fgf \circ g ) is injective → ( g ) must be injective
  • Injectivity of ( fgf \circ g ) gives no guarantee about injectivity of ( f )

Surjectivity

  • If both ( f ) and ( g ) are surjective → ( fgf \circ g ) is surjective
  • If ( fgf \circ g ) is surjective → ( f ) must be surjective
  • Surjectivity of ( fgf \circ g ) gives no guarantee about surjectivity of ( g )

Option Analysis Pattern

When given properties of ff, gg, and fgf \circ g:

GivenResult
1fgf \circ g is injectivegg is injective
2fgf \circ g is surjectiveff is surjective
3ff and gg are injectivefgf \circ g is injective
4ff and gg are surjectivefgf \circ g is surjective
5gg and fgf \circ g are injectiveff is not necessarily Injective
6ff and fgf \circ g are surjectivegg is not necessarily Surjective

fgf \circ g is injective

  • fgf \circ g is injective ------> gg is injective
  • fgf \circ g is injective <------ ff and gg are injective

fgf \circ g is surjective

  • fgf \circ g is surjective -----> ff is surjective
  • fgf \circ g is surjective <----- ff and gg are surjective

Not Guaranteed

  • ff andfgf \circ g are surjective —X—> No guarantee about gg
  • gg andfgf \circ g are injective —X—> No guarantee about ff

Proofs: Composition Properties

  • Let gABg\:A \to B and fBCf\:B \to C.

1. fgf \circ g injective     g\implies g injective

  • Proof:
    • Suppose g(x_1)=g(x_2)g(x\_1) = g(x\_2) for x_1,x_2Ax\_1, x\_2 \in A.
    • Apply ff to both sides: f(g(x_1))=f(g(x_2)    (fg)(x_1)=(fg)(x_2)f(g(x\_1)) = f(g(x\_2) \implies (f \circ g)(x\_1) = (f \circ g)(x\_2)
    • Since (fg)(f \circ g) is injective, we must have x_1=x_2x\_1 = x\_2.
    • g is injective.\therefore g \text{ is injective.}

2. fgf \circ g surjective     f\implies f surjective

  • Proof:
    • Let cCc \in C be arbitrary.
    • Since fgf \circ g is surjective, there exists aAa \in A such that
    • (fg)(a)=c    f(g(a))=c(f \circ g)(a) = c \implies f(g(a)) = c
    • Let b=g(a)Bb = g(a) \in B. Then f(b)=cf(b) = c.
    • Since this holds for all cCc \in C,
    • f is surjective.\therefore f \text{ is surjective.}

3. ff and gg injective     \implies fgf \circ g injective

  • Proof:
    • Suppose (fg)(x_1)=(fg)(x_2)(f \circ g)(x\_1) = (f \circ g)(x\_2).
    • Then f(g(x_1))=f(g(x_2))f(g(x\_1)) = f(g(x\_2))
    • Since (f) is injective, g(x_1)=g(x_2)g(x\_1) = g(x\_2)
    • Since (g) is injective, x_1=x_2x\_1 = x\_2.
    • fg is injective.\therefore f \circ g \text{ is injective.}

4. ff and gg surjective     fg\implies f \circ g surjective

  • Proof:
    • Let cCc \in C be arbitrary.
    • Since ff is surjective, there exists bBb \in B such that f(b)=cf(b) = c.
    • Since gg is surjective, there exists aAa \in A such that g(a)=bg(a) = b.
    • Substituting: (fg)(a)=f(g(a))=f(b)=c(f \circ g)(a) = f(g(a)) = f(b) = c
    • fg is surjective.\therefore f \circ g \text{ is surjective.}

Counterexample: Clarifying “No Guarantee” Cases

1. gg and fgf \circ g injective     \implies ❌ No guarantee about ff

  • Counterexample:
    • A=1,B=a,b,C=XA = {1}, \quad B = {a, b}, \quad C = {X}
    • g(1)=a(injective)g(1) = a \quad (\text{injective}),
    • f(a)=X,f(b)=X(not injectivef(a) = X , f(b) = X \quad (\text{not injective})
    • (fg)(1)=X(injective)(f \circ g)(1) = X \quad (\text{injective})
  • Here, ff is not injective, but fgf \circ g is injective.

Note: ff only needs to be injective on the range of gg, not on all of BB.

2. ff and fgf \circ g surjective     \implies ❌ No guarantee about gg

  • Counterexample:
    • A=1,B=1,2,C=1A = {1}, \quad B = {1,2}, \quad C = {1}
    • g(1)=1(not surjective, since 2 is missed)g(1) = 1 \quad (\text{not surjective, since 2 is missed}),
    • f(1)=1f(1) = 1 , f(2)=1(surjective)f(2) = 1 \quad (\text{surjective})
    • (fg)(1)=1(surjective onto C)(f \circ g)(1) = 1 \quad (\text{surjective onto } C)
  • Here, gg is not surjective, but fgf \circ g is surjective.

Note: ff can map multiple elements of BB to the same element in CC as long as the image of gg covers CC.

Composition of Functions (f ∘ g) : Injective / Surjective Implications (Made by me ⭐)

g f
A ───▶ B ───▶ C

1. f ∘ g -> injective

  • if f ∘ g is injective then g must be injective.
    Reason: If g:A->B is not injective, then multiple elements of A can point to the same element of B.
    Then applying f on that same B gives same output in C.
    So two different elements of A will map to same element in C, hence A->C will not be injective.
    So g must be injective.
  • Injective ⇒ blame earlier function (g)

2. f ∘ g -> surjective

  • if f ∘ g is surjective then f must be surjective.
    Reason: If f:B->C is not surjective, then some elements of C are not covered by f.
    Then no matter what g does (A->B), those missing elements of C can never be reached.
    So A->C also cannot be surjective.
    Hence f must be surjective.
  • Surjective ⇒ blame later function (f)

Note:

Injectivity flows backward
Surjectivity flows forward

Common GATE Traps ⚠️

  • Confusing injective and surjective implications
  • Assuming bijection without proof
  • Ignoring codomain vs image