Canonical: https://knowlpedia.com/measure-theory/indicator-function/

# Indicator function

A function that equals 1 on a set and 0 outside it.

An **indicator function** of a subset \(A\subseteq X\) is the function \(\mathbf 1_A:X\to\{0,1\}\) defined by \(\mathbf 1_A(x)=1\) for \(x\in A\) and \(\mathbf 1_A(x)=0\) for \(x\notin A\).

Indicator functions translate set operations into algebraic ones and are the basic building blocks of [simple functions](https://knowlpedia.com/measure-theory/simple-function/). In a [measurable space](https://knowlpedia.com/measure-theory/measurable-space/) \((X,\Sigma)\), \(\mathbf 1_A\) is [measurable](https://knowlpedia.com/measure-theory/measurable-function/) exactly when \(A\) is a [measurable set](https://knowlpedia.com/measure-theory/measurable-set/) (with \(\{0,1\}\) carrying its power-set sigma-algebra).

## Examples

- On \((\mathbb R,\mathcal B(\mathbb R))\), the indicator function \(\mathbf 1_{(0,1)}\) of the open [interval](https://knowlpedia.com/real-analysis/interval/) \((0,1)\) is measurable.
- If \(N\) is a [null set](https://knowlpedia.com/measure-theory/null-set/) in a measure space, then \(\mathbf 1_N\) equals \(0\) [almost everywhere](https://knowlpedia.com/measure-theory/almost-everywhere/).
