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 Images , 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 Images , 01, 0011 and 001. The first was included outright, while the second and third are justified by the rule, via the presence of Images 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 Images 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 Images , 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.           Images

1.6.0.6 Definition. (Derivations) Given a set of objects, Images —the initial objects—and a set of operations Images . An ( Images , Images )-derivation, or just derivation if the context makes clear which Images and Images 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 Images

(2) a result of some k -ary operation, from the set Images , 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.            Images

Images   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 . Images

1.6.0.7 Example. Let Images = {0} and Images 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.           Images

1.6.0.8 Example. Let Images = {0} and Images 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.           Images

1.6.0.9 Definition. A set S is built by steps from a set of initial objects, Images , and a set of operations Images as follows: S = { a : a appears in some ( Images , Images )-derivation}.           Images

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 Images = { Images }, while Images 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 ( Images , Images ) is {0 n 1 n : n ≥ 0}, where, for any string A , and n > 0, A n means

Images

while A 0 means Images .

We have two directions to establish set equality:

⊆. For any a Images 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 Images (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 = Images ; in S. Fix an n and assume that 0 n 1 n Images 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 Images S.            Images

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.            Images

For example, Images 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 ∉ Images .

1.6.0.12 Definition. (Closure) Given a set of initial objects, Images , and a set of operations, Images . A set S is called the closure of Images under Images —in symbols S = Cl( Images , Images )—iff it is the smallest set that contains Images as a subset and is closed under all of the operations of Images .

A set such as C1( Images , Images ) is also called recursively or inductively defined from the initial objects I and rules Images .           Images

Note that “smallest” means ⊆-smallest, that is, if a set T contains Images and is closed under Images , then S ⊆ T. This attribute, smallest, directly leads to the technique of (structural) induction over C1( Images , Images ):

Images    Structural Induction: Let S = C1( Images , Images ) and Images ( x ) be a property (formula). To show that all a Images S have the property, do the following:

(1) Prove Images ( a ) for all a Images Images .

(2) Prove that the property propagates with every R Images Images , 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 Images Images . 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.            Images

1.6.0.13 Theorem. Structural Induction works: That is, if (1) and (2) above are indeed proved, then, for all a Images S , Images ( a ) holds.

Proof. Let Images = { a : Images ( a ) holds}. Now (1) translates into Images ⊆ Images , while, by (2), for any R Images Images , whenever all the inputs of R are in Images [i.e., they all satisfy Images ( x )], then so is the output, that is, Images is closed under all the operations of Images . By the “smallest” property of S ( 1.6.0.12 ), we have S ⊆ Images , that is, for all a Images S , Images ( a ) holds.           Images

Images Images It turns out that not all properties Images ( x ) lead to sets { x : Images ( 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). Images Images

1.6.0.14 Theorem. Given a set of initial objects , Images , and a set of operations , Images . The two sets: S —built by steps ( 1.6.0.9 ) from Images and Images — and C1( Images , Images ) are equal.

Proof. For ⊆ we do induction on derivation length of a Images S. If the length equals 1, then a Images Images . Since Images ⊆ C1( Images , Images ) 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 Images 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 Images we conclude that the result of the operation, a , is in the closure.

For ⊇ we do induction over C1( Images , Images ): For the basis, if a Images Images then a Images S via a derivation of length 1. We now show that the property “ a Images S ” propagates with every R Images Images . 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 Images 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 Images S by the way S is obtained.           Images

Images 1.6.0.15 Remark. The above is a significant theorem: If we want to prove properties of C1( Images , Images ) 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( Images , Images ), 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( Images , Images ) where Images is the adopted set of axioms and Images 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 Images Images applied on prior members of the derivation —and the latter is tantamount to saying “members of C1 ( Images , Images )” because of 1.6.0.14 —we have the following very useful “membership test”:

b Images C1( Images , Images ) iff b Images Images or b is the result of some rule applied to members of C1( Images , Images ).

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.           Images Images

1.6.0.16 Example. Let Images = {3} and Images consist of just x + y = z and x – y = z , where in both cases z is the output variable. We are thinking of Images as our reference set here. Let us see why we have

Images

For the ⊆ we do, of course, induction over C1( Images , Images ). Well, Images 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 Images . 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 Images 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 Images C1( Images , Images ): indeed, apply x − y = z to input 3, 3. But then 3 k Images C1( Images , Images ) 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 .           Images

1.6.0.17 Example. Let us work within arithmetic (simply for the sake of having a fixed alphabet of symbols). We take as Images the set of all logical axioms ( 1.1.1.38 ), and these two rules form Images :

Images

and

Images

That is, our familiar MP and Gen. So, what is C1( Images , Images )? 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( Images , Images )—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( Images , Images ), is true.

Well, the claim holds for Images 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 .           Images

Images   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). Images Images

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: Images ; output: (∀ x ) Images

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 Images , Images → Images yield Images so do infinitely many pairs Images , Images → Images for all possible choices of Images . This phenomenon is called ambiguity.

1.6.0.18 Definition. (Ambiguity) A pair Images , Images is ambiguous if one or more of the following hold. Otherwise it is unambiguous.

(1) For some a Images C1( Images , Images ) and some n -ary rule R Images Images , 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 Images C1( Images , Images ) and two distinct n -ary and m -ary rules R and Q in Images , 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 Images Images , there is an n -ary rule R Images Images , and a tuple 〈 p 1 , …, p n 〉 such that R ( p 1 , …, p n , a ).

If a Images C1( Images , Images ) and R ( p 1 , …, p n , a ) holds for some R Images Images , we will call 〈 p 1 , …, p n 〉 a vector (or sequence) of immediate predecessors of a. For short, i.p.            Images

Images    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 Images = {1, 2, 3} and let Images consist of just two string operations:

Images

images

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( Image , Image ) we will opt for the natural approach: As C1( Image , Image ) 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( Image , Image ) 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)
                       = Image EV (1) + EV (2) Image × 3
                       = Image 1 + 2 Image × 3
                       = 9

No, no, you say. It is

EV (1 + 2 × 3) = EV (1) + EV (2 × 3)
                       = EV (1) + Image EV (2) × EV (3) Image
                       = 1 + Image 2 × 3 Image
                       = 7

We are both “right”, of course. The pair Image , Image is ambiguous; in particular, the string 1 + 2 × 3 has two i.p.: Images 1 + 2, 3 Images on which the first computation is based, and Images 1, 2 × 3 Images on which we based the second computation.   Image

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 . Image

images   (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 Images a , c Images to the relation that we have built so far, as long as, for some b , Images a , b Images and Images b , c Images 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.   images

1.6.0.21 Theorem. For any relation R, its unique transitive closure exists and equals C1( Image , Image ), where Image = R — a set of ordered pairs — and Image contains just one operation on pairs that, for any two input pairs Images a , b Images and Images b , c Images (note the common b), the operation produces the pair Images a , c Images .

images   We will denote the transitive closure of R by R + .   images

Proof . We show that C1( Image , Image ) satisfies (1)–(2) of 1.6.0.20 , which will confirm that R + = C1( Image , Image ). For (1), we are done by the property Image ⊆ C1( Image , Image ) of any closure. For (2) we are done since C1( Image , Image ) is closed under the operation in Image : If Images a , b Images and Images b , c Images are in C1( Image , Image ), then so is Images a , c Images .

For (3), let T be transitive and R ⊆ T . We want to show that C1( Image , Image ) ⊆ T . Well, both T and C1( Image , Image ) are supersets of R and are closed under the operation “if Images a , b Images and Images b , c Images are included, then so is Images a , c Images ”. But, as a closure, C1( Image , Image ) is ⊆-smallest with these two properties, therefore C1( Image , Image ) ⊆ T as needed. Image

1.6.0.22 Corollary. For any relation R, its transitive closure R + is equal to Image n ≥1 R n .

images   We also may write

images    images

Proof . Let us set Image and prove that Q = C1( Image , Image ), where Image , Image are as in 1.6.0.21 .

For Q ⊆ C1( Image , Image ) it suffices to prove that R n ⊆ C1( Image , Image ), for n ≥ 1, by induction on n : For n = 1, a R 1 b means a R b thus Images a , b Images Images C1( Image , Image ) since R = images . 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 Images a , c Images and Images c , b Images in C1( Image , Image ), hence Images a , b Images is in C1( Image , Image ) (transitivity).

For Q ⊇ C1( Image , Image ) we do induction on the closure. Since Image = 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 . Image

images    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 .   Image