Relations and Functions
Two sets, and a question that sounds almost too simple to deserve a whole chapter: which elements of one are linked to which elements of the other? Every relation you will ever meet — brother of, taller than, congruent to, has the same remainder as — is an answer to exactly that question, and this chapter's entire opening half is devoted to sharpening the vague word "linked" into something a proof can grip. Out of every possible link, one kind turns out to organise almost all of higher mathematics: the equivalence relation, a link that is reflexive, symmetric and transitive all at once, and that quietly slices any set into tidy, non-overlapping equivalence classes — same-remainder numbers, congruent triangles, parallel lines, all sorted into their own drawers without a single element left out or double-counted. The second half of the chapter turns from relations to their best-behaved special case, functions, and asks a sharper question still: when can a function be run backwards? A function is one-one if distinct inputs never collide into the same output, onto if every element of the target set actually gets hit, and bijective when both hold together — and it is exactly the bijective functions that possess a genuine inverse, a function that undoes them perfectly in both directions. Along the way you will meet the composition of two functions, , and discover the sobering fact that composing in the other order, , usually gives something completely different. Building on the Class XI groundwork of sets, domain, codomain and range, this chapter is where "relation" and "function" finally earn rigorous definitions you can prove things with — definitions that JEE and NEET lean on constantly, from counting equivalence relations on a three-element set to proving invertibility of a rational function on sight. Class XI gave you the vocabulary; this chapter gives you the machinery.
- A relation in a set is any subset of ; the two extremes are the empty relation () and the universal relation ().
- is reflexive if for every ; symmetric if forces ; transitive if forces .
- An equivalence relation is reflexive, symmetric and transitive together — the single most important type of relation in all of mathematics.
- Every equivalence relation on a set splits into disjoint equivalence classes , whose union is all of , with all elements inside one class mutually related and no element of one class related to any element of another.
- A function is one-one (injective) if forces , and onto (surjective) if every has some preimage in ; it is bijective if it is both.
- The composition builds a new function from to out of and ; in general .
- A function is invertible exactly when it is bijective, and the inverse, when it exists, is unique — checking only one-one or only onto is never enough to claim invertibility.
- For a finite set , a self-map is one-one exactly when it is onto — a shortcut that fails for infinite sets, where a function can be one-one but not onto (or the reverse).
- Key idea: a relation is any subset of A cross A, an equivalence relation (reflexive, symmetric, transitive together) partitions its set into disjoint equivalence classes, and among functions it is exactly the bijective ones — one-one and onto together — that are invertible, with the finite-versus-infinite distinction being the chapter's sharpest trap.
An equivalence relation (reflexive, symmetric and transitive) partitions a set into disjoint equivalence classes, and a function is invertible exactly when it is bijective (one-one and onto), a pairing that, for finite sets only, collapses into a single condition since one-one and onto become equivalent on a self-map of a finite set.
What this chapter covers
The chapter runs in two connected halves. The first half, types of relations, opens with the two trivial extremes (empty and universal relations), then builds the three defining properties — reflexive, symmetric, transitive — and assembles them into the equivalence relation, together with the equivalence classes it generates and the way those classes partition the underlying set. The second half, types of functions, revisits domain, codomain and range from Class XI just long enough to define one-one and onto precisely, combines them into bijective, and then builds the composition of two functions before asking the central question of the chapter: which functions can be inverted? The answer — a function is invertible if and only if it is bijective — is the theorem the whole chapter has been building toward, and the closing remark about finite versus infinite sets (one-one and onto coincide only on a finite self-map) is the chapter's most tested subtlety.
The core ideas
Reflexive, symmetric and transitive relations
A relation in a set is, by definition, nothing more than a subset of — membership in is the only rule there is. The two extreme cases fix the vocabulary before anything more refined is possible.
where: the empty relation relates nothing to anything (no pair satisfies its defining condition), while the universal relation relates every element of to every element of , with no exceptions. Both are called trivial relations precisely because neither one discriminates between elements the way an interesting relation should. Between these two extremes sit the three properties that matter most:
where: range over in each clause, and every implication must hold for every choice of the elements involved — a single counterexample anywhere destroys the property. Reflexivity is checked one element at a time and must never be skipped for an "obvious" or isolated element; symmetry is checked pair by pair, in both directions; transitivity is checked over chains of two pairs at a time. For the set , is reflexive (all three diagonal pairs are present) but neither symmetric ( while ) nor transitive ( but ). By contrast, on the integers is reflexive ( is divisible by ), symmetric (if then ), and transitive (if and , then is a sum of two even numbers, hence even) — all three at once, which is exactly what earns it the name equivalence relation.
Definition. A relation in a set is an equivalence relation if is reflexive, symmetric and transitive. Equivalence relations are the single most important type of relation in mathematics because they formalise the everyday idea of "essentially the same," whether that means congruent triangles, parallel lines, or integers with the same remainder on division by some fixed number.
Equivalence classes and partitions of a set
Once a relation is known to be an equivalence relation, it does something remarkable: it sorts the whole set into non-overlapping groups automatically. For the relation on , every even integer turns out to be related to , and every odd integer to , and never the two mixed — the set of even integers and the set of odd integers are disjoint, their union is all of , and all elements inside each one are mutually related. This subset is called an equivalence class.
where: , the equivalence class containing , collects every element of related to ; the second pair of statements records that the full collection of distinct classes (also written for various choices of ) covers completely and never overlaps. In the example above, and , and note for every even , since any two even numbers generate the same class. A richer illustration: on , the relation produces exactly three classes, , and — every element of falls into exactly one of the three, and the three classes are disjoint and exhaust . This reverse direction works too: starting from any partition of a set into disjoint, exhaustive subsets, defining "related" as "lying in the same subset" always produces a genuine equivalence relation — partitions and equivalence relations are two descriptions of the same underlying structure.
One-one, onto and bijective functions
Turn now from arbitrary relations to the special, well-behaved subset of relations called functions, and ask two independent questions about a function : does it ever send two different inputs to the same output, and does its output ever miss part of ?
where: a function that is not one-one is called many-one — some element of the codomain has more than one preimage. A function that is not onto has a range strictly smaller than its codomain — some element of is never hit. Definition. A function that is both one-one and onto is bijective, and only bijective functions can be paired with a true two-sided inverse. Three worked contrasts fix the ideas: , is one-one (doubling never collides) but not onto (odd numbers are never hit); , is neither one-one () nor onto (negative numbers are never hit, since a square is never negative); , is both one-one and onto, since and every real has preimage .
Composition of functions and invertibility
Given a function from to and a second function from to , feeding the output of straight into builds a single new function from to , called the composition of and .
where: the notation is read " of ," and the order matters critically — acts first, on the original input, and acts second, on 's output. For and , both mapping to , , while — genuinely different functions, since at already (). This asymmetry is the source of the chapter's most reliable trap: never assume without checking. With composition available, invertibility can be defined precisely: a function is invertible if there is a function that undoes it in both directions at once.
where: and denote the identity functions on and ( for every ), and the function , when it exists, is called the inverse of and written . The double condition matters: alone (a "left inverse") is not the same guarantee as (a "right inverse") — invertibility demands both simultaneously. NCERT states, as a working remark, that this happens exactly when is one-one and onto; the full two-directional proof is worked out below.
Two derivations of the central theorem, and the finite-set shortcut
NCERT states as a remark that a function is invertible exactly when it is one-one and onto, without walking through both directions of the argument in the main text. Because this equivalence is the single most load-bearing fact in the composition-and-invertibility section — everything from constructing an explicit inverse to disproving invertibility rests on it — the goal here is to prove both directions in full: first that invertibility forces bijectivity, and then, the more constructive direction, that bijectivity alone is enough to build an inverse from scratch.
Step 1. Assume is invertible, so there exists with and . To show is one-one, suppose for some . Apply to both sides: , which by definition of composition is . Since , this reads . So is one-one.
Step 2. To show is onto, take any and set . Since , we have , that is, . Since was arbitrary, every element of has a preimage in under , so is onto. Steps 1 and 2 together show invertible bijective.
Step 3. Conversely, assume is bijective. Define as follows: for each , onto-ness guarantees at least one with , and one-one-ness guarantees this is the only such element. So the rule the unique with genuinely defines a function — existence of the value comes from onto, uniqueness (so is well defined, not multi-valued) comes from one-one.
Step 4. Verify is a two-sided inverse. For any , is, by the definition in Step 3, the unique element that sends to — and itself is one such element, so by uniqueness , i.e. . For any , writing , the definition of says precisely , i.e. , so . Both conditions of equation hold, so is invertible. Combining both directions: is invertible if and only if is bijective, and the inverse, when it exists, is completely determined by and therefore unique.
Go deeper · Derivation B · 2 minFor a finite self-map, one-one and onto are the same property
NCERT verifies this only for the three-element set in two short worked examples, then asserts in a remark that the same equivalence holds for every finite set , contrasting it sharply with two other examples on where the two properties split apart on an infinite set. The goal here is to supply the general argument for an arbitrary finite set with elements, and to isolate exactly where finiteness gets used, so the boundary between the finite and infinite cases is understood rather than merely memorised.
Step 1. Let with , a finite number. Suppose is one-one. Consider the image . Because is one-one, distinct elements of produce distinct values of , so listing for each of the elements of produces genuinely distinct outputs — no repeats. Hence has exactly elements.
Step 2. But is, by definition, a subset of the codomain , and itself has exactly elements. A subset of a finite -element set that itself contains all elements must be the whole set — a proper subset of a finite set always has strictly fewer elements than the set itself, since removing even one element strictly reduces the count. So , meaning every element of the codomain is hit by : is onto. This proves one-one onto, for finite self-maps.
Step 3. Conversely, suppose is onto, so and the values , as ranges over , together cover all elements of . Suppose, for contradiction, that is not one-one: then some two distinct elements satisfy , so the list of outputs for contains at least one repeat. A list of values with at least one repeated entry can name at most distinct values — too few to cover all elements of , contradicting onto-ness. So must be one-one, proving onto one-one for finite self-maps.
Step 4. Both directions used only one fact about finiteness: that a subset of an -element set with exactly elements must be the entire set. This fails for infinite sets, because an infinite set can contain a proper subset that is still infinite — exactly as large in the sense that matters for this argument. Concretely, , is one-one (doubling never collides) but its image, the even numbers, is a proper subset of that is still infinite, so it is not onto (odd numbers are never hit); conversely with and for is onto (every natural number is hit) but not one-one (). Finiteness is exactly the missing ingredient, and this is, as NCERT notes, a genuine characteristic difference between finite and infinite sets.
Worked examples
Board level - testing reflexivity, symmetry and transitivity (Exercise 1.1, Q3 pattern)
Check whether the relation R defined on the set A = {1, 2, 3, 4, 5, 6} by R = {(a, b) : b = a + 1} is reflexive, symmetric or transitive.
Step 1. List the pairs directly from the rule. For , gives , all inside ; for , falls outside , so it is excluded. Hence .
Step 2. Reflexive test: we would need for every , i.e. , which is false for every real number. In particular , so fails reflexivity at once — no need to check further elements once a single failure is found.
Step 3. Symmetric test: ; is ? That would require , false. So , and is not symmetric.
Step 4. Transitive test: and ; transitivity would demand , i.e. , false. So , and is not transitive. Answer: R is neither reflexive, nor symmetric, nor transitive.
Board level - proving a linear function is bijective and finding its inverse (Exercise 1.2, Q7(i) and Example 17 pattern)
Let f : R to R be defined by f(x) = 3 - 4x. Show that f is one-one and onto, and hence find its inverse.
Step 1. One-one: assume . Then . By the definition in equation , is one-one.
Step 2. Onto: take an arbitrary (the codomain) and try to solve for : . Since is any real number, is also a well-defined real number, so a preimage exists for every . Hence is onto.
Step 3. Since is both one-one and onto, it is bijective, and by the invertibility theorem proved above, is invertible. Its inverse is exactly the rule found while proving onto-ness: , so .
Step 4. Verify both compositions: , and . Both check out. Answer: f is one-one and onto, hence invertible, with inverse f⁻¹(x) = (3 - x)/4.
Competitive level (JEE / NEET) - counting equivalence relations containing two given pairs (Example 24 pattern)
Let A = {1, 2, 3}. Find the number of equivalence relations on A that contain the pairs (1, 2) and (2, 1).
Step 1. Any equivalence relation must contain by reflexivity, regardless of anything else. Together with the two given pairs, the smallest possible candidate is . This is already a valid equivalence relation: reflexive by construction, symmetric since and are both present, and transitive vacuously — the only chain to check is with , which forces , already present.
Step 2. The only undecided pairs link to : namely . Suppose we try adding just one of these, say . Symmetry immediately forces as well. Then transitivity, applied to and , forces ; symmetry then forces too. Adding a single cross-connection between and the block forces, through the closure demanded by symmetry and transitivity, the addition of all four remaining pairs at once — there is no way to add "a little bit" of a new relationship to an equivalence relation.
Step 3. So there are exactly two possibilities: either remains in a class of its own, giving with equivalence classes and ; or all four remaining pairs get added at once, merging fully into the block and producing the universal relation , with one single class . Step 2 shows there is nothing strictly between these two, because admitting any single cross-pair forces closure to the full universal relation.
Step 4. Counting the possibilities from Steps 1 to 3 gives exactly two valid equivalence relations. Answer: there are exactly 2 equivalence relations on {1, 2, 3} containing (1, 2) and (2, 1). Timing note: budget under two minutes. The fast method is to count set partitions rather than re-deriving symmetry and transitivity closure from scratch: an equivalence relation on a finite set corresponds exactly to a partition of that set into disjoint classes, and forcing and simply forces and into the same class. What remains is only the question of where goes — its own singleton class, or merged into the block — exactly partitions, hence equivalence relations. This partition-counting shortcut is the standard technique for every "count the equivalence relations containing such-and-such pairs" question on JEE and NEET.
Common traps
The single most common slip is checking transitivity (or symmetry) only against the pairs explicitly listed, mistaking "no counterexample among the pairs I listed" for a genuine proof — a rule-based relation like needs an argument that holds for every triple, not a spot check of a few numbers. A closely related mistake is forgetting that reflexivity must hold for literally every element of , including isolated elements with no other relationships at all. Many students also believe symmetric-and-transitive together force reflexivity — and indeed, if for some , symmetry gives and transitivity then gives — but this only works for elements that already appear in some pair; an isolated element is never forced into , so symmetric-and-transitive can still fail to be reflexive overall. On the function side, students often assume an element of the codomain with two preimages breaks onto-ness — it does not; onto only demands at least one preimage per codomain element, which is exactly what "many-one but onto" describes. Composition order is another reliable trap: applies first and second, and in general. Finally, students over-apply the finite-set shortcut to infinite sets, or to a function between two finite sets of different sizes — it applies only to a self-map on one and the same finite set.
You should be able to…
- Test any given relation for reflexivity, symmetry and transitivity directly against the formal definitions in equation , checking every element or pair the definition requires, not just a sample.
- State the definition of an equivalence relation and prove a given relation satisfies all three properties in general, using an arbitrary element or triple rather than a finite check.
- Compute the equivalence classes of a given equivalence relation, and explain why they always partition the underlying set into disjoint, exhaustive groups.
- Distinguish one-one, onto and bijective functions using the formal quantifier definitions in equation , and correctly identify which property fails for a given function, with a stated reason.
- Compute the composition of two functions, evaluate it at specific points, and recognise that generally differs from .
- Prove a function is invertible by showing it is bijective, and construct its explicit inverse using the method in the first derivation.
- State and correctly apply the finite-set shortcut (one-one is onto for a self-map on a finite set), and explain, with the two standard counterexamples on , exactly why it fails on infinite sets.
- Count the number of relations or equivalence relations on a small finite set satisfying given constraints, using the partition-counting technique from the competitive worked example.
Ask the tutor: Want to work through proving a trickier relation is an equivalence relation, or counting equivalence relations on a four-element set, step by step together?
What exactly makes an equivalence relation more special than just being reflexive, symmetric and transitive on their own?
Any one of the three properties alone tells you very little — a relation can be purely reflexive and do almost nothing interesting. What makes the combination special is that reflexive, symmetric and transitive together are exactly the conditions needed to guarantee the relation sorts the whole set into clean, non-overlapping groups (the equivalence classes), with every element belonging to exactly one group and every pair of elements inside a group genuinely related to each other. Drop any one property and the sorting breaks: without transitivity, elements can be "locally" related without the groups closing up consistently; without symmetry, "related to" stops meaning the same thing in both directions; without reflexivity, an element might not even belong to its own group.
Why is R = {(a, b) : a is less than or equal to b} on the real numbers not an equivalence relation, even though it is reflexive and transitive?
It fails symmetry, and that single failure is enough to disqualify it. Reflexivity holds ( for every real ), and transitivity holds ( and together force ), but symmetry demands that force as well — which is false whenever and are different (for instance is true, but is false). A relation needs all three properties simultaneously to be called an equivalence relation; being "mostly there," with two out of three, is not enough, and this exact relation is the standard example used to show reflexive-and-transitive does not imply symmetric.
Why does g composed with f generally differ from f composed with g, even when both make sense?
Because composition is about the order of two separate transformations, and most pairs of transformations genuinely do not commute. means "first apply to , then apply to that result," while means the reverse order — first , then . For and , takes the cosine first and squares afterward, while squares first and takes the cosine of that — completely different formulas, confirmed numerically at where but . Only in special cases, such as when , does the order stop mattering in the relevant sense (both compositions then become identity functions, though even that equality is on different domains in general).
Why do I need to check both one-one and onto before calling a function invertible? Isn't finding a formula for the inverse enough?
Because an algebraic manipulation that looks like it produces an "inverse formula" can silently hide a failure of one-one or onto, and the resulting formula will not actually satisfy both composition conditions in equation . For example, solving for gives , which looks like an inverse formula, but on all of is not one-one (both and give ), so cannot recover the original input in general — it silently throws away the negative branch. The theorem proved above is precise: invertibility requires both properties together, because one-one guarantees the candidate inverse is well defined (no ambiguity about which preimage to return) and onto guarantees it is defined everywhere on the target set (no gaps). Skipping either check can produce a rule that works for some inputs but is not a genuine two-sided inverse.
Does one-one implies onto really fail for every function on an infinite set, or just some functions?
Just some functions — the finite-set shortcut is not "always false on infinite sets," it is simply "not automatic" on infinite sets, and both outcomes remain possible. The identity function , , is one-one and onto simultaneously, exactly as it would be on a finite set — infinite sets are not forbidden from having nice bijective self-maps. What changes on an infinite set is only that one-one no longer guarantees onto, and onto no longer guarantees one-one: counterexamples become possible where none existed before, as shown by (one-one, not onto) and the shifted function , for (onto, not one-one). So on an infinite set, both properties must always be checked independently and explicitly, using the full definitions in equation , rather than inferred from each other.