How to Prove That a Function Is Well Defined
At a glance
- 1. Identify domain and codomain
State precisely which objects count as inputs and which outputs are allowed.
- 2. Check existence
Show the rule produces an output in the codomain for every input.
- 3. Check uniqueness
Show that a single input cannot lead to two different outputs.
- 4. Check representatives
For equivalence classes, prove equivalent representatives give the same output.
A well-defined function gives each input in its domain exactly one output in its codomain. The main proof obligation is often straightforward when inputs have a single form, but it becomes especially important when an input can be written in multiple ways, as with a fraction or an equivalence class.
To prove well-definedness, state the domain and codomain, verify that the rule produces an allowed output for every input, and show that the output is unambiguous. For definitions involving representatives, the key test is that equivalent representatives produce the same result.
What it means for a function to be well defined
A function assigns to every element of exactly one element of . There are two parts to this condition:
- Existence: For every , the rule gives an output, and that output belongs to $B.
- Uniqueness: For each fixed , the rule does not assign two different outputs.
In many familiar formulas, the notation makes uniqueness seem automatic. For example, assigns one real number to every real input. But the domain and codomain still matter: the rule does not define a function from all real numbers to the real numbers, because it gives no output at . It does define a function from the nonzero real numbers to the real numbers.
Well-definedness is not the same as injectivity or surjectivity. A function can be well defined and still send different inputs to the same output, or fail to reach some elements of its codomain.
A practical proof method
Use the following checklist when a function is given by a formula or construction.
- Write the domain and codomain. Be precise about the permitted inputs and outputs.
- Check existence. Take an arbitrary input and confirm the rule can be applied and gives an element of the codomain.
- Check uniqueness. Confirm that the input determines a single output.
- Check alternative representations. If the same input can be represented in different ways, show the output is independent of the representation.
The fourth step is the central one for quotient sets. Suppose elements of a domain are equivalence classes. A class can have many representatives, so a rule written using a representative is valid only if choosing another representative does not change the resulting class or value.
Worked example: a function on residue classes
Define a rule on integers modulo 6 by
Here, denotes the residue class of the integer modulo 6. The same class has many representatives: for instance, . We must check that the formula gives the same output no matter which representative is used.
Take any integers and representing the same class. Then , which means that 6 divides . Now factor the difference of their squares:
Since 6 divides , it also divides . Therefore and are congruent modulo 6, so . The output class does not depend on the chosen representative, and the rule is well defined.
For the example , the outputs agree: and modulo 6. This illustrates the general proof, but checking a single pair alone would not establish well-definedness for every class.
How to show a rule is not well defined
To disprove well-definedness for a rule on equivalence classes, find two equivalent representatives that produce different outputs. One such pair is enough.
For example, consider the proposed rule from the integers modulo 2 to the integers. The representatives 0 and 2 give the same input class, because modulo 2. But the proposed outputs are 0 and 2, which are different integers. Thus the output depends on the representative, and this rule does not define a function on the residue classes.
A separate failure can occur when the rule produces a value outside the declared codomain. In that case, the rule may still define a function into a larger set, but it does not define the stated function into the smaller codomain.
Common mistakes
- Checking only a few examples. Examples can reveal a problem, but well-definedness requires a general argument for every allowed input or every equivalent pair of representatives.
- Proving injectivity instead. Showing that equal outputs imply equal inputs is a different property. Well-definedness asks whether each input has one unambiguous output.
- Ignoring the codomain. A formula may produce a unique value but still fail to land in the set specified as the codomain.
- Assuming a formula settles the issue. If a formula uses a choice of representative, you must justify that the choice does not affect the result—or explicitly define a canonical choice as part of the rule.
For an ordinary formula, a well-definedness proof often reduces to checking that it applies throughout the domain and has values in the codomain. For quotient sets and other constructions with multiple representations, compare arbitrary representatives and prove that the resulting outputs agree.
References
- Paul R. Halmos, Naive Set Theory
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.