This example illustrates what formal proofs that a function is an injection, surjection, or bijection might look like. All the proofs concern the function
We begin by showing that \(f\) is an injection and a surjection.
Theorem 1. The function \(f\) defined by (1) is an injection.
Proof. We will prove that \(f\) is an injection by showing that \(f(a,b) = f(c,d)\) implies that \(a=b\) and \(c=d\). From the definition of \(f\), \(f(a,b) = f(c,d)\) implies the following system of equations.
Adding these equations yields
Theorem 2. Function \(f\) defined by (1) is a surjection.
Proof. We show that \(f\) is a surjection by showing that for any pair of real numbers, \((x,y)\), there is another pair \((a,b)\) such that \(f(a,b) = (x,y)\). From the definition of \(f\), this would require
We can rewrite these equations as
so that \(x - b = y + b\). We can then isolate \(b\) on one side of this equation:
Now we plug this definition of \(b\) back into one of the equations for \(a\) to get
We finish the proof by verifying that for any pair of real numbers \((x,y)\), \(f(\tfrac {x+y}{2},\tfrac {x-y}{2}) = (x,y)\):
We have now shown that every pair \((x,y)\) in the codomain of function \(f\) has a preimage under \(f\), and so \(f\) is a surjection. □
Finally, being an injection and a surjection implies that \(f\) is a bijection:
Corollary 1. Function \(f\) defined by (1) is a bijection.
Proof. That \(f\) is a bijection follows immediately from it being an injection and a surjection. □