binary relations
Functions as Relations
You should know: relations, cartesian products
Overview
A function f: X → Y can be defined set-theoretically as nothing more than a special binary relation on X × Y: a set of ordered pairs (x, y) that satisfies two extra constraints beyond being a relation. First, it must be total — every x in the domain X appears as a first coordinate in some pair. Second, it must be functional (single-valued) — no x appears as the first coordinate of two different pairs. Together these say that each input is assigned exactly one output, which is the everyday meaning of 'function' recast entirely in the language of sets. This viewpoint unifies functions and relations under one framework: every function IS a relation, but most relations are not functions, since a general relation can leave inputs unassigned or assign several outputs to the same input.
Intuition
A general relation is a wiring diagram where a source node can send zero, one, or many arrows to targets, and a target can receive any number of arrows. A function is the same diagram with two extra rules imposed: every source node must send out exactly one arrow (never zero, never two) — you can think of it as a strict 'vending machine' where pressing a button always gives exactly one, well-defined item. Injectivity then says no two different buttons dispense the same item; surjectivity says every item on the shelf is dispensed by SOME button. Because a function is really just its graph — the set of (input, output) pairs — two functions with the same domain, codomain, and set of pairs are literally the same function, no matter how differently they were 'described' or computed.
Formal Definition
A relation f ⊆ X × Y is a function from X to Y, written f: X → Y, if it satisfies totality and functionality (single-valuedness). Injectivity, surjectivity, and bijectivity are then properties of this set of pairs.
Notation
| Notation | Meaning |
|---|---|
| f is a function with domain X and codomain Y | |
| The unique y with (x,y) ∈ f | |
| The set of pairs {(x, f(x)) : x ∈ X} — identical to f itself as a set | |
| The converse relation {(y,x) : (x,y) ∈ f}; a function only when f is a bijection |
Properties
Total
Single-valued (functional)
Injective
Surjective (onto)
Bijective
Example: The converse f⁻¹ is then also a function, from Y to X
Worked Examples
Check R₁: every element of X (1,2,3) appears exactly once as a first coordinate, so R₁ is total and single-valued.
Check R₂: element 1 appears as the first coordinate of two pairs, (1,a) and (1,b), so R₂ is not single-valued. Also 3 never appears, so it also fails totality.
Answer: R₁ is a function X → Y; R₂ is not (it fails single-valuedness and totality).
Practice Problems
Explain why the relation R = {(x,y) ∈ ℝ×ℝ : x² + y² = 1} (the unit circle) is NOT a function from ℝ to ℝ.
Which extra condition turns a general binary relation R ⊆ X × Y into a function?
A shipping system assigns each of 500 packages to exactly one of 500 lockers, with no locker holding two packages and no locker left empty. As a relation on Packages × Lockers, what kind of function is this, and why does its converse relation also define a function?
Quiz
Summary
- A function f: X → Y is a binary relation on X × Y satisfying totality (every x has some y) and single-valuedness (each x has at most one y).
- Every function is a relation, but most relations are not functions — they can leave inputs unassigned or assign multiple outputs.
- Injective, surjective, and bijective are properties of the function's underlying set of ordered pairs (its graph).
- The converse of a relation is a function again exactly when the original function is a bijection.
References
- WebsiteWikipedia — Binary relation
Mathematics