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

Testing for Injectivity

Master techniques to prove or disprove that a function is injective using definitions and horizontal line tests.

Testing for Injectivity

You'll learn how to rigorously prove whether a function is injective (one-to-one) or find counterexamples showing it's not.

Now that you understand what injective functions are—functions where different inputs always produce different outputs—it's time to master the techniques for verifying injectivity.

The Definition-Based Approach

The most rigorous method uses the formal definition directly: a function f: A → B is injective if for all x₁, x₂ ∈ A, if f(x₁) = f(x₂), then x₁ = x₂.

Strategy: Assume f(x₁) = f(x₂) and algebraically manipulate until you derive x₁ = x₂. If you succeed, the function is injective.

Example: Prove f: ℝ → ℝ defined by f(x) = 3x + 5 is injective.

Proof: Assume f(x₁) = f(x₂). Then:

  • 3x₁ + 5 = 3x₂ + 5
  • 3x₁ = 3x₂
  • x₁ = x₂ ✓

Disproving Injectivity

To show a function is not injective, find a single counterexample: two distinct inputs with the same output.

Example: Show g(x) = x² on ℝ is not injective.

Counterexample: g(2) = 4 and g(-2) = 4, but 2 ≠ -2. Not injective.

The Horizontal Line Test

For functions with visual graphs, the horizontal line test provides geometric intuition: if any horizontal line intersects the graph more than once, the function is not injective. If every horizontal line intersects at most once, it's injective.

This works because a horizontal line y = c represents all points with the same output value c.

Key Takeaway: To prove injectivity, assume f(x₁) = f(x₂) and derive x₁ = x₂ using the definition; to disprove it, find two distinct inputs producing the same output.