Course contentsShow
← Mathematics
Lesson 2563 of 3,12151. Discrete Math — Sets, Relations, FunctionsFree lesson

Testing for Surjectivity

Learn methods to verify surjectivity by showing every codomain element has a preimage in the domain.

Testing for Surjectivity

You'll learn how to rigorously verify whether a function is onto by proving every codomain element has at least one preimage.

The Core Idea

Recall that a function f: A → B is surjective (onto) if every element in the codomain B is "hit" by the function—meaning every b ∈ B is f(a) for some a ∈ A.

To test for surjectivity, you need to prove:

For every y in the codomain B, there exists at least one x in the domain A such that f(x) = y.

This is an existence proof with a universal quantifier: ∀y ∈ B, ∃x ∈ A such that f(x) = y.

Common Testing Strategies

1. Direct Construction (Algebraic)

Start with an arbitrary element y from the codomain. Solve the equation f(x) = y for x. If you can always express x in terms of y (and that x is in the domain), the function is surjective.

Example: Is f: ℝ → ℝ defined by f(x) = 2x + 3 surjective?

  • Take arbitrary y ∈ ℝ
  • Solve: y = 2x + 3 → x = (y - 3)/2
  • Since (y - 3)/2 ∈ ℝ for any y, every real number is hit
  • Therefore, f is surjective ✓

2. Checking the Range

Show that range(f) = codomain. If they're equal, the function is surjective. If range(f) ⊂ codomain (proper subset), it's not surjective.

3. Counterexample for Non-Surjectivity

To prove a function is not surjective, find just one element in the codomain with no preimage.

Example: f: ℤ → ℤ where f(x) = 2x is not surjective because 1 ∈ ℤ has no integer preimage (would need x = 1/2).

Key Takeaway: To verify surjectivity, show every codomain element has a preimage—typically by solving f(x) = y and confirming x exists in the domain for all y in the codomain.