Let X {\displaystyle X} be a set, and let A {\displaystyle A} be a subset of X {\displaystyle X} . The characteristic function of A {\displaystyle A} is the function
taking values in the extended real number line defined by
Let 1 A : X → R {\displaystyle \mathbf {1} _{A}:X\to \mathbb {R} } denote the usual indicator function:
If one adopts the conventions that
then the indicator and characteristic functions are related by the equations
and
The subgradient of χ A ( x ) {\displaystyle \chi _{A}(x)} for a set A {\displaystyle A} is the tangent cone of that set in x {\displaystyle x} .