© 2021 Steven Obua

Abstraction Logic

by Steven Obua
Cite as: https://doi.org/10.47757/abstraction.logic.2
November 14th, 2021
Abstract
Abstraction Logic is introduced as a foundation for Practical Types [1] and Practal [2]. It combines the simplicity of first-order logic with direct support for variable binding constants called abstractions. It also allows free variables to depend on parameters, which means that first-order axiom schemata can be encoded as simple axioms. Conceptually abstraction logic is situated between first-order logic and second-order logic. It is sound with respect to an intuitive and simple algebraic semantics. Completeness holds for both intuitionistic and classical abstraction logic, and all abstraction logics in between and beyond.

Introduction

The goal of Practical Types [1] is to provide a foundation for formal machine-assisted reasoning that anyone would find empowering who is interested in rigorous thinking and design. This paper provides a foundation on which Practical Types will be built as a particular class of abstraction logics.
Like first-order logic, abstraction logic has a single universe of discourse, i.e. it is one-sorted. It goes even further than ordinary first-order logic in that truth values are part of this universe, i.e. the universe forms a Fregean domain [3].
Like higher-order logic and type theory, abstraction logic provides built-in support for variable binding constructs. But variable binding is not achieved indirectly via a function sort or type; instead it is directly modelled via shape specifications for (possibly) variable binding constructs called abstractions. Abstractions are simply the constants of abstraction logic. As a consequence α\alpha-equivalence of terms is a central concept in abstraction logic, but β/η\beta/\eta-conversion do not play any role at this level.
Free variables can depend on parameters. Thus where first-order logic needs axiom schemata consisting of infinitely many axioms, abstraction logic can express the same with a single axiom, just like higher-order logic. This is illustrated multiple times when we present several concrete abstraction logics .
Although abstraction logic started out as an investigation into the logic of Practical Types, it will be important for the design of Practal [2] in its own right. The relationship between Practal, Practical Types and abstraction logic is similar to the relationship between the Isabelle System [4] and its logics HOL and Pure. Locales [5] are an important mechanism for modular reasoning in Isabelle built on top of Pure. Because abstraction logic is simpler than type theory, but at the same time more versatile, the same should be true for an abstraction logic mechanism for modular reasoning inspired by locales.
The relationship between Practical Types and abstraction logic can also be compared to the relationship between set theory and first-order logic. Similarly, abstraction logic is not limited to Practical Types, it can provide a foundation for many applications where currently first-order logic is used. Furthermore, abstraction logic can be applied in places where previously higher-order logic was needed, as in the realm of interactive theorem proving.
Overview. We first list some notation . Then abstraction algebras  are introduced. Then the syntax  and semantics  of terms representing values in abstraction algebras is presented. De Bruijn terms  for abstraction syntax are defined next, and the treatment of α\alpha-equivalence  is based on them. After introducing substitution , we show that de Bruijn terms form an abstraction algebra themselves , and use this fact to show the fundamental role that α\alpha-equivalence plays. Finally abstraction logic  itself is introduced, and our notion of proof  is shown to be sound . Several examples  of abstraction logics are presented. We discuss consistency  in the context of abstraction logic. We construct the Rasiowa Abstraction Algebra  of any abstraction logic L{\mathcal{L}} that extends Deduction Logic with Equality , and use it to prove completeness  of any such L{\mathcal{L}}, including intuitionistic and classical abstraction logic. We conclude by briefly discussing matching and unification  of abstraction syntax terms.

Preliminaries

Let’s fix some general notation first:

Algebra

A shape σ\sigma prescribes a number mm of binders and a number nn of parameters. Furthermore it assigns to each parameter the set of binders it depends on. A shape is therefore written as (m;p0,,pn1)(m; p_0, \ldots, p_{n-1}) where m,nNm, n \in \mathbb{N}, and each pip_i is a subset of m{\overline{{m}}}. Furthermore we require that there are no superfluous binders: i=0n1pi=m\bigcup_{i=0}^{n-1} p_i = {\overline{{m}}} We call mm the valence of the shape, and nn its arity. Above condition implies that a shape with arity 00 necessarily has valence 00. It also implies that for a unary shape its sole parameter will depend on all binders.
An abstraction signature S=(a0:σ0,,ak1:σk1)\mathfrak{S} = (a_0 : \sigma_0, \ldots, a_{k-1} : \sigma_{k-1}) is a list of kk different abstractions aia_i, where each abstraction aia_i is associated with its shape σi\sigma_i.
An abstraction algebra A=(U;I;S){\mathfrak{A}} = (U; I; \mathfrak{S}) is a non-empty set UU together with an abstraction signature S\mathfrak{S} and an interpretation II which interprets an abstraction aia_i as an element I(ai)I(a_i) of the set ΛU(σi){\Lambda_{U}({\sigma_i})}. The set ΛU(σi){\Lambda_{U}({\sigma_i})} will be defined shortly.
Examples of abstractions and their shapes are:
We require an abstraction aa of shape σ\sigma to be an element of ΛU(σ){\Lambda_{U}({\sigma})}. We define ΛU(σ){\Lambda_{U}({\sigma})} for σ=(m;p0,,pn1)\sigma = (m; {p_0, \ldots, p_{n-1}}) as follows: ΛU(σ)={Uif n=0Fmp0(U)××Fmpn1(U)Uif n1 {\Lambda_{U}({\sigma})} = \begin{cases} U & \text{if}\ n = 0\\ {{{\mathcal{F}_{m}^{{p_0}}(U)} \times \ldots \times {\mathcal{F}_{m}^{{p_{n-1}}}(U)}} \rightarrow U} & \text{if}\ n \geq 1 \end{cases} Here, for m1m \geq 1 and pmp \subseteq {\overline{{m}}}, we define Fmp(U){\mathcal{F}_{m}^{p}(U)} as follows: Fmp(U)={Uif p={fπmp(U)fUpU}UmUif p {\mathcal{F}_{m}^{p}(U)} = \begin{cases} U & \text{if}\ p = \emptyset\\ \{\, f \circ {\pi_m^p(U)} \,\mid\, f \in {{U^{{|p|}}} \rightarrow U} \} \subseteq {{U^m} \rightarrow U} & \text{if}\ p \neq \emptyset \end{cases} The projections πmp(U):UmUp{\pi_m^p(U)} : {{U^m} \rightarrow {U^{|{p}|}}} are defined for p=i0,,in1p = {\langle {i_0, \ldots, i_{n-1}} \rangle} via (u0,,um1)(ui0,,uin1)(u_0, \ldots, u_{m-1}) \mapsto (u_{i_0}, \ldots, u_{i_{n-1}})
In particular, if the valence of σ\sigma is 00 and its arity nn, then ΛU(σ)={Uif n=0UnUif n0 {\Lambda_{U}({\sigma})} = \begin{cases} U & \text{if}\ n = 0\\ {{U^n} \rightarrow U} & \text{if}\ n \neq 0 \end{cases}
Note that an abstract algebra as described by Rasiowa [6] (see also [7], [8] →) is thus simply an abstraction algebra where all abstractions have zero valence.
If the valence of σ\sigma is 11, then ΛU(σ)=F1p0(U)××F1pn1(U)U{\Lambda_{U}({\sigma})} = {{{\mathcal{F}_{1}^{{p_0}}(U)} \times \ldots \times {\mathcal{F}_{1}^{{p_{n-1}}}(U)}} \rightarrow U}, where F1pi(U){\mathcal{F}_{1}^{{p_i}}(U)} is either UU or UU{U \rightarrow U}, depending on whether pi=p_i = \emptyset or pi={0}p_i = \{0\}, respectively.
Continuing our previous examples, we can now say the following:
Bounded universal quantification x:T.P[x]\forall x : T.\, P[x] has shape (1;{},{0})(1; \{\}, \{0\}), and is therefore interpreted as an element of U×(UU)U{{U \times ({U \rightarrow U})} \rightarrow U}.
Another example is defined by funeqx.Tf[x]g[x]x:T.f[x]=g[x]\operatorname{funeq} x.\, T\, f[x]\, g[x] ≝ \forall x : T.\, f[x] = g[x] The shape of funeq\operatorname{funeq} is (1;{},{0},{0})(1; \{\}, \{0\}, \{0\}), and therefore funeq:U×(UU)×(UU)U\operatorname{funeq} : {{U \times ({U \rightarrow U}) \times ({U \rightarrow U})} \rightarrow U}

Syntax

Given an abstraction signature S=(a0:σ0,,ak1:σk1)\mathfrak{S} = (a_0 : \sigma_0, \ldots, a_{k-1} : \sigma_{k-1}) and a set of variables XX, we define the set TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} of terms over S\mathfrak{S}. We require variables and abstractions not to overlap, of course, i.e. aiXa_i \notin X for all iki \in {\overline{{k}}}. We also require each variable xXx\in X to be associated with a fixed arity xarityN{x_{\operatorname{arity}}} \in \mathbb{N}.
The set TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} of terms is then defined inductively as follows:
Note that with this definition all terms in TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} are wellformed, although the definition makes only use of the valence and arity of an abstraction instead of its full shape. Of course, the full shape is important: it is needed to determine the free variables Free(t){\operatorname{Free}({t})} of a term tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})}. We define Free(t){\operatorname{Free}(t)} recursively, following the inductive definition of TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})}: Free(x[t0,,txarity1])={x}Free(t0)Free(txarity1)Free((ax0xm1.t0tn1))= (Free(t0){xi0,0,,xi0,p01}) (Free(t1){xi1,0,,xi1,p11}) (Free(tn1){xin1,0,,xin1,pn11})where σa=(m;p0,,pn1)and pj=ij,0,,ij,pj1 jn \begin{array}{lcl} {\operatorname{Free}({x[{t_0, \ldots, t_{{{x_{\operatorname{arity}}}}-1}}]})} & = & \{x\} \cup {\operatorname{Free}({t_0})} \cup \ldots \cup {\operatorname{Free}({t_{{x_{\operatorname{arity}}} - 1}})} \\[0.2cm] {\operatorname{Free}({(a\,x_0 \ldots x_{m-1}.\, t_0 \ldots t_{n-1})})} & = & \phantom{\cup\ }({\operatorname{Free}({t_0})} \setminus \{x_{i_{0, 0}}, \ldots, x_{i_{0, {|{p_0}|} - 1}}\}) \\ & &\cup\ ({\operatorname{Free}({t_1})} \setminus \{x_{i_{1, 0}}, \ldots, x_{i_{1, {|{p_1}|} - 1}}\}) \\ & & \vdots \\ & &\cup\ ({\operatorname{Free}({t_{n-1}})} \setminus \{x_{i_{n-1, 0}}, \ldots, x_{i_{n-1, {|{p_{n-1}}|} - 1}}\}) \\ & & \text{where}\ {\sigma_{a}} = (m; {p_0, \ldots, p_{n-1}}) \\ & & \text{and}\ p_j = \langle i_{j, 0}, \ldots, i_{j, {|{p_j}|} - 1} \rangle \ \forall j \in {\overline{{n}}} \end{array} In case of Free(t)={\operatorname{Free}(t)} = \emptyset, the term tt is called closed.
The following table examines our previous examples in terms of abstraction syntax: x=y(=.x y)x,yx.P[x](x.P[x])Pλx:T.A[x](λx.TA[x])T,Ax:T.P[x](x.TP[x])T,Pfuneqx.Tf[x]g[x](funeqx.Tf[x]g[x])T,f,gx:T.f[x]=g[x](x.T(=.f[x]g[x]))T,f,g \begin{array}{c|c|c} {\includegraphics[height=0.5em]{FF6AAFAC-BADB-41C3-ADC7-A1AAD402ED58}} & {\includegraphics[height=0.5em]{87C1D531-C2C1-42AF-9E21-8F87031148D8}} & {\includegraphics[height=0.5em]{49711145-C51A-4355-920C-D2354871B67C}} \\\hline x = y & (= .\, x\ y) & x, y \\ \forall x.\, P[x] & (\forall x.\, P[x]) & P \\ \lambda x : T.\, A[x] & (\lambda x .\, T\, A[x]) & T, A \\ \forall x : T.\, P[x] & (\forall x.\, T\, P[x]) & T, P \\ \operatorname{funeq} x.\, T\, f[x]\, g[x] & (\operatorname{funeq} x.\, T\, f[x]\, g[x]) & T, f, g\\ \forall x : T.\, f[x] = g[x] & (\forall x.\, T\, (= .\, f[x]\, g[x])) & T, f, g \end{array} Note that xx is a free variable of the expression λx:x. x\lambda x : x.\ x Although the variable xx is bound in the second parameter of λ\lambda, it occurs free in the first parameter of λ\lambda, and is therefore a free variable of the entire expression.

Semantics

Given a set FF of variables, and a set UU, a valuation ν\nu of FF in UU is a mapping that assigns to each xFx \in F with xarity=0{x_{\operatorname{arity}}} = 0 an element ν(x)U\nu(x) \in U, and to each xFx \in F with xarity1{x_{\operatorname{arity}}} \geq 1 a function ν(x)UxarityU\nu(x) \in {{U^{{x_{\operatorname{arity}}}}} \rightarrow U}. We denote the set of valuations of FF in UU by (F,U){\includegraphics[height=0.5em]{4C074B62-3A5B-434A-99AE-50F05AE46B36}}(F, U).
Let S\mathfrak{S} be an abstraction signature, and A=(U;I;S){\mathfrak{A}} = (U; I; \mathfrak{S}) an abstraction algebra with signature S\mathfrak{S}. Given a term tTX(S)t \in {\mathcal{T}_{X}({\mathfrak{S}})}, any valuation ν\nu of Free(t){\operatorname{Free}(t)} in UU determines an element νtU{\nu}\llbracket{t}\rrbracket \in U, recursively defined as follows:
If tt is a closed term, then νt{\nu}\llbracket{t}\rrbracket is independent of the choice of the valuation ν\nu in UU, and we can therefore define tA=νt{{\llbracket t \rrbracket}_{{\mathfrak{A}}}} = {\nu}\llbracket{t}\rrbracket

De Bruijn Terms

Terms TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} provide an adequate user interface for humans, but are awkward to handle from a technical point of view. This becomes apparent when formulating more complex operations on terms, like substitution. One reason for this awkwardness is the potential of clashes between bound variables and free variables. Another reason is that two terms which are semantically equivalent, like (ax.x)(a\, x.\, x) and (ay.y)(a\, y.\, y), can nevertheless be syntactically different because of different choices for the names of bound variables.
In actual software implementations of logic, a common approach to deal with this problem is called locally nameless [9]. The following definitions are inspired by this approach. We first define de Bruijn preterms BXpre(S){\mathcal{B}_{{X}}^{\text{pre}}({\mathfrak{S}})}:
The idea is that a term like (axy.(b.xy)(cx.xy))(a\, x\, y.\, (b.\, x\, y)\, (c\, x.\, x\, y)) corresponds to the de Bruijn term (a(b01)(c02))(a\, (b\, \uparrow\hspace{-0.15em}{{0}}\, \uparrow\hspace{-0.15em}{{1}})\, (c\, \uparrow\hspace{-0.15em}{{0}}\, \uparrow\hspace{-0.15em}{{2}}))
This correspondence is made precise by the mapping α:TX(S)BXpre(S)\alpha : {{{\mathcal{T}_{{X}}({\mathfrak{S}})}} \rightarrow {{\mathcal{B}_{{X}}^{\text{pre}}({\mathfrak{S}})}}} Let X0={xXxarity=0}X_0 = \{x \in X \mid {{x}_{\operatorname{arity}}} = 0\}. To define α\alpha, we first define a function α:TX(S)×(X0N)BXpre(S)\alpha' : {{{\mathcal{T}_{{X}}({\mathfrak{S}})} \times ({{X_0} ↪ {\mathbb{N}}})} \rightarrow {{\mathcal{B}_{{X}}^{\text{pre}}({\mathfrak{S}})}}} which keeps track of the current mapping of bound variables to de Bruijn indices: α(x[t0,,tn1],η)=x[α(t0,η),,α(tn1,η)]if η is undefined at xα(x,η)=η(x)if η is defined at xα((ax0xm1.t0tn1),η)=(at0tn1)where the shape of a=(m;p0,,pn1)and for all  in, ti=α(ti,(η+m)[xpipi]) \begin{array}{rcl} \alpha'(x[{t_0, \ldots, t_{n-1}}], \eta) & = & x[\alpha'(t_0, \eta), \ldots, \alpha'(t_{n - 1}, \eta)] \\ & & \text{if}\ \eta\ \text{is undefined at}\ x \\[0.5em] \alpha'(x, \eta) & = & \uparrow\hspace{-0.15em}{{\eta(x)}} \\ & & \text{if}\ \eta\ \text{is defined at}\ x\\[0.5em] \alpha'((a\,x_0 \ldots x_{m-1}.\, t_0 \ldots t_{n-1}), \eta) & = & (a\, t'_0 \ldots t'_{n-1}) \\ \text{where the shape of}\ a &=& (m; {p_0, \ldots, p_{n-1}}) \\ \text{and for all }\ i \in {\overline{{n}}},\ t'_i & = & \alpha'(t_i, (\eta + m)[\overline{x_{p_i} \coloneqq p_i}]) \end{array} For any partial function f:UNf : {U ↪ {\mathbb{N}}} and any mNm \in \mathbb{N} we define f=f+mf' = f + m in the obvious way such that f(u)=f(u)+mf'(u) = f(u) + m holds if ff is defined at uUu \in U.
Then we can define α\alpha by α(t)=α(t,)\alpha(t) = \alpha'(t, \emptyset)
Of particular interest are those elements of BXpre(S){\mathcal{B}_{{X}}^{\text{pre}}({\mathfrak{S}})} that are in the image of α\alpha. We are also interested in (part of) the image of α\alpha': BXh(S)={α(t,η)(t,η)TX(S)×(X0h)}BX(S)=h=0BXh(S) \begin{array}{rcl} {\mathcal{B}_{{X}}^{h}({\mathfrak{S}})} & = & \left\{ \alpha'(t, \eta) \mid (t, \eta) \in {\mathcal{T}_{{X}}({\mathfrak{S}})} \times ({{X_0} ↪ {{\overline{h}}}}) \right\} \\[0.5em] {\mathcal{B}_{{X}}({\mathfrak{S}})} & = & \bigcup_{h = 0}^\infty\, {\mathcal{B}_{{X}}^{h}({\mathfrak{S}})} \end{array} The image of α\alpha therefore is BX0(S){\mathcal{B}_{{X}}^{0}({\mathfrak{S}})}. We call BX(S){\mathcal{B}_{{X}}({\mathfrak{S}})} the set of de Bruijn terms, and BXh(S){\mathcal{B}_{{X}}^{h}({\mathfrak{S}})} is the set of de Bruijn terms with at most hh holes.
Instead of defining de Bruijn terms indirectly via α\alpha', it is easy to carve them out of de Bruijn preterms in a more direct fashion. For that we need the notion of free atoms FreeAtoms(t){\operatorname{FreeAtoms}(t)} of a de Bruijn preterm tBXpre(S)t \in {\mathcal{B}_{{X}}^{\text{pre}}({\mathfrak{S}})}: FreeAtoms(t)=FreeAtoms0(t)FreeAtomsl(n)={if n<l{nl}if nlFreeAtomsl(x[t0,,tn1])={x}i=0n1FreeAtomsl(ti)FreeAtomsl((at0tn1))=i=0n1FreeAtomsl+m(ti)where m is the valence of a \begin{array}{rcl} {\operatorname{FreeAtoms}(t)} & = & {\operatorname{FreeAtoms}_{0}(t)} \\[0.5em] {\operatorname{FreeAtoms}_{l}({\uparrow\hspace{-0.15em}{n}})} & = & \begin{cases} \emptyset & \text{if}\ n < l\\ \{n - l\} & \text{if}\ n \geq l \end{cases}\\[1.5em] {\operatorname{FreeAtoms}_{l}({x[{t_0, \ldots, t_{n-1}}]})} & = & \{x\} \cup \bigcup_{i=0}^{n-1} {\operatorname{FreeAtoms}_{l}({t_i})} \\[0.8em] {\operatorname{FreeAtoms}_{l}({(a\,t_0\ldots t_{n-1})})} & = & \bigcup_{i=0}^{n-1} {\operatorname{FreeAtoms}_{{l + m}}({t_i})} \\ & & \text{where}\ m\ \text{is the valence of}\ a \end{array}
De Bruijn terms BX(S){\mathcal{B}_{{X}}({\mathfrak{S}})} are then those de Bruijn preterms tt such that for every subpreterm of tt of the form (at0tn1)(a\,t_0 \ldots t_{n-1}) the inclusion FreeAtoms(ti)mpi {\operatorname{FreeAtoms}({t_i})}\, \cap \uparrow\hspace{-0.15em}{{{\overline{m}}}} \subseteq\, \uparrow\hspace{-0.15em}{{p_i}} holds for all ini \in {\overline{n}}. Here the shape of aa is (m;p0,,pn1)(m; {p_0, \ldots, p_{n-1}}).
Note that an immediate consequence of this characterisation is that every subterm of a de Bruijn term is also a de Bruijn term.
Furthermore, note that BXh(S)={tBX(S)FreeAtoms(t)Nh}{\mathcal{B}_{{X}}^{h}({\mathfrak{S}})} = \left\{ t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} \mid {\operatorname{FreeAtoms}(t)}\,\cap \uparrow\hspace{-0.15em}{{\mathbb{N}}} \subseteq\, \uparrow\hspace{-0.15em}{{{\overline{h}}}} \right\}

α\alpha-Equivalence

We say that two terms ss and tt in TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} are α\alpha-equivalent iff α(s)=α(t)\alpha(s) = \alpha(t)
The importance of α\alpha-equivalence stems from the fact that it is the same as semantical equivalence. We call ss and tt in TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} semantically equivalent iff for any abstraction algebra (U;I;S)(U; I; \mathfrak{S}), and for any valuation ν(X,U)\nu \in {\includegraphics[height=0.5em]{F47FEC58-3FC9-437D-8276-F73D733DA708}}({X}, U), we have ν(s)=ν(t)\nu(s) = \nu(t).
We first show that α\alpha-equivalence implies semantical equivalence.
To this end, we define valuations also on de Bruijn terms. Given a set FF of variables and a subset NN of N\mathbb{N}, a de Bruijn valuation ν\nu of FNF\, \cup \uparrow\hspace{-0.15em}{{N}} in UU is a mapping such that ν\nu is a valuation of FF in UU, and additionally, ν\nu assigns to each n\uparrow\hspace{-0.15em}{{n}} an element ν(n)U\nu(\uparrow\hspace{-0.15em}{{n}}) \in U for all nNn \in N.
Any valuation ν\nu of FreeAtoms(t){\operatorname{FreeAtoms}({t})} in UU determines an element νtU{\nu}\llbracket{t}\rrbracket \in U: νn=ν(n)νx[t0,,tn1]=ν(x)(νt0,,νtn1)ν(at0tn1)=I(a)(νt0,,νtn1)if the valence of a is 0ν(at0tn1)=I(a)(f0,,fn1)if the valence of a is m1where fi(u0,,um1)=m(ν)[0u0,,(m1)um1]tifor all (u0,,um1)Um \begin{array}{rcl} {\nu}\llbracket{{\uparrow\hspace{-0.15em}{n}}}\rrbracket & = & \nu(\uparrow\hspace{-0.15em}{n}) \\[0.5em] {\nu}\llbracket{{x[{t_0, \ldots, t_{n-1}}]}}\rrbracket & = & \nu(x)({\nu}\llbracket{{t_0}}\rrbracket, \ldots, {\nu}\llbracket{{t_{n-1}}}\rrbracket)\\[0.5em] {\nu}\llbracket{{(a\,t_0\ldots t_{n-1})}}\rrbracket & = & I(a)({\nu}\llbracket{{t_0}}\rrbracket, \ldots, {\nu}\llbracket{{t_{n-1}}}\rrbracket)\\ & & \text{if the valence of}\ a\ \text{is}\ 0 \\[0.5em] {\nu}\llbracket{{(a\,t_0\ldots t_{n-1})}}\rrbracket & = & I'(a)(f_0, \ldots, f_{n-1})\\ & & \text{if the valence of}\ a\ \text{is}\ m \geq 1 \\ \text{where}\ f_i({u_0, \ldots, u_{m-1}})& = & {\uparrow^{m}\hspace{-0.15em}({\nu})[\uparrow\hspace{-0.15em}{{0}} \coloneqq u_0, \ldots, \uparrow\hspace{-0.15em}{{(m-1)}} \coloneqq u_{m-1}]}\llbracket{{t_i}}\rrbracket\\ & & \text{for all}\ ({u_0, \ldots, u_{m-1}}) \in U^m \end{array}
Here II' is a slight modification of the interpretation II in that where I(a)I(a) expects an element eUe \in U as one of its arguments, I(a)I'(a) will accept a constant function (u0,,um1)e({u_0, \ldots, u_{m-1}}) \mapsto e instead. Otherwise, II' and II are identical.
The valuation m(ν)\uparrow^{m}\hspace{-0.15em}({\nu}) is derived from ν\nu via m(ν)(x)=ν(x)where xXm(ν)((m+n))=ν(n)where nN \begin{array}{rcll} \uparrow^{m}\hspace{-0.15em}({\nu})(x) & = & \nu(x) & \text{where}\ x \in X \\ \uparrow^{m}\hspace{-0.15em}({\nu})(\uparrow\hspace{-0.15em}{{(m + n)}}) & = & \nu(\uparrow\hspace{-0.15em}{n}) & \text{where}\ n \in \mathbb{N} \end{array} In the above the left hand sides are defined iff the right hand sides are defined.
It is not immediately obvious that ν(at0tn1){\nu}\llbracket{{(a\,t_0\ldots t_{n-1})}}\rrbracket is well-defined, because in order to be able to apply I(a)I'(a) to (f0,,fn1)({f_0, \ldots, f_{n-1}}), the fif_i cannot be just any functions in UmU{{U^m} \rightarrow U}. Assuming that the shape of aa is (m;p0,,pn1)(m; {p_0, \ldots, p_{n-1}}), if pi=p_i = \emptyset, fif_i must be a constant function, and for pip_i \neq \emptyset, fif_i needs to be in Fmpi(U){\mathcal{F}_{m}^{{p_i}}(U)}. But this is easily seen to be the case, given that νtνt{\nu'}\llbracket{t}\rrbracket \neq {\nu}\llbracket{t}\rrbracket only holds if ν\nu' and ν\nu have a different assignment for some qFreeAtoms(t)q \in {\operatorname{FreeAtoms}(t)}, and according to our earlier observation , FreeAtoms(ti)mpi{\operatorname{FreeAtoms}({t_i})}\, \cap \uparrow\hspace{-0.15em}{{{\overline{m}}}} \subseteq\, \uparrow\hspace{-0.15em}{{p_i}}.
Given a valuation ν(X,U)\nu \in {\includegraphics[height=0.5em]{B2734E0C-053C-4DC9-A5E3-B9B30088182A}}({X}, U), together with an injective function η:X0N\eta : {{X_0} ↪ {\mathbb{N}}}, the corresponding de Bruijn valuation νη\nu_\eta is defined as νη(x)=ν(x)where xXνη(n)=ν(x)where η(x)=n \begin{array}{rcll} \nu_\eta(x) & = & \nu(x) & \text{where}\ x \in X \\ \nu_\eta(\uparrow\hspace{-0.15em}{n}) & = & \nu(x) & \text{where}\ \eta(x) = n \end{array} We prove that for any term tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})}, any valuation ν(X,U)\nu \in {\includegraphics[height=0.5em]{A67B38AA-0E23-4CC7-8340-BB13C8F095C9}}({X}, U), and any injective η:X0N\eta : {{X_0} ↪ {\mathbb{N}}}, we have νηα(t,η)=νt {\nu_\eta}\llbracket{{\alpha'(t, \eta)}}\rrbracket = {\nu}\llbracket{t}\rrbracket\quad
The proof is by induction over tt:
In particular, for tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} and ν(X,U)\nu \in {\includegraphics[height=0.5em]{070CF6F8-5A9F-4A22-8ACD-F5F6EFC19D5E}}({X}, U): να(t)=νt {\nu}\llbracket{{\alpha(t)}}\rrbracket = {\nu}\llbracket{t}\rrbracket An immediate consequence is that α\alpha-equivalence implies semantical equivalence: Let ss and tt be α\alpha-equivalent terms in TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})}, i.e. α(s)=α(t)\alpha(s) = \alpha(t). Then for all valuations ν(X,U)\nu \in {\includegraphics[height=0.5em]{B9B27D46-49AE-4423-B5C6-F1730BE3FB1A}}({X}, U), we have νs=να(s)=να(t)=νt{\nu}\llbracket{s}\rrbracket = {\nu}\llbracket{{\alpha(s)}}\rrbracket = {\nu}\llbracket{{\alpha(t)}}\rrbracket = {\nu}\llbracket{t}\rrbracket

Substitution

Before showing that semantical equivalence implies α\alpha-equivalence in the next section , we will first consider how to perform substitution of (some of) the free atoms in a de Bruijn term.
A substitution is a function σ:DBX(S)\sigma : {{D} \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} with domain DXND \subseteq X\, \cup \uparrow\hspace{-0.15em}{{\mathbb{N}}}. Application t/σt / {\sigma} of a substitution σ:DBX(S)\sigma : {{D} \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} to a de Bruijn term tBX(S)t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} is recursively defined as follows: n/σ=σ(n)if n is in the domain of σn/σ=nif n is not in the domain of σx[t0,,tn1]/σ=(σ(x)/[0t0,,(n1)tn1])nif x is in the domain of σ;here  denotes the empty substitution,and ti=(ti/σ)+nx[t0,,tn1]/σ=x[t0/σ,,tn1/σ]if x is not in the domain of σ(at0tn1)/σ=(at0tn1) where ti=ti/m(σ),given the valence of a is m \begin{array}{rcll} {\uparrow\hspace{-0.15em}{n}} / {\sigma} & = & \sigma(\uparrow\hspace{-0.15em}{n}) \\ & & \text{if}\ \uparrow\hspace{-0.15em}{n}\ \text{is in the domain of}\ \sigma \\[0.5em] {\uparrow\hspace{-0.15em}{n}} / {\sigma} & = & \uparrow\hspace{-0.15em}{n} \\ & & \text{if}\ \uparrow\hspace{-0.15em}{n}\ \text{is not in the domain of}\ \sigma \\[0.5em] {x[{t_0, \ldots, t_{n-1}}]} / {\sigma} & = & ({\sigma(x)} / {\emptyset[\uparrow\hspace{-0.15em}{0} \coloneqq t'_0, \ldots, \uparrow\hspace{-0.15em}{{(n-1)}} \coloneqq t'_{n-1}]}) - n \\ & & \text{if}\ x\ \text{is in the domain of}\ \sigma;\\ & & \text{here}\ \emptyset\ \text{denotes the empty substitution}, \\ & & \text{and}\ t'_i = ({t_i} / {\sigma}) + n \\[0.5em] {x[{t_0, \ldots, t_{n-1}}]} / {\sigma} & = & x[{t_0} / {\sigma}, \ldots, {t_{n-1}} / {\sigma}] \\ & & \text{if}\ x\ \text{is not in the domain of}\ \sigma \\[0.5em] {(a\, t_0 \ldots t_{n-1})} / {\sigma} & = & (a\, t'_0 \ldots t'_{n-1})\ \text{where}\ t'_i =\, {t_i} / {\uparrow^{m}\hspace{-0.15em}({\sigma})},\\ & & \text{given the valence of}\ a\ \text{is}\ m \end{array} In the above definition we used the expression t+zt + z for tBX(S)t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} and zZz \in \mathbb{Z}. This expression is only defined if for all nFreeAtoms(t)\uparrow\hspace{-0.15em}{n} \in {\operatorname{FreeAtoms}(t)}, we have n+z0n + z \geq 0. Then: t+z=t+0zn+lz=nif n<ln+lz=(n+z)if nlx[t0,,tn1]+lz=x[t0+lz,,tn1+lz](at0tn1)+lz=(a(t0+l+mz)(tn1+l+mz))where the valence of a is m \begin{array}{rcll} t + z & = & t +_0 z &\\ \uparrow\hspace{-0.15em}{n} +_l z & = & \uparrow\hspace{-0.15em}{n} & \text{if}\ n < l \\ \uparrow\hspace{-0.15em}{n} +_l z & = & \uparrow\hspace{-0.15em}{{(n + z)}} & \text{if}\ n \geq l \\ x[{t_0, \ldots, t_{n-1}}] +_l z & = & x[t_0 +_l z, \ldots, t_{n-1} +_l z] \\ (a\, t_0 \ldots t_{n-1}) +_l z & = & (a\, (t_0 +_{l + m} z) \ldots (t_{n-1} +_{l + m} z)) \\ & & \text{where the valence of}\ a\ \text{is}\ m \end{array}
Furthermore, we define m(σ)\uparrow^{m}\hspace{-0.15em}({\sigma}) for a substitution σ:DBX(S)\sigma : {{D} \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} and mNm \in \mathbb{N} by m(σ)(x)=σ(x)+xaritymfor xXDm(σ)((m+n))=σ(n)+mfornD \begin{array}{rcll} \uparrow^{m}\hspace{-0.15em}({\sigma}) (x) & = & \sigma(x) +_{{x_{\operatorname{arity}}}} m & \text{for}\ x \in X \cap D \\ \uparrow^{m}\hspace{-0.15em}({\sigma}) (\uparrow\hspace{-0.15em}{{(m + n)}}) & = & \sigma(\uparrow\hspace{-0.15em}{n}) + m & \text{for} \uparrow\hspace{-0.15em}{n} \in D \end{array} Then m(σ)\uparrow^{m}\hspace{-0.15em}({\sigma}) is a substitution with domain (XD){(m+n)nD}(X \cap D) \cup \{\uparrow\hspace{-0.15em}{{(m + n)}} \mid\, \uparrow\hspace{-0.15em}{n} \in D\}.
We define the free atoms of a substitution σ:DBX(S)\sigma : {{D} \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} by FreeAtoms(σ)=nDFreeAtoms(σ(n))xDX{qxarityqFreeAtoms(σ(x))xarity)} \begin{array}{rcl} {\operatorname{FreeAtoms}({\sigma})} & = & \bigcup_{\uparrow n \in D} {\operatorname{FreeAtoms}({\sigma(\uparrow\hspace{-0.15em}{n})})} \\ & \cup & \bigcup_{x \in D \cap X} \{q - {{x}_{\operatorname{arity}}} \mid q \in {\operatorname{FreeAtoms}({\sigma(x)})} \setminus {\overline{{{{x}_{\operatorname{arity}}}}}})\} \end{array}
We call a substitution σ:DBX(S)\sigma : {D \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} regular if FreeAtoms(σ)X{\operatorname{FreeAtoms}({\sigma})} \subseteq X.
For regular σ\sigma we have σ(x)BXxarity(S)\sigma(x) \in {\mathcal{B}_{{X}}^{{{x_{\operatorname{arity}}}}}({\mathfrak{S}})} for all xDXx \in D \cap X and σ(n)BX0(S)\sigma(\uparrow\hspace{-0.15em}{n}) \in {\mathcal{B}_{{X}}^{0}({\mathfrak{S}})} for all nD\uparrow\hspace{-0.15em}{n} \in D.
Note that if σ\sigma is regular, then m(σ)\uparrow^{m}\hspace{-0.15em}({\sigma}) is regular, too.
Given a de Bruijn valuation ν\nu of FF in UU, any regular substitution σ:DBX(S)\sigma : {{D} \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} with FreeAtoms(σ)F{\operatorname{FreeAtoms}({\sigma})} \subseteq F induces a de Bruijn valuation νσ\nu_\sigma of FDF \cup D in UU via νσ(q)=ν(q)if qFDνσ(n)=νσ(n)if nDνσ(x)=νσ(x)if xDX0νσ(x)=(u0,,un1)ν[0u0,,(n1)un1]σ(x)if xDX and where xarity=n>0 \begin{array}{rcl} \nu_\sigma(q) & = & \nu(q) \\ & & \text{if}\ q \in F \setminus D \\[0.5em] \nu_\sigma(\uparrow\hspace{-0.15em}{n}) & = & {\nu}\llbracket{{\sigma(\uparrow\hspace{-0.15em}{n})}}\rrbracket\\ & & \text{if}\ \uparrow\hspace{-0.15em}{n} \in D \\[0.5em] \nu_\sigma(x) & = & {\nu}\llbracket{{\sigma(x)}}\rrbracket\\ & & \text{if}\ x \in D \cap X_0 \\[0.5em] \nu_\sigma(x) & = & ({u_0, \ldots, u_{n-1}}) \mapsto\, {\nu[\uparrow\hspace{-0.15em}{0} \coloneqq u_0, \ldots, \uparrow\hspace{-0.15em}{{(n-1)}} \coloneqq u_{n-1}]}\llbracket{{\sigma(x)}}\rrbracket \\ & & \text{if}\ x \in D \cap X \ \text{and where}\ {x_{\operatorname{arity}}} = n > 0 \end{array}
The following holds for any tBX(S)t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} with FreeAtoms(t)FD{\operatorname{FreeAtoms}(t)} \subseteq F \cup D: νt/σ=νσt {\nu}\llbracket{{t / {\sigma}}}\rrbracket = {\nu_\sigma}\llbracket{t}\rrbracket We prove this by induction on tt:

De Bruijn Abstraction Algebra

Given an abstraction signature S\mathfrak{S} and a set of variables XX, we define an abstraction algebra BX(S)=(U;I;S)\mathfrak{B}_{{X}}({\mathfrak{S}}) = (U; I; \mathfrak{S}) such that U=BX(S){} \begin{array}{rcl} U & = & {\mathcal{B}_{{X}}({\mathfrak{S}})} \uplus \{\star\} \end{array} The symbol \star represents an undefined value.
To define the interpretation II, let us first define functions Ψh:BX(S)(UhU)\Psi_h : {{{\mathcal{B}_{{X}}({\mathfrak{S}})}} \rightarrow {({{U^h} \rightarrow U})}} for hNh \in \mathbb{N} and h>0h > 0 via Ψh(t)(u0,,uh1)=(t/[j0uj0+h,,jl1ujl1+h])hwhere hFreeAtoms(t)=j0,,jl1and where ui for allij0,,jl1Ψh(t)(u0,,uh1)=if ui= for some ihFreeAtoms(t) \begin{array}{rcl} \Psi_h(t)({u_0, \ldots, u_{h-1}}) & = &(t / {\emptyset[\uparrow\hspace{-0.15em}{{j_0}} \coloneqq u_{j_0} + h, \ldots, \uparrow\hspace{-0.15em}{{j_{l-1}}} \coloneqq u_{j_{l-1}} + h]}) - h\\ & & \text{where}\ \uparrow\hspace{-0.15em}{{{\overline{h}}}} \cap {\operatorname{FreeAtoms}(t)} =\, \uparrow\hspace{-0.15em}{{{\langle {j_0, \ldots, j_{l-1}} \rangle}}} \\ & & \text{and where}\ u_i \neq \star \ \text{for all}\, i \in {\langle {j_0, \ldots, j_{l-1}} \rangle} \\[0.5em] \Psi_h(t)({u_0, \ldots, u_{h-1}}) & = & \star \\ & & \text{if}\ u_i = \star \ \text{for some}\ \uparrow\hspace{-0.15em}{i} \in\, \uparrow\hspace{-0.15em}{{{\overline{h}}}} \cap {\operatorname{FreeAtoms}(t)} \end{array} It is easy to see that Ψh\Psi_h is injective: Assume s,tBX(S)s, t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} and sts \neq t. Then ss and tt must differ at some topmost position. If both ss and tt contain in that position only abstractions, variables, or de Bruijn indices not corresponding to one of the hh function arguments, then this difference will survive the substitution. If only one of them contains a function argument de Bruijn index, then just vary the corresponding argument to produce a difference. If both contain function argument de Bruijn indices, then the indices must be different, so just pass different arguments for those two indices to produce a difference.
Assume now aa is an abstraction of shape (m;p0,,pn1)(m; {p_0, \ldots, p_{n-1}}). What is I(a)I(a)?
We call BX(S)\mathfrak{B}_{{X}}({\mathfrak{S}}) the de Bruijn Abstraction Algebra for S\mathfrak{S} and XX.
There is a straightforward relationship between valuation in BX(S)\mathfrak{B}_{{X}}({\mathfrak{S}}) and substitution. To state this relationship we need the notion of strict valuation. This is a valuation ν:DU\nu : {D \rightarrow U} such that for all xDXx \in D \cap X with xarity>0{{x}_{\operatorname{arity}}} > 0 ν(x)(u0,,uxarity1)=if ui= for some ixarity \nu(x)({u_0, \ldots, u_{{{{x}_{\operatorname{arity}}}}-1}}) = \star \quad\text{if}\ u_i = \star\ \text{for some}\ i \in {\overline{{{{x}_{\operatorname{arity}}}}}} We need strict valuations because they possess the following property. Given a term tBX(S)t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} with FreeAtoms(t)D{\operatorname{FreeAtoms}(t)} \subseteq D, then νt=if ν(q)= for some qFreeAtoms(t) {\nu}\llbracket{t}\rrbracket = \star \quad \text{if}\ \nu(q) = \star\ \text{for some}\ q \in {\operatorname{FreeAtoms}(t)}
We prove this by induction over tt:
Given a substitution σ:DBX(S)\sigma : {D \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}}, we can view it as a de Bruijn valuation σ\sigma' of DD in UU as follows: σ(n)=σ(n)if nDσ(x)=σ(x)if xX0Dσ(x)=Ψxarity(σ(x))if xXD and xarity>0 \begin{array}{rcll} \sigma'(\uparrow\hspace{-0.15em}{n}) & = & \sigma(\uparrow\hspace{-0.15em}{n}) & \text{if}\ \uparrow\hspace{-0.15em}{n} \in D\\ \sigma'(x) & = & \sigma(x) & \text{if}\ x \in X_0 \cap D \\ \sigma'(x) & = & \Psi_{{x_{\operatorname{arity}}}}(\sigma(x)) & \text{if}\ x \in X \cap D\ \text{and}\ {x_{\operatorname{arity}}} > 0 \end{array}
We call σ\sigma a strict substitution if σ\sigma' is a strict valuation. An equivalent characterisation of a strict substitution σ:DBX(S)\sigma : {D \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} is that for all xDXx \in D \cap X FreeAtoms(σ(x))xarity=xarity {\operatorname{FreeAtoms}({\sigma(x)})}\, \cap \uparrow\hspace{-0.15em}{{{\overline{{{x_{\operatorname{arity}}}}}}}} =\, \uparrow\hspace{-0.15em}{{{\overline{{{x_{\operatorname{arity}}}}}}}}
Applying a strict substitution σ:DBX(S)\sigma : {D \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} to a term tBX(S)t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} with FreeAtoms(t)D{\operatorname{FreeAtoms}(t)} \subseteq D is the same as applying the valuation σ\sigma' to tt: σt=t/σ{\sigma'}\llbracket{t}\rrbracket = t / {\sigma} We prove this by induction over tt.
Consider now the strict substitution ι:XBX(S)\iota : {X \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} defined by ι(x)=xif xX0ι(x)=x[0,,(xarity1)]if xXX0 \begin{array}{rcll} \iota(x) & = & x & \text{if}\ x \in X_0 \\ \iota(x) & = & x[\uparrow\hspace{-0.15em}{0}, \ldots, \uparrow\hspace{-0.15em}{{({{x}_{\operatorname{arity}}}-1)}}] & \text{if}\ x \in X \setminus X_0 \end{array} Obviously t/ι=tt / {\iota} = t holds for all tBX(S)t \in {\mathcal{B}_{{X}}({\mathfrak{S}})}, and thus also ιt=t/ι=t{\iota'}\llbracket{t}\rrbracket = t / {\iota} = t.
We call ι\iota the canonical substitution.
Assume two terms s,tTX(S)s, t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} which are semantically equivalent. Then α(s)=ια(s)=ιs=ιt=ια(t)=α(t) \alpha(s) = {\iota'}\llbracket{{\alpha(s)}}\rrbracket = {\iota'}\llbracket{{s}}\rrbracket = {\iota'}\llbracket{{t}}\rrbracket = {\iota'}\llbracket{{\alpha(t)}}\rrbracket = \alpha(t) and therefore ss and tt are α\alpha-equivalent.
Thus semantical equivalence implies α\alpha-equivalence. Together with our previous result that α\alpha-equivalence implies semantical equivalence this means that semantical equivalence and α\alpha-equivalence are equivalent.

Logic

A signature S\mathfrak{S}' extends a signature S\mathfrak{S} if every abstraction of S\mathfrak{S} is also an abstraction of S\mathfrak{S}', and has the same shape in both S\mathfrak{S} and S\mathfrak{S}'.
A logic algebra is a tuple L=(U;X;V;I;S)\mathfrak{L} = (U; X; V; I; \mathfrak{S}) such that
  1. (U;I;S)(U; I; \mathfrak{S}) is an abstraction algebra.
  2. XX is a set of variables, and VV is a non-empty subset of (X,U){\includegraphics[height=0.5em]{5FA0A1F7-27C7-47B5-8076-B55802A33E1D}}({X}, U) such that:
  3. S\mathfrak{S} is an extension of the signature S0{\mathfrak{S}_0}, where S0=(:(0;):(0;{},{}):(1;{0})) {\mathfrak{S}_0} = \left( \begin{array}{ccl} ⊤ & : & (0;) \\ ⇒ & : & (0; \{\}, \{\}) \\ ∀ & : & (1; \{0\}) \end{array} \right)
  4. I()(I(),b)=I()I(⇒)(I(⊤), b) = I(⊤) implies b=I()b = I(⊤) for all bUb \in U.
  5. For all f:UUf : {U \rightarrow U}, if f(u)=I()f(u) = I(⊤) for all uUu \in U, then I()(f)=I()I(∀)(f) = I(⊤).
A logic algebra is called degenerate if UU consists of a single element.
An abstraction logic L=(S;X;A){\mathcal{L}} = (\mathfrak{S}; X; {\mathbb{A}}) is a signature S\mathfrak{S} together with a set of variables XX and a set of axioms A{\mathbb{A}} such that
  1. S\mathfrak{S} is an extension of the signature S0{\mathfrak{S}_0}.
  2. XX is a set of variables with associated arities, such that both XX and X0X_0 are countably infinite.
  3. A{\mathbb{A}} is a subset of TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})}.
An abstraction logic L=(S;X;A){\mathcal{L}}' = (\mathfrak{S}'; X'; {\mathbb{A}}') is called an extension of L{\mathcal{L}} if S\mathfrak{S}' is an extension of S\mathfrak{S} and XXX \subseteq X' and AA{\mathbb{A}} \subseteq {\mathbb{A}}'.
We say that a logic algebra (U;X;V;I;S)(U; X; V; I; \mathfrak{S}) is a model for the term tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} if for every valuation νV\nu \in V we have νt=I(){\nu}\llbracket{t}\rrbracket = I(⊤).
We furthermore say that a logic algebra is a model for the logic L=(S;X;A){\mathcal{L}} = (\mathfrak{S}; X; {\mathbb{A}}) if it is a model for all axioms aATX(S)a \in {\mathbb{A}} \subseteq {\mathcal{T}_{{X}}({\mathfrak{S}})}. Note that any abstraction algebra with U=1{|U|} = 1 and signature S\mathfrak{S} induces a model for L{\mathcal{L}}.
If every model of L{\mathcal{L}} is also a model of tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})}, then we say that tt is valid in L{\mathcal{L}}: Lt {\mathcal{L}} ⊨ t

Proofs

Given a logic L=(S;X;A){\mathcal{L}} = (\mathfrak{S}; X; {\mathbb{A}}), a proof in L{\mathcal{L}} of tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} is one of the following:
  1. An axiom: AX(t)\operatorname{AX}(t) such that tAt \in {\mathbb{A}}.
  2. An application of substitution: SUBST(t,σ,ps)\operatorname{SUBST}(t, \sigma, p_s) where
  3. A use of modus ponens: MP(t,ph,pg)\operatorname{MP}(t, p_h, p_g) such that
  4. Introduction of the universal quantifier: ALL(t,x,ps)\operatorname{ALL}(t, x, p_s) where
If there exists a proof of tt in L{\mathcal{L}}, we say that tt is a theorem of L{\mathcal{L}}: Lt {\mathcal{L}} ⊢ t

Soundness

Abstraction logic is sound, i.e. every theorem of L=(S;X;A){\mathcal{L}} = (\mathfrak{S}; X; {\mathbb{A}}) is also valid in L{\mathcal{L}}: LtimpliesLt{\mathcal{L}} ⊢ t \quad\text{implies}\quad {\mathcal{L}} ⊨ t We show by induction over pp that if pp is a proof of tt in L{\mathcal{L}}, then tt is valid in L{\mathcal{L}}:

Several Abstraction Logics

In this section several abstraction logics of practical interest are introduced. We use convenient concrete syntax instead of pure abstraction syntax to present their axioms.
Deduction Logic LD{\mathcal{L}}_D has signature SD=S0\mathfrak{S}_D = {\mathfrak{S}_0} and the following axioms AD{\mathbb{A}}_D:
  1. AAA ⇒ A
  2. A(BA)A ⇒ (B ⇒ A)
  3. (A(BC))((AB)(AC))(A ⇒ (B ⇒ C)) ⇒ ((A ⇒ B) ⇒ (A ⇒ C))
  4. (x.A[x])A[x](∀ x.\,A[x]) ⇒ A[x]
  5. (x.AB[x])(Ax.B[x])(∀ x.\,A ⇒ B[x]) ⇒ (A ⇒ ∀ x.\, B[x])
Axiom 1 might surprise, because one would expect it to apply only to truth values, not the entire universe. But because abstraction logic has only a single universe of discourse, every value must also be considered to be a truth value, because for any term tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} one can ask the question: Is tt true?
Using these axioms one can prove the following deduction theorem: Any proof of AA in L+=(S,X,A{ϕ}){\mathcal{L}}^+ = (\mathfrak{S}, X, {\mathbb{A}} \cup \{\phi\}) can be translated into a proof of ϕA\phi' ⇒ A in the logic L=(S,X,A){\mathcal{L}} = (\mathfrak{S}, X, {\mathbb{A}}) as long as L{\mathcal{L}} extends LD{\mathcal{L}}_D. Here ϕ\phi' is the universal closure of ϕ\phi, i.e. ϕ=x0.x1.xn1.ϕ\phi' = ∀ x_0. ∀ x_1. \ldots ∀ x_{n-1}.\, \phi where Free(ϕ)={x0,,xn1}{\operatorname{Free}({\phi})} = \{x_0, \ldots, x_{n-1}\}.
In a system for machine-assisted theorem proving like Practal [2] it makes sense to bake in native support for LD{\mathcal{L}}_D so that moving theorems from L+{\mathcal{L}}^+ to L{\mathcal{L}} doesn’t necessarily involve the actual translation of proofs.
Deduction Logic with Equality LE{\mathcal{L}}_E extends LD{\mathcal{L}}_D by adding the equality abstraction == such that SE=SD+(=:(0;,)) \mathfrak{S}_E = \mathfrak{S}_D + \left(\begin{array}{ccl} = & : & (0; \emptyset, \emptyset)\end{array}\right) It has axioms AE{\mathbb{A}}_E, adding the following axioms to AD{\mathbb{A}}_D:
  1. x=xx = x
  2. x=y(A[x]A[y])x = y ⇒ (A[x] ⇒ A[y])
  3. A(A=)A ⇒ (A = ⊤)
Note that (A=)A(A = ⊤) ⇒ A is then also a theorem in LE{\mathcal{L}}_E.
Deduction Logic with Equality and Falsity LF{\mathcal{L}}_F extends LE{\mathcal{L}}_E with falsity and negation ¬¬: SF=SE+(:(0;)¬:(0;)) \mathfrak{S}_F = \mathfrak{S}_E + \left( \begin{array}{ccl} ⊥ & : & (0;)\\ ¬ & : & (0; \emptyset)\\ \end{array} \right) Its set of axioms AF{\mathbb{A}}_F is obtained by adding the following axioms to AE{\mathbb{A}}_E:
  1. =(x.x)⊥ = (∀ x.\, x)
  2. ¬A=(A)¬ A = (A ⇒ ⊥)
Note that all of the following are theorems of LF{\mathcal{L}}_F:
In particular, LF{\mathcal{L}}_F is certainly not paraconsistent as the principle of explosion A(¬AB)A ⇒ (¬ A ⇒ B) is a theorem.
Axioms 9 and 10 are actually definitions. That means that LF{\mathcal{L}}_F does not add anything new to LE{\mathcal{L}}_E really: Falsity and negation are already present in LE{\mathcal{L}}_E, albeit in disguise.
Intuitionistic Logic LI{\mathcal{L}}_I extends LF{\mathcal{L}}_F by adding abstractions for conjunction , disjunction , equivalence \Leftrightarrow and existential quantification such that SI=SF+(:(0;,):(0;,):(0;,):(1;{0})) \mathfrak{S}_I = \mathfrak{S}_F + \left( \begin{array}{ccl} ∧ & : & (0; \emptyset, \emptyset)\\ ∨ & : & (0; \emptyset, \emptyset)\\ \Leftrightarrow & : & (0; \emptyset, \emptyset)\\ ∃ & : & (1; \{0\})\\ \end{array} \right) Its set of axioms AI{\mathbb{A}}_I is obtained by adding the following axioms to AF{\mathbb{A}}_F:
  1. (AB)A(A ∧ B) ⇒ A
  2. (AB)B(A ∧ B) ⇒ B
  3. A(B(AB))A ⇒ (B ⇒ (A ∧ B))
  4. A(AB)A ⇒ (A ∨ B)
  5. B(AB)B ⇒ (A ∨ B)
  6. (AB)((AC)((BC)C))(A ∨ B) ⇒ ((A ⇒ C) ⇒ ((B ⇒ C) ⇒ C))
  7. (AB)=((AB)(BA))(A \Leftrightarrow B) = ((A ⇒ B) ∧ (B ⇒ A))
  8. A[x]x.A[x]A[x] ⇒ ∃ x.\, A[x]
  9. (x.A[x])((x.A[x]B)B)(∃ x.\, A[x]) ⇒ ((∀ x.\, A[x] ⇒ B) ⇒ B)
Note that A(A=)A \Leftrightarrow (A = ⊤) and A(A)A \Leftrightarrow (A \Leftrightarrow ⊤) and ¬A(A)¬ A \Leftrightarrow (A \Leftrightarrow ⊥) are all theorems of LI{\mathcal{L}}_I, but ¬A(A=)¬ A \Leftrightarrow (A = ⊥) is not.
Classical Logic LK{\mathcal{L}}_K extends LI{\mathcal{L}}_I with the law of the excluded middle:
  1. A¬AA ∨ ¬ A
Note that (A)(A)(A \Leftrightarrow ⊤) ∨ (A \Leftrightarrow ⊥) is thus a theorem in LK{\mathcal{L}}_K.
The class of abstraction logics Practical Types LP{\mathcal{L}}_ℙ will be designed as extensions of LK{\mathcal{L}}_K.
With proper support for modular reasoning and axiom tracking, it should be possible to mix different logics, so that statements like the following become provable: Theorem ϕ\phi of LP{\mathcal{L}}_ℙ has a proof in LI{\mathcal{L}}_I assuming hypotheses ψ0,,ψn1\psi_0, \ldots, \psi_{n-1} which have been proven in LP{\mathcal{L}}_ℙ.
Locales [5] are a mechanism for modular reasoning in Isabelle [4]. A locale corresponds in Practal just to a particular abstraction logic. So supporting locales comes down to supporting the simultaneous use of different abstraction logics, and to facilitate the transfer of theorems between them. In principle such a transfer should always construct a proof in the target logic from a proof in the source logic. In practice less expensive methods and short cuts can be used if such a proof replay is guaranteed to be possible in principle.

Consistency

An abstraction logic L{\mathcal{L}} is called inconsistent if Lx.x{\mathcal{L}} ⊢ ∀ x.\, x and consistent if it is not inconsistent.
If an abstraction logic L{\mathcal{L}} is inconsistent and an extension of a deduction logic LD{\mathcal{L}}_D, then all models of L{\mathcal{L}} are degenerate. This is easy to see. Assume L{\mathcal{L}} is inconsistent. Then x.x∀ x.\,x is a theorem in L{\mathcal{L}}. Using axiom 4 of LD{\mathcal{L}}_D for A[x]=xA[x] = x and modus ponens it follows that xx is a theorem. That means that xx is valid in any model (U;X;V;I;S)(U; X; V; I; \mathfrak{S}) of L{\mathcal{L}}. In particular, for any valuation νV\nu \in V we have νx=I(){\nu}\llbracket{x}\rrbracket = I(⊤). For any uUu \in U we can define a valuation νuV\nu_u \in V such that νu(x)=u\nu_u(x) = u. Then u=νu(x)=νux=I()u = \nu_u(x) = {\nu_u}\llbracket{x}\rrbracket = I(⊤). That means U={I()}U = \{I(⊤)\}, thus any model of L{\mathcal{L}} is degenerate.
What about the other direction? If every model A{\mathfrak{A}} of an abstraction logic L{\mathcal{L}} is degenerate, then x.xA=I(){{\llbracket {∀ x.\, x} \rrbracket}_{{\mathfrak{A}}}} = I(⊤) holds. Therefore Lx.x{\mathcal{L}} ⊨ ∀ x.\, x But is x.x∀ x.\, x then a theorem of L{\mathcal{L}}? We will see soon  that this is indeed the case if L{\mathcal{L}} extends LE{\mathcal{L}}_E.
Therefore, if L{\mathcal{L}} extends LE{\mathcal{L}}_E, then inconsistency of an abstraction logic L{\mathcal{L}} is equivalent to all of its models being degenerate.

Rasiowa Abstraction Algebra

Helena Rasiowa [10] proved completeness of intuitionistic predicate logic using algebraic methods, and furthermore gave a detailed description of her methods in her book on non-classical logics [6]. Her approach is even more far-reaching than she seems to have realized: There is no need for a special treatment of the quantifiers of predicate logic if you just choose the proper setting. That setting is abstraction logic.
We construct a special model R=(U;X;V;I;S)\mathfrak{R} = (U; X; V; I; \mathfrak{S}), which we call Rasiowa Abstraction Algebra, for any logic L=(S;X;A){\mathcal{L}} = (\mathfrak{S}; X; {\mathbb{A}}) that extends LE{\mathcal{L}}_E.

Constructing UU

The basic idea of the approach is due to Lindenbaum and Tarski and is mostly standard: Construct a model by considering the equivalence classes of terms that can be proven to be equal according to the logic. Note that while the original approach considers only variable-free terms and sentences, our approach works with terms which are allowed to contain free variables. Furthermore, there is no need (or possibility, for that matter) for us to distinguish between terms and sentences. This makes our completeness proof conceptually simple and elegant.
The relation on TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} is thus defined as stiffLs=ts ≈ t \quad\text{iff}\quad {\mathcal{L}} ⊢ s = t This is obviously an equivalence relation:
We let UU be the set of equivalence classes of TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} with respect to this relation: U=TX(S)/U = {\mathcal{T}_{{X}}({\mathfrak{S}})}\, / ≈
For tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} we write [t]R{[t]_{\mathfrak{R}}} for its corresponding equivalence class in UU.

Equivalence of de Bruijn Terms

For tBX0(S)t' \in {\mathcal{B}_{{X}}^{0}({\mathfrak{S}})} we write [t]RB{[{t'}]^{\mathcal{B}}_{\mathfrak{R}}} to denote [t]R{[t]_{\mathfrak{R}}} where tt is any term in TX(S){\mathcal{T}_{{X}}({\mathfrak{S}})} such that α(t)=t\alpha(t) = t'. This is well-defined, because if sTX(S)s \in {\mathcal{T}_{{X}}({\mathfrak{S}})} such that α(s)=t\alpha(s) = t' as well, then α(s)=α(t)\alpha(s) = \alpha(t) and thus s=ts = t will be derivable in L{\mathcal{L}} using the axioms of LE{\mathcal{L}}_E.
For s,tBXm(S)s, t \in {\mathcal{B}_{{X}}^{m}({\mathfrak{S}})} we write smts ≈_m t iff [s/σ]RB=[t/σ]RB{[{s / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}} = {[{t / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}} for all substitutions σ:mBX0(S)\sigma : {{{\overline{m}}} \rightarrow {{{\mathcal{B}_{{X}}^{0}({\mathfrak{S}})}}}}
Note that s0ts ≈_0 t is equivalent to [s]RB=[t]RB{[s]^{\mathcal{B}}_{\mathfrak{R}}} = {[t]^{\mathcal{B}}_{\mathfrak{R}}}.
Assume cc is an abstraction of S\mathfrak{S} and has shape (m;p0,,pn1)(m; {p_0, \ldots, p_{n-1}}). If for all ini \in {\overline{n}}
  1. si,tiBXm(S)s_i, t_i \in {\mathcal{B}_{{X}}^{m}({\mathfrak{S}})},
  2. (FreeAtoms(si)FreeAtoms(ti))Npi({\operatorname{FreeAtoms}({s_i})} \cup {\operatorname{FreeAtoms}({t_i})})\, \cap \uparrow\hspace{-0.15em}{{\mathbb{N}}} \subseteq p_i,
  3. simtis_i ≈_m t_i,
then [(cs0sn1)]RB=[(ct0tn1)]RB{[{(c\, s_0 \ldots s_{n-1})}]^{\mathcal{B}}_{\mathfrak{R}}} = {[{(c\, t_0 \ldots t_{n-1})}]^{\mathcal{B}}_{\mathfrak{R}}}.
To see this, let s=(cs0sn1)s = (c\, s_0 \ldots s_{n-1}) and t=(ct0tn1)t = (c\, t_0 \ldots t_{n-1}). The first two conditions guarantee that both ss and tt are in BX0(S){\mathcal{B}_{{X}}^{0}({\mathfrak{S}})}. Now consider s,tTX(S)s', t' \in {\mathcal{T}_{{X}}({\mathfrak{S}})} such that α(s)=s\alpha(s') = s and α(t)=t\alpha(t') = t. We can choose ss' and tt' such that s=(cx0xm1.s0sn1)t=(cx0xm1.t0tn1) \begin{array}{rcl} s' & = & (c\, x_0 \ldots x_{m-1}.\, s'_0 \ldots s'_{n-1}) \\ t' & = & (c\, x_0 \ldots x_{m-1}.\, t'_0 \ldots t'_{n-1}) \\ \end{array} for some variables xjx_j and some terms sis'_i and tit'_i. Then for all ini \in {\overline{n}} si=α(si,[xpipi])ti=α(ti,[xpipi]) \begin{array}{rcl} s_i & = & \alpha'(s'_i, \emptyset[\overline{x_{p_i} \coloneqq p_i}]) \\[0.3em] t_i & = & \alpha'(t'_i, \emptyset[\overline{x_{p_i} \coloneqq p_i}]) \end{array} This implies α(si)=si/[pixpi]=si/[0x0,,(m1)xm1]α(ti)=ti/[pixpi]=ti/[0x0,,(m1)xm1] \begin{array}{rclcl} \alpha({s'_i}) & = & {s_i} / {\emptyset[\overline{\uparrow\hspace{-0.15em}{{p_i}} \coloneqq x_{p_i}}]} & = & {s_i} / {\emptyset[\uparrow\hspace{-0.15em}{0} \coloneqq x_0, \ldots, \uparrow\hspace{-0.15em}{{(m - 1)}} \coloneqq x_{m - 1}]}\\[0.3em] \alpha({t'_i}) & = & {t_i} / {\emptyset[\overline{\uparrow\hspace{-0.15em}{{p_i}} \coloneqq x_{p_i}}]} & = & {t_i} / {\emptyset[\uparrow\hspace{-0.15em}{0} \coloneqq x_0, \ldots, \uparrow\hspace{-0.15em}{{(m - 1)}} \coloneqq x_{m - 1}]}\\ \end{array} From simtis_i ≈_m t_i follows therefore [α(si)]RB=[α(ti)]RB{[{\alpha({s'_i})}]^{\mathcal{B}}_{\mathfrak{R}}} = {[{\alpha({t'_i})}]^{\mathcal{B}}_{\mathfrak{R}}} and [si]R=[ti]R{[{s'_i}]_{\mathfrak{R}}} = {[{t'_i}]_{\mathfrak{R}}}, thus Lsi=tifor all in{\mathcal{L}} ⊢ s'_i = t'_i \quad \text{for all}\ i \in {\overline{n}} From this we can prove in L{\mathcal{L}} the theorem s=ts' = t', which implies [s]RB=[t]RB{[s]^{\mathcal{B}}_{\mathfrak{R}}} = {[t]^{\mathcal{B}}_{\mathfrak{R}}}.

Defining Φm\Phi_m

For m>0m > 0 we define Φm:BXm(S)(UmU)\Phi_m : {{{\mathcal{B}_{{X}}^{m}({\mathfrak{S}})}} \rightarrow {({{U^m} \rightarrow U})}} via Φm(t)([t0]RB,,[tm1]RB)=[t/[0t0,,(m1)tm1]]RB \Phi_m(t)({[{t_0}]^{\mathcal{B}}_{\mathfrak{R}}}, \ldots, {[{t_{m-1}}]^{\mathcal{B}}_{\mathfrak{R}}}) = {[{{t} / {\emptyset[\uparrow\hspace{-0.15em}{0} \coloneqq t_0, \ldots, \uparrow\hspace{-0.15em}{{(m-1)}} \coloneqq t_{m-1}]}}]^{\mathcal{B}}_{\mathfrak{R}}} Φm\Phi_m has the following properties:
  1. Φm\Phi_m is well-defined
  2. Φm(s)=Φm(t)\Phi_m(s) = \Phi_m(t) implies smts ≈_m t
  3. Φm(t)Fmp(U)\Phi_m(t) \in {\mathcal{F}_{m}^{p}(U)} implies that there exists ss with Φm(t)=Φm(s)\Phi_m(t) = \Phi_m(s) and FreeAtoms(s)Np{\operatorname{FreeAtoms}({s})}\, \cap \uparrow\hspace{-0.15em}{{\mathbb{N}}} \subseteq p
To see 1., let us first define Φm:BXm(S)(BX0(S)mBX0(S))\Phi'_m : {{{\mathcal{B}_{{X}}^{m}({\mathfrak{S}})}} \rightarrow {({{{{\mathcal{B}_{{X}}^{0}({\mathfrak{S}})}}^m} \rightarrow {{\mathcal{B}_{{X}}^{0}({\mathfrak{S}})}}})}} via Φm(t)(t0,,tm1)=t/[0t0,,(m1)tm1] \Phi'_m(t)(t_0, \ldots, t_{m-1}) = {t} / {\emptyset[\uparrow\hspace{-0.15em}{0} \coloneqq t_0, \ldots, \uparrow\hspace{-0.15em}{{(m-1)}} \coloneqq t_{m-1}]} It is clear that Φm\Phi'_m is well-defined. Furthermore, assume we are given s0,,sm1{s_0, \ldots, s_{m-1}} such that si0tis_i ≈_0 t_i. The following theorem can be derived in LE{\mathcal{L}}_E: A0=B0Am1=Bm1T[A0,,Am1]=T[B0,,Bm1]A_0 = B_0 ⇒ \ldots ⇒ A_{m-1} = B_{m-1} ⇒ T[{A_0, \ldots, A_{m-1}}] = T[{B_0, \ldots, B_{m-1}}]
Applying the substitution σ=[Tt,A0s0,,Am1sm1,B0t0,,Bm1tm1]\sigma = \emptyset[T \coloneqq t,\,A_0 \coloneqq s_0, \ldots ,A_{m-1} \coloneqq s_{m-1},\, B_0 \coloneqq t_0, \ldots, B_{m-1} \coloneqq t_{m-1}] to this theorem yields Φm(t)(s0,,sm1)0Φm(t)(t0,,tm1)\Phi'_m(t)(s_0, \ldots, s_{m-1}) ≈_0 \Phi'_m(t)(t_0, \ldots, t_{m-1}).
To show 2., let us assume that smts ≈_m t does not hold. Then there is a regular substitution σ\sigma with domain m{\overline{m}} such that [s/σ]RB[t/σ]RB{[{s / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}} \neq {[{t / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}}. Setting ri=σ(i)r_i = \sigma(\uparrow\hspace{-0.15em}{i}) we see that Φm(s)(r0,,rm1)=[s/σ]RB\Phi_m(s)({r_0, \ldots, r_{m-1}}) = {[{s / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}} and Φm(t)(r0,,rm1)=[t/σ]RB\Phi_m(t)({r_0, \ldots, r_{m-1}}) = {[{t / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}} and thus Φm(s)Φm(t)\Phi_m(s) \neq \Phi_m(t).
To verify 3., let us assume we have tBXm(S)t \in {\mathcal{B}_{{X}}^{m}({\mathfrak{S}})} with Φm(t)Fmp(U)\Phi_m(t) \in {\mathcal{F}_{m}^{p}(U)}, and that iFreeAtoms(t)\uparrow\hspace{-0.15em}{i} \in {\operatorname{FreeAtoms}(t)} for some ipi \notin p. If we vary only those arguments of Φm(t)\Phi_m(t) corresponding to those positions ii, then this function must be constant, and does therefore not depend on those positions i0,,ik1{\langle {i_0, \ldots, i_{k-1}} \rangle}. We can therefore define s=t/[i0,,ik1]s = t / {\emptyset[i_0 \coloneqq ⊤, \ldots, i_{k-1} \coloneqq ⊤]} Then Φm(t)=Φm(s)\Phi_m(t) = \Phi_m(s) and FreeAtoms(s)Np{\operatorname{FreeAtoms}(s)}\, \cap \uparrow\hspace{-0.15em}{{\mathbb{N}}} \subseteq p.

Constructing II

Next, we are constructing the interpretation I(c)I(c) of an abstraction cc of R\mathfrak{R}.

Applying Valuations

Let σ:DBX(S)\sigma : {D \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} be a regular substitution.
It induces a de Bruijn valuation σ\sigma' of DD in UU as follows: σ(x)={[σ(x)]RBif xX0(DN)Φxarity(σ(x))if xXX0 \sigma'(x) = \begin{cases} {[{\sigma(x)}]^{\mathcal{B}}_{\mathfrak{R}}} & \text{if}\ x \in X_0 \cup (D\, \cap \uparrow\hspace{-0.15em}{{\mathbb{N}}}) \\ \Phi_{{x_{\operatorname{arity}}}}(\sigma(x)) & \text{if}\ x \in X \setminus X_0 \end{cases} Then for any tBX(S)t \in {\mathcal{B}_{{X}}({\mathfrak{S}})} with FreeAtoms(t)D{\operatorname{FreeAtoms}(t)} \subseteq D we have σt=[t/σ]RB {\sigma'}\llbracket{t}\rrbracket = {[{{t} / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}} We show this by induction over tt.

Constructing VV

Now V(X,U)V \subseteq {\includegraphics[height=0.5em]{24ABA16B-23E3-4B4F-B1D2-76BD855A72E9}}({X}, U) is defined as follows: V={ν(X,U)ν=σ for some regular σ:XBX(S)} V = \left\{ \nu \in {\includegraphics[height=0.5em]{B08794D7-0099-4A9A-9247-416DC84C6A86}}({X}, U) \mid \nu = \sigma'\ \text{for some regular}\ \sigma : {{X} \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} \right\} An equivalent definition of VV is V={ν(X,U)xXX0.tBXxarity(S).ν(x)=Φxarity(t)} V = \left\{ \nu \in {\includegraphics[height=0.5em]{8767FCEC-CF8E-4ABB-B12D-D48A3778AA2D}}({X}, U) \mid \forall\, x \in X \setminus X_0.\, \exists\, t \in {\mathcal{B}_{{X}}^{{{x_{\operatorname{arity}}}}}({\mathfrak{S}})}.\, \nu(x) = \Phi_{{x_{\operatorname{arity}}}}(t) \right\}
We need to check that VV fulfills the criteria set out for it in our logic algebra definition.

R\mathfrak{R} is a Model for L{\mathcal{L}}

The tuple R=(U;X;V;I;S)\mathfrak{R} = (U; X; V; I; \mathfrak{S}) we constructed is a logic algebra:
  1. (U;I;S)(U; I; \mathfrak{S}) is an abstraction algebra by construction.
  2. We verified that VV has the required properties.
  3. Certainly S\mathfrak{S} is an extension of S0{\mathfrak{S}_0}.
  4. Assume I()(I(),[b]R)=I()I(\text{⇒})(I(⊤), {[{b}]_{\mathfrak{R}}}) = I(⊤) for bTX(S)b \in {\mathcal{T}_{{X}}({\mathfrak{S}})}. Using the definition of II in R\mathfrak{R}, this is equivalent to [b]R=[]R{[{⊤ ⇒ b}]_{\mathfrak{R}}} = {[{⊤}]_{\mathfrak{R}}}. This means that we can prove (b)=(⊤ ⇒ b) = ⊤ in L{\mathcal{L}}, and thus also b⊤ ⇒ b. Application of modus ponens together with Axiom 0 yields Lb{\mathcal{L}} ⊢ b, and Axiom 8 delivers Lb={\mathcal{L}} ⊢ b = ⊤, and thus [b]R=[]R=I(){[{b}]_{\mathfrak{R}}} = {[{⊤}]_{\mathfrak{R}}} = I(⊤)
  5. Let f:UUf : {U \rightarrow U} such that f(u)=I()f(u) = I(⊤) for all uUu \in U.
    We define fBX1(S)f' \in {\mathcal{B}_{{X}}^{1}({\mathfrak{S}})} by f=f' = ⊤. Then Φm(f)(u)=[]RB=[]R=I()=f(u)\Phi_m(f')(u) = {[{⊤}]^{\mathcal{B}}_{\mathfrak{R}}} = {[{⊤}]_{\mathfrak{R}}} = I(⊤) = f(u) This means Φm(f)=f\Phi_m(f') = f and therefore I()(f)=[()]RB=[x.]RI(∀)(f) = {[{(∀\, ⊤)}]^{\mathcal{B}}_{\mathfrak{R}}} = {[{∀ x. ⊤}]_{\mathfrak{R}}} We can prove (x.)=(∀ x. ⊤) = ⊤ in L{\mathcal{L}}. This yields I()(f)=[x.]R=[]R=I()I(∀)(f) = {[{∀ x. ⊤}]_{\mathfrak{R}}} = {[{⊤}]_{\mathfrak{R}}} = I(⊤)
We need to show that R\mathfrak{R} is a model for all axioms aAa \in {\mathbb{A}} of L{\mathcal{L}}.
Assume ν=σV\nu = \sigma' \in V. Then νa=σa=[α(a)/σ]RB{\nu}\llbracket{a}\rrbracket = {\sigma'}\llbracket{a}\rrbracket = {[{{\alpha(a)} / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}}. Because aa is an axiom, we can prove La{\mathcal{L}} ⊢ a. Choose tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} such that α(t)=α(a)/σ\alpha(t) = {\alpha(a)} / {\sigma}. With proof rule SUBST\operatorname{SUBST} we can derive Lt{\mathcal{L}} ⊢ t. Thus νa=[α(a)/σ]RB=[t]R=[]R=I(){\nu}\llbracket{a}\rrbracket = {[{{\alpha(a)} / {\sigma}}]^{\mathcal{B}}_{\mathfrak{R}}} = {[t]_{\mathfrak{R}}} = {[{⊤}]_{\mathfrak{R}}} = I(⊤)
We conclude that R\mathfrak{R} is indeed a model of L{\mathcal{L}}.

Completeness

An abstraction logic L=(S;X;A){\mathcal{L}} = (\mathfrak{S}; X; {\mathbb{A}}) is called complete if every valid term is also a theorem, i.e. if for all tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} LtimpliesLt{\mathcal{L}} ⊨ t \quad\text{implies}\quad {\mathcal{L}} ⊢ t
If L{\mathcal{L}} extends LE{\mathcal{L}}_E, then L{\mathcal{L}} is complete.
This can be seen easily now. Construct the Rasiowa Abstraction Algebra R=(U;X;V;I;S)\mathfrak{R} = (U; X; V; I; \mathfrak{S}) as a model for L{\mathcal{L}}. The canonical substitution ι:XBX(S)\iota : {X \rightarrow {{\mathcal{B}_{{X}}({\mathfrak{S}})}}} is defined by ι(x)=xif xX0ι(x)=x[0,,(xarity1)]if xXX0 \begin{array}{rcll} \iota(x) & = & x & \text{if}\ x \in X_0 \\ \iota(x) & = & x[\uparrow\hspace{-0.15em}{0}, \ldots, \uparrow\hspace{-0.15em}{{({{x}_{\operatorname{arity}}}-1)}}] & \text{if}\ x \in X \setminus X_0 \end{array} Obviously t/ι=t{t'} / {\iota} = t' holds for all tBX(S)t' \in {\mathcal{B}_{{X}}({\mathfrak{S}})}. Consequently, ιt=[α(t)/ι]RB=[α(t)]RB=[t]R{\iota'}\llbracket{t}\rrbracket = {[{{\alpha(t)} / {\iota}}]^{\mathcal{B}}_{\mathfrak{R}}} = {[{\alpha(t)}]^{\mathcal{B}}_{\mathfrak{R}}} = {[{t}]_{\mathfrak{R}}} holds for all tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})}.
Assume that tTX(S)t \in {\mathcal{T}_{{X}}({\mathfrak{S}})} is valid. Because of ιV\iota' \in V this implies [t]R=ιt=I()=[]R{[{t}]_{\mathfrak{R}}} = {\iota'}\llbracket{t}\rrbracket = I(⊤) = {[{⊤}]_{\mathfrak{R}}} which shows that Lt={\mathcal{L}} ⊢ t = ⊤, and therefore also Lt{\mathcal{L}} ⊢ t

Matching and Unification

Given two terms s,tBX(S)s, t \in {\mathcal{B}_{{X}}({\mathfrak{S}})}, it is natural to ask and a common task in machine-assisted reasoning to unify ss and tt, i.e. to ask for a substitution σ\sigma such that s/σ=t/σs / {\sigma} = t / {\sigma}
A related and easier problem is to match the pattern ss to tt, i.e. to find a substitution σ\sigma such that s/σ=ts / {\sigma} = t
Given that abstraction syntax can be seen as a special case of higher-order syntax, we can adapt the results from higher-order unification. Experiments in that direction have been carried out, and a higher-order unification algorithm [11] has been adapted for both abstraction unification [12] and abstraction matching [13]. These experiments have been carried out before the inception of abstraction logic, therefore the notation used in them is slightly different. The resulting algorithms are somewhat simpler than the original ones, as there is no need for iteration and no need to compensate for β/η\beta/\eta-equivalence.
Second-order matching is decidable, and second-order unification is semi-decidable [14]. Given that abstraction syntax can also be seen as a special case of second-order syntax, as a consequence abstraction matching is decidable, and abstraction unification is semi-decidable. One would hope that maybe abstraction unification is even decidable, but the requirements of Goldfarb’s undecidability proof for second-order unification [15] seem to carry over to abstraction unification.
Unification and matching are especially important in automated reasoning. Superposition is the basis of modern automated reasoning systems, and it is interesting to observe that the approach of superposition to work with theorems of the form s=s = ⊤ is very natural in abstraction logic. There are current efforts [16] to bridge the gap between first-order automated theorem proving and higher-order automated theorem proving. It would certainly make sense to have a pit stop at abstraction automated theorem proving on that journey.

References

[1]Steven Obua. (2021). Practical Types, https://doi.org/10.47757/practical.types.1.
[2]Steven Obua. (2021). Practal — Practical Logic: A Bicycle for Your Mathematical Mind, https://doi.org/10.47757/practal.1.
[3]Saul A. Kripke. (2013). Fregean Quantification Theory, https://doi.org/10.1007/s10992-013-9299-x.
[4]Lawrence C. Paulson, Tobias Nipkow, Makarius Wenzel. (2019). From LCF to Isabelle/HOL, https://doi.org/10.1007/s00165-019-00492-1.
[5]Clemens Ballarin. (2014). Locales: A Module System for Mathematical Theories, https://doi.org/10.1007/s10817-013-9284-7.
[6]Helena Rasiowa. (1974). An algebraic approach to non-classical logics, https://doi.org/10.1016/s0049-237x(09)x7004-7.
[7]Helena Rasiowa, Roman Sikorski. (1963). The Mathematics of Metamathematics.
[8]Helena Rasiowa. (1973). Introduction to Modern Mathematics, https://doi.org/10.1016/c2013-0-11892-2.
[9]Arthur Charguéraud. (2012). The Locally Nameless Representation, https://doi.org/10.1007/s10817-011-9225-2.
[10]Helena Rasiowa. (1951). Algebraic Treatment of the Functional Calculi of Heyting and Lewis, https://doi.org/10.4064/fm-38-1-99-126.
[11]Petar Vukmirović, Alexander Bentkamp, Visa Nummelin. (2021). Efficient Full Higher-Order Unification, https://arxiv.org/abs/2011.09507.
[12]Steven Obua. (2021). Unification in practal-light, https://github.com/practal/practal-light/blob/728de5bfffa28d296d611db2c7388c069fc0b711/Sources/practal-light/Tools/Unification.swift.
[13]Steven Obua. (2021). Matching in practal-light, https://github.com/practal/practal-light/blob/728de5bfffa28d296d611db2c7388c069fc0b711/Sources/practal-light/Tools/Matching.swift.
[14]Gilles Dowek. (2001). Higher-Order Unification and Matching, https://doi.org/10.1016/B978-044450813-3/50018-7.
[15]Warren D. Goldfarb. (1979). The Undecidability of the Second-Order Unification Problem, https://doi.org/10.1016/0304-3975(81)90040-2.
[16]Petar Vukmirović, Alexander Bentkamp, Jasmin Blanchette, Simon Cruanes, Visa Nummelin, Sophie Tourret. (2021). Making Higher-Order Superposition Work, https://doi.org/10.1007/978-3-030-79876-5_24.