Theory Syntax
theory Syntax
imports Main "HOL-Library.Countable"
begin
section ‹Syntax: a deep embedding of HOL in HOL›
text ‹BKK's language of classical higher-order logic --- HOL, by which we mean
Church's simple theory of types throughout (BKK Sections 2.1--2.2) --- in a @{emph ‹locally
nameless›} representation: bound variables are de Bruijn indices, free variables
and parameters carry their type. BKK take alphabetic variants to be identical (BKK
Section 2.1); locally nameless makes that literally true --- ‹α›-equivalent terms are
@{emph ‹equal›}, so capture-avoiding substitution and the entire renaming theory disappear.
As in BKK, non-logical constants are @{emph ‹parameters›} with names drawn from a type ‹'p›, and
we include BKK's optional primitive equality ‹Eq σ› (BKK Section 2.1, Remark 7.9),
alongside the always-expressible defined Leibniz equality (BKK Section 2.2).
Beyond BKK's signature we deliberately carry a family of description operators ‹Iota σ› of
type ‹(σ ❙⇒ 𝗈) ❙⇒ σ›, one for each type: BKK have no description operator (they decline to
add one, BKK Section 2.3.1, pointing to Andrews 1972 for the semantic issues); we follow that
reference instead and equip ‹Iota σ› with the description axiom for singletons --- the rule
‹NK(ι)› of the calculus and the corresponding model condition ‹gm_descB›. Definitions
and lemmas below that carry no BKK
reference are locally-nameless infrastructure (opening, closing, freshness, renaming): they
have no counterpart in the paper, where identification of alphabetic variants is handled
informally (BKK Section 2.1).›
subsection ‹Types and terms›