Monadic Second-Order Logic in HOL: Deep and Shallow Embeddings with Automated Faithfulness (Isabelle/HOL dataset)

Christoph BenzmĂĽller đź“§ and Daniel Kirchner đź“§

July 13, 2026

This is a development version of this entry. It might change over time and is not stable. Please refer to release versions for citations.

Abstract

We develop, in Isabelle/HOL, three embeddings of monadic second-order logic (MSO) into classical higher-order logic side by side: a deep embedding (an inductive datatype with an explicit satisfaction relation), a maximal-shallow embedding, and a minimal-shallow embedding — the last a locale parametrised by an interpretation and by first- and second-order assignments. The enabling ingredient is a two-sorted capture-avoiding substitution apparatus (predication, substitution, alphabetic renaming, and a substitution lemma, developed once for each binder namespace), in which each binder is transparent for the other. Faithfulness of all three embeddings is mechanised and automated. The central result is a fully mechanised two-sorted downward Löwenheim–Skolem theorem. Its corollary identifies range-relative validity with the general (Henkin-style) reading of MSO, while comprehension witnesses that the standard reading is strictly stronger; an elementary-substructure refinement recovers the standard reading from the minimal embedding as well, so the two readings become one device under two interpretation classes. We further exercise the embeddings on classical MSO landmarks: Boolean closure and graph operations hold under the standard (full second-order) reading and fail under the general one, making the dichotomy concrete, while reachability and 2-colorability are non-theorems, refuted throughout with nitpick countermodels.

License

BSD License

Note

Generative AI use: The authors used generative AI assistants (Anthropic’s Claude family of models) to draft and shorten prose, to propose and shorten some proofs (in particular parts of the two- sorted Löwenheim–Skolem construction), and to maintain the LaTeX presentation of this entry. The mathematical content, the theory development, and the design choices are the authors’; all text and proofs in the final entry have been verified by the authors, who take full responsibility for the content.

Topics

Session MSOinHOL