1 Introduction
We develop a formal theory of finite structures, motivated in part by an imperative programming language for transforming such structures.
Our point of departure is to posit finite structures as a fundamental artifact of computing and programming. It is a truism that a database is a finite structure. But elements of infinite datatypes, such as the natural numbers or binary strings, are also finitestructures that obey certain requirements. Computing over such a datatype can thus be construed as a transformation process driven by those structures’ internal making. Viewed from that angle, a function computed by a transducerprogram is perceived as a mapping over the space of finitestructures, rather than a function within a particular infinite structure. Thus, finite partialstructures form a common platform for computing both within particular finite structures, and in the aggregate for computing over infinite datatypes, as long as their elements are not infinite themselves (e.g. streams).
Our theory is secondorder, in that we quantify over structures (via a quantification over finite functions). The wellknown secondorder nature of inductive data is thus manifested in the computation objects being themselves secondorder, albeit finite ones. The atoms, from which our finite structures are built, are the firstorder elements. They are nameless and structureless, and there must be an unlimited supply of them to permit unhindered structure extension during computation. One intends to identify structures that differ only by the choice of atoms, i.e. ones that are isomorphic to each other, though it turns out that we can often convey that intent implicitly, without complicating matters with permanent references to equivalence classes.
Since referencing objects by constant and function identifiers is central to imperative programming, we choose to base our structures on partialfunctions, rather than sets or relations. That is, each one of our structures is a finite set of finite partialfunctions. The Tarskian notion of an explicit structure universe is superfluous here: the only atoms that matter are the ones that appear as inputs and/or outputs of a structure’s functions, a set we shall call the structure’s scope.
Finally, as we base our finite structures on finite partialfunctions, the basic operations on structures must be functionupdates of some form. This is analogous to the operation of adjoining an element to a set, which underlies several existing theories of finite sets (see below).
In fact, the idea that inductive dataobjects, such as the natural numbers, can be construed as being composed of underlying units, goes back all the way to Euclid, who defined a number as “a multitude composed of units” [4, 7th book, definition 2]. The logicist project of Frege, Dedekind and Russell, which attempted to reduce mathematics to logic’s first principles, included this very same reduction of natural numbers to finite sets. The current predominant view of natural numbers as irreducible primal objects was advocated by opponents of the logicist project, notably Poincaré [5] and Kronecker, whose critique was subsequently advanced by the emergence of Tarskian semantics and by Gödel’s incompleteness theorems.
Philosophical considerations aside, the kinship between natural numbers and finite sets raises interesting questions about the formalization of finite set theory, and the mutual interpretation of such a theory with formal theories for arithmetic. Several formal theories proposed for finite set theory are based on ZF with the Axiom of Infinity replaced by its negation, which we denote here by . [10] shows that can be interpreted in PA (Theorem 3.1), and that PA can be interpreted in (Theorem 4.5), but not by the inverse of the former. That inverse would work for the interpretation of PA provided is augmented with a Transitive Containment axiom, asserting that every set is contained in a transitive set (Theorem 6.5). A result analogous to the latter^{1}^{1}1Wang removes from ZF Infinity without replacing it with its negation, since he does not interpret finite set theory in PA. was proved by Wang already in 1953 [22], where he uses an axiom (ALG) analogous to Transitive Containment, stating the enumerability of the collection of all finite sets.
It seems, though, that is somewhat of an oxymoron, in that it embraces ZF, a theory designed specifically to reason about infinity, only to eviscerate it off the bat by excluding infinity.^{2}^{2}2The subtext is, of course, the conviction that ZFC is the canonical formal framework for all of mathematics. An approach more germane to finiteness was proposed already by Zermelo [24, Theorem 3], Whitehead and Russell [23, *120.23], Sierpiński [18, p.106], Kuratowski [11], and Tarski [20]. It enforces finiteness by an induction principle for sets: if satisfies a property and whenever satisfies then so does for each , then all sets satisfy . This induction principle corresponds to the inductive definition of finite sets as the objects generated by successively joining elements to .
Mayberry [13] defines an arithmetic based on induction on sets, which he deftly dubs Euclidean Arithmetic. He considers a number of induction principles derived from the setinduction principle above, but allows for neither set quantifiers nor unbounded atomic quantifiers in the induction formula. Consequently, his system is mutually interpretable with a weak number theory, namely extended with an exponentiation function (detailed proof in [9]). Pettigrew [15, 16] shows that these two theories are also equipollent with a bounded version of .
Our approach differs from the ones above in several respects. Our theory FS of finite structures is based on finite structures rather than finite sets, and is formally secondorder, in contrast to theories based on ZF, which on the one hand are firstorder, and on the other hand refer to a cumulative hierarchy of sets. At the same time, FS’s secondorder nature is weak, in that its induction principle implies that its secondorder object are finite. As a result, our theory of finite structures, although based on a variant of set induction (and not ) is equipollent to full Peano Arithmetic.
Principally, our motivation is to develop new natural tools for the analysis and verification or computing and programming. We are particularly interested in novel forms of calibrating computational resources by syntactic methods. In [12] we already show that, by using finite structures as focal concept, one obtains an abstract characterization of primitive recursive mathematics based on the concept of loop variant, familiar from program verification.
The remaining of the paper is organized as follows. In §2 we lay out our fundamental concepts and notations. Our theory FS of finite structures is presented in §3, followed by its programming language counterpart ST in §4. We then prove in §5 an abstract generalization of Kleene’s classical theorem about the existential definability of computability, and use it in §6 to show that FS is mutually interpretable in Peano Arithmetic.
2 Finite structures
2.1 Finite functions
Our basic notion is the finite partial structure, in which functionidentifiers are interpreted as partialfunctions. For example, we construe binary strings as structures over the vocabulary with a constant and unary function identifiers and . E.g., is taken to be the four element structure
Here is interpreted as the partialfunction defined only for the leftmost atom, and as the partialfunction defined only for the second and third. As in Gurevich’s ASM, we posit our finite structures to live within a denumerable set of atoms, i.e. unspecified and unstructured objects. To accommodate nondenoting terms we extend to a flat domain , where in addition to the atoms we posit a fresh object , intended to denote “undefined.” The elements of are the standard elements of .^{3}^{3}3We refer neither to boolean values not to “background structures” [1] on top of atoms.
By an function we mean a finite ary partialfunction over , where ; thus, the nullary functions are the atoms. We identify an Afunction with the total function satisfying
(1) 
Note that is necessarily strict, i.e. its output is whenever one of its inputs is. For each we let be the empty ary function, i.e. the one that returns for every input. When in no danger of confusion we write for . The scope of is the set of atoms occurring in its entries.
Function partiality provides a natural representation of finite relations over by partial functions, without recourse to booleans. We represent a finite ary relation over () by ary functions whose domain is , notably the function
2.2 structures over a vocabulary
A vocabulary is a finite set of functionidentifiers, with each assigned an arity . We refer to nullary functionidentifiers as tokens and to unary ones as pointers.
For the moment we might think of these identifiers as reserved names, but they can be construed just the same as (permanently free) variables.
An entry of an function is a tuple where . is an structure over if it is a mapping that to each , assigns a ary function , said to be a component of . The scope of is the union of the scopes of its components.
If is an structure over , and an structure over , then is an expansion of (to ), and a reduct of (to ), if the two structures have the same interpretation for identifiers in (the scope of may be strictly larger than that of ). For structures and over the same vocabulary, we say that is a substructure of if every entry of is an entry of .
A finite collection of structures is itself a structure: if is a structure over (), then the collection is the union over the disjoint union of the vocabularies.
Given a vocabulary , the set of terms is generated by

.

If , and then
Note that we write function application in formal terms without parentheses and commas, as in or . We optionally superscript function identifiers by their arity, and implicitly posit that the arity of a function matches the number of arguments displayed; thus writing assumes that
is a vector of length
, and (with no superscript) that the vector is as long as ’s arity. A term is standard if does not occur in it.Given an structure over , the value of a term t in , denoted , is obtained by recurrence on t:


For ,
An atom is accessible in if for some . An Astructure over is accessible if every atom in the scope of is accessible. For example, if is without tokens then no atom of a structure can be accessible. If every atom in the scope of an accessible structure is the value of a unique term we say that is free. Note that an accessible Astructure can fail to be free even if all its components are injective:
However, we have the straightforward observation:
Lemma 1
An accessible Astructure over is free iff there is a finite set of terms, closed under taking subterms, such that the function is injective.
If q is a standard term, and consists of the subterms of q, then we write for the resulting free structure. It is often convenient to fix a reserved token, say , to denote in each structure its root, i.e. the term q as a whole. For example, for nullary and , unary , and binary , the structures , , , are, respectively,
2.3 A secondorder language
We wish to present a formal theory of finite structures, that deals not only with one structure at a time, but with structure transformation, in particular by suitable imperative programs. To that end, we generalize our discussion from a single vocabulary to a vocabulary “on demand.” We posit for each a denumerable sets of ary variables, intended to range over the ary functions. The variables of arity and are dubbed atomic and functional, respectively. When a particular vocabulary is of interest (with the exhibited ordering of its identifiers), we write (with the vocabulary’s name as superscript) for a vector of variables , with . We update our definitions of the set Tm of terms, and of their semantics in a structure , by referring to function variables rather than identifiers of a fixed vocabulary.
An equation is a phrase of the form , where . The set Fm of formulas is generated inductively by

Every equation is a formula;

Fm is closed under the propositional operators ( and ).

If is a formula, then so are and ().
Given an structure for a set of variables, a variable , and ary function , we write for the structure which is identical to , except that . Given a formula and a structure , where all variables free in are in the domain of , the truth of in , denoted , is defined by recurrence on formulas, as follows.
(2) 
When we also say that verifies . Clearly, depends only on for variables occurring free in .
Recall from (1) that we identify a finite with its strict extension , so the quantifiers range over all strict valued functions, which for the nullary case means that atomic variables may take any value in . This definition departs from Tarski’s semantics in that quantification ranges over all functions, regardless of the scope of .
2.4 Firstorder formulas
We call quantification over atomic variables firstorder, and quantification over functional variables secondorder. A formula is firstorder if all its quantifiers are firstorder.
We use notation conventions for some important firstorder formulas:

for . We overload this convention, and write to mean , where .
Dually, abbreviates

(3) states that the atom denoted by is in the scope of . Thus
means that is true “within” , which is not the same as . For example, is true for all structures, whereas is false for all structures.

Let . The structures that model the following formula are precisely the structures for the natural numbers, described in §2.2.^{4}^{4}4We disregard here the token
(4)
The following observation is a variant of a basic result of Finite Model Theory. We shall not use it in this paper.
Proposition 2
Let be a firstorder formula. The following problem is decidable in polynomial time (in the size of the input structure presentation). We assume that structure are given as tables.

Given an Astructure , is true for .
Proof. The proof is by induction on .
Absent secondorder quantifiers,
the only case of interest is when the main operator of is an atomic quantifier, say . The input’s format
provides direct scanning of all entries that are in the scope of ,
and the denotations of the Afunctions all yield
for all other entries. From this the calculation of
the truth in of is immediate.
3 A theory of finite structures
3.1 On axiomatizing finiteness
Since our structure are built of functions, we refer to a generative process that extends functions rather than sets ore relations. The set of ary functions is generated by:

The empty ary function is in ;

If , , and , then extending with an entry yields an function in .
From this inductive definition we obtain an Induction Schema for functions. Using the abbreviations
(5) 
Induction for a formula (with a distinguished functionvariable ) reads
(6) 
Since the components of structures are functions, without constraints that relate them, there is no need to articulate a separate induction principle for structures. Indeed, every structure for a vocabulary is obtained by first generating the entries of , then those for , and so on. Note that this would no longer be the case for an inductive definition of the class of accessible structures, whose components must be generated in tandem:^{5}^{5}5We shall discuss the class in detail elsewhere.

If is in , is in the scope of , , and ,
then extending with an entry yields a structure in .
3.2 The theory Fs
Our axiomatic theory FS for functions has free and bound variables for atoms and free and bound variables for functions of arbitrary positive arity. We use as syntactic parameters for atomic variables, and as syntactic parameters for functional variables, optionally superscripted with their arity when convenient.
The axiom schemas are the universal closures of the following templates, for all arities , terms t, and formulas . For a function variable and variables we write for .

[Strictness]

[Infinity]
Note that this states that is infinite (unbounded), and has no bearing on the finiteness of functions.

[Emptyfunction] .

[Extension]

[Explicitdefinition]
This schema combines Zermelo’s Separation Schema with an Explicit Definition principle: is defined by the term t, for arguments in the domain of . 
[fInduction] Recalling (6) above:
For each of the schemas [Emptyfunction], [Functionextension], and [Explicitdefinition], the function asserted to exist is trivially unique, and so adding identifiers for these functions is conservative over FS. We write , and , respectively, for these functions (one for every arity ).
The relevant axiomschemas above can be rephrased using these three constructs as primitives:

[Emptyfunction]

[Extension]

[Explicitdefinition]
Also note the contrapositive form of fInduction:
(7) 
3.3 Some derived schemas

[Union] .
The proof is by fInduction on and Extension. 
[Composition]
(8) This follows from Explicitdefinition and Union.

[Branching]
The universal closure with respect to is proved by inductions on and , using Extension.

[Contraction]
(9) This is the dual of Extension. The proof of (refeq:contraction) is by induction on for the universal closure of (9) with respect to .

[Function pairing]
(10) Much of the expressive and proof theoretic power of arithmetic is due to the representation of finite sequences and finite sets of numbers by numbers. The Functionpairing schema provides a representation of two ary functions by a single ary function. Namely, are “tagged” withing by the tags respectively. In other words, writing for , we have and . (We might require, in addition, that for all atoms , but this is inessential if we include explicitly in the representation.)

[Atomicchoice] A more interesting form of tagging is provided by the following principles of Choice.
(11) This is analogous to [14, Lemma 2(e)], and is straightforward by induction on . Suppose the schema holds for , yielding the function . To show the schema true for suppose it satisfies the premise
(12) Then satisfies (12) as well, yielding a for the conclusion. Also, by (12) there is an atom such that , and so the conclusion is satisfied by in place of .

[Functionchoice]
where abbreviates Note that Atomicchoice is a special case of Functionchoice, with nullary.
Note that the bounding condition in the choice schemas above is essential: even the simplest case
(13) is false already for , since the identity function over is not finite.
4 Imperative programs over structures
We define a variant of Gurevich’s abstract state machines (ASMs) [2, 6, 8], for the transformation of structures. Transducerprograms define mappings between structures, which are akin to the mappings underlying Fraenkel’s Replacement Axiom, and more generally the proper classes of BernaysGödel set theory. Namely, these mappings are not functions, and are referred to in the theory FS via the formulas that define them.
4.1 Structure revisions
Our structure transformation programming language, ST, is designed to be a Turingcomplete computing system for the transformation of finite partialstructures, using the simplest possible building blocks while maintaining expressiveness. An STprogram takes an structure as input, and successively applies basic structure revisions to it. The process may terminate with a final structure when no further revision is called for. For example, addition over might be computed by a program that takes as input a structure representing two natural numbers and , and grafting the second on top of the first. Doubling a number might be performed by copying the input before grafting the copy over the input, or alternatively generating a new structure by repeatedly extending it with two atoms while depleting the input.
We start by defining the basic operations of ST, to handle entries. Each such operation maps a structure into a structure which is identical to with the exceptions noted.

An extension is a phrase where the ’s are standard terms and q is a term. The intent is that is identical to , except that if then .

An inception is a phrase of the form , where c is a token. A common alternative notation is . The intent is that is identical to , except that if , then is an atom not in the scope of . A more general form of inception, with a fresh atom assigned to a term t is obtained as the composition
where c is a reserved token.
We allow extensions and inceptions to refer to an identifier f not in the vocabulary of , in which case the vocabulary of extends that of , and we posit that .

A contraction, the dual of an extension, is a phrase of the form . The intent is that is identical to , except that .

A deletion, the dual of an inception, is a phrase of the form , where c is a token. The intent is that is obtained by removing . That is, is identical to , except that for all functions present and all , if , then .
Note that a deletion cannot be obtained via the composition of contractions, because might be reached by functions of from atoms that are not accessible, in which case the atom cannot be eliminated from the scope of by contractions alone.
We refer to extensions, contractions, inceptions and deletions as revisions. Extensions and inceptions are then constructive revisions, whereas contractions and deletions are the destructive revisions.
An extension and a contraction can be combined into an assignment, i.e. a phrase of the form . This can be viewed as an abbreviation, with a fresh token, for the composition of four revisions:
(Note that the atom denoted by q (when defined) is being memorized by , since q may become inaccessible due to the contraction .) Although assignments are common and useful, we prefer contractions and extensions as basic constructs, for two reasons. First, these constructs are truly elemental. More concretely, the distinction between constructive and destructive revisions plays a role in implicit characterizations of computational complexity classes, as for example in [12].
4.2 St programs
Our programming language ST for structure transformation consists of guarded iterative programs using revisions as basic operations. Define a guard to be a quantifierfree formula.^{6}^{6}6Taking for guards arbitrary firstorder formulas would not make a difference anywhere. The programs of ST are generated inductively as follows.

A structurerevision is a program.

If and are programs and is a guard, then , and are programs.
For a program we define the binary yield relation between structures by recurrence on . For a revision the definition follows the intended semantics described informally above. The cases for composition, branching, and iteration, are straightforward as usual.
Let be a partialmapping from a class of Astructures to a class of Astructures. A program computes if for every , for some expansion of . Note that the vocabulary of the output structure need not be related to the input vocabulary.
4.3 Turing completeness
Guarded iterative programs are well known to be sound and complete for Turing computability, and proofs of the Turing completeness of abstract state machines have been given before (see for example [7, §3.1]). To dispel any concern that those proofs need more than finite structures and our simple revision operations, we outline a proof here.
Theorem 3
Let be a Turing transducer computing a partialfunction . There is an STprogram that, for every , transforms to .
Proof. Suppose uses an extended alphabet , set of states , start state , print state , and transition function . Recall that for we write for the structure .
Define to be the vocabulary with , and each state in as tokens; and with and each symbol in as pointers. The intent is that a configuration (i.e. with cursored) be represented by the structure
All remaining tokens are undefined.
We define the program to implement the following phases:

Convert the input structure into the structure for the initial configuration, and initialize to the initial input element. Use a loop to initialize a fresh pointer to be the destructor function for the input string, to be used for backwards movements of the cursor.

Main loop: configurations are revised as called for by . The loop’s guard is (the “print” state) being undefined.

Convert the final configuration into the output.
5 Computability implies existential definability
5.1 Expressing relation iteration
Suppose is a formula, with variablevectors , both for the vocabulary . Define the relation as the least fixpoint of the closure conditions:

for all .

If and then .
Theorem 4
For every formula there is a formula that defines the relation .
Proof. By definition, just in case there are () such that
The functionvectors can be bundled jointly into a single vector , using a vocabulary with a fresh variable for each in . We also refer to two fresh auxiliary variables and , and let the bundled vector be defined by
For a term t let abbreviate .
Now define
(14) 
Example. Let be a vocabulary with identifiers of arity , and etc. be vectors of atomic variables. Take for the following formula (where and are construed as sets).
That is, is identical to except that it may contain additional atoms, all obtained by applying some to elements of . Then the existential formula
defines the set of accessible atoms. Consequently,
is true for a structure iff is accessible.
5.2 Existential definability of computable relations between structures
Theorem 5
For every STprogram over structures, there is an existential formula that holds iff .
Proof. By induction on .

If is a revision then is in fact firstorder, and trivially defined.

If is , then by IH there are existential formulas and that hold just in case and . We thus define
which is existential if and are.

If is we define
which is existential if and are. Note that here is firstorder, so the negation is harmless.
Theorem 5 defines a binary relation between the initial and final configurations of an STprogram. Given a convention on which program variables are to be considered inputs and which output, the formula can be modified to express the inputoutput relation computed by the program. For instance, if uses variables , of which and are used for the inputs, and and are used for the outputs, then the I/O relation defined by is
(15) 
6 Equipollence of Fs and Pa
6.1 Interpretation of arithmetic formulas in finite structures
The intended model of FS has no “universe” in the traditional, Tarskian, sense. Using the structures as the target “elements” falls short of the natural embedding, where natural numbers are interpreted as equivalence classes of such structures. Note that we cannot take one representative from each equivalence class because there is no way to formally identify such representatives. Consequently, we depart from the traditional definition of interpretations between languages and between formal theories, (see e.g. [3, §2.7]), relax the requirement that the source universe be interpreted by a definable subset of the target universe, and interpret the natural numbers instead by equivalence classes of structures satisfying (as defined in (4)).
The representation of natural numbers by equivalence classes of structures can now be formalized as follows. Take PA to be based on logic without equality, that is with equality considered a binary relation identifier rather than a logical constant, which for PA happens to be interpreted as identity. The point is that our interpretation of PA in FS must now include a definition of the interpretation of equality, though not as the identity relation between the atoms of FS, but rather as structure isomorphism. The property of a unary function being an isomorphism between structures over the vocabulary can be defined by
(16) 
Given that (as defined in (16)) is assumed true for and , and that must be strict, the condition above implies that the function must be a bijection. We now define the interpretation of the equality relation of PA as the relation
between structures representing natural numbers.
We interpret the remaining nonlogical constants of PA, namely 0, successor, addition and multiplication, via basic equations for them. For each variable of PA let and be FSvariables. In any given context only finitely many variables will be present, so the collection of all corresponding FSvariables will be finite as well. Every equation of PA is equivalent to a formula involving only equation of one of the following five forms:
(17) 
We define the following interpretation for such equations.

.

where Iso is as in (16).

where is(18) 
where is the existential formula defined by (15) for the STprogram computing addition,

( is defined similarly, referring to the STprogram for multiplication.

Combining the previous cases, we easily define (by discourselevel induction on terms) an interpretation for all terms t,q.
We let the mapping commute with the connectives: is , etc.
For the quantifiers we let
(19) 
Let be the standard model of PA, with zero, successor, addition, and multiplication as functions.
Theorem 6
The interpretation is semantically sound and complete: for every closed formula of PA, is true in iff is true for all structures.
Proof. Consider the following fixed interpretation of the natural numbers as structures. Let be an atom (to interpret 0), and an injective unary partialfunction
Comments
There are no comments yet.