User blog:Emlightened/System Tau Notes

I'm really really sorry, but this is incomplete. I have been making a text document (up to 42kb rn) trying to formalise and explain a Googological System, but it was never finished. I've not edited it in two months, and thought it was a better idea to let it die here than on my hard drive.

Still, I'm pretty sure there are some interesting and salvageable ideas here. Since writing it, I've learned a lot of type theory (in particular, I think I have a decent understanding of inductive-recursive types), so if I come back here at some point, I should be able to clean up the presentation and present what I have in an inductive, not recursive, manner. (I'd probably also switch from math notation to computing notation, too. Easier to work with in practice.)

The basic idea is to create some recursive types (like labelled binary trees, lists, etc.), and to bestow well-founded orderings onto them, so they can be used for recursion in the way googologists normally do.

That said, here it is, in  tags (that hopefully won't break MathJax):

= Ramble/comment
 * 1) = Incomplete section

= System \(\tau\) =

Introducing System \(\tau\) (tau).

\(\tau\) is a googological system (a system designed specifically for the verification of googological notations as total recursive) based on a first order type theory. It is geared towards notations that are based on ordinal-like structures, not seperator-based structures, although the latter can be encoded with some difficulty.

There are four sorts of object: terms (which are used to represent expressions), (data) types, functions, and orderings (used to show a function with recursion halts).

Motivation
The motivation for a googological system in general is clear: we have a formal system that can prove that notations actually work as expected (although not necessarily how strong they are), so this section deals with why \(\tau\) was designed as it is.

One of the main issues with making a system in general is probably encoding the data types. Googologists regularly create complex data types for their notations, so any system should be able to encode most or all of these. My solution is to note that most data types can be represented as either a choice between terms of (possibly) different data types (sum) or pair of terms of (possibly) different data types (product). For illustration:


 * A natural is a choice between 0 and the successor of a natural.
 * A list of X is a choice between the empty list or a pair of a list of X and an X.
 * A binary tree is a choice between the empty tree or a pair of two binary trees.

Hence, we describe data types using inductive types, and formailse these through unit, sum, product and recursive types.

Other than that, we need to formalise functions, which means formalising lots of recursion. To do this, when defining a function, we allow self-reference. To avoid infinite loops, we further require that whenever f(x) contains reference to f(a), some a, we can prove a<x for a well-founded <.

To ensure this, we define orderings. The orderings all have the property 'if a is a subserm of b, then a is less than or equivalent to b', and we can further define orderings such that the left term in a product is ordered before the right term (or vice-versa) and such that the left terms for a sum are smaller then the right terms in a sum (or vice-versa). These are all well-founded.

Formalising Terms and Types
The simple, non-inductive types (and corresponding terms) are easy to state. To denote that a term \(a\) is of type \(A\), we write \(a:A\) (this is basically \(\varepsilon\) but in type theory). We have the empty type, \(\mathbf 0\), the unit type \(\mathbf 1\) with only \(u:\mathbf 1\). We also have product types and sum types. Type equivalence is extensional.

The product and sum types are both type constructors, that is, they each take two types and output a thrid, new type. With these, we also need to specify term constructors, to construct the terms, and term eliminators, to extract information from the terms.

The Terms
Terms are types according to Curry typing. This means that each term can be in any of many types, likes objects in sets in set theory. The reason we don't replace 'term' with 'object' and 'type' with 'set' is simply because we're using type theory, not set theory. (If we were using Church typing instead then the theory (on the face of it) remains quite similar, but each term has a single, unique type.)

The terms are easily enumerated. \(u\) is a term. If \(a\) is a term then \(La\) and \(Ra\) are terms. If \(a\) and \(b\) are terms then \((a,b)\) is also a term. That's it. Each term can also be assigned a type according to it's structure, as defined below.

Product Type
If \(A\) and \(B\) are types, then \(A \times B\) is a type, the product of \(A\) and \(B\). Furthermore, if \(a:A\) and \(b:B\) then \((a,b):A\times B\).

The deconstructors for the product type \(A \times B\) are the functions \(\pi_1^{A \times B}:A \times B \to A\) and \(\pi_2^{A \times B}:A \times B \to B\) which for \(a:A\) and \(b:B\) satisfy \(\pi_1^{A \times B}(a,b) = a\) and \(\pi_2^{A \times B}(a,b) = b\).

We take product to be right associative, so \(A \times B \times C = A \times (B \times C)\). We also use powers as shorthand for iterated product, so \(A^1 = A\) and \(A^{n+1} = A \times A^n\)

Sum Type
If \(A\) and \(B\) are types, then \(A + B\) is a type, the sum of \(A\) and \(B\). Furthermore, if \(a:A\) and \(b:B\) then \(La:A + B\) and \(Rb:A + B\)

The two types of deconstructors for the sum type \(A + B\) are the functions \(\delta_1^A:A+\mathbf 0 \to A\), \(\delta_2^A:\mathbf 0+A \to A\) which for \(a:A\) satisfy \(\delta_1^ALa = a\), \(\delta_2^ARa = a\). We also have the sum functions (deconstructors for a sum type \(A\)): \(F \uplus G:A \to D\) where \(F:B \to D\) and \(G:C \to D\), and \(B \cap C = \mathbf 0\) and \(B \cup C = A\) (this is decidible). For \(b:B\) and \(c:C\) this satisfies \((F \uplus G)b = Fb\) and \((F \uplus G)c = Gc\). (Note that this can be used for types such as \(A = (\alpha + \beta) \times \gamma\) with \(B = (\mathbf + \beta) \times \gamma\) and \(C = (\alpha + \mathbf 0) \times \gamma\); unconventional, but easy to use.)

We take sum to be right associative, so \(A + B + C = A + (B + C)\). We also take products before sums, so \(A \times B + C = (A \times B) + C\) and \(A + B \times C = A + (B \times C)\). Additionally, if \(A = B+C\), then \(LA = B+\mathbf 0\) and \(RA = \mathbf 0+C\). Lastly, \(\uplus\) is associative, so it is assumed that the associativity is chosen such that the results make sense (i.e. produce actual types).

Recursive Types
(Equi)recursive types are the backbone of the system. To make a recursive type, we use the \(\mu\) type variable binder: \(\mu\alpha.A = A[\alpha:=\mu\alpha.A]\). This binds \(\alpha\); we do not allow a variable to occur both bound and free in in expression, and rename bound variables to avoid this whenever encessary.

For a simple example, let's consider the natural numbers, \(\texttt{Nat} = \mu\alpha.\mathbf 1+\alpha\). If we were to expand this type, we'd get \(\texttt{Nat} \approx 1+\texttt{Nat} \approx 1+1+\texttt{Nat} \approx 1+1+1+\cdots\). Now, what are the inhabitants of this type? They are \(Lu\), \(RLu\), \(RRLu\), \(RRRLu\) and so on. To realise these as natural numbers, just count the number of \(R\)s.

Examples

 * \(\texttt{Nat} = \mu\alpha.\mathbf 1+\alpha\). Natural numbers: \(Lu = 0\), \(Ra = a+1\).
 * \(\texttt{List(A)} = \mu\alpha.\mathbf 1+\texttt{A}\times\alpha\). Lists from \(\texttt A\): \(Lu =\) empty list, \(R(a,l) =\) list \(l\) with \(a\) added to the end.
 * \(\texttt{BiTree} = \mu\alpha.\mathbf 1+\alpha^2\). Binary trees: \(Lu =\) empty tree, \(R(t,u) =\) tree with children \(t\) and \(u\).
 * \(\texttt{TriTree} = \mu\alpha.\mathbf 1+\alpha^3\). Trinary trees: \(Lu =\) empty tree, \(R(t,(u,v)) =\) tree with children \(a\), \(b\) and \(c\).
 * \(\texttt{Tree(A)} \mu\alpha. 1+\alpha\times\texttt{A}\times\alpha\). Trees with labels from \(\texttt A) (except root node): \(Lu\) root node, \(R(t,(a,u)) =\) tree \(t\) with additional child node \(u\) labelled \(a\).
 * \(\texttt{A} \times \texttt{Tree(A)}\). Trees with labels from \(\texttt A\) (all nodes). This data type might not have the avaliable orderings. The alternative way of doing this would be to type leaf and non-leaf nodes differently.



Subtyping and Union Types
The type \(\mathbf 0\), although seemingly useless, is very important as it is used for combining types.

Generally, \(\alpha\) is a subtype of \(\beta\), written \(\alpha \subseteq \beta), if all terms of type \(\alpha\) are also terms of type \(\beta\). In general, this is equivalent to replacing types in the written representation of \(\beta\) with \(\mathbf 0\).

Types can also be unioned to form other previously defined types. This is, technically, more of a notational shorthand, as we can decide if the union of two given types is actually a type and compute its value if so. The union of the types \(A\) and \(B\) is \(A \cup B\), and it is required that \(A\) and \(B\) are disjoint to do this, that is that there is no \(c\) such that \(c:A\) and \(c:B\).

A syntactic subtype of \(A\) is a type \(B\) that has been used in the construction of \(A\): the syntactic subtypes of \(A+B\) and \(A \times B\) include both \(A\) and \(B\). The syntactic subtypes of \(\mu\alpha.A\) are those of \(A\). Lastly (this concept will be used in orderings for recursive types), the \(\alpha\)-constant subtypes of \(A\) are those syntactic subtypes of \(A\) that do not have \(\alpha\) as a syntactic subtype (i.e. that \(\alpha\) does not occur free in)

Formalising Functions and Orderings
Function decleration is similar to a modified form of the \(\lambda\) calculus, and is as follows:

\[\lambda Fa: A \to B.b\)]

Where given \(a:A\) and \(F:A \to B\), \(b:B\), \(F\) and \(a\) are function and term variables respectively, and \(F:A \to B\) denotes that \(F\) is a function with domain \(A\) and codomain \(B\).

Functions have the following reduction rule for \(t:A\):

\[(\lambda Fa: A \to B.b)t \Rightarrow b[a:=t][F:=\lambda Fa: A \to B.b]\]

Where \(b[a:=t]\) is the result of taking the term \(b\) and replacing all instances of the variable \(a\) with \(t\).

However, these functions may never terminate: consider \(\lambda Fa: A \to A. Fa\), which has the infinte reduction sequence \((\lambda Fa: A \to A. Fa)t \Rightarrow Fa[a:=t][F:=\lambda Fa: A \to A.Fa] \Rightarrow Ft[F:=\lambda Fa: A \to A.Fa] \Rightarrow (\lambda Fa: A \to A. Fa)t \cdots\). For this reason we introduce the concept of a valid function.

Validity of functions
A function \(\lambda Fa: A \to B.b\) is, intuitively speaking, valid iff there is some ordering \(<\) such that for every subterm \(Ft\) of \(b\), \(t<a\). However, as \(a\) is a variable, verifying this naïvely would require testing infinitely many possible values of \(a\), so instead we formalise the notion of decreasing subterm on an ordering.

Orderings
Given a type \(X\) and \(x:X\), \(y:X\), we show if \(x<^Xy\) as follows:


 * 1) If \(x\) is a subterm of \(y\), \(x<^Xy\).
 * 2) Let the active subterms for \(x\) and \(y\) be \(x' = x\) and \(y' = y\) respectively.

 a_1 > a_2 > \cdots \).) We define this collection below.

For operations on orderings, instead of using the normal curly brackets (parentheses, \(\)) for clarification or precidence, we use square brackets \([\,]\). This is simply for clearness, the square brackets are not operations in themselves.

Sum and Product Orderings
Given types \(A\) and \(B\) with orderings \(<^A\) and \(<^B\) we can define the sum orderings \([<^A+<^B]\), \([<^A\overset{\leftarrow}+<^B]\) and \([<^A+\overset{\to}<^B]\), and the product orderings \([<^A\times<^B]\), \([<^A\overset{\leftarrow}\times<^B]\) and \([<^A\overset{\to}\times<^B]\) as follows:


 * Let \(a:A\), \(a':A\), \(b:B\) and \(b':B\) with \(a<^Aa'\) and \(b<^Bb'\).
 * If \(a<^Aa'\), \(La [<^A+<^B] La'\) and if \(b<^Bb'\), \(Rb [<^A+<^B] Rb'\)
 * If \(a<^Aa'\), \((a,b) [<^A\times<^B] (a',b)\) and if \(b<^Bb'\), \((a,b) [<^A\times<^B] (a,b')\)
 * \(Rb [<^A\overset{\leftarrow}+<^B] La\) and \(La [<^A\overset{\to}+<^B] Rb\)
 * If \(c:A\times B\), \(c':A\times B\) and \(c [<^A\times<^B] c'\), \(c [<^A\overset{\leftarrow}\times<^B] c'\) and \(c [<^A\overset{\to}\times<^B] c'\)

\([<^A\overset{\leftarrow}\times<^B]\) and \([<^A\overset{\to}\times<^B]\) are weakened lexicographic orders which are specified in the subsection after next.

Embedding Orderings
Embedding orderings are fairly simple. Simply put, if \(<^A:A\) and \(a:\mu\alpha.A\) is a subterm of \(a':\mu\alpha.A\), then \(a [\mu<^\alpha.<^A] a'\). Also, if \(a <^A[<^\alpha:=[\mu<^\alpha.<^A]] a'\), then \(a [\mu<^\alpha.<^A] a'\).

Additionally, some conditions have to be met before making an embedding ordering, to preserve strictness. For instance, in \(\mu\alpha.\mathbf 1+\alpha\), we can't start with \([<^1\overset{\leftarrow}+<^\alpha]\) as then \(Lu>RLu\), and we would ahve to have \(Lu<RLu\) by embeddability, a contradiction. ####

Weakened Lexicographic Orderings
We start by considering the ordering on lists of naturals that order (n,l) weakly lexicographically in the left subterm. After creating rules for his, we try to generalise appropiately. a,b:N[α=μα.1+N×α]; j,k:μα.1+N×α; a::j = R(a,j); <:(N×α)[α=μα.1+N×α]

embedding order product order When looking at ordering stuff of type X, ordering stuff of sub-type Y, and have X #} μα.A #} Y #} α (with #} meaning 'contains as a substring'), have the condition that the type-α term at the bottom is smaller than

0	00	000	0000	1	01	001	0001	10	010	0010	100	0100	1000	11

Our types are equivalent to simultaneously inducttive types. In particular, a specification of the form: Ax = Ax \n Ax Ax = Var := SoP SoP = 0 SoP = P SoP = SoP|SoP P = 1 P = Var P = P&P can represent an arbitary family of simultaneous inductive types, and also is equivalent to a recursive type. Also, do same for corecursive?



Proof of encoding Primitive Recursion
Consider \(F:D \to A\) and \(G: \texttt{Nat} \times A \times D \to A\).

\(\lambda Hb:\texttt{Nat} \times D \to A.(\lambda:L\texttt{Nat} \times D\to A.F\pi_2 b)\oplus\lambda:R\texttt{Nat} \times D\to A.GH(\delta_2^\texttt{Nat}\pi_1b,\pi_2b)\)

This isn't the most elegant way of presenting our function. Let's represent it in a more understandable way:


 * \(H(Rn,d) = G(n,H(n),d)\)
 * \(H(0,d) = F(d)\)

That's the function definitions taken care of, however we still need to prove the function is valid, by supplying the appropiate ordering \(<:\texttt{Nat} \times D\) for which \((\delta_2^\texttt{Nat}\pi_1b,\pi_2b) < b\) when \(b:R\texttt{Nat} \times D\). As it turns out, the standard ordering on \(\texttt{Nat} \times D\) is sufficient.

Proof of encoding Ackermann Function
The definition for the Ackermann function \(A:\texttt{Nat}^2 \to \texttt{Nat}\) is:


 * (\(S:\texttt{Nat} \to \texttt{Nat} = R\) and \(P:\mathbf 0 + \texttt{Nat} \to \texttt{Nat} = \delta_2\) are successor and predecessor.)
 * \(A(0,n) = Sn\)
 * \(A(Sn,0) = A(n,1)\)
 * \(A(Sn,Sm) = A(n,A(Sn,m))\)
 * So, as a \(\lambda\) expression: \(\lambda At:\texttt{Nat}^2 \to \texttt{Nat}.(\lambda: (\mathbf 1 + \mathbf 0) \times \texttt{Nat}.S\pi_2 t)\uplus(\lambda: (\mathbf 0 + \texttt{Nat}) \times (\mathbf 1 + \mathbf 0) \to \texttt{Nat}.A(P\pi_1t,1))\uplus(\lambda:(\mathbf 0 + \texttt{Nat})^2 \to \texttt{Nat}.A(P\pi_1t,A(\pi_1t,P\pi_2t)))\)

Hrm. As you can tell, the \(\lambda\) expression doesn't really make anything any clearer. We'll only write them out explicitly when it either shows the function works as expected, or makes things clearer.

Anyway, here we require an \(<:\texttt{Nat}^2\) so \((n,1) < (Rn,0)\), \((n,A(Rn,m)) < (Rn,Rm)\) and \((Rn,m) < (Rn,Rm)\). Either \(A\) is decreasing according to \(<\) (false), or we can simplify the second of these to \((n,x) < (Rn,Rm)\), arbitary \(x\), which suggests we order by the first component, then the second (lexicographic order).

Multi-variable Ackermann Function
Defintion:


 * A[\cdots_0, n] = n+1
 * A[\cdots, n+1, 0] = A[\cdots, n, 1]
 * A[\cdots, a+1, n+1] = A[\cdots, a, A[\cdots, a+1, n]]
 * A[\cdots, a+1, 0, \cdots_0, n] = A[\cdots, a, n, \cdots_0, n]

Hrm. Don't really like that \(A[\cdots, 0, 0] = 1\), but whatever, it's the only version with a wiki page.

Anyway, this is the point where we need to use the concept of a decreasing function (not just smaller subterm), and where case distinction can't just be realised at the type level. This is because we are defining a single \(A\) function that works on any length list, not a \(A\) function for each length.



Wainer Hierarchy



 * 1) END POST HEREISH

Presenting a notation in \(\tau\)
Make a new blag post for this? And leave until after \(\tau l\) and \(\tau\varepsilon\)?

>>> Give a schema sufficient for defining data structures and functions of many notations in \(\tau\), maintaining compatibility with the orderings that exist whenever possible.

>>> Give a list of simple functinos which can simply be stated as in \(\tau\) but are a bit more difficult to represent directly, and how to use the result (as it may return an encoded (as product) curried function).

>>> Have a bunch of methods that are still \(\tau\) but a lot easier to use than \(\tau\) directly. Basically syntactic sugar.

= Extenions =

This section will be periodically added to with various extensions. Hopefully, it will be fully up to date.

Summaries
Theory			complete? new types			new orderings		summary \(\tau\varepsilon\)	0%		no				yes, on \(\mu\alpha.A\) \(\tau l\)		0%		yes				yes \(\tau\to\)		0%		closure under \(\to\)		? \(\tau2^-\)		0%		so closure under \(\forall\)	no \(\tau\mathcal B\)	0%		fo closure under \(\nu\)	no?

Theory:			% Done:	Adds: \(\tau\varepsilon\)	0%	More embedding-based orderings \(\tau l\)		0%	Miscelleneous types and orderings \(\tau\to\)		0%	Arrow types, and recursive types without negation fixed points \(\tau2^-\)		0%	Polytypes (universal quantification over function types) \(\tau\mathcal B\)	0%	Corecursive types and bar recursion

Embedding Orderings: \(\tau\varepsilon\)
This is easily the most useful extension currently planned. It allows weakenings of the embedding ordering to be made, which in turn allows for ordinal collapsing functions to be encoded, greatly boosting the system.

Miscelleneous Types and Orders: \(\tau l\)
This extension is in part syntactic sugar. It adds many new basic types and orderings designed so that the system becomes more intuitive to use and so that the encoding is less extrenuous.

Higher Order: \(\tau\to\)
This extension closes the system under arrow types. It is a simple extension that allows function exponentiation, and function-to-function transformations in general (functionals) to be described. It also allows recursive types to be applied to arrow types in ways that preserve normalisation and the existence of empty types.


 * 1) \(\alpha \in \alpha\)
 * 2) \(\alpha \in A\) implies \(\alpha \in D\) where \(D\) is \(A+B\), \(B+A\), \(A \times B\), or \(B \times A\)
 * 3) \(\alpha \in A\) or \(-\alpha \in B\) implies \(\alpha \in A \to B\)
 * 4) \(\alpha = --\alpha\)
 * 5) \(\mu\alpha.A\) can only be done if \(-\alpha \notin A\)

Polytypes: \(\tau2^-\)
This extension adds polytypes, which allow universal quantification over function types. It doesn't increase the power of the theory, but does increase flexibility, by allowing creation of (for instance) a length-of function for lists of arbitary type, types for \(L\) and \(R\), and doesn't require type arguments (hence increasing syntactic flexibility).

However, this extension is arguably of little practical value, as interest is typically in functions on fixed types.

Corecursive: \(\tau\mathcal B\)
This extension adds corecursive types to the mix. These types enable us to encode some functions into first-order objects, encode real numbers, and use bar recursion. Notably, although bar recursion prevents us from using the full function space (when the domain type is corecursive, at least), we are able to have the type of real numbers encoded as a corecursive type, allowing proof of the recursiveness and totality of some functions \(f:\mathbb R \to \mathbb R\)


 * 1) Bar Recursion:
 * 2) \(\mathcal N = \mu\alpha.1 + \alpha\); \(\mathcal L = \mu\alpha.1 + \mathcal N \times \alpha\); \(\mathcal S = \mu\alpha.\mathcal N \times \alpha\)
 * 3) Source type fixed(?) to \(\mathcal N\), unfortunately
 * 4) Given \(Y: \mathcal S \to \mathcal N\), \(G: \mathcal L \to B\), \(H: \mathcal L \times \nu\alpha.B\times\alpha \to B\), produces \(\mathcal B[Y,G,H]: \mathcal L \to B\)
 * 5) Has following reduction rules: \(\mathcal B[Y,G,H](a) = G(a)\text{ if }Y(lstr(a)) < len(a)\); \(\mathcal B[Y,G,H](a) = H(a,fstr[\lambda n.\mathcal B[Y,G,H](R(n,a))) \text{ otherwise}\)
 * 6) Where lstr takes a list, reverses it, and returns a stream infinitely extending the result with zeroes, and fstr is the canonical transformation \((\mathcal N \to \mathcal N) \to \mathcal S