{empty, add(empty, n1), add(add(empty, n1), n2) , ...
add( ... add(add(empty, n1), n2) ... , np) , ... }
with the ordering n1 < n2 < ... < np
constitutes a set of canonical terms we must first demonstrate that each such
term belongs to a different equivalence class. This result follows
immediately by observing first that no two terms of this set can be proved
to be equivalent as a result of the axioms. We must next show that
any reduced set expression s is equivalent to
one of these canonical forms.
Given a general set expression s of the form
Identical values will be brought together which can then be removed using the THEN clause of axiom (5). This idea is explained further in the next section when we discuss the use of hidden operations.
We have shown that any reduced expression is equivalent to a term in our proposed set of canonical terms. However, to prove that our set of terms is indeed a canonical set, we must now show that any set term s can be reduced to one of the proposed canonical forms. Just as with the stack example, we prove this result using structural induction.
Theorem : all well-formed set expressions s
set
can be reduced to one of
the forms
where e1 < e2 < ... < ek < em.
Base Case : From our stated theorem, the base case when s has the value empty, corresponding to an expression of length 1, is true. (For this example, empty is the only nullary constructor).
Hypothesis : Suppose that any given set expression s of length n can be reduced to
What we must
do now is show that the above theorem also holds for all
set expressions obtained from s of length (n+1), that is for the terms
add(s, en) and delete(s, en), (en
nat