Being a function means no input is ambiguous. Being one-to-one means no output is ambiguous either. That symmetry is the whole point, and it is what decides whether a function can be run backwards.
The Definition
A function is one-to-one if different inputs always give different outputs:
The contrapositive is the version used in proofs, and it says the same thing:
Read that as: if two inputs land on the same output, they must have been the same input all along.
The word for this in higher mathematics is injective. The two terms mean exactly the same thing.
One-to-One vs Many-to-One
Every function is one or the other.
| Type | Description | Still a function? |
|---|---|---|
| One-to-one | each output used once | Yes |
| Many-to-one | some output shared by several inputs | Yes |
| One-to-many | an input with several outputs | No — not a function at all |
That third row is worth keeping straight. “One-to-many” is not a kind of function; it is the thing the vertical line test rules out. One-to-one and many-to-one are the only two options once you already have a function.
The Horizontal Line Test
The graphical test. Sweep a horizontal line up and down the graph.
- Never crosses more than once → one-to-one.
- Crosses twice anywhere → not one-to-one.
The reasoning mirrors the vertical test. A horizontal line is the set of all points at one particular height — one particular output. If it meets the curve twice, two different inputs produce that output.
One failing line is enough. You do not need to check every height — a single horizontal line hitting twice settles it.
Order matters between the two tests: apply the vertical test first. A relation that is not a function cannot be one-to-one, because the term only applies to functions.
Which Familiar Functions Pass?
| Function | One-to-one? | Reason |
|---|---|---|
| Yes | a slanted line hits each height once | |
| No | every input gives the same output | |
| No | ||
| Yes | always increasing | |
| No | ||
| Yes | increasing on its whole domain | |
| Yes | each output comes from one input | |
| Yes | always increasing |
A useful shortcut: a function that is always increasing, or always decreasing, is automatically one-to-one. It can never come back to a height it has already used. Turning points are what break the property, which is why the parabola and absolute value fail — both double back.
Proving It Algebraically
The graph is convincing but not a proof. The algebraic method is short and always works the same way.
Method. Assume
Example — prove
Since equal outputs force equal inputs, it is one-to-one.
To prove a function is not one-to-one, a single counterexample is enough. For
That asymmetry is worth remembering. Proving yes needs a general argument; proving no needs one pair of numbers.
Restricting the Domain
A function that fails can often be repaired by throwing away part of its domain.
This is not a trick; it is standard practice. It is exactly how
Why It Matters: Inverses
Here is the payoff. Reversing a function means swapping every input and output. For the reversal to be a function, each output must have come from exactly one input — which is precisely the one-to-one condition.
Reverse
A function has an inverse function if and only if it is one-to-one. See Inverse Functions for what to do with that.
Worked Example A: From a Graph
A graph passes the vertical line test and is always rising. Is it one-to-one?
Yes. A strictly increasing function never revisits an output, so no horizontal line can cross it twice.
Worked Example B: A Proof
Prove
Worked Example C: A Counterexample
Show
Try the two values either side of the vertex at
Two inputs, one output. Not one-to-one.
Worked Example D: A Rational Function
Is
Yes. Each branch is decreasing and they occupy different output ranges, so no height is repeated.
Worked Example E: Restricting
Find a restriction making
The vertex is at
Common Mistakes to Avoid
- Using the vertical test for one-to-one. That test only decides whether it is a function.
- Applying the horizontal test before the vertical one. A non-function cannot be one-to-one.
- Thinking many-to-one means “not a function”. It is a perfectly good function.
- Confusing one-to-many with many-to-one. One-to-many is not a function at all.
- Trying to prove “not one-to-one” in general. One counterexample is sufficient and much faster.
- Checking only a couple of horizontal lines. Passing a few proves nothing; use algebra or the increasing/decreasing argument.
- Forgetting the restricted domain afterwards. Once restricted, it is a different function.
Where This Leads Next
- Inverse functions — the direct payoff, since one-to-one is the entry condition.
- Inverse trigonometric functions, all defined on restricted domains for exactly this reason.
- Logarithms, the inverse of the one-to-one exponential function.
- Bijections and injections, the formal vocabulary in later courses.
- Cryptography and hashing, where whether a mapping is reversible is the entire question.
Practice Problems
Work each one before opening the answer.
Problem 1. Is
Show answer
Yes.
Problem 2. Is
Show answer
No.
Problem 3. Is
Show answer
Yes — a cubic of this form is always increasing, so it passes the horizontal line test.
Problem 4. Is
Show answer
No.
Problem 5. Is the constant function
Show answer
No. Every input gives 6, so outputs are shared endlessly.
Problem 6. Prove
Show answer
Problem 7. Give a counterexample showing
Show answer
Problem 8. What restriction makes
Show answer
The vertex is at
Problem 9. A graph fails the horizontal line test but passes the vertical one. What can you say?
Show answer
It is a function, but many-to-one, so it has no inverse function unless the domain is restricted.
Problem 10. Does
Show answer
Yes. It is always increasing, hence one-to-one. Its inverse is the logarithm.
Quick Reference
| Question | Answer |
|---|---|
| Definition | Different inputs give different outputs |
| Proof form | |
| Disproof | One counterexample pair |
| Graphical test | Horizontal line test |
| Vertical line test | Decides “is it a function” |
| Horizontal line test | Decides “is it one-to-one” |
| Always increasing/decreasing | Automatically one-to-one |
| Turning point present | Not one-to-one |
| Other name | Injective |
| Why it matters | Only these have inverse functions |
One-to-one is the condition that makes inverse functions possible. It builds on the definition of a function, and restricting the domain is the standard way to obtain it. More Algebra lessons are available.