First, we need to define the “symmetric difference” of two sets. This is the collection of points in one or the other set, but not in both:
So now we define an extended real-valued function by
I say that this has almost all the properties of a metric function. First of all, it’s clearly symmetric and nonnegative, so that’s two of the four right there. It also satisfies the triangle inequality. That is, for any three sets , , and in , we have the inequality
Indeed, points in are either in or not. If not, then they’re in , while if they are they’re in . Similarly, points in are either in or . That is, the symmetric difference is contained in the union of the symmetric difference and the symmetric difference . And so monotonicity tells us that
establishing the triangle inequality.
What’s missing is the assertion that if and only if . But there may be plenty of sets with measure zero, and any one of them could arise as a symmetric difference; as written, our function is not a metric. But we can fix this by changing the domain.
Let’s define a relation: if and only if . This is clearly reflexive and symmetric, and the triangle inequality above shows that it’s transitive. Thus is an equivalence relation, and we can pass to the collection of equivalence classes. That is, we consider two sets and to be “the same” if .
This trick will handle the obstruction to being a metric, but only if we can show that gives a well-defined function on these equivalence classes. That is, if and , then . But means , and similarly for . Thus we find
and so the two are equal. We define the distance between two -equivalence classes by picking a representative of each one and calculating between them.
This relation turns out to be extremely useful. That is, as we go forward we will often find things simpler if we consider two sets to be “the same” if they differ by a set of measure zero, or by a subset of such a set. We will call subsets of sets of measure zero “negligible”, since we can neglect things that only happen on such a set.