Class 12 Maths, Worked in Full Past papersGet updates
Chapter 1 · Relations and Functions

Exercise 1.2 · Q8: (a,b)↦(b,a)(a,b)\mapsto(b,a) is bijective

Exercise 1.2Types of functions · Exercise 1.2
The question

Let AA and BB be sets. Show that f:A×B→B×Af : A \times B \to B \times A such that f(a,b)=(b,a)f(a, b) = (b, a) is bijective function.

Exam answer

One-one: Let (a1,b1),(a2,b2)∈A×B(a_1, b_1), (a_2, b_2) \in A \times B with f(a1,b1)=f(a2,b2)f(a_1, b_1) = f(a_2, b_2)⁠. Then

(b1,a1)=(b2,a2)⇒ b1=b2 and a1=a2⇒ (a1,b1)=(a2,b2)\begin{aligned} & (b_1, a_1) = (b_2, a_2) \\ \Rightarrow\ & b_1 = b_2 \text{ and } a_1 = a_2 \\ \Rightarrow\ & (a_1, b_1) = (a_2, b_2) \end{aligned}

Thus ff is one-one.

Onto: Let (b,a)∈B×A(b, a) \in B \times A⁠. Then (a,b)∈A×B(a, b) \in A \times B and f(a,b)=(b,a)f(a, b) = (b, a)⁠. Thus ff is onto.

Hence ff is bijective.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

The function simply swaps the two entries of an ordered pair. Everything follows from one fact: two ordered pairs are equal exactly when their first entries are equal and their second entries are equal. Using it, equal outputs force equal inputs (one-one), and any pair (b,a)(b, a) in B×AB\times A comes from the pair (a,b)(a, b) in A×BA\times B (onto). Swapping twice gets you back where you started, which is the intuition for why nothing is lost or missed.

Given, to show, and the plan
Given
Arbitrary sets AA and BB⁠, and the rule f(a,b)=(b,a)f(a,b) = (b,a) for every (a,b)∈A×B(a,b)\in A\times B⁠.
To show
ff is bijective: one-one and onto.
Plan
(1) Check that ff maps A×BA\times B into B×AB\times A⁠. (2) One-one: assume f(a1,b1)=f(a2,b2)f(a_1,b_1) = f(a_2,b_2) and compare entries. (3) Onto: for an arbitrary element of B×AB\times A⁠, write down a preimage and check it. (4) Conclude, and note the inverse.

Basics you need

1Cartesian product

A×B={(a,b):a∈A, b∈B}A\times B = \{(a,b) : a\in A,\ b\in B\}⁠: first entry from AA⁠, second from BB⁠. Order matters, so A×BA\times B and B×AB\times A are usually different sets. For example, with A={1,2}A=\{1,2\}⁠, B={p}B=\{p\}⁠: A×B={(1,p),(2,p)}A\times B = \{(1,p),(2,p)\} but B×A={(p,1),(p,2)}B\times A = \{(p,1),(p,2)\}⁠. Basics: sets, ordered pairs and A × B

2Equality of ordered pairs

(x,y)=(u,v)(x, y) = (u, v) if and only if x=ux = u and y=vy = v⁠. This is the only tool the proof needs.

3One-one and onto

One-one: f(p1)=f(p2)⇒p1=p2f(p_1) = f(p_2) \Rightarrow p_1 = p_2 for all p1,p2p_1, p_2 in the domain (Definition 5). Onto: every element of the codomain is ff of something in the domain (Definition 6). Basics: one-one and onto

4Proving a "for all" statement

Because AA and BB are arbitrary sets, we cannot list elements. We name arbitrary elements (a1,b1,…a_1, b_1, \dots⁠) and argue only from the definitions. Basics: proving and disproving

Solution

  1. Check that ff maps A×BA\times B into B×AB\times A

    Take any element of the domain; it has the form (a,b)(a, b) with a∈Aa\in A and b∈Bb\in B⁠. Its image f(a,b)=(b,a)f(a,b) = (b, a) has first entry b∈Bb\in B and second entry a∈Aa\in A⁠, so (b,a)∈B×A(b,a)\in B\times A⁠. Each input pair gives exactly one output pair, so ff is a function from A×BA\times B to B×AB\times A⁠.

    The domain and codomain are different sets, so it is worth confirming that the swapped pair lands in the right one. It does, precisely because the entries are swapped: what came from BB is now first, as B×AB\times A requires.
    B×AB\times A consists of pairs whose first entry is in BB and second entry is in AA (Basic 1). Basics: sets, ordered pairs and A × B
  2. One-one: equal swapped pairs come from equal pairs

    Let (a1,b1)(a_1, b_1) and (a2,b2)(a_2, b_2) be any two elements of A×BA\times B with f(a1,b1)=f(a2,b2)f(a_1, b_1) = f(a_2, b_2)⁠. Then

    (b1,a1)=(b2,a2)⟹ b1=b2  and  a1=a2(compare entries)⟹ (a1,b1)=(a2,b2)(reassemble the pair).\begin{aligned} &(b_1, a_1) = (b_2, a_2) \\ \Longrightarrow\ &b_1 = b_2 \ \text{ and } \ a_1 = a_2 &&\text{(compare entries)}\\ \Longrightarrow\ &(a_1, b_1) = (a_2, b_2) &&\text{(reassemble the pair)}. \end{aligned}

    So equal images force equal inputs: ff is one-one.

    The input of ff is a whole pair, so "x1=x2x_1 = x_2" in the definition of one-one becomes "(a1,b1)=(a2,b2)(a_1,b_1) = (a_2,b_2)". We use the equality rule for ordered pairs twice: first to break the equal outputs into equal entries, then to reassemble those entries into equal inputs. The entries are the same; only their positions differ.
    (x,y)=(u,v)(x,y) = (u,v) if and only if x=ux=u and y=vy=v (Basic 2). One-one: equal images imply equal inputs (Definition 5).
  3. Onto: every pair in B×AB\times A is a swapped pair

    Take an arbitrary element of the codomain B×AB\times A⁠. It has the form (b,a)(b, a) with b∈Bb\in B and a∈Aa\in A⁠. Choose the input (a,b)(a, b)⁠. Since a∈Aa\in A and b∈Bb\in B⁠, this input lies in the domain A×BA\times B⁠, and

    f(a,b)=(b,a). ✓f(a, b) = (b, a). \ ✓

    So every element of B×AB\times A is the image of some element of A×BA\times B⁠: ff is onto.

    To prove onto we start from an arbitrary element of the codomain and produce a preimage. The natural guess is to swap back. We then confirm two things: the guess is in the domain (its first entry aa is in AA and its second entry bb is in BB⁠), and applying ff to it really gives the element we started with.
    Onto: for every yy in the codomain, find xx in the domain with f(x)=yf(x)=y⁠, and check that xx lies in the domain (Definition 6). Basics: one-one and onto
  4. Conclude, and see it on a small example

    ff is one-one (Step 2) and onto (Step 3), so ff is bijective.

    For a concrete picture, take A={1,2}A = \{1, 2\} and B={p,q,r}B = \{p, q, r\}⁠. Then A×BA\times B and B×AB\times A each have 2×3=62\times3 = 6 elements, and ff pairs them off one to one:

    (a,b)∈A×B(a,b)\in A\times B(1,p)(1,p)(1,q)(1,q)(1,r)(1,r)(2,p)(2,p)(2,q)(2,q)(2,r)(2,r)
    f(a,b)∈B×Af(a,b)\in B\times A(p,1)(p,1)(q,1)(q,1)(r,1)(r,1)(p,2)(p,2)(q,2)(q,2)(r,2)(r,2)

    The six outputs are all different (one-one), and they are all six elements of B×AB\times A (onto).

    The inverse is the swap in the other direction, g:B×A→A×Bg : B\times A \to A\times B⁠, g(b,a)=(a,b)g(b, a) = (a, b)⁠. Indeed g(f(a,b))=g(b,a)=(a,b)g(f(a,b)) = g(b,a) = (a,b) and f(g(b,a))=f(a,b)=(b,a)f(g(b,a)) = f(a,b) = (b,a)⁠.

    The general proof in Steps 2 and 3 covers every possible AA and BB⁠, including infinite ones; the table is only an illustration. The remark about gg gives a second way to see the result: a function that has a two-sided inverse is a bijection (Section 1.4). Swapping is undone by swapping back.
    Bijective = one-one and onto (Definition 7); a function is invertible exactly when it is bijective. Lesson: invertible functions
Result

f(a,b)=(b,a)f(a,b) = (b,a) is one-one, because (b1,a1)=(b2,a2)(b_1,a_1) = (b_2,a_2) gives a1=a2a_1 = a_2 and b1=b2b_1 = b_2⁠, so (a1,b1)=(a2,b2)(a_1,b_1) = (a_2,b_2)⁠. It is onto, because any (b,a)∈B×A(b,a)\in B\times A equals f(a,b)f(a,b) with (a,b)∈A×B(a,b)\in A\times B⁠. Hence ff is a bijective function from A×BA\times B to B×AB\times A⁠, with inverse (b,a)↦(a,b)(b,a)\mapsto(a,b)⁠.

Check it with numbers

With A={1,2}A = \{1,2\} and B={p,q,r}B = \{p,q,r\}⁠, list all 6 images of ff⁠: (p,1)(p,1)⁠, (q,1)(q,1)⁠, (r,1)(r,1)⁠, (p,2)(p,2)⁠, (q,2)(q,2)⁠, (r,2)(r,2)⁠. That is 6 distinct pairs, equal to the whole of B×AB\times A⁠, which has 3×2=63 \times 2 = 6 elements ✓. Applying ff and then the swap back to, say, (2,q)(2, q) gives (q,2)(q, 2) and then (2,q)(2, q) again ✓.

Common mistakes
  1. Treating A×BA\times B and B×AB\times A as the same set. They are different unless A=BA = B (or one of them is empty); that is why the codomain must be B×AB\times A⁠.
  2. Proving the result with a single example. AA and BB are arbitrary, so the proof must use arbitrary elements. A table for particular sets only illustrates.
  3. Mixing up which entry belongs to which set. In the onto step, the preimage of (b,a)(b,a) is (a,b)(a,b)⁠, with a∈Aa\in A first.
  4. Forgetting that the inputs are pairs. One-one must conclude (a1,b1)=(a2,b2)(a_1,b_1) = (a_2,b_2)⁠, not just one of the two entry equalities.
What to take away
  1. Equality of ordered pairs (entry by entry) is the tool for any function whose inputs or outputs are pairs.
  2. When AA and BB are arbitrary sets, prove properties with arbitrary elements, using only definitions.
  3. A function that can be undone by another function (here, swapping back) is a bijection.

Every fact used, and where it comes from

FactUsed inSource
Cartesian product A×BA\times B⁠; ∣A×B∣=∣A∣⋅∣B∣|A\times B| = |A|\cdot|B| for finite setsSteps 1, 4Class XI, Relations and Functions (Basics: sets, ordered pairs and A × B)
(x,y)=(u,v)  ⟺  x=u(x,y) = (u,v) \iff x = u and y=vy = vStep 2Definition of ordered pairs (Class XI)
Definitions of one-one, onto, bijectiveSteps 2–4Definitions 5, 6, 7, Section 1.3 (Lesson: types of functions)
A function with a two-sided inverse is bijectiveStep 4 remarkDefinition 9 and Section 1.4 (Lesson: invertible functions)
The six-pair tableStep 4, CheckBrute-force recomputed in the site's verification script
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →