# Well-defined expression

(Redirected from Well-defined)

In mathematics, a well-defined expression or unambiguous expression is an expression whose definition assigns it a unique interpretation or value. Otherwise, the expression is said to be not well defined, ill defined or ambiguous.[1] A function is well defined if it gives the same result when the representation of the input is changed without changing the value of the input. For instance, if ${\displaystyle f}$ takes real numbers as input, and if ${\displaystyle f(0.5)}$ does not equal ${\displaystyle f(1/2)}$ then ${\displaystyle f}$ is not well defined (and thus not a function).[2] The term well-defined can also be used to indicate that a logical expression is unambiguous or uncontradictory.

A function that is not well defined is not the same as a function that is undefined. For example, if ${\displaystyle f(x)={\frac {1}{x}}}$, then even though ${\displaystyle f(0)}$ is undefined, this does not mean that the function is not well defined; rather, 0 is not in the domain of ${\displaystyle f}$.

## Example

Let ${\displaystyle A_{0},A_{1}}$ be sets, let ${\displaystyle A=A_{0}\cup A_{1}}$ and "define" ${\displaystyle f:A\rightarrow \{0,1\}}$ as ${\displaystyle f(a)=0}$ if ${\displaystyle a\in A_{0}}$ and ${\displaystyle f(a)=1}$ if ${\displaystyle a\in A_{1}}$.

Then ${\displaystyle f}$ is well defined if ${\displaystyle A_{0}\cap A_{1}=\emptyset \!}$. For example, if ${\displaystyle A_{0}:=\{2,4\}}$ and ${\displaystyle A_{1}:=\{3,5\}}$, then ${\displaystyle f(a)}$ would be well defined and equal to ${\displaystyle \operatorname {mod} (a,2)}$.

However, if ${\displaystyle A_{0}\cap A_{1}\neq \emptyset }$, then ${\displaystyle f}$ would not be well defined because ${\displaystyle f(a)}$ is "ambiguous" for ${\displaystyle a\in A_{0}\cap A_{1}}$. For example, if ${\displaystyle A_{0}:=\{2\}}$ and ${\displaystyle A_{1}:=\{2\}}$, then ${\displaystyle f(2)}$ would have to be both 0 and 1, which makes it ambiguous. As a result, the latter ${\displaystyle f}$ is not well defined and thus not a function.

## "Definition" as anticipation of definition

In order to avoid the quotation marks around "define" in the previous simple example, the "definition" of ${\displaystyle f}$ could be broken down into two logical steps:

1. The definition of the binary relation. In the example:
${\displaystyle f:={\bigl \{}(a,i)\mid i\in \{0,1\}\wedge a\in A_{i}{\bigr \}},}$
(which so far is nothing but a certain subset of the Cartesian product ${\displaystyle A\times \{0,1\}}$.)
2. The assertion. The binary relation ${\displaystyle f}$ is a function; in the example:
${\displaystyle f:A\rightarrow \{0,1\}.}$

While the definition in step 1 is formulated with the freedom of any definition and is certainly effective (without the need to classify it as "well defined"), the assertion in step 2 has to be proved. That is, ${\displaystyle f}$ is a function if and only if ${\displaystyle A_{0}\cap A_{1}=\emptyset }$, in which case ${\displaystyle f}$ – as a function – is well defined. On the other hand, if ${\displaystyle A_{0}\cap A_{1}\neq \emptyset }$, then for an ${\displaystyle a\in A_{0}\cap A_{1}}$, we would have that ${\displaystyle (a,0)\in f}$ and ${\displaystyle (a,1)\in f}$, which makes the binary relation ${\displaystyle f}$ not functional (as defined in Binary relation#Special types of binary relations) and thus not well defined as a function. Colloquially, the "function" ${\displaystyle f}$ is also called ambiguous at point ${\displaystyle a}$ (although there is per definitionem never an "ambiguous function"), and the original "definition" is pointless.

Despite these subtle logical problems, it is quite common to use the term definition (without apostrophes) for "definitions" of this kind, for three reasons:

1. It provides a handy shorthand of the two-step approach.
2. The relevant mathematical reasoning (i.e., step 2) is the same in both cases.
3. In mathematical texts, the assertion is "up to 100%" true.

## Independence of representative

Questions regarding the well-definedness of a function often arise when the defining equation of a function refers not only to the arguments themselves, but also to elements of the arguments, serving as representatives. This is sometimes unavoidable when the arguments are cosets and when the equation refers to coset representatives. The result of a function application must then not depend on the choice of representative.

### Functions with one argument

For example, consider the following function:

${\displaystyle {\begin{matrix}f:&\mathbb {Z} /8\mathbb {Z} &\to &\mathbb {Z} /4\mathbb {Z} \\&{\overline {n}}_{8}&\mapsto &{\overline {n}}_{4},\end{matrix}}}$

where ${\displaystyle n\in \mathbb {Z} ,m\in \{4,8\}}$ and ${\displaystyle \mathbb {Z} /m\mathbb {Z} }$ are the integers modulo m and ${\displaystyle {\overline {n}}_{m}}$ denotes the congruence class of n mod m.

N.B.: ${\displaystyle {\overline {n}}_{4}}$ is a reference to the element ${\displaystyle n\in {\overline {n}}_{8}}$, and ${\displaystyle {\overline {n}}_{8}}$ is the argument of ${\displaystyle f}$.

The function ${\displaystyle f}$ is well defined, because:

${\displaystyle n\equiv n'{\bmod {8}}\;\Leftrightarrow \;8{\text{ divides }}(n-n')\Rightarrow \;4{\text{ divides }}(n-n')\;\Leftrightarrow \;n\equiv n'{\bmod {4}}.}$

As a counter example, the converse definition:

${\displaystyle {\begin{matrix}g:&\mathbb {Z} /4\mathbb {Z} &\to &\mathbb {Z} /8\mathbb {Z} \\&{\overline {n}}_{4}&\mapsto &{\overline {n}}_{8},\end{matrix}}}$

does not lead to a well-defined function, since e.g. ${\displaystyle {\overline {1}}_{4}}$ equals ${\displaystyle {\overline {5}}_{4}}$ in ${\displaystyle \mathbb {Z} /4\mathbb {Z} }$, but the first would be mapped by ${\displaystyle g}$ to ${\displaystyle {\overline {1}}_{8}}$, while the second would be mapped to ${\displaystyle {\overline {5}}_{8}}$, and ${\displaystyle {\overline {1}}_{8}}$ and ${\displaystyle {\overline {5}}_{8}}$ are unequal in ${\displaystyle \mathbb {Z} /8\mathbb {Z} }$.

### Operations

In particular, the term well-defined is used with respect to (binary) operations on cosets. In this case, one can view the operation as a function of two variables, and the property of being well-defined is the same as that for a function. For example, addition on the integers modulo some n can be defined naturally in terms of integer addition.

${\displaystyle [a]\oplus [b]=[a+b]}$

The fact that this is well-defined follows from the fact that we can write any representative of ${\displaystyle [a]}$ as ${\displaystyle a+kn}$, where ${\displaystyle k}$ is an integer. Therefore,

${\displaystyle [a]\oplus [b]=[a+kn]\oplus [b]=[(a+kn)+b]=[(a+b)+kn]=[a+b];}$

similar holds for any representative of ${\displaystyle [b]}$, thereby making ${\displaystyle [a+b]}$ the same, irrespective of the choice of representative.

## Well-defined notation

For real numbers, the product ${\displaystyle a\times b\times c}$ is unambiguous because ${\displaystyle (a\times b)\times c=a\times (b\times c)}$; hence the notation is said to be well defined.[1] This property, also known as associativity of multiplication, guarantees the result does not depend on the sequence of multiplications; therefore, a specification of the sequence can be omitted. The subtraction operation is non-associative; despite that, there is a convention that ${\displaystyle a-b-c}$ is shorthand for ${\displaystyle (a-b)-c}$, thus it is considered "well-defined". On the other hand, Division is non-associative, and in the case of ${\displaystyle a/b/c}$, parenthesization conventions are not well established; therefore, this expression is often considered ill-defined.

Unlike with functions, notational ambiguities can be overcome by means of additional definitions (e.g., rules of precedence, associativity of the operator). For example, in the programming language C, the operator - for subtraction is left-to-right-associative, which means that a-b-c is defined as (a-b)-c, and the operator = for assignment is right-to-left-associative, which means that a=b=c is defined as a=(b=c).[3] In the programming language APL there is only one rule: from right to left – but parentheses first.

## Other uses of the term

A solution to a partial differential equation is said to be well-defined if it is continuously determined by boundary conditions as those boundary conditions are changed.[1]