# Contour set

In mathematics, contour sets generalize and formalize the everyday notions of
* everything superior to something
* everything superior or equivalent to something
* everything inferior to something
* everything inferior or equivalent to something.

## Formal definitions

Given a relation on pairs of elements of set $X$
    $\succcurlyeq ~\subseteq ~X^{2}$
and an element $x$ of $X$
    $x\in X$
The upper contour set of $x$ is the set of all $y$ that are related to $x$:
    $\left\{y~\backepsilon ~y\succcurlyeq x\right\}$
The lower contour set of $x$ is the set of all $y$ such that $x$ is related to them:
    $\left\{y~\backepsilon ~x\succcurlyeq y\right\}$
The strict upper contour set of $x$ is the set of all $y$ that are related to $x$ without $x$ being in this way related to any of them:
    $\left\{y~\backepsilon ~(y\succcurlyeq x)\land \lnot (x\succcurlyeq y)\right\}$
The strict lower contour set of $x$ is the set of all $y$ such that $x$ is related to them without any of them being in this way related to $x$:
    $\left\{y~\backepsilon ~(x\succcurlyeq y)\land \lnot (y\succcurlyeq x)\right\}$
The formal expressions of the last two may be simplified if we have defined
    $\succ ~=~\left\{\left(a,b\right)~\backepsilon ~\left(a\succcurlyeq b\right)\land \lnot (b\succcurlyeq a)\right\}$
so that $a$ is related to $b$ but $b$ is not related to $a$, in which case the strict upper contour set of $x$ is
    $\left\{y~\backepsilon ~y\succ x\right\}$
and the strict lower contour set of $x$ is
    $\left\{y~\backepsilon ~x\succ y\right\}$

### Contour sets of a function

In the case of a function $f$ considered in terms of relation $\triangleright$, reference to the contour sets of the function is implicitly to the contour sets of the implied relation
    $(a\succcurlyeq b)~\Leftarrow ~[f(a)\triangleright f(b)]$

## Examples
### Arithmetic

Consider a real number $x$, and the relation $\geq$. Then
* the upper contour set of $x$ would be the set of numbers that were greater than or equal to $x$,
* the strict upper contour set of $x$ would be the set of numbers that were greater than $x$,
* the lower contour set of $x$ would be the set of numbers that were less than or equal to $x$, and
* the strict lower contour set of $x$ would be the set of numbers that were less than $x$.
Consider, more generally, the relation
    $(a\succcurlyeq b)~\Leftarrow ~[f(a)\geq f(b)]$
Then
* the upper contour set of $x$ would be the set of all $y$ such that $f(y)\geq f(x)$,
* the strict upper contour set of $x$ would be the set of all $y$ such that $f(y)>f(x)$,
* the lower contour set of $x$ would be the set of all $y$ such that $f(x)\geq f(y)$, and
* the strict lower contour set of $x$ would be the set of all $y$ such that $f(x)>f(y)$.
It would be technically possible to define contour sets in terms of the relation
    $(a\succcurlyeq b)~\Leftarrow ~[f(a)\leq f(b)]$
though such definitions would tend to confound ready understanding.
In the case of a real-valued function $f$ (whose arguments might or might not be themselves real numbers), reference to the contour sets of the function is implicitly to the contour sets of the relation
    $(a\succcurlyeq b)~\Leftarrow ~[f(a)\geq f(b)]$
Note that the arguments to $f$ might be vectors, and that the notation used might instead be
    $[(a_{1},a_{2},\ldots )\succcurlyeq (b_{1},b_{2},\ldots )]~\Leftarrow ~[f(a_{1},a_{2},\ldots )\geq f(b_{1},b_{2},\ldots )]$

### Economics

In economics, the set $X$ could be interpreted as a set of goods and services or of possible outcomes, the relation $\succ$ as strict preference, and the relationship $\succcurlyeq$ as weak preference. Then
* the upper contour set, or better set, of $x$ would be the set of all goods, services, or outcomes that were at least as desired as $x$,
* the strict upper contour set of $x$ would be the set of all goods, services, or outcomes that were more desired than $x$,
* the lower contour set, or worse set, of $x$ would be the set of all goods, services, or outcomes that were no more desired than $x$, and
* the strict lower contour set of $x$ would be the set of all goods, services, or outcomes that were less desired than $x$.
Such preferences might be captured by a utility function $u$, in which case
* the upper contour set of $x$ would be the set of all $y$ such that $u(y)\geq u(x)$,
* the strict upper contour set of $x$ would be the set of all $y$ such that $u(y)>u(x)$,
* the lower contour set of $x$ would be the set of all $y$ such that $u(x)\geq u(y)$, and
* the strict lower contour set of $x$ would be the set of all $y$ such that $u(x)>u(y)$.

## Complementarity

On the assumption that $\succcurlyeq$ is a total ordering of $X$, the complement of the upper contour set is the strict lower contour set.
    $X^{2}\backslash \left\{y~\backepsilon ~y\succcurlyeq x\right\}=\left\{y~\backepsilon ~x\succ y\right\}$
    $X^{2}\backslash \left\{y~\backepsilon ~x\succ y\right\}=\left\{y~\backepsilon ~y\succcurlyeq x\right\}$
and the complement of the strict upper contour set is the lower contour set.
    $X^{2}\backslash \left\{y~\backepsilon ~y\succ x\right\}=\left\{y~\backepsilon ~x\succcurlyeq y\right\}$
    $X^{2}\backslash \left\{y~\backepsilon ~x\succcurlyeq y\right\}=\left\{y~\backepsilon ~y\succ x\right\}$