Nominal Recursors as Epi-Recursors

We study nominal recursors from the literature on syntax with bindings and compare them with respect to expressiveness. The term "nominal" refers to the fact that these recursors operate on a syntax representation where the names of bound variables appear explicitly, as in nominal logic. We argue that nominal recursors can be viewed as epi-recursors, a concept that captures abstractly the distinction between the constructors on which one actually recurses, and other operators and properties that further underpin recursion. We develop an abstract framework for comparing epi-recursors and instantiate it to the existing nominal recursors, and also to several recursors obtained from them by cross-pollination. The resulted expressiveness hierarchies depend on how strictly we perform this comparison, and bring insight into the relative merits of different axiomatizations of syntax. We also apply our methodology to produce an expressiveness hierarchy of nominal corecursors, which are principles for defining functions targeting infinitary non-well-founded terms (which underlie lambda-calculus semantics concepts such as Böhm trees). Our results are validated with the Isabelle/HOL theorem prover.


I. INTRODUCTION
Syntax with bindings is pervasive in λ-calculi, logics and programming languages.Consequently, powerful mechanisms for performing definitions and reasoning involving bindings are important for formalizing the meta-theory of such systems [1], [5], [22].Central among these mechanisms are recursion principles (recursors for short), allowing one to define functions by recursing over the syntax-e.g., for syntactic translations, semantic interpretations, and static analysis.
A large amount of research has been dedicated to devising such mechanisms, within three main paradigms: nominal / nameful, nameless / De Bruijn, and higher-order abstract syntax (HOAS).Each of the three paradigms has pros and cons discussed at length in the literature (e.g., [1], [12], [14], [21], [41]).A major selling point of the nominal paradigm, of which the most prominent representative is nominal logic [6], [25], [58], is that it employs a formal representation that is close to the one used in textbooks and informal descriptions, where on the one hand the names of bound variables are shown explicitly, and on the other hand their particular choice is irrelevant.Moreover, definitions and reasoning within this paradigm mimic informal practice, including support for Barendregt's convention [11]: avoiding the capturing of bound variables by conveniently choosing their names in definition and proof contexts [19], [45], [56].
A particularly delicate subject, where the nominal paradigm must walk a tightrope to achieve its goals, are the recursion principles.The specific challenge for recursion here is that terms with bindings, which are equated modulo (i.e., quotiented to) α-equivalence ( §II-A), do not form a free, hence standardly recursable datatype.To overcome this problem, various nominal recursors have been proposed and successfully deployed in formal developments (e.g., [25], [40], [45], [51], [55]).These recursors come in a variety of formats and flavors, in particular they use different operators and have different features that enhance their cores ( §II-B).
In this paper, we contribute a general, systematic account of nominal recursors, highlighting their underlying principles and their inter-connections.We ask two questions.The first is: What is a nominal recursor?In particular, what are the essential features that the nominal recursors from the literature have in common ( §III)?After an analysis of what the existing recursors aim to achieve and how they operate ( §III-A), and some processing of their original presentations to phrase them uniformly using signatures and models ( §III-B), we synthesize the concept of an epi-recursor ( §III-C).This concept captures abstractly their essential behavior, which can be summarized as follows: On top of the constructor-based infrastructure specific to standard recursion, these recursors take advantage of additional infrastructure employing non-constructor operators, to make the recursive definitions go through.And indeed, all the considered nominal recursors, and others obtained by crosspollinating them, are particular cases of epi-recursors ( §III-D).
The second question is: What does it mean for a nominal recursor to be more expressive than another, and how do the existing recursors compare?( §IV).Apart from its theoretical interest, this question is of practical importance for designers and developers of formal reasoning frameworks.We answer it by introducing two relations for comparing the strength of epirecursors, which differ in the amount of effort one is willing to invest in simulating one recursor by another.The first, stricter relation ( §IV-A) follows naturally from the definition of epirecursors.The second, laxer relation ( §IV-C) is more elaborate, and was inspired by previous efforts to make a nominal recursor work on a somewhat brittle terrain where syntax meets semantics ( §IV-B).Instantiating the two relations to compare the nominal recursors yields two different hierarchies of strength.The comparisons reveal some interesting phenomena about the relative merits of considering various combinations of operations and axioms.Quite surprisingly given the wide variability of the underlying infrastructures, the laxer comparison yields an almost flat hierarchy, revealing that most of the recursors have the same strength-but still revealing that the symmetric operators (swapping and permutation) fare better than the asymmetric ones (renaming and substitution).
The discussed recursors and their comparison results have been mechanized in the Isabelle/HOL theorem prover [39].The mechanization is publicly available [48].An appendix also accompanies the paper-giving proof sketches, discussing a uniform way to enhance the recursors with full-fledged recursion and Barendregt's convention, and providing details on nominal sets and on our Isabelle mechanization.arXiv:2301.00894v1[cs.LO] 2 Jan 2023 II.BACKGROUND This section provides background on syntax with bindings ( §II-A) and recalls several nominal recursors ( §II-B).
We let Var be a countably infinite set of variables, ranged over by x, y, z etc.The set Tr of λ-terms, ranged over by t, s etc., is defined by the grammar: t ::= Vr x | Ap t 1 t 2 | Lm x t with the proviso that terms are equated (identified) modulo αequivalence (a.k.a.naming equivalence).Thus, for example, Lm x (Ap (Vr x) (Vr x)) and Lm y (Ap (Vr y) (Vr y)) are considered to be the same term.We will often omit writing the injection Vr of variables into terms.
What the above definitions means is the following: One first defines the set PTr of preterms (sometimes called "raw terms") to be freely generated by the following grammar: p ::= PVr x | PAp p 1 p 2 | PLm x p Then one defines the α-equivalence relation ≡ : PTr → PTr → Bool inductively, proves that it is an equivalence, and defines Tr by quotienting PTr to it, i.e., takes Tr = PTr/ ≡.Finally, one proves that the preterm constructors are compatible with ≡, which allows to define the constructors on terms: Vr : Var → Tr, Ap : Tr → Tr → Tr and Lm : Var → Tr → Tr.
Working with terms rather than preterms has several advantages, including (1) being able to formalize concepts at the right abstraction level (since in most applications the naming of bound variables is supposed to be irrelevant) and (2) the substitution operator being well-behaved.This is why most formal and informal developments prefer terms.
For the rest of this paper, we will focus on terms and mostly forget about preterms-the latter will show up only occasionally, when we discuss ideas and intuitions.
We will consider generalizations of some common operations and relations on terms, namely: • free-variables FV : Tr → P(Var) (where P(Var) is the powerset of Var); e.g., we have FV(Lm x (Ap y x)) = {y} • freshness _#_ : Var → Tr → Bool; e.g., we have x # Lm x x; also, assuming x = y, we have ¬ x # Lm y x Above, Perm denotes the set of finite permutations (i.e., bijections of finite support) on the set of variables, namely {σ : Var → Var | {x | σ x = x} finite }.We let x ↔ y denote the permutation in Perm that takes x to y, y to x and everything else to itself.Note that the permutation operation is a generalization of swapping.Indeed, we have t Free-variables and freshness are of course two faces of the same coin: a variable x is fresh for a term t (i.e., x # t) if and only if it is not free in t (i.e., x / ∈ FV(t)).We will not give definitions for the above operators, but count on the reader's familiarity with them and hope that the above examples (and their subsequently listed properties in §III-D) avoid any possible confusion.The definitions can be done in many different (equivalent) ways-see, e.g., [11] [45].

B. Nominal recursors
Next we look at some nominal recursors in their "natural habitat", using concepts and terminology used by the authors who introduced them (only adapted slightly to this paper's notations, and instantiated to the syntax of λ-calculus).Later on, in §III, we will recast them in a uniform format.
For convenience, we will refer to these recursors by the additional operators that they are based on; e.g., the "perm/free", or "swap/fresh" recursor.However, we should emphasize that not only the choice of the operators, but also the axioms imposed on them are responsible for a recursor's behavior.
1) The perm/free recursor: This is the best known nominal recursor, originating in the context of nominal logic [25].In the form we present here, which does not require any special logical foundation (e.g., axiomatic nominal set theory), it is due to Pitts [45], who builds on previous work by Gabbay and Pitts [25] and by Urban and Berghofer [55].Pitts called this recursor "α-structural" to emphasize that it operates on α-equivalence classes, i.e., on terms rather than preterms.But since this is true about all nominal recursors, we will instead refer to this as the "perm/free recursor" because it employs the permutation and free-variable operators.Some preparations are needed for introducing this recursor.(Perm, id, •) forms a group, where id is the identify permutation and • is composition.A pre-nominal set is a set equipped with a Perm-action, i.e., a pair A = (A, _[_] A ) where A is a set and _[_] A : A → Perm → A is an action of the group Perm on A, i.e., is idle for identity permutations (a[id] A = a for all a ∈ A) and compositional (a Given a pre-nominal set A = (A, _[_] A ), an element a ∈ A and a set X ⊆ Var, we say that a is supported by X, or that X supports a, if a[x↔y] A = a holds for all x, y ∈ Var such that x, y / ∈ X.An element a ∈ A is called finitely supported if there exists a finite set X ⊆ A such that a is supported by X.
) is a nominal set and a ∈ A, then the smallest set X ⊆ Var that supports a can be shown to exist-it is denoted by supp A (a) and called the support of a.
Given two pre-nominal sets . The set of terms with their Perm-action, (Tr, _[_]), forms a nominal set.The support of a term t consists of its free variables.
The recursion theorem states that it is possible to define a function g from terms to any other set provided A is equipped with a nominal-set structure and additionally has some "termlike" operators matching the variable-injection, application and λ-abstraction operator, satisfying a specific condition.Concretely, the theorem says that there exists a unique function g that commutes with these operators in a specific way.
Thm 1: [25], [45] Let A = (A, _[_] A ) be a nominal set and let Vr A : Var → A, Ap A : A → A → A and Lm A : Var → A → A be functions, all supported by a finite set X of variables and such that the following freshness condition for binders (FCB) holds: there exists x ∈ Var such that x / ∈ X and x # A Lm A x a for all a ∈ A.
Then there exists a unique g : Tr → A supported by X such that the following hold for all x ∈ Var and t 1 , t 2 , t ∈ Tr: Note that the recursor features a parameter set of variables X, and requires the term-like operators to be supported by X; in exchange, it guarantees that the defined function g is also supported by X; moreover, the recursive clause for Lm is conditioned by the abstracted variable x being fresh for X.The rationale of this X-parametrization is the modelling of Barendregt's famous variable convention [11][p.26]:"If [the terms] M 1 , . . ., M n occur in a certain mathematical context (e.g.definition, proof), then in these terms all bound variables are chosen to be different from the free variables."According to this, functions can be defined on terms while conveniently assuming that the λ-abstracted variables do not clash with other variables in the context of the definition-in the perm/free recursor, the set of these other variables is over-approximated by X.
2) The swap/free recursor: The next recursor is due to Norrish [40], who departs from the nominal logic tradition by taking the free-variable operator as a primitive-whereas in nominal logic this operator, called support, is defined in terms of permutation.While this distinction is not important in the concrete case of terms, it does matter when one discusses abstract "term-like" structure on the target domain.Another (as we shall see, consequential) difference from the perm/free recursor is in taking swapping rather than permutation as primitive.
Norrish's recursor employs swapping structures, which are sets equipped with swapping-and free-variable-like operators, namely triples A = (A, _[_ ∧ _] A , FV A ) where _[_∧_] A : A → Var → Var → A and FV A : Var → P(A) such that and the following hold for all x, y, z ∈ Var and a ∈ A: a The set of terms equipped with their standard swapping and free-variable operations, namely (Tr, _[_ ∧ _], FV), forms a swapping structure.The recursion theorem says that, given a suitable "term-like" infrastructure on a set A, which includes A being a swapping structure, and factors in a set of parameter variables X, there exists a unique function from terms to A that commutes with the term-like operators in a manner that obeys Barendregt's variables convention.In addition, the function commutes with swapping and preserves the free variables, again in a Barendregt-convention observing manner.(Norrish also considers a dynamic-parameter version of Barendregt's convention, which we omit here.Pitts [45,Ex. 5.6] shows how static parameters suffice for encoding dynamic parameters.)Thm 2: [40] Let A = (A, _[_ ∧ _] A , FV A ) be a swapping structure, and let Vr A : Var → A, Ap A : (Tr × A) → (Tr × A) → A and Lm A : Var → (Tr × A) → A be some functions, and let X be a finite set of variables, such that the following hold for all x, y ∈ Var, t 1 , t 2 , t ∈ Tr and a 1 , a 2 , a ∈ A: (1) Then there exists a unique function g : Tr → A such that the following hold for all x, y ∈ Var and t 1 , t 2 , t ∈ Tr: An enhancement of this recursor is the enabling of fullfledged (primitive) recursion rather than mere iteration-as seen in the constructor-like operators Vr A , Ap A and Lm A taking as inputs not only elements of A but also terms.Hence the recursive clauses for the defined function g allow the computed value to depend not only on the recursive results for smaller terms, but also on the smaller terms themselves.
3) The swap/fresh recursor: The next recursor was described by Gheri and Popescu [27].Similarly to the previous recursors, it is based on structures that generalize operators on terms-here freshness and swapping .It is similar to the swap/free recursor by its focus on swapping, but different in that it (a) uses freshness rather than free variables, (b) requires different properties from the models, (c) does not support Barendregt's convention and (d) extends full-fledged recursion to refer to non-constructor operators as well (in that these operators also take additional term arguments).As will emerge from our analysis, only (b) is an essential difference; the others refer to enhancements possible for all nominal recursors.
A freshness-swapping model is a set equipped with constructor-, swapping-and freshness-like operators, namely a tuple (A, Tr and # A : Var → (Tr × A) → Bool satisfying the following properties for all x, y, z ∈ Var, t 1 , t 2 , t ∈ Tr, and a 1 , a 2 , a ∈ A: (1) The recursion theorem states that the terms form an initial freshness-swapping model, in that for any freshness-swapping model there exists a unique function from terms that commutes with the constructors and swapping, and preserves freshness.This result has a classic model theory flavor, as it depicts the term datatype as initial in a certain (infinite) Horn theory.
Thm 3: [27] For any freshness-swapping model (A, Vr A , Ap A , Lm A , _[_ ∧ _] A , # A ), there exists a unique function g : Tr → A such that the following hold: 4) The subst/fresh recursor: The next recursor, introduced by Gunter and Popescu [51], has a similar structure to the previous one (in particular it is a Horn initiality theorem), but is based on substitution rather than swapping.
A freshness-substitution model is similar to a freshnessswapping model, but instead of a swapping-like operator _[_ ∧ _] A it has a substitution-like operator _[_/_] A : (Tr × A) → (Tr × A) → Var → Tr and: • instead of the clauses (4)-( 6) that describe swapping commuting with the constructors, it satisfies corresponding clauses for substitution-where this time commutation with λ-abstraction is restricted by a suitable freshness condition • instead of clause (7), it satisfies a substitution-based renaming clause for λ-abstraction.Namely, it satisfies the following clauses: (4) (Vr x, Thm 4: [51] For any freshness-substitution model (A, Vr A , Ap A , Lm A , _[_/_] A , # A ), there exists a unique g : Tr → A such that the clauses listed in Thm. 3 hold, except that the clause for g commuting with swapping is replaced by a clause for substitution: g (t[s/y]) = (t, g t)[(s, g s)/y] A .
5) The renaming recursor: The last discussed recursor was introduced by Popescu [49].It is more minimalistic than the others since, in addition to the constructors, it only uses one operator, namely renaming-subject to the equational theory of constructor-enriched renamable sets, defined next.
A constructor-enriched renamable set is a tuple The first three families of equations above, (1)-( 3), refer to standard properties of renaming, whereas the last six, (4)-( 9), connect renaming with the constructors.The recursion theorem characterizes terms as initial model in this equational theory.
Thm 5: [49] For any constructor-enriched renamable set A = (A, _[_/_] A , Vr A , Ap A , Lm A ), there exists a unique g : Tr → A such that the following hold: ) Enhancements: The above recursors clearly have many aspects in common, but also display some essential variability regarding the non-constructor operators they are based on and the conditions imposed on the target-domain counterparts of these operators.Other dimensions of variability were what we called the "enhancements": support for Barendregt's convention and full-fledged recursion.It turns out that both types of enhancements can be made uniformly to all nominal recursors (as we detail in App.D).So in what follows, for comparing these recursors we will strip them off their enhancements and focus on their essential variability only.

III. NOMINAL RECURSORS AS EPI-RECURSORS
In this section, we will propose a way to look at the nominal recursors as mechanisms for helping recursion to proceed "as if freely", i.e., by writing clauses for each constructor as if the datatype of terms were freely generated by the constructors.We start by describing this view informally, using an example ( §III-A).To formalize the view, we introduce signatures and models to describe uniformly the term-like operators features in the previous section's recursion theorems ( §III-B).Then we define the central concept of this paper, that of an epi-recursor ( §III-C), which captures this view in a general category-theoretic form.Finally, we show that all the discussed nominal recursors, and others that are obtained as variations or combinations of these, are epi-recursors ( §III-D).
As mentioned, we will not consider the recursors in their original forms-as introduced by their authors, recalled in §II-B-but their essential cores, striped of their full-fledged recursion and Barendregt convention enhancements.(The enhancements, discussed in App.D, turn out to be orthogonal.)

A. The purpose of nominal recursors
Let us start with recursion (to be precise, a restricted form of recursion called iteration) over a free datatype, i.e., freely generated by the constructors, such as that of preterms (recalled in §II-A).To define a function g : PTr → A between preterms and some target domain A, informally speaking we write recursive clauses for each of the constructors: • g (PVr x) = expression depending on x • g (PAp p 1 p 2 ) = expr.depending on g p 1 and g p 2 • g (PLm x p) = expr.depending on x and g p The above "expression depending on" formulation can be made rigorous by considering preterm-like operations on the target domain A. Namely, for a recursive definition like the above to be possible, we must organize A as a model A = (A, Vr A , Ap A , Lm A ), where Vr A : Var → A, Ap A : A → A → A and Lm A : Var → A → A. Now, the recursive definition of g is nothing but the statement that g commutes with the operations that correspond to each other: In fact, we could say that the model A is the recursive definition of g-because it determines a unique function g : PTr → A that commutes with the operations.Now, let's switch from preterms to terms.We can summarize the purpose of all nominal recursors as follows: To define functions g : Tr → A between terms and target domains A by recursing over the constructors as if the datatype of terms was freely generated, i.e., by writing recursive clauses similarly to those of the free datatype of preterms: • g (Vr x) = expression depending on x • g (Ap t 1 t 2 ) = expression depending on g t 1 and g t 2 • g (Lm x t) = expression depending on x and g t But the datatype of terms is not freely generated, so such a definition cannot work out of the box.One needs to further prop recursion by describing the interaction of the intended function g not only with the constructors, but also with other operations and/or relations.For example, the swap/fresh recursor described in §II-B requires two additional clauses, for the swapping operation and the freshness relation: • g (t[x ∧ y]) = expression depending on x, y and g t • x # g t implies expression depending on x and g t The above can also be made rigorous using models.The requirement is to define term-like operations and relations on the target domain A corresponding not only to the constructors but also to other operators; i.e., in this case, organize A as a model A = (A, Vr A , Ap A , Lm A , _[_∧_] A , # A ), consisting of: • (as before for preterms) counterparts of the constructors, Vr A : Var → A, Ap A : A → A → A, and Lm A : Var → A → A , as well as • counterparts of the swapping operation and the freshness relation, _[_∧_] A : A → Var → Var → A and # A : Var → A → Bool Another new requirement compared to the case of free datatypes is that the model A is similar to terms not only because of the matching arities of its operations/relations, but also because it satisfies specific term-like properties, i.e, Acounterparts of properties of the terms-e.g., swapping commuting with λ-abstraction, more precisely the A-counterpart of swapping commuting with the A-counterpart of λ-abstraction.
If the above is successfully achieved, i.e., if one provides a model A satisfying the required properties, then the recursor guarantees the existence of a unique function g : Tr → A that commutes with the operations (here, constructors and swapping) and preserves the relations (here, freshness).
The following simple example illustrates the above discussion.§IV-B and App.B show two more complex examples; many others can be found in the literature, e.g., [40], [45], [51].
Example 6: (depth of a term) Let us consider the task of defining the depth function on terms, depth : Tr → N. The natural recursive clauses we would wish to write are (i) depth As discussed, such a definition does not work out of the box because of the non-freeness of the terms.To make this work, we can add clauses describing the intended behavior of depth with respect to swapping and freshness: x # t implies True (for this particular definition, this clause is vacuous-nothing informative to say here) This means organizing the target domain N as a model After checking that N satisfies some required properties (which in this case is trivial) we obtain a unique function depth satisfying clauses (i)-(v).
We can define this function using other recursors from §II.For example, we can deploy the perm/free recursor if in the model N we replace the swapping operator with an equally trivial permutation operator _[_] N defined as m [σ] N = m.

B. Signatures and models
Next we introduce some notation that allows us to discuss the various recursors uniformly.Let Sym, the set of (operation or relation) symbols, be {vr, ap, lm, pm, sw, sb, ren, fv, fr}.These symbols refer to variable, application and λ-abstraction constructors, permutation, swapping, substitution, renaming and free-variable operations, and the freshness relation, respectively.A signature Σ will be any subset of Sym.
Given a signature Σ, a Σ-model M consists of a set M , called the carrier set, and operations and/or relations on M as indicated in the signature.More precisely: Given two Σ-models M and M , a morphism between them is a function between their carrier sets g : M → M that commutes with the operations and preserves the relations.For example: if vr ∈ Σ, we require that g( We write g : M → M to indicate that the function g is a morphism between M and M .Σ-models and their morhisms form a category.We write T r(Σ) for the Σ-model whose carrier is the set of terms Tr and whose operations and relations are the standard ones for terms.
Let Σ ctor be the signature comprising the term constructors only, namely Σ ctor = {vr, lm, ap}.Ignoring the full-fledged recursion and Barendregt convention enhancements, we see that what all the described nominal recursors have in common, which is also shared with the standard recursors over free datatypes, is that they allow one to recurse over terms using the constructors, i.e., they (1) require the intended target domain to be (at least) a Σ ctor -model M, and (2) ensure the existence of a function g that commutes with the constructors, i.e., a morphism g : T r(Σ ctor ) → M.Moreover, as illustrated in §III-A, another aspect that the nominal recursors have in common is that, in order to make recursing over terms possible, they (1) require one to extend M to a Σ ext -model M for an extended signature Σ ext ⊇ Σ ctor and to verify some specific properties for M , and (2) capitalize on the fact that T r(Σ ext ) is initial among all Σ ext -models that satisfy the given propertieswhich gives a morphism T r(Σ ext ) → M , i.e., a function g that commutes not only with the constructors but also with the other operations and relations in Σ ext .In short, what all these recursors do is prop constructor-based recursion by extending the signature and exploiting initiality of the term model there.

C. Epi-recursors
We capture the above phenomenon in the following concept: Def 7: An epi-recursor is a tuple r = (B, T, C, I, R) where: In typical examples C and B will be categories of models, i.e., sets endowed with algebraic/relational structure, so that the models in C have more structure than those in B, and R will be a structure-forgetting functor.We think of the base object T as the syntactic model of interest-such as the term model T r(Σ ctor ) with constructors only-which is the source object of the intended recursion definitions.Then I is its extension to an object of C that makes recursion possible-for our nominal recursors, this is a model T r(Σ ext ), having other "recursion-propping" operators in addition to the constructors.
Thus, to define a morphism g : T → B in B (where B is some object in B) using the epi-recursor r = (B, T, C, I, R), we do the following (as depicted in Fig. 1):

D. Nominal recursors as epi-recursors, formally
We claimed that all the nominal recursors described in §II fall under the above epi-recursion pattern.However, this is not entirely clear from the formulations of some of these recursors.In this subsection, we will make this claim precise.Fig. 2 collects the properties of the operations and relations on terms that are relevant for these recursors.The reader will probably recognize many properties that are useful for reasoning about terms, independently from their relevance for recursion.The properties SwVr, SwAp, SwLm relate swapping with the constructors.SwLm points to one of the main appeals of the swapping operator for developing the theory of λcalculus: It shows that swapping commutes with λ-abstraction on terms exactly in the same way as it does for preterms, i.e., is essentially oblivious to the non-injectiveness of λ-abstraction.SwId, SwCp, SwIv are algebraic properties of swapping: identity, compositionality and involutiveness.SwFr and FrSw are properties connecting swapping to freshness (and SwFv and FvSw are their alternative free-variable-based formulations).SwFr says that swapping two fresh variables has no effect on the term.FrSw says that freshness of a variable for a swapped term is equivalent to freshness of the swapped variable for the original term-stating for the freshness predicate a variant of what in nominal logic is called equivariance.SwCg is there exists x such that x / ∈ FV(Lm x t) for all t Fig. 2: Basic properties of operations and relations on terms a swapping-based congruence property describing a criterion for the equality of two λ-abstractions.SwBvr is a property allowing the renaming of a λ-bound variable with any fresh variable, again via swapping.The last two are reminiscent of intuitive properties of α-equivalence on preterms.
FrVr, FrAp and FrLm relate freshness with the constructors, corresponding to an inductive definition of freshness; and FvVr, FvAp and FvLm are their free-variable counterparts.(Note that the converses of FrVr, FrAp and FrLm and the equality versions of FvVr, FvAp and FvLm also hold for terms; though for recursion it is not the stronger, but the weaker versions of properties that lead to stronger definitional principles-since they mean weaker constraints on models.) Most properties of swapping generalize to corresponding properties of permutation.We have properties relating permutation with the constructors, PmVr, PmAp and PmLm, identity and compositionality, PmId and PmCp, and properties relating permutation with the free-variables, PmFv and FvPm.
Like swapping, substitution commutes with the constructors, which is expressed in SbVr, SbAp, SbLm.As shown by SbLm, unlike in the case of swapping, substitution's commutation with λ-abstraction requires a freshness condition.Substitution also enjoys congruence and bound-variable renaming properties similar to those of swapping, as expressed by SbCg and SbBvr.The renaming operator of course enjoys all the properties of substitution; e.g., RnVr, RnAp, RnLm1 and RnCg are the counterparts of SbVr, SbAp, SbLm and SbCg.One may ask why we bother considering renaming, which is a restriction of substitution; the reason is that, again, for expressive recursors we want less structure and weaker properties.
The last group, FSup, FvDPm, FvDSw and FCB, are nominal logic properties-in the figure they are stated for terms but hold for all nominal sets.FSup states that terms have finite support (i.e., finite set of free variables).FvDPm and FvDSw state the definability of free-variables from permutations and (alternatively) from swapping.FCB is the freshness condition for binders from the statement of the perm/free recursion theorem (Thm.1), but with the Barendregt set X removed.FCB is weaker than FvLm since it quantifies existentially rather than universally over the bound variable, though in nominal logic they are equivalent (the "some/any" property [45]).
Each of the properties listed in Fig. 2 is satisfied by the terms with their basic operations and relations, i.e., by the term model T r(Σ) for any signature Σ that contains all the symbols referred to in the property.But we can speak of the corresponding properties in relation to any other Σ-model M, and they may or may not be satisfied by M. For example, when we say that the model M (with carrier M ) satisfies SwCg, we mean the following: For all m 1 , m 2 ∈ M and  ∈ FV M (Lm M x m) for all m ∈ M .Given a subset Props of the properties listed in Fig. 2 and a signature Σ comprising the symbols referred to in Props, any Σ-model satisfying Props will be called a (Σ, Props)-model.Now we can (re)formulate nominal recursors as epi-recurors: Thm 9: Consider the nine choices, for i ∈ {1, . . ., 9}, of tuples r i = (B, T, C i , I i , R i ) given by the sets of properties Props i shown in in Fig. 3. (For example, Props 5 consists of SwVr, SwAp, SwLm, SwBvr, FrVr, FrAp, FrLm.)More precisely, we assume that the signature Σ i consists of all the operation and relation symbols occurring in Props i , and: • B is the category of Σ ctor -models and T = T r(Σ ctor ) • C i is the category of (Σ i , Props i )-models and Next we discuss this theorem's nine statements of epirecursion principles.We will distinguish between the five "original recursors" from the literature and four "variant recursors" obtained from those as combinations and variations.
1) The original recursors: As suggested by the names in Fig. 3, five of these principles, namely r 1 , r 4 , r 6 , r 7 and r 8 , are reformulations in our epi-recursor terminology of (the stripped down versions of) the nominal recursors from in §II.This is easy to see in the case of r 6 and r 7 .Indeed, after removing the term arguments of the operations and relations, Thms. 3 (swap/fresh) and 4 (subst/fresh) simply state, for a suitable extension of the constructor signature Σ ctor , the initiality of the corresponding term model among all models satisfying Props 6 or Props 7 .Moreover, Thm. 5 (about renaming recursion) is easily seen to become exactly r 8 if we trivialize the Barendregt-convention parameter X, i.e., take X = ∅.
Seeing that r 1 is the stripped down version of the perm/free recursor (expressed by Thm 1) requires a bit of work.After removing X from (i.e., taking X to be ∅ in) Thm. 1, we see that a nominal set A = (A, _[_] A ) together with ∅-supported operations Vr A : Var → A, Ap A : A → A → A and Lm A : Var → A → A can be equivalently described as a (Σ 1 , Props 1 )-model.Moreover, the properties of the unique function g : Tr → A guaranteed by Thm. 1 are equivalent to those of Σ i -morphisms.(App.A gives more details.)Thm. 1 does not actually need the finite-support condition FSup for the target domain-which is why in Fig. 3 we show it for r 1 (and for its variant r 3 discussed below) as crossed out.
Seeing that r 4 is the stripped down version of the swap/free recursor (expressed by Thm. 2) is also not immediate.After removing the Barendregt parameterization on X from Thm. 2, we obtain operations and relations that fit the pattern of full-fledged recursion, i.e., iteration plus additional term arguments-e.g., Vr A : Var → A, Ap A : (Tr × A) → (Tr × A) → A and Lm A : Var → (Tr × A) → A. So the situation becomes similar to that of r 6 and r 7 versus Thms. 3 and 4.However, two of Thm.2's assumptions, namely (2) and (3), do not directly fit the normal full-fledged recursion pattern.But after using the facts that FV (Ap t 1 t 2 ) = FV t 1 ∪ FV t 2 and FV (Lm x t) = FV t {x}, they are equivalent to: (2) In this form, they are seen to express a kind of full-fledged recursion that is optimized for the free-variable operator.Indeed, they are weaker versions of ones that do fit the pattern: (2) Removing the term arguments from the latter turns them into Fig.2's properties FvAp and FvLm; and removing the term arguments from the other assumptions in Thm. 2 turns them into the other properties of Props 4 .Finally, the conclusion of Thm. 2 corresponds precisely to the Σ 2 -morphism conditions.
2) The variant recursors: The remaining principles, r 2 , r 3 , r 5 and r 9 , are obtained by combining axioms of the original recursors.They act as bridges between the latter helping their comparison, but are also of independent interest, e.g., r 9 will be seen to be maximal with respect to expressiveness.
We call r 2 a "perm/free variant" because it is another recursor based on permutation and freeness, just like the original perm/free recursor r 1 .However r 2 does not follow the nominal-set route of r 1 (which defines the free-variable, i.e., support operator from permutation, via FvDPm) but instead follows the idea of the swap/free recursor r 4 (using permutation instead of swapping) and postulates properties connecting the free-variable operator with permutation (via PmFv and FvPm) and with the constructors (via FvVr, FvAp and FvLm).In short, r 2 is a hybrid between r 1 and r 4 .Another hybrid between the two is the swap-free variant r 3 , which uses the swapping operator like r 4 and nominal-set-like axioms like r 1 .r 5 is an r 6 -r 7 hybrid, based on the observation that r 6 and r 7 have quite similar structures, in that they both axiomatize the interaction between the constructors and freshness on the one hand, and their specific operator (either swapping or substitution) on the other hand; of course, substitution behaves differently from swapping w.r.t.constructors, but the respective constructor-commuting properties (SbVr, SbAp and SbLm vs. SwVr, SwAp and SwLm) have a similar flavor.The difference between r 6 and r 7 lays in the additional property that they use to further prop recursion over the constructors: in one case via a congruence rule SwCg and in the other via a bound-variable-renaming rule SbBvr.However, both these latter types of rules make sense for the other operator too, mutatis mutandis.As it turns out, we can replace SwCg with SbBvr in the swap/fresh recursor r 6 , obtaining the swap/fresh variant r 5 .But we cannot perform the dual modification to the subst/fresh recursor r 7 , where replacing SbBvr with SbCg will not give a valid recursor; the reason is that, unlike swapping, substitution-like operators need a more delicate handling of the bound variables, which SbBvr but not SbCg can achieve.
Finally, r 9 is a r 7 -r 8 hybrid, in that it has axioms similar to r 7 , but like r 8 uses the renaming operator instead of the substitution operator.Again, similarly to the case of substitution, replacing RnBvr with RnCg would not work.
We discovered these variant recursors during the Isabelle formalization of the originals-observing the roles played by different axioms in propping recursion, and noting that in specific contexts some operators and axioms are interchangeable.

IV. COMPARING RECURSORS
An advantage of viewing nominal recursors as epi-recursors is clear sight on their relative expressiveness.In this section, we start with a direct means of comparing epi-recursor expressiveness and instantiate it to our nominal recursors ( §IV-A).Then we analyze a problematic example, semantic interpretation ( §IV-B), which suggests a gentler comparisonyielding a much flatter expressiveness hierarchy ( §IV-C).We conclude the section with a summary of our findings ( §IV-D).

A. A head-to-head comparison
Def 10: Given epi-recursors r = (B, T, C, I, R) and r = (B, T, C , I , R ) with the same base category B and base object T , we call r stronger than r, written r ≥ r, if r can define everything that r can, i.e.: for all objects B in B and morphisms g : T → B, g definable by r implies g definable by r .
It is easy to see that ≥ is a preorder on epi-recursors.We write r ≡ r to state that r and r have equal strengths, i.e., both r ≥ r and r ≥ r hold.
We can establish r ≥ r by showing how to move from r to r in an initial-object preserving way, as depicted in Fig. 4: One way to read Prop.11's criterion (and Fig. 4's picture) is the following: Thinking of R as a kind of "distance" from the extended category C (and its initial object I) to the base category B (and the base object B), we have that the closer this distance, the more expressive the recursor.We have applied this criterion to prove the following expressiveness hierarchy: Thm 12: The epi-recursors described in Thm. 9 (and in Fig. 3) compare as follows with respect to their expressiveness: Thus, there are two recursors at the top of the expressiveness hierarchy: the swap/fresh recursor r 6 and the renaming/fresh (variant) recursor r 9 .(Note that the latter is not an "original" but a "variant" obtained by combining two originals, namely r 7 and r 8 .)Roughly speaking, these recursors' expressiveness is strong because their underlying axiomatizations: • keep freshness only loosely coupled with other operators such as swapping, permutation or renaming-unlike r 1 , r 3 and r 8 which ask that freshness be definable from them; • use congruence or renaming axioms that target exactly the ingredients needed for having recursion go through-unlike those of r 1 , r 2 , r 3 , r 4 and r 8 , which employ algebraic axiomatizations such that nominal sets or swapping structures; • keep the structure of their operators minimalistic and non-redundant-unlike r 7 , whose operator emulates substitution, which is more than needed.
Choosing between swapping and permutation as recursion primitives turned out to be interesting.The two are known to be equivalent for nominal sets [46, §6.1], as reflected by the fact that r 1 ≡ r 3 .But they are no longer equivalent when loosening the axiomatization to include freshness as a primitiveas reflected by the fact that r 4 ≥ r 2 but (in all likelihood) not vice versa.This is because the proof of the r 4 recursor gets away without assuming swapping compositionality SwCp, a crucial ingredient for extending swapping to permutation.

B. Semantic interpretation example
The notion of interpreting syntax in semantic domains is a well-known challenging example for binding-aware recursion.
Let D be a set and AP : D → D → D and LM : (D → D) → D be operators modeling semantic notions of application and abstraction.(Subject to some axioms that are not of interest here, the structure (D, AP, LM) is known as a Henkin model for λ-calculus [11].)An environment will be a function ξ : Var → D. Given x, y ∈ Var and d, e ∈ D, we write ξ x := d for ξ updated with value d for x (i.e., acting like ξ on all variables except for x where it returns d); and we write ξ x := d, y := e instead of ξ x := d y := e .
The semantic interpretation function sem : Tr → (Var → D) → D should go recursively by the following clauses: (1) sem (Vr Of course, these clauses do not work out of the box, and here is where the nominal recursors can help.Note that, towards the goal of building a (Σ 1 , Props 1 )model I, we had no other choice about defining the operators Vr I , Vr I , Vr I and [_] I on the target domain I.And the freevariable (support) operator FV I is also uniquely determined by the axiom FvDPm (definability of freeness from permutation).
Finally, to deploy r 1 and obtain a unique function sem satisfying clauses (1)-( 4), it remains to check that I satisfies the axioms in Props 1 .However, as it turns out, I does not satisfy one of the axioms in Props 1 , namely FCB (the freshness condition for binders).Indeed, FCB requires that there exists a variable x such that for all i ∈ I, x / ∈ FV I (Lm I x i).Applying FvDPm and the definitions of _[_] I and Lm I , one can see that x / ∈ FV I (Lm , holds for all but a finite number of variables y.The only chance for the above to be true is if i, when applied to an environment, ignores the value of y in that environment for all but a finite number of variables y; in other words, i only analyzes the value of a finite number of variables in that environment-but this is not guaranteed to hold for arbitrary elements i ∈ I.In conclusion, r 1 cannot be deployed directly to define semantic interpretations. Other recursors in our list can.For example, the perm-free variant r 2 can be deployed as follows.We use the same definitions as above for Vr I , Vr I , Vr I and [_] I , but now we are free to choose the free-variable operator FV I more flexibly, making sure that the (Σ 2 , Props 2 )-morphism condition holds for FV I versus FV, i.e., that (5) FV I (sem t) ⊆ FV t holds.Namely, for each i ∈ I, we define FV I i as {x ∈ Var | ∃ρ : Var → D, d ∈ D. i ρ = i (ρ x := d )}.The definition identifies a natural notion of what it means for a variable to "occur freely" in a semantic item i ∈ I: when i actually depends on x, i.e., when changing the value of x in an input environment ξ makes a difference in the result of applying i.And indeed, with FV I defined like this, I forms a (Σ 2 , Props 2 )-model, which gives us a unique function sem satisfying (1)-( 5).
Thus, semantic interpretation is an example where our "head-to-head" comparison has a visible outcome.But there is still an unexplored nuance here, which we discuss next.
Above, we argued that the semantic interpretation example cannot be defined directly using the perm/free recursor r 1 .However, as discussed by Pitts [45, §6.3], it turns out that it can be defined in a more roundabout manner, after some technical hassle [45, §6.3].The trick is to restrict the target domain I to a subset I on which the above defined operators do form an (Σ 1 , Props 1 )-model, and use r 1 to define sem : Tr → I .It is interesting to look at Pitts's definition of the subset I , because it will reveal a way to relax the expressiveness comparison between epi-recursors.I is defined as {i ∈ I | ∃V ⊆ Var.V finite and ∀x ∈ V. ∀ρ, d. i ρ = i (ρ x := d }.Then one proves that I is closed under the constructors Vr I , Vr I , Vr I .Moreover, for I the above problem with FCB disappears, roughly because all the elements of I are finitary.So I , with the same operators as those we tried for I, now forms a (Σ 1 , Props 1 )-model, and r 1 recursion can proceed and define sem : Tr → I , hence also sem : Tr → I.
Having different nominal recursors in front of us laid out as epi-recursors, we can view Pitts's trick in a new light.Remember that, when deploying r 2 to define sem, we used the operator FV I , which is a laxer notion of free-variable than that allowed by r 1 .An equivalent definition of I is as the set of all elements of I that have FV I finite.In this light, Pitts's trick can be seen as borrowing the free-variable operator from the different recursor r 2 , in order to single out a suitable target domain for deploying r 1 !One can also prove that, on I , the nominal-logic support (defined from permutation via FvDPm) coincides with FV I -which means that, for the target domain I , r 1 works as well as r 2 .
Thus, on a subset of the target domain that is closed under constructors, the previously deemed weaker recursor r 1 can simulate r 2 .As it turns out, this is a general phenomenon, which we can phrase for epi-recursors as a gentler expressiveness comparison, and apply to our array of nominal recursors.Formalizing this for two epi-recursors r = (B, T, C, I, R) and r = (B, T, C , I , R ) must make sure to avoid patholog-ical dependencies.Indeed, a first attempt is: For all objects B in B and morphisms g : T → B, if g is definable by r then there exists an object B 0 and two morphisms g 0 : T → B 0 and h : B 0 → B such that g 0 is definable by r and g = h•g 0 .But this would yield a vacuous concept, rendering any epi-recursor r stronger than any other r: just take B 0 = T , g 0 = 1 T (which is obviously definable by r ) and h = g.So we should be careful not to allow the above "transition" morphism h depend on the r-definability morphism g.Otherwise, we would use r-definability itself to reduce r-definability to r -definability.

C. A gentler comparison
For being able to produce morphisms to objects B of B independently of other data, the following concept comes handy.An initial segment of a category C is a pair (C 0 , (m(C) : where C 0 is a full subcategory of C and, for each object C of C, o(C) is an object and m(C) a morphism in C 0 .Using an ordering metaphor for morphisms, an initial fragment of a category provides a "smaller" object for any of its objects.Now we can formulate our gentler relation for comparing strength, which we call quasi-strength: Def 13: r = (B, T, C , I , R ) is quasi-stronger than r = (B, T, C, I, R), written r r, when there exists an initial segment (B 0 , (m(B) : o(B) → B) B∈Obj(B) ) of B such that, for all g : T → B definable by r, there exists a morphism g 0 : T → o(B) such that g 0 is definable by r and g = m(B) • g 0 .Thus, r r says that what r can define is obtainable from what r can define up to composition with a morphism that only depends on the target object in the base category.is a preorder weaker than ≥.We write r ∼ = r to mean that r r and r r both hold, i.e., r and r have quasi-equal strengths.
While being a reasonable weakening of ≥, the relation is likely to be more costly to deploy in concrete cases than ≥.Indeed, as suggested by our discussion in §IV-B, applying r r, i.e., using r in lieu of r, in particular extracting o(B) from B and using o(B) as a "more precise" target domain, can involve non-negligible formal bureaucracy in concrete situations.
Our effective criterion for checking ≥ (Prop.11) can be generalized to deal with .Given two categories C and C , each with initial segments ) is an initial segment of C such that C 0 contains I and R preserves the above initial segments, and The gist of this criterion (and also its proof idea) is shown in Fig. 5: One starts with a morphism g that is definable by r and uses the two initial segments to factor it into a morphism g 0 definable by r and a remainder morphism m(B).
Applying the gentler comparison to our recursors (via the Prop.14 criterion) yields the following quite surprising result: Thm 15: The epi-recursors described in Thm. 9 (and in Fig. 3) compare as follows by quasi-strength: Thus, brings a dramatic flattening of the ≥ hierarchy established by Thm.12: All the swapping-and permutationbased recursors r 1 -r 6 have equal quasi-strengths.The intuition for this, as we discovered during the proofs, is the following.Recall that the differences in strength (using ≥) between these recursors were due to: (1) the looseness or tightness of their connection between swapping/permutation and freeness/freshness, (2) the higher flexibility of swapping compared to permutation, and (3) the more focused nature of congruence compared to an algebraic axiomatization.Remarkably, all these differences vanish if we are allowed to navigate along submodels, which enables.This is because (as we detail in the App.C proof of Thm.15), certain minimal submodels are much more "term-like" than an arbitrary model; e.g., they generalize Pitts's submodel definition for semantic interpretation, where nominal-style freshness coincides with other, more loosely axiomatized notions of freshness.
An interesting takeover when switching from ≥ to is the swapping/permutation-based recursors r 1 -r 6 becoming (quasi-)stronger than the renaming-based recursors r 8 and r 9 .Indeed, defining renaming from swapping or vice-versa seems impossible in arbitrary models, meaning these two types of recursors are ≥-incomparable.But when switching to submodels (allowed by ) one direction is possible: The swapping of two variables can be defined in a renaming-based model similarly to how it is done for concrete terms, via picking an intermediate fresh variable; and "picking fresh" is possible in minimal submodels because everything there is finitely supported.

D. Summary
Epi-recursors are comparable for expressiveness according to a strict relation ≥, saying that everything definable by one is definable by the other, and a looser relation , saying that everything definable by one can be defined by the other with the help of an additional morphism, typically a submodel inclusion.The handling of the semantic interpretation example with the nominal logic recursor was our inspiration for , and gives a flavor of the additional overhead incurred by .The effective criteria we used to prove these relations for concrete recursors (Props.11 and 14), can be paraphrased using "is" and "has": • r ≥ r holds if any r-model M is an r -model-in that it can be regarded (after defining the relevant operations, in a way that ensures functoriality) as an r -model.• r r holds if any r-model M has an r -submodel-in that there exists a submodel M of M that still satisfies the propertied required by r, and can be regarded as an r -model.The -hierarchy of nominal recursors is significantly flatter than the ≥-hierarchy, sending an egalitarian message: Most of the nominal recursors turn out to have the same strength, with the only nuance that the recursors based on symmetric operators (swapping and permutation) are more expressive than those based on asymmetric ones (renaming and substitution).The proximal related work is of course that on nominal recursors, which we discussed in detail.We provide not only a uniform view of these recursors, but also simpler proofs of their underlying recursion theorems (as explained in App.C).
1) Recursors in different paradigms: Binding-aware recursors have also been developed in the other two major paradigms.In the nameless representation, the λ-constructor does not take a variable as an input, i.e., does not have the type Var → Tr → Tr, but rather Tr → Tr.Scope-safe versions of nameless recursion based on category theory have been studied extensively, e.g., [2], [3], [13], [24], [31], [32].A nameless recursor is in principle easier to deploy because the constructors are free; the price is additional index shifting overhead [12].
Hybrid nameless/nominal solutions have also been proposed, notably the locally named [38], [47] and locally nameless [7], [17] representations.In recent work [44], Pitts introduces locally nameless sets, an algebraic axiomatization of syntax under the locally nameless representation, and characterizes the locally nameless recursor [17] using initiality in a functor category (similarly to recursors in the nameless setting [24], [31]).He also proves that the category of locally nameless sets is isomorphic to that of finitely supported rensets [49] and to categories given by other axiomatizations of renaming from the literature [26], [53]; this suggests that the expressive power of the locally nameless recursor might be located in the vicinity of r 8 (which is based on rensets).On the way to his results, Pitts gives an alternative axiomatization of finitely supported rensets, using instead of RnCh a simpler (unconditional) axiom, let us call it RnCh': t Replacing RnCh with RnCh' would give a recursor r 8 ' such that r 8 ≥ r 8 (since RnCh' implies RnCh in the presence of RnIm) and r 8 ∼ = r 8 (since RnCh' holds for finitely supported rensets, hence for a suitable minimal submodel).
In strong HOAS, as implemented in dedicated logical frameworks [8], [42], [43], the λ-constructor has type (Tr → Tr) → Tr.Here, the difficulty with recursion is not the non-freeness of the constructors, but the fact that binding constructors are not recursable in the typical wellfoundedness manner.Solutions to this have been designed using modality operators [52] and contextual types [23].Recursion mechanisms have also been designed within weak HOAS, [20], where the λ-constructor, having type (Var → Tr) → Tr, is standardly recursable-yielding a free datatype that contains all terms but also additional entities referred to as "exotic terms".Partly due to the exotic terms, this free datatype is not very helpful for recursively defining useful functions on terms.But the situation is significantly improved in a variant called parametric HOAS (PHOAS) [18].The functions definable recursively in PHOAS seem to be exactly those definable via the semantic interpretation pattern.
A nominal/HOAS hybrid can be found in Gordon and Melham's characterization of the λ-term datatype [29], which employs the nameful constructors but features weak-HOAS style recursion over Lm.Norrish inferred his swap/free recursor r 4 from the Gordon-Melham one.Weak-HOAS recursion also has interesting connections with nameless recursion: In presheaf toposes as in Fiore et al. [24], Hofmann [31] and Ambler et al. [4], the function space Var ⇒ T is isomorphic to the De Bruijn level shifting transformation applied to T ; this effectively equates the weak-HOAS and nameless recursors.
2) Recursion over non-free datatypes: Some nominal recursors operate by characterizing terms as the non-free datatype determined as initial model of an equational theory [16], [28], or more generally of a Horn theory [37], employing an infinite number of axioms.In such cases, and ignoring the Barendregt enhancement, nominal recursion becomes a particular case of Horn recursion.(This is not true for the nominal logic recursor r 1 , since FvDPm is not a Horn formula.)Our concept of epirecursor applies to general Horn recursion as well-provided one identifies a constructor-like subsignature of the given signature, i.e., such that the initial model of the Horn theory has its carrier generated by its operations.In algebraic specifications, this property is called sufficient completeness [30].
The non-free datatypes of sets and bags are degenerate examples of the above, where the constructor subsignature is the entire signature.Tannen and Subrahmanyam [54] and Buneman et al. [15] study (essentially) Horn recursors for these datatypes as a basis of new designs for database languages.They prove connections between their axiomatizations that could be captured using our ≥ relation between epi-recursors.
3) Corecursion for infinitary terms with bindings: Terms with bindings having infinite depth, e.g., Böhm trees [11], [34], are useful concepts in the meta-theory of λand πcalculi.Nominal corecursion principles [14], [35], [36] help defining functions that output such infinitary terms.An interesting question is whether all the different nominal recursors have corecursion counterparts, and whether they compare similarly.not require the free-variable operator to be definable from swapping, but only to be related to swapping by some weaker properties.And indeed, this looseness translates into higher flexibility, because any (Σ 1 , Props 1 )-model can be proved to be in particular a (Σ 2 , Props 2 )-model.Thus, r 2 ≥ r 1 follows from Prop.11 using the identity functor.
(Since working with permutation is much heavier than working with swapping, we preferred to do this proof while taking advantage of the permutation-swapping connection.Namely, starting with a (Σ 1 , Props 1 )-model M, and already knowing from before that M with its swapping operator corresponding to permutation satisfies Props 3 , we proved that it also satisfies SwFv and FvSw, as well as FvVr, FvAp and FvLm, (thus essentially establishing on the way that r 4 ≥ r 3 ).Then, using the permutation-swapping connection, we inferred PmFv and FvPm from SwFv and FvSw.) Proof of r 4 ≥ r 2 : This holds essentially for the same reason why r 1 ≥ r 3 holds, namely because the restriction to transpositions of a permutation operator satisfying PmId and PmCp will satisfy SwId, SwIv and SwCp.But note that, this time, we don't have SwCp on the swapping side, in that r 4 does not require SwCp-so the converse construction described above when proving r 3 ≥ r 1 (using decomposition into transpositions) does not hold, forbidding us from establishing the converse inequality r 2 ≥ r 4 .And it seems impossible to be able to produce a more expressive variation of r 2 which satisfies weaker properties than PmId and PmCp in order to hope for restoring, in this context, the symmetry between swapping and permutation.This reveals a perhaps unexpected phenomenon: that swapping-based recursors can be strictly more expressive than their permutation-based counterparts, as is indeed the case of r 4 versus r 2 .
Proof of r 5 ≥ r 4 : This follows by applying Prop.11 with the functor that transforms the freshness operator into a freevariable operator using negation.Indeed, save for the straightforwardly corresponding freshness operator's properties FrVr, FrAp and FrLm and their free-variable counterparts FvVr, FvAp and FvLm, the only difference between r 5 and r 4 is the replacement of the swapping and swapping-frshness properties SwId, SwIv, SwFv and FvSw with a single property: the swapping-based renaming rule SwBvr.And the latter follows from the former in the presence of FvLm.Going in the other direction, for proving r 4 ≥ r 5 , does not seem possible: SwBvr is a (more abstract) weaker assumption than SwId, SwIv, SwFv and FvSw, even in the presence of all the other assumptions.
Proof of r 6 ≥ r 5 : This follows from the fact that, in the presence of the other axioms in Props 5 , the bound-variable renaming property SwBvr implies the congruence property SbCg (though not the other way around).
Proof of r 8 ≥ r 7 : This follows immediately since the axioms for substitution imply those for renaming (though not the other way around, since substitution requires additional structure).
Proof of r 9 ≥ r 8 : The proof here takes advantage of the fact that, in a constructor-enriched renset (structures axiomatizing renaming that form the basis of recursor r 8 ), freshness is definable from renaming [50] in such a way that the r 9 properties can be proved.
One may wonder whether any relation can be established between the strength of swapping-based recursors on the one hand, and renaming-or substitution-based recursors on the other hand.The answer seems to be negative: Substitution-like operators _[_/_] M : M → M → Var → M are structurally more complex than swapping-like operators _[_∧_] M : M → Var → Var → M as they (intuitively) refer to the replacement not of variables for variables, but of entities from the models for variables; so there seems to be no hope of defining the former from the latter in a freshness-swapping model; and it seems that not even renaming-like operators can be defined from swapping-like operators, since the latter but not the former preserve the free variables.
Conversely, defining a swapping-like operator in a substitution based or renaming based model seems superficially more plausible.However, the only way to achieve this while ensuring the required properties for swapping is along the lines of the standard trick of employing an additional fresh variable, namely picking a fresh z and defining m[x∧ y] M = m[z/x] M [x/y] M [y/z] M .But this does not work since the substitution based and renaming based models do not guarantee the existence of fresh variables-and adding axioms guaranteeing that would severely restrict the recursors' expressiveness.Thus, the swapping/permutation-based recursors and substitution/renaming based recursors seem incomparable w.r.t.expressiveness (that is, using the "head-to-head" comparison relation ≥; but see of course the situation changes when we switch to the looser comparision , as discussed in §IV-C).
Proof of Prop.14.The entities appearing in this proof are shown in Fig. 5 (from the main paper), which to some extent also summarizes the proof.
Assume g : T → B is definable by r, meaning that g = R !I,C for some C in C. Let g 0 = R !I,o1(C) .Note that, because R preserves the initial segments and B = R C, we have that o(B) = R o 1 (C), hence g 0 : T → o(B).We must show that (i) g 0 is r -definable and (ii) g = m(B) • g 0 .
To show (i), let Proof of Thm. 15.Recall that the base category for all epi-recursors is the category of Σ ctor -models.To prove the theorem, we will apply Prop.14. Recall that the functor components of the recursors (R and R in Prop.14) are each time the forgetful functors.For each -relationship we prove, we will define the initial segment of the base category (B 0 from Prop. 14 ) as follows: For any Σ ctor -model A of carrier A we take o(A) to be its minimal submodel (subalgebra), i.e., the one generated by Vr A , Ap A and Lm A ; and we take m(A) : o(A) → A to be the inclusion morphism.
Let us first consider the ∼ =-chain going from r 1 to r 6 .Since, by Thm. 12, r 6 (the swap/fresh recursor), is the strongest w.r.t.≥, and r 1 (the perm/free recursor) and r 3 (the swap/free variant recursor) are the weakest and are equivalent with each other, and because the relation is weaker than ≥, it suffices to prove r 3 r 6 .
Proof of r 3 r 6 : To satisfy the conditions of Prop.14, we need to define an initial segment of the category of (Σ 6 , Props 6 )-models and an initial-segment-preserving prefunctor to the category of Σ ctor -models.
To achieve this, it turns out that the natural route goes through the properties of the swap/free recursor r 4 .We proceed as follows: Given a (Σ 6 , Props 6 )-model M of carrier M , we define a submodel M of M on the subset M of M generated by the constructor-like operations Vr M , Ap M and Lm M and prove that, modulo the translation between freshness and freeness (via negation), M is an (Σ 4 , Props 4 )model.The operations on M should of course be inherited from the ones of M. For this to be possible, we first need that M is closed under the Σ 6 -operations.By definition it is closed under the constructor-like operations and, thanks to M satisfying SwVr, SwAp and SwLm, it is also closed under the swapping-like operation.Now, we take the freshness predicate on # M to be defined in the style of nominal logic, i.e., by (the freshness translation of) FvDSw, which we will refer to as FrDSw: for x ∈ Var and m ∈ M : x# M m is defined to mean that m[x ∧ y] M = m for only a finite number of variables y.
Alternatively, we could have defined # M inductively by the clauses FrVr, FrAp and FrLm, which would make M the minimal submodel of M. Indeed, these two definitions will eventually turn out to be equivalent, but our proof needs to follow a delicate sequence of steps which require that we start with the nominal-like definition.For now, let us write $ M for this alternative, inductively define freshness predicate.Note that $ M is smaller than the restriction of # M to M .
To establish that M is a submodel of M, it remains to prove that, for items in M , # M is smaller than # M .We will actually prove the stronger statement that # M is smaller than $ M .The proof proceeds by expanding the definition of # M , and needs that FrDSw and FrSw hold for $ M .Both these last properties follow by induction on the definition of $ M .(Note that a direct proof that # M is smaller than # M would not work along the same lines, since neither FrDSw and FrSw are guaranteed to hold for the restriction of # M to M ; the tighter predicate $ M is actually needed.)So M is a submodel of M. We now need to prove that M is a (Σ 6 , Props 6 )-model.M satisfies SwVr, SwAp, SwLm because these are Horn clause and its supermodel M satisfies them.That M satisfies FrVr and FrAp follows easily by applying the definition of # M .That M satisfies SwCg follows immediately from M satisfying SwCg and # M being included in # M .
For proving the next facts, we need to make heavy use of the fact that M satisfies the structural properties of swapping, SwId, SwIv and SwCp.All these three follow by easy induction on the definition of M and the fact that M satisfies SwVr, SwAp, SwLm.
To prove that M satisfies FrLm, we first prove that x # M Lm M x d holds for all d ∈ M , in particular, that M satisfies FCB.A prerequisite for the latter is that M satisfies FrSw, which follows from the definition of # M together with the fact that M satisfies SwCp and SwIv.Now, that M satisfies FrLm almost (but not quite) follows from SwCg (for # M ); we actually need a stronger version of SwCg to hold for # M , namely: For all x, x , z ∈ Var and To prove the latter, we need to cover the cases not covered by SwCg, namely (1) that of z = x = x , which follows from the fact that M satisfies SwId and (2) that of z = x and z# M m (and a case symmetric to it), which needs that M satisfies SwFr and FrDSw, i.e., that FrDSw holds for # M (whereas so far we only know that it holds for $ M ).That M satisfies SwFr follows from the definition of # M together with the fact that M satisfies SwCp.That M satisfies FrDSw follows from the fact that (3) FrDSw holds for # (the predicate on terms), and that (4) the unique Σ 6 -morphism g : T r(Σ 6 ) → M guaranteed by the initiality of T r(Σ 6 ) has its image included in M and it turns out to preserve freshness not only in the form "x#t implies x# M g t", but in the stronger form "x#t iff x# M g t".Fact (4) follows from applying FrDSw to both # and # M and using that g commutes with swapping.
In summary, along the above route, we proved that M is a submodel of M that satisfies the properties in Props 6 , meaning that the inclusion function is a morphism between M and M in the category of (Σ 6 , Props 6 )-models, as desired.On the way, we also proved that M satisfies FCB, SwIv, SwId, SwCp, FrSw, SwFr and FvDSw.So, in the notations of Prop.14. we take o 1 (M) to be M and we take m 1 (M) : o(M) → M to be the inclusion morphism.The forgetful functor between (Σ 6 , Props 6 )-models and Σ ctor -models (R in Prop.14's notations) is easily seen to be initial-segment preserving.
We define Prop.14's operator F to take any model M to the model F M that replaces # M with FV M standardly defined from # M and to be the identity on morphisms.We must show that F M satisfies the properties in Props 3 .This is true, because SwVr, SwAp and SwLm are already in Props 6 and all the other properties in Props 3 have already been proved above.It is easily seen that F is a pre-functor (a functor actually) such that R • F = R C 0 and F T r(Σ 6 ) = T r(Σ 3 ), as required by Prop.14.This concludes the proof of r 3 r 6 .
(Note that, on the way to proving that our constructed submodel M satisfies Props 6 and (via the freshness to freevariable translation) satisfies Props 3 , we actually proved that M satisfies (again via the translation) all properties of Props 4 To deal with this difficulty, we rephrase the above definition by eliminating freshness completely.Namely, first we prove that (*) y # M m[u/y] whenever u = y.This allows us to rephrase the above choice-independence property as an equation: 1For all m ∈ M and y, y , z 1 , z 2 , u ∈ Var, if y, y ∈ {z 1 , z 2 , u} and y, y # M m, then Indeed, the previous version follows from this one, using (*).Now, this version can be inferred from the term-model connection, using the corresponding property for terms.
After overcoming this difficulty, the desired properties in Props 6 all follow smoothly either using the term-model connection or by fresh induction.Again, it is easily seen that F is a functor such that R • F = R C 0 and F T r(Σ 9 ) = T r(Σ 6 ).This concludes the proof of r 6 r 8 .
3) Back to the proof of the recursion theorems: The heart of the proof of an epi-recursion principle, i.e., of the fact that a tuple r = (B, T, C, I, R) forms an epi-recursor, is a proof of initiality, namely the initiality of the object I in the category C.And indeed, this is the difficult part in the proof of all the nominal recursors listed in Thm 9.
Next, we show how we can take advantage of the expressiveness comparisons to "borrow" a (quasi)weaker recursion principle from a (quasi)stronger one, and to infer all nominal recursors from only two of them-those located at the top of the expressiveness hierarchy.
Indeed, the idea behind our expressiveness comparison criteria (Props.11 and 14) has been the possibility of one recursor to simulate the behavior of another recursor, so it feels natural use this idea for "borrowing" purposes.To this end, we first introduce pre-epi-recursors, which are epi-recursors without the initiality condition, and a possible property of them called tightness: Def 20: A pre-epi-recursor is a tuple r = (B, T, C, I, R) subject to the same condition as an epi-recursor (Def.7), but without the requirement that I is the initial object of C.
A pre-epi-recursor is called tight if the following hold: • T is a quasi-initial object in B (in that for every object B in B there exists at most one morphism from T to B).
• The functor R is faithful (in that it is injective on morphisms).
All the nominal epi-recursors we discussed in this paper are tight, because T is a quotient of the term algebra (known to be quasi-initial) and the functor R is the identity on morphisms.
• For all z ∈ Var X and (t, m), (s All the recursion principles generalize from their stripped down versions to the enhanced versions: Thm 24: Thm. 9 still holds if we replace the categories of Σ i -models with those of (X, Σ i )-models.
Recall that Thms.1-5 list existing nominal recursors from the literature.Thm. 9 's recursors r 1 , r 4 , r 6 , r 7 and r 8 were stripped-down versions of these recursors.By contrast, Thm.24's corresponding recursors are further enhancements of the original recursors, obtained by putting together all the enhancements-because the strongest version of each enhancement now benefits each recursor.
In order to generalize our comparison results, we were actually compelled to strengthen the recursors even beyond the sum of all enhancements.For example, both the perm/free recursor (specific to nominal logic) and Norrish's swap/free recursor were based on axiomatizations of permutation and swapping: forming nominal sets in the case of the perm/free recursor and entities called swapping structures for the swap/free recursor [40].At the same time, both recursors had Barendregt enhancements that allowed the flexibility of working modulo X, meaning that some axioms on the target domains operated modulo X-as seen in Thms. 1 and 2. However, this flexibility was not affecting the notions of nominal set or swapping structure, which did not consider X.Our systematic approach to adding performing the Barendregt enhancement, reflected in particular in the r 1 and r 4 versions of our Thm.24, makes this flexibility pervasive, thus strengthening Thms. 1 and 2 with what could be called nominal sets up to X and swapping structures up to X.We have not investigated whether such stronger recursors can make a difference in practice, but it is in principle useful to have the strongest possible recursors at our disposal.
All the expressiveness comparisons results for the stripped down recursors carry over to the enhanced recursors as well: Thm 25: Thms.12 and 15 still hold for the enhanced recursors (employing (X, Σ i )-models) described in Thm.24.
The proofs follow the same lines as those we sketched for Thms.12 and 15, using the categorical criteria from Props.11 and 14.One phenomenon worth mentioning is that the goal of extending our comparison results to the enhanced recursors have forced us to perform more general enhancements than originally intended (and thought possible).For example, the aforementioned notion of performing Barendregt enhancement more comprehensively in r 1 and r 4 (yielding nominal sets up to X and swapping structures up to X) were required in order to prove that, via r 3 , they are quasi-stronger than (the naturally enhanced version of) r 6 .

E. Isabelle Mechanization
We have mechanized our results about nominal recursors as epi-recursors and their comparisons in the theorem prover Isabelle/HOL [39].The mechanization is publicly available [48].It covers both the stripped-down versions of the recursors discussed in the main paper and their enhancements discussed in App.D.
We made heavy use of Isabelle's locales [9], [33], which we found to be an excellent abstraction mechanism for representing the expressiveness relationships between recursors.A locale fixes some types, constants and assumptions.One can perform definitions and prove theorems inside a locale, and everything happens relative to the entities fixed in that locale.Viewed from outside the locale, all these definitions and theorems are (1) polymorphic in that locale's fixed types, (2) universally quantified over that locale's constants, and (3) conditioned by that locale's assumptions.
A locale can be interpreted at the top level of an Isabelle theory by providing concrete types and constants for that locale's parameter types and constants, and verifying the locale's assumptions; after a successful interpretation, all the definitions performed and theorems proved in a locale are automatically instantiated for these concrete types and constants.A locale L 1 can also be interpreted relative to another locale L 2 by establishing a sublocale relationship L 1 ≤ L 2 .This amounts to showing that the entities of L 1 can provide an interpretation of those of L 2 ; i.e., in the context of the fixed types, constants and assumptions of L 1 , one identifies some types and constants that instantiate those of L 2 , and verifies the assumptions of L 2 .
The traditional application of locales is structuring the development of algebraic structures, such as groups, rings, fields etc. [9], [10].Then (top-level) interpretations provide particular examples of such structures, e.g., interpreting the ring locale into the particular ring of integers.Moreover, sublocale relationships are useful for showing the inclusion between two types of structures, e.g., fields are particular kinds of rings, or more generally for showing that one type of structure induces another type of structure.
Our own results in this paper are also algebraic / modeltheoretic in nature.For each of the nine types of models underlying the nominal recursors, we have introduced a locale, as shown in Fig. 7.
Each locale fixes the carrier type M of a model and the operations and relations on the model: constructor, permutation, swapping, substitution, renaming, free-variablr and freshness operators.Then it postulates the respective axioms.(In the case of the enhanced recursors, the locale also fixes the domain D ⊆ Tr × M and assumes that D is closed under the operations, as explained in App.D; it also fixes a set of variables X, assumes its finiteness, and the axioms are stated relative to X, again as explained in App.D.) In short, each locale axiomatizes a class of models, namely that of (Σ i , Props i )-models (and (X, Σ i , Props i )-models) for each recursor r i .Recall that the results on strength comparison reported in Thm. 12 (and extended to enhanced recursors in Thm.25) essentially show that one recursor is stronger than another, say r i ≥ r j , by showing that any (Σ j , Props j )-model M is (or can be regarded as) a (Σ i , Props i )-model-that is, after defining on M the Σ i -operations.We expressed this in Isabelle as follows: Say L i and L j are the locales for these two classes of models.Working inside locale L j , we defined the Σ i operations and proved for them the Props i properties.This allowed us to prove the locale relationship L j ≤ L i , which is a statement of r i ≥ r j .This shallow embedding of the ≥ relationship allowed us to concretely borrow for (Σ j , Props j )models the r i recursor, in other words to infer the r j recursor from the r i recursor.
A similar, but slightly more involved mechanism was used for mechanizing the quasi-strength comparison results of Thm. 15 (extended to enhanced recursors in Thm.25).Remember that r i r j was proved by showing that any (Σ j , Props j )-model M has a (Σ i , Props i )-submodel-in that there exists a submodel M of M that on the one hand still satisfies Props j , and on the other hand can be regarded as a (Σ i , Props i )-model (again, via defining on M the Σ ioperations).We expressed this in Isabelle as follows: Working inside locale L j , we identified a suitable subset M of M's carrier M (and, for enhanced recursors, a suitable subset of M's domain D) and proved that it is closed under the operations and satisfies the Props j properties-as discussed in the proof sketch of Thm. 25 from App. C, this was in each case a minimal set closed under the constructors, defined inductively.In other words, we built a (Σ j , Props j )-submodel.To capture this using locales, we defined the locale L j that extends L j with a subset M that forms a (Σ j , Props j )submodel, and proved L j ≤ L j by defining Min to be the aforementioned minimal submodel of Min .Then we defined the Σ i operations on M (more precisely, we defined them on the entire type and proved that M is closed under them), after which we proved for them the Props i properties.This allowed us to prove the locale relationship L j ≤ L i , defining the model Min of L i to be the same minimal submodel of Min .These two locale inclusions together form a statement of r i r j .Again, this mechanized relationship is effective, in that it allowed us to infer the r j recursor from the r i recursor.
As a byproduct of the above network of sublocales that allows borrowing recursors, we were able to infer all the nine recursors from just two of them, namely r 6 (the swapfresh recursor) and r 9 (the renaming/fresh variant recursor)as discussed in the proof sketch of Thm. 9 from App. C. For r 6 and r 9 , we performed direct proofs of initiality.The initial morphism was constructed by first defining inductively a relation and then proving that it is a function and it commutes with the relevant operations and preserves freshness.This approach is distinct from (and we believe simpler than) previous techniques from the literature used to prove nominal recursion principles.For example, Norrish bases the proof of his swap/free recursor [40] on a previous recursor by Melham and Gordon [29], which in turn uses the lifting of a function from preterms after proving that it respects α-equivalence.Similarly, Pitts [45]'s proof of the perm/free recursor lifts a function from preterms.Our approach is simpler in that it does not delve into preterms, but operates entirely at the abstraction level of terms.
The theory structure of our Isabelle development is shown in Fig. 8. Everything is based on a formalization of terms as equivalence classes of preterms, in the theory Lambda_Terms.Due to the need to borrow some properties from the terms model to arbitrary models (for given signatures) via the initial morphism (as explained in the proof sketch of Thm. 15 from App. C), a large theory of terms had to be formalized, comprising a wealth of results about the term operators, depth-based and fresh induction principles.Moreover, the auxiliary theory Swap_vs_Perms performs the conversions between swappingbased and permutation-based axioms: starting with the classic result on switching between the two alternative axiomatizations of nominal sets as described in Pitts's monograph [46,Section 6.1], and extending this correspondence in various ways as needed by the various recursors: to covering a separate freshness predicate (not reducible to swapping or permutation), to relaxing nominal sets to "nominal sets modulo X" for a more comprehensive application of Barendregt's convention (as discussed in App.D), etc.
The names of the other theories in Fig. 8 are selfexplanatory.For example: • the theory RenamingFreshV_model formalizes the models for the renaming/fresh variant recursor (and of course contains the locale with the same name); • the theory SwapFresh_SwapFreshV_SwapFree_models formalizes the models corresponding to the swap/fresh, swap/fresh variant and swap/free recursors (and contains the corresponding locales); • the constructors Vr : Var → Tr, Ap : Tr → Tr → Tr and Lm : Var → Tr → Tr • (capture-avoiding) substitution _[_ /_] : Tr → Tr → Var → Tr; e.g., we have (Lm x (Ap x y)) [Ap x x / y] = Lm x (Ap x (Ap x x)) • (capture-avoiding) renaming _[_ /_] : Tr → Var → Var → Tr, the restriction of substitution to variables, i.e., it substitutes variables for variables rather than terms for variables; e.g., we have (Lm x (Ap x y)) [x / y] = Lm x (Ap x x) • swapping _[_ ∧ _] : Tr → Var → Var → Tr; e.g., we have (Lm x (Ap x y)) [x ∧ y] = Lm y (Ap y x) • permutation _[_] : Tr → Perm → Tr; e.g., we have (Lm x (Ap z y)) [x → y, y → z, z → x] = Lm y (Ap x z) which gives us a morphism !I,C : I → C in C from the initiality of I • take g to be R !I,C , the restriction of !I,C to B Def 8: We call a morphism g : T → B definable by the epi-recursor r if g = R !I,C for some extension C of B.

Fig. 3 :
Fig.3: Sets of properties relevant for nominal recursion example, M satisfying FCB means the following: There exists x ∈ Var such that x / ∈ FV M (Lm M x m) for all m ∈ M .Given a subset Props of the properties listed in Fig.2and a signature Σ comprising the symbols referred to in Props, any Σ-model satisfying Props will be called a (Σ, Props)-model.Now we can (re)formulate nominal recursors as epi-recurors:

Fig. 4 :Prop 11 :
Fig. 4: Criterion for comparing expressiveness Prop 11: Let r = (B, T, C, I, R) and r = (B, T, C , I , R ), and assume F : C → C is a pre-functor (i.e., a functor but without the requirement of preserving identity and composition of morphisms) such that R • F = R and F I = I .Then r ≥ r.
First, let us attempt to deploy the perm/free recursor r 1 .To this end, we try to organize the target domain I = (Var → D) → D as a (Σ 1 , Props 1 )-model I.The three desired clauses above already determine constructor operations Vr I , Ap I and Lm I on the set of interpretations, I = (Var → D) → D, namely: (1) Vr I : Var → I by Vr I x i ξ = ξ x (2) Ap I : I → I → I by Ap I i 1 i 2 ξ = AP (i 1 ξ) (i 2 ξ) (3) Lm I : Var→I →I by Lm I x i ξ = LM (d → i (ξ x:=d )) Thus, we already have the Σ ctor component of our intended model.Now we must define a permutation operator on I.The definition is obtained by analyzing the desired behavior of the to-be-defined function sem w.r.t.permutation; i.e., determining the value of sem(t[ρ]) from sem t and ρ.The answer is (4) sem (t[ρ]) ξ = sem t (ξ • ρ), and leads to defining _[_] I by i [ρ] I ξ = i (ξ • ρ).
Our relation r ≥ r compares the strength of epi-recusors directly, as inclusion between what r can define and what r can define.The discussion ending §IV-B suggests that this relation may be too strict.More flexibly, we could check if what r can define is obtainable from what r can define up to composition with a morphism (which can be an inclusion, as in Pitts's trick).

Fig. 5 :
Fig. 5: Gentler criterion for comparing expressiveness Moreover, by the initiality of I and the fact that F I = I , we have!I ,C =!I ,F o1(C) = F ! I,o1(C) .Hence, using that R • F = R C 0 , we have R !I ,C = R F ! I,o1(C) = R !I,o1(C) = g 0 , which concludes the proof of (i).Next we show (ii).By the initiality of I, we have m 1 (C)•!I,o1(C) =! I,C ; hence, by the functoriality of R, we have R m 1 (C)•R !I,o1(C) = R !I,C .Hence, since R preserves the initial segments which implies R m 1 (C) = m(R C) = m(B), we obtain m(B) • g 0 = g, as desired.

Fig. 7 :
Fig. 7: Isabelle locales corresponding to recursors • the theory Renaming_model_is_RenamingFreshV_submodel proves that each renaming model is (can be regarded as) a renaming/fresh variant model, via the sublocale statement Renaming_model ≤ RenamingFreshV_model;• the theory SwapFresh_model_has_SwapFreeV_submodel proves that each swap/fresh model has a swap/fresh submodel that is (can be regarded as) a swap/freee