The Nodes

Indicator function

Date: 2025-11-30

Let f: {a,b,c,d} → {0,1} be a function such that it maps:
a → 1
b → 0
c → 0
d → 1

f is a 2-valued function (it maps to a set of 2 values). Such a function is called a condition, or predicate.
Conventionally, the value 1 indicates that the condition is satisfied (True), and 0 indicates it is not (False).

The notation {variable | condition} defines a set containing only the elements for which the condition is satisfied.

Let's define a new set using f:
{x | f x} 
This expression is equivalent to the set {a,d}, because f is satisfied only for a and d (as f a and f d evaluate to 1).

Links