In order to prove the fgoagog thing we need to be able to do computations on trees at a low level of the Grzegorczyk hierarchy, so it doesn’t mess up the complexity of the whole group computation. I will give a model of finite trees that lies in , the same level as Cannonito/Gatterdam’s standard index for the free group. (( this post has been sitting as a draft since the beginning of May because I wanted to make some nice tree pictures, but I’d rather just publish it now. So, the trees section is copied out of my notes and might not make sense ))
Lists
First of all, I’ll show how to encode sequences of numbers so that they can be manipulated and read by functions. Let be a sequence of non-negative numbers.
First encode the list as a Gödel number:
where is the prime. (( it’s just occurred to me that I haven’t shown that things such as finding primes and divisiblity tests and so on are computable. I’ll do another post after this one with suitable definitions for all that stuff ))
In order to actually do anything with this encoded list, we need to be able to find out its length and the value of the entry at any given position. return the exponent of the prime in :
I’m using instead of to denote the element of an encoded list, just so it’s clear that’s what’s happening later on.
finds the length of an encoded list:
Note that if there is no such that holds. The bit in the minimisation is so that the function is bounded – it doesn’t matter what upper bound I pick as long as it’s “enough”.
returns the first occurence of in an encoded list :
Make use of to determine whether an encoded list contains a given value:
This function to find the largest element of a list , , is defined by using a helper function , which gives the biggest element up to :
, which I will also write , gives you the sublist of starting at position and ending at position . The max/min stuff is to make sure this function works sensibly even when given wrong inputs:
\[
, also written , appends a value to the end of an encoded list :
Trees
A tree consists of a set of vertices and a set of edges connecting pairs of vertices, with no loops.
A rooted tree has a unique vertex said to be at the ‘top’. In an ordered tree, the set of children of each vertex is ordered, so there is a leftmost child, and so on. A plane recursive tree is a rooted, ordered tree constructed by a process which begins with the root node and recursively adds vertices below existing ones.
We can assign a labelling to a plane recursive tree by giving vertices labels corresponding to the order in which they were added to the tree, beginning with for the root. This way, the sequence of labels encountered heading outwards from the root is always increasing. Every edge can also be given a unique labelling by saying that the edge , connecting vertex to , has label .
Suppose we have a tree with root vertex . is computable if there is an -decidable labelling (we can assume ) and an -computable “parent function” which gives the label of the parent of a vertex. We also require that .
A finite plane recursive tree can be entirely described in a canonical way by a depth-first walk. Note that every node has a single parent and a finite ordered set of children. The process on ‘visiting’ a vertex goes as follows: for each child node , travel along and visit , then travel backwards along . The sequence of labelled edges travelled along by beginning this process at is the depth-first walk of the tree. Note that each edge is visited exactly twice – once heading outwards, and again heading back towards the root.
This sequence can then be encoded as a Gödel number by the method in Section 1. We will define a function which takes an encoded tree and gives the parent of the vertex with label . Note that the root vertex’s label will not appear in this sequence because it has no associated edge.
Some functions to work with encoded trees:
To find the first and second occurrences of the edge with label in the walk:
To get the label of the child of the root:
To find the subtree descended from the child node:
The number of children of the root node:
Whether the root has a child with label :
Finally, the parent function. The idea is to basically do the depth-first walk, remembering which vertex you just came from. If you reach a subtree which doesn’t contain then turn back, or if you reach the required vertex then return the label of the vertex you just came from.
where .
We will also need to know if the tree contains an edge :
Theorem
A finite ordered tree is computable.
Proof
As the tree is finite, of course its labelling is -decidable, and as defined above is -computable.