This archive contains the theory files associated to our ITP submission 
"A Formalized General Theory of Syntax with Bindings." They can be processed 
with Isabelle2016-1, available from https://isabelle.in.tum.de/ 

The directory Trivia formalizes some auxiliary concepts.

The directory Binding_Syntax_Theory contains the bulk of our development. The 
names of its theory files are quite self-explanatory. In particular:

-- the theories with "QuasiTerms"-prefixed name deal with quasiterms and their 
operations, covered in the paper's sections 3.1--3.4

-- Transition_QuasiTerms_Terms and Terms introduce terms as quasiterms modulo 
alpha and formalize their properties, including the fresh induction schema (the 
paper's sections 3.5 and 4.1) 

-- Well_Sorted_Terms fixes a signature and transfers all proved facts from good 
terms to well-sorted terms (as described in the paper's section 5)

-- Iteration, Semantic_Domains and Recursion deal with the iteration, semantic 
interpretation and recursion schemas described in the paper's section 4.2 and 
appendix B. The recursion theorems are not stated exactly as described in the 
paper. There are the following differences: 

-----(1) They employ iterator/recursor combinators to produce, from models, the 
functions of which existence is stated in the paper; e.g., the functions f and 
fAbs from the paper's theorem 12 are obtained as "iter MOD" and "iterAbs MOD", 
where "MOD" is the model. 

-----(2) Custom predicates are used to describe the various involved properties, 
be they required for the models or given back by the recursors. For example, 
"termFSbImorph (iter MOD) (iterAbs MOD) MOD" states that "iter MOD" and "iterAbs MOD" 
form together an "(iteration) morphism of freshness-substitution models", i.e., 
they commute with the constructors and with substitution and preserve freshness. 

-- Regular_Cardinals imports Isabelle's cardinal library, which offers support 
for regular cardinals

The theory Binding_Syntax puts everything together and applies some filtered 
searches to display the most important theorems. 

As a matter of notation, the formalization is fairly closed to the paper, although 
the paper sometimes simplifies notation for readability. For example, the 
formalization does not employ the "uparrow" notation for the lifting predicates. 

Lorenzo Gheri and Andrei Popescu
13 April, 2017
