One frequently encounters inductive —or, as they are increasingly frequently called, recursive —definitions of sets. This starts like this: Suppose that we start with the alphabet {0, 1} and want to build strings as follows: We want to include
, the empty string. We also want the rule or operation that asks us to include 0 A 1 if we know that the string A is included. So, some strings we might include are
, 01, 0011 and 001. The first was included outright, while the second and third are justified by the rule, via the presence of
and 01, respectively. The last one would be legitimate if we knew that 0 was included. But is it? That is not a fair question. It becomes fair if we consider the smallest—with respect to inclusion ⊆—set of strings that we can build, by including
and repeatedly applying the rule. Then it can be proved that neither 0 nor 001 can be included in this smallest set.
There are several examples in mathematics and theoretical computer science of “smallest” sets defined from some start-up objects via a set of operations or rules whose application on existing objects yields new ones to include. Another one is the set of terms, formulae and proofs of logic. Further down we will encounter more examples such as the set of partial recursive and primitive recursive functions. But why look that far: Perhaps the simplest such smallest set built from initial objects and the application of operations is
, as we have noted already: the initial object is 0 and the operation is “ + 1”, the successor function.
The purpose of this section is to offer some unifying definitions and discuss their connection to each other.
1.6.0.5 Definition. (Operations) An n -ary operation or rule is a (binary) relation R such that whenever aRb , then a is an n -tuple. We will write R ( a 1 , …, a n , b ) rather than R (〈 a 1 , …, a n 〉, b ) or 〈 a 1 , …, a n 〉 Rb. We will call the sequence of objects a 1 , …, a n inputs, and the object b an output , or a result of R applied to the listed inputs.
It is not required that the relation be single-valued in its outputs.
1.6.0.6 Definition. (Derivations) Given a set of objects,
—the initial objects—and a set of operations
. An (
,
)-derivation, or just derivation if the context makes clear which
and
we have in mind, is a finite sequence of objects, a 1 , …, a n such that every a i is one of
(1) a member of
(2) a result of some k -ary operation, from the set
, applied on k inputs among the a j that appear before a i in the sequence —i.e., j < i for all such inputs a j .
We call the number n the length of the derivation.
Since the legitimacy of any a i in a derivation never depends on a a k with k > i , it is clear that if a 1 , …, a r , …, a n is a derivation, then so is a 1 , …, a r .
Note also that nowhere does the definition ask that the a i be distinct. Indeed, once an a i is placed as the i -th element, for the first time, it can be placed again thereafter—as a j = a i , with j > i —any number of times we wish. The same reason of legitimacy that applied originally to a i still applies to all the additional placements a j .
1.6.0.7 Example. Let
= {0} and
contain just the relation (given in atomic formula form) x +1 = y , with y being the output variable. Then the reader can readily verify that the sequences
0,0,1,2,2,2,3,0,0,4
and
0,1,2,3,4
are derivations.
1.6.0.8 Example. Let
= {0} and
contain just the relation (given in atomic formula form) x + 1 = y , this time x being the output variable. Then the reader can readily verify that the sequences
0,0, −1, −2, −2, −2, −3,0,0, −4
and
0, −1, −2, −3, −4, −5, −6
are derivations.
1.6.0.9 Definition. A set S is built by steps from a set of initial objects,
, and a set of operations
as follows: S = { a : a appears in some (
,
)-derivation}.
If S is a set built by steps, then we can prove properties of its members by induction on the lengths of their derivations.
1.6.0.10 Example. Given the alphabet {0, 1}. Let
= {
}, while
contains just the operation on strings 0 x 1 = y — x being the input and y the output variables. We will show that the set S built by steps from the given pair (
,
) is {0 n 1 n : n ≥ 0}, where, for any string A , and n > 0, A n means
while A 0 means
.
We have two directions to establish set equality:
⊆. For any a
S we do induction on its derivation length to show a = 0 m 1 m for some m. If the length is 1, then it can only contain
(initial object). Thus a = 0 0 1 0 . We take as I.H. the truth of the claim when a is in a derivation of length > n.
For the I.H., suppose that a has a derivation, a 1 , …, a n .
If a = a i with i < n , then since a 1 , … a i is a shorter derivation, we are done by the I.H. If a = a n we have two cases: One, a is initial. This has already been dealt with. Two, a = 0 a i 1, for some i < n .
By the I.H. a i = 0 m 1 m . Thus, a has the same form.
⊇. For any n ≥ 0 we prove that 0 n 1 n must appear in some derivation. This is done by (simple) induction on n. For n = 0 (basis) 0 n 1 n =
; in S. Fix an n and assume that 0 n 1 n
S (this is the I.H.)
For the I.S. note that 0 n +1 1 n +1 \= 00 n 1 n 1. The I.H. guarantees a derivation exists in which 0 n 1 n occurs. Without loss of generality (see remark following 1.6.0.6 ) the derivation has the form a 1 , a 2 , …, 0 n 1 n . This can be extended to the derivation a 1 , a 2 , …, 0 n 1 n , 00 n 1 n 1, hence 00 n 1 n
S.
1.6.0.11 Definition. A set S is closed under an n - ary operation iff, for every n -tuple of inputs chosen from S , all the results that the operation produces are also in S.
For example,
is closed under x + y = z ( z is output), x × y = z ( z is output), but not under x − y = z ( z is output). For example, 0 − 1 = −1 ∉
.
1.6.0.12 Definition. (Closure) Given a set of initial objects,
, and a set of operations,
. A set S is called the closure of
under
—in symbols S = Cl(
,
)—iff it is the smallest set that contains
as a subset and is closed under all of the operations of
.
A set such as C1(
,
) is also called recursively or inductively defined from the initial objects I and rules
.
Note that “smallest” means ⊆-smallest, that is, if a set T contains
and is closed under
, then S ⊆ T. This attribute, smallest, directly leads to the technique of (structural) induction over C1(
,
):
Structural Induction: Let S = C1(
,
) and
( x ) be a property (formula). To show that all a
S have the property, do the following:
(1) Prove
( a ) for all a
.
(2) Prove that the property propagates with every R
, that is, whenever the inputs of R have the property, then so does the output.
The part “the inputs of R have the property” above is the I.H. for R. There will be one I.H. for each R
. The I.S. for the R in question is to prove that, based on the I.H., the output has the property—i.e., the property propagates from the input side to the output side of the “black box” R.
Why “structural”? Because the induction is with respect to how the set was built.
The process (1)–(2) is (structural) induction over S , or induction with respect to S.
1.6.0.13 Theorem. Structural Induction works: That is, if (1) and (2) above are indeed proved, then, for all a
S ,
( a ) holds.
Proof. Let
= { a :
( a ) holds}. Now (1) translates into
⊆
, while, by (2), for any R
, whenever all the inputs of R are in
[i.e., they all satisfy
( x )], then so is the output, that is,
is closed under all the operations of
. By the “smallest” property of S ( 1.6.0.12 ), we have S ⊆
, that is, for all a
S ,
( a ) holds.
It turns out that not all properties
( x ) lead to sets { x :
( x )}—some such collections are “too big” to be, technically , “sets”(cf. Section 1.3 ).
Our proof above was within Cantor’s informal or naïve set theory that glosses over such small print. However, formal set theory, that is meant to save us from our naïveté, upholds the “principle” of structural induction, (1)–(2), albeit using a slightly more complicated proof. Cf. Tourlakis (2003b).
1.6.0.14 Theorem. Given a set of initial objects ,
, and a set of operations ,
. The two sets: S —built by steps ( 1.6.0.9 ) from
and
— and C1(
,
) are equal.
Proof. For ⊆ we do induction on derivation length of a
S. If the length equals 1, then a
. Since
⊆ C1(
,
) by 1.6.0.12 , the basis is settled. Assume next (I.H.) that for all k < n , if a occurs in a derivation of length k , then a is in the closure.
I.S.: Let a occur in a derivation of length n. If it does not occur at the right end, then the I.H. kicks in and a is in the closure. So let a be the last object in the derivation. If it is initial, we have nothing to add to what we said for the basis. Suppose instead that a is the result of an operation from
that was applied on inputs a j 1 , …, a j r that appeared to the left of a in the derivation. By the I.H. all the a j m are in the closure. The later being closed under all operations from
we conclude that the result of the operation, a , is in the closure.
For ⊇ we do induction over C1(
,
): For the basis, if a
then a
S via a derivation of length 1. We now show that the property “ a
S ” propagates with every R
. To unclutter exposition, and without loss of generality, fix an R —and pretend without loss of generality that its arity is 3—and let its inputs a , b , c be all in S. Let R ( a , b , c , d ). We want d
S.
Well, by I.H. there are three derivations …, a , …; …, b , …; and …, c , … If we concatenate them into one sequence
…, a , …, …, b , …, …, c , …
we have a derivation (why?). Due to the way d is obtained, so is
…, a , …, …, b , …, …, c , …, d
But then d
S by the way S is obtained.
1.6.0.15 Remark. The above is a significant theorem: If we want to prove properties of C1(
,
) as a whole, the best idea is to do structural induction over the set. If on the other hand we want to prove that some a is a member of C1(
,
), then the best idea is to provide a derivation for it.
Compare: If we want to prove a property of all theorems of a theory, then we do induction over the theory that is built using 1.1.1.34 (and 1.1.1.38 ). If on the other hand we want to verify that a formula is a theorem, then we produce a proof for it. Evidently, by 1.6.0.14 we have that the iterative definition of “theorem” in 1.1.1.34 is equivalent with the inductive one: The set of all theorems is C1(
,
) where
is the adopted set of axioms and
is the adopted rules of inference. Cf. also 1.6.0.17 below.
Note that since b appears in a derivation iff it is either initial or a result of some R
![]()
applied on prior members of the derivation —and the latter is tantamount to saying “members of C1 (
,
)” because of 1.6.0.14 —we have the following very useful “membership test”:
b
C1(
,
) iff b
![]()
or b is the result of some rule applied to members of C1(
,
).
In words, the theorem says that the inductive approach—forming the closure—and the iterative approach, building one element at a time via a derivation, yield the same result.
1.6.0.16 Example. Let
= {3} and
consist of just x + y = z and x – y = z , where in both cases z is the output variable. We are thinking of
as our reference set here. Let us see why we have
For the ⊆ we do, of course, induction over C1(
,
). Well,
contains just 3, and 3 = 3 × 1, hence is in the right hand side (rhs) of (1).
Let us see that membership to the right propagates with the two rules: So let a and b be in the rhs. Then a = 3 m and b = 3 r for some m, r in
. Trivially, each of a + b and a − b is a multiple of 3.
As for ⊇, let a be in the rhs, that is, a = 3 k for some k
Z.
Case 1. k ≥ 0. Let us do induction on k ≥ 0 to show that 3 k in the left hand side (lhs). Well, if k = 0, then we are done by the derivation 3, 0 (why is this a derivation?).
Take as I.H. the truth of the claim for (fixed) k and go to k + 1. Given that 3( k + 1) = 3 k + 3, we are done by the I.H. and since the lhs is closed under x + y = z (of course, 3 is in lhs).
Case 2. k < 0. Well, 0
C1(
,
): indeed, apply x − y = z to input 3, 3. But then 3 k
C1(
,
) as well, since 3 k = 0 − 3(− k ); now apply the same rule on inputs 0 and 3 (− k ) with the help of Case 1 .
1.6.0.17 Example. Let us work within arithmetic (simply for the sake of having a fixed alphabet of symbols). We take as
the set of all logical axioms ( 1.1.1.38 ), and these two rules form
:
and
That is, our familiar MP and Gen. So, what is C1(
,
)? But of course—immediately from 1.6.0.14 —it is the set of all absolute theorems (provable without nonlogical axioms) that we can prove if we employ as our only rules Gen and MP (cf. 1.1.1.34 ).
By induction over this C1(
,
)—or as logicians prefer to say, by induction on theorems —we can prove the soundness of this proof system: That every theorem, i.e., member of C1(
,
), is true.
Well, the claim holds for
as we already know ( 1.1.1.39 ).
We only need to show that the claim propagates with the two rules above: Indeed, the MP is a special case of tautological implication, and Gen preserves truth by 1.1.1.15 .
In 1.1.1.34 we adopted all tautological implications—not just MP—as rules. This was expedient. It suffices to include just one such implication: MP. The interested reader can see why in Tourlakis (2008, 2003a).
Both examples 1.6.0.7 and 1.6.0.16 employ rules that are functions (single valued). Example 1.6.0.17 on the other hand has a rule that is not a function:
input:
; output: (∀ x )
since for each of the infinitely many choices of x we have a different output (why “infinitely many”?)
A more crucial—and troublesome—observation is this: In 1.6.0.7 every member of the closure has a unique immediate predecessor. Not so in Examples 1.6.0.16 and 1.6.0.17 . In the former, 12 could be 15 – 3 or 6 + 6 or 9 + 3. Indeed, 3 is both initial, and something that can be (re)built: 6 – 3, for example. In the latter example, if
,
→
yield
so do infinitely many pairs
,
→
for all possible choices of
. This phenomenon is called ambiguity.
1.6.0.18 Definition. (Ambiguity) A pair
,
is ambiguous if one or more of the following hold. Otherwise it is unambiguous.
(1) For some a
C1(
,
) and some n -ary rule R
, there are 〈 p 1 , …, p n 〉 ≠ 〈 q 1 , …, q n 〉 such that R ( p 1 , …, p n , a ) and R ( q 1 , …, q n , a );
(2) For some a
C1(
,
) and two distinct n -ary and m -ary rules R and Q in
, there are 〈 p 1 , …, p n 〉 and 〈 q 1 , …, q m 〉 such that R ( p 1 , …, p n , a ) and Q ( q 1 , …, q m , a );
(3) For some element a
, there is an n -ary rule R
, and a tuple 〈 p 1 , …, p n 〉 such that R ( p 1 , …, p n , a ).
If a
C1(
,
) and R ( p 1 , …, p n , a ) holds for some R
, we will call 〈 p 1 , …, p n 〉 a vector (or sequence) of immediate predecessors of a. For short, i.p.
1.6.0.19 Example. Here is why ambiguity is trouble. Let us start with the alphabet of symbols A = {1, 2, 3, +, ×}. We will inductively define a restricted set of arithmetic expressions (for example, we employ no variables) as follows. Let
= {1, 2, 3} and let
consist of just two string operations:
Some examples are 1 + 1, 2 × 1 and, more interestingly, 1 + 2 × 3. What do these strings mean ? Let us assign the “natural” meaning: “1” means 1, “2” means 2, and “3” means 3. “+” means add (plus) and “×” means multiply. Thus, extending this to an arbitrary member of C1(
,
) we will opt for the natural approach: As C1(
,
) is defined inductively itself, why not effect a recursive definition of meaning via a function “EV” (for “evaluate”), which will compute the value of a member A of C1(
,
) by calling itself recursively on A’s i.p .
Therefore, we define (if you will, we program ) EV by:
EV (1) = 1
EV (2) = 2
EV (3) = 3
EV ( X + Y ) = EV ( X ) + EV ( Y )
EV ( X × Y ) = EV ( X ) × EV ( Y )
So what is the value (meaning) of 1 + 2 × 3? Well,
EV (1 + 2 × 3) = EV (1 + 2) × EV (3)
=
EV (1) + EV (2)
× 3
=
1 + 2
× 3
= 9
No, no, you say. It is
EV (1 + 2 × 3) = EV (1) + EV (2 × 3)
= EV (1) +
EV (2) × EV (3)
= 1 +
2 × 3
= 7
We are both “right”, of course. The pair
,
is ambiguous; in particular, the string 1 + 2 × 3 has two i.p.:
1 + 2, 3
on which the first computation is based, and
1, 2 × 3
on which we based the second computation.
While we are on the subject of closures, let us look at the very important transitive closure of a relation.
1.6.0.20 Definition. (Transitive Closure) The transitive closure of a relation R is the smallest (in the sense of inclusion, ⊆) transitive relation that includes R, that is, if Q is a transitive closure of R, then we must have
(1) R ⊆ Q
(2) Q is transitive, and
(3) If T is transitive and R ⊆ T, then Q ⊆ T .
(1) While we have no a priori reason to expect that transitive closures exist just by virtue of us coining this term, we can say one thing:
A relation R cannot have more than one transitive closure. Indeed, if Q and Q ′ are both transitive closures of R , then having Q ′ pose as “T” we get Q ⊆ Q ′. Next, having Q so pose, we have Q ′ ⊆ Q . Thus, Q = Q ′.
(2) Intuitively, we can imagine the (we can now say “the” ) transitive closure of a relation R as the relation that we get from R by step-by-step adding pairs
a , c
to the relation that we have built so far, as long as, for some b ,
a , b
and
b , c
are already included. We stop this process of adding pairs as soon as we obtain a transitive relation via this process. This observation is made precise below.
1.6.0.21 Theorem. For any relation R, its unique transitive closure exists and equals C1(
,
), where
= R — a set of ordered pairs — and
contains just one operation on pairs that, for any two input pairs
a , b
and
b , c
(note the common b), the operation produces the pair
a , c
.
We will denote the transitive closure of R by R + .
Proof . We show that C1(
,
) satisfies (1)–(2) of 1.6.0.20 , which will confirm that R + = C1(
,
). For (1), we are done by the property
⊆ C1(
,
) of any closure. For (2) we are done since C1(
,
) is closed under the operation in
: If
a , b
and
b , c
are in C1(
,
), then so is
a , c
.
For (3), let T be transitive and R ⊆ T . We want to show that C1(
,
) ⊆ T . Well, both T and C1(
,
) are supersets of R and are closed under the operation “if
a , b
and
b , c
are included, then so is
a , c
”. But, as a closure, C1(
,
) is ⊆-smallest with these two properties, therefore C1(
,
) ⊆ T as needed.
1.6.0.22 Corollary. For any relation R, its transitive closure R + is equal to
n ≥1 R n .
We also may write
Proof . Let us set
and prove that Q = C1(
,
), where
,
are as in 1.6.0.21 .
For Q ⊆ C1(
,
) it suffices to prove that R n ⊆ C1(
,
), for n ≥ 1, by induction on n : For n = 1, a R 1 b means a R b thus
a , b
C1(
,
) since R =
. Taking the obvious I.H. for n we next let a R n + 1 b . This means that for some c we have a R c and c R n b . By the basis and I.H. respectively we have
a , c
and
c , b
in C1(
,
), hence
a , b
is in C1(
,
) (transitivity).
For Q ⊇ C1(
,
) we do induction on the closure. Since
= R ⊆ Q, we only need show that Q is transitive. Let then a Q c and c Q b, hence, for some m and n , a R m c and c R n b . Therefore a R m ∘ R n b and thus a R m + n b by Exercise 1.8.42 . Thus a Q b .
1.6.0.23 Remark. (1) Thus, we have a R + b iff, for some n , a R n b iff, for some sequence
a 0 ,..., a n
where a 0 = a and a n = b, we have
a i R a i +1 , for i = 0,1 ,..., n − 1
The notation below is also common.
a R + b iff, for some a j , it is a R a 1 R a 2 R a 3 ... a j R a j +1 ... a n − 2 R a n −1 R b
(2) If R is on A , then its reflexive transitive closure is denoted by R* and is defined by 1 A ∪ R + . That is, a R * b iff a = b or a R + b .