# Injective and surjective

An injective function never sends two different inputs to the same output. A surjective function hits every value in its target set. Both together is a bijection.

Maths (university) · Part 01: Logic, sets and proof · Card 9 of 9 · Last updated 2026-10-19

## Analogy

Seats in a cinema: injective means no two people share a seat, surjective means no seat stays empty.

## Example

**Two functions on real numbers**

f(x) = x^2: f(2) = f(-2) = 4, not injective.
No x gives f(x) = -1, not surjective.
g(x) = 2x + 1: g(x) = y gives x = (y-1)/2.
So g is injective and surjective.

## In practice

Only bijections can be reversed, so these ideas decide whether an inverse function exists.

## Practice

### Flashcards

- **Is f(x) = x^2 injective on the real numbers?** No. f(2) = f(-2) = 4, so two inputs share one output.

## Questions people ask

### How do I test whether a function is injective?

Assume f(a) = f(b) and try to show a = b. If that works, the function is injective. If you can find two different inputs with the same output, such as 2 and -2 for x squared, it is not. The graph passes the horizontal line test if injective.

### Why does a bijection have an inverse?

Each output comes from exactly one input, so you can run the function backwards without any guesswork. Surjective means every output is reachable, injective means each is reached once. For g(x) = 2x + 1, the inverse is (y - 1)/2.

Web page: https://studyvisually.com/learn/science/maths-university/maths-university-part-1/maths-university-part-1-concept-9
Study this card in the app: https://studyvisually.com/app/learn?category=maths-university&card=maths-university-part-1-concept-9
