User blog comment:Alemagno12/Huge Ordinal Analysis/@comment-1605058-20180202100829

Here is a complete definition of Z3. The language consists of, apart from all the logical symbols and arithmetical operations, three kinds of variables - first-order variables representing natural numbers (lowercase letters), second-order variables representing sets of natural numbers (uppercase letters), and third-order variables representing sets of sets of natural numbers (caligraphic letters), and the inclusion symbol \(\in\), which can bind either a variable of the former two kinds (e.g. \(x\in X\)) or of the latter two kinds (e.g. \(X\in\mathcal X\)). Then the axioms are the following:


 * The standard Peano arithmetic axioms excluding induction,
 * The second-order induction axiom: \(\forall X:(0\in X\land\forall x:x\in X\implies Sx\in X)\implies\forall x:x\in X\),
 * The second-order comprehension schema: for any formula \(\varphi(x)\) with \(x\) a free first-order variable and with \(X\) not a free variable, \(\exists X\forall x:x\in X\iff\varphi(x)\),
 * The third-order comprehension schema: for any formula \(\varphi(X)\) with \(X\) a free second-order variable and with \(\mathcal X\) not a free variable, \(\exists\mathcal X\forall X:X\in\mathcal X\iff\varphi(X)\).

Actually, the comprehension schemata should also allow parameters - we should allow \(\varphi\) to have a number of free variables \(\forall x_1,\dots,x_k,X_1,\dots,X_l,\mathcal X_1,\dots,\mathcal X_m\) and in the axioms we require the comprehension holds for any choice of those, so the second-order comprehension should say \[\forall x_1,\dots,x_k,X_1,\dots,X_l,\mathcal X_1,\dots,\mathcal X_m\exists X\forall x:x\in X\iff\varphi(x,x_1,\dots,x_k,X_1,\dots,X_l,\mathcal X_1,\dots,\mathcal X_m)\] and similarly for third-order comprehension.

For any fixed-order arithmetic, the extension is obvious - you just add more variable kinds and add a comprehension scheme for each of them. Full higher-order arithmetic will contain variables of all finite orders and infinitely many schemata.