arXiv論文メモ
新着一覧
cs.LO / cs.PL · 査読状況未確認

Leanでガード付き再帰の定義と証明を扱う言語を実装

Garlene: Guarded Recursion in Lean

Sergei Stepanenko, Patrick Bahr, Rasmus Ejlers Møgelberg

この論文をやさしく読む

ひとことで言うと

無限に続くデータなどを安全に再帰的に定義する仕組みを、定理証明支援系Leanの中で使えるようにします。定義を書くだけでなく、その性質を証明し、通常のLeanの開発へ持ち出せます。

何に役立つ?

ガード付き再帰を利用したプログラムや言語理論の証明を、Leanで機械的に確認するための道具になります。独自の構文と証明モードにより、定義と推論を支援します。

この研究の面白いところ

新しい再帰原理を単に追加するのではなく、前層による意味モデルを与えて埋め込み言語の健全性を示しています。そのモデルを通常のLeanへ成果を取り出す橋渡しにも使います。

どこまで分かった?

要旨は実装と複数の事例を報告していますが、事例の規模や他方式との性能比較は記載していません。示された健全性は構築した言語に関するもので、あらゆる再帰拡張の安全性を保証するものではありません。

v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。

アブストラクトの日本語訳

形式体系の再帰原理を拡張することは魅力的である一方、危険も伴い、整合性の不具合を引き起こしてきた歴史がよく知られている。中野のガード付き再帰は、型理論を強力な再帰原理で健全に拡張する、洗練された型に基づく方法である。そのため、ストリームなどの無限構造を使うプログラミングから、総合的なガード付き領域理論による高度なプログラミング言語機能の推論まで、多くの用途に有用である。 残念ながら、主要な対話型定理証明支援系はガード付き再帰を直接には支援しておらず、利用者は機械化されていない紙と鉛筆の証明か、保守されていない証明支援系に依存する機械化に頼らざるを得ない。本論文では、定義のための単純型付きラムダ計算と、推論のための高階論理からなるLean内の埋め込み言語として、ガード付き再帰を実装する。 Leanの優れたメタプログラミング機能を用いることで、この言語では直感的な構文でガード付き再帰定義を記述でき、専用の証明モードでその性質を証明できる。言語に前層モデルを与え、それを用いて健全性を証明するとともに、ガード付き再帰定義とその定理を通常のLeanによる開発へ書き出せるようにする。この言語の有用性を示すため、ガード付き再帰を使ったプログラミングと推論の複数の事例を提示する。

v1の要旨から自動生成。本文の精読・人による確認は未実施。

初稿
2026-09-21(UTC)
最新改訂
2026-09-21 · v1
査読・掲載
査読状況未確認
arXivで読むPDF

更新履歴

取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。

原文の要旨

Extending the recursion principles of a formal system is an enticing but dangerous endeavour with a well-documented history of leading to consistency bugs. Nakano's guarded recursion is an elegant, type-based approach to soundly extend type theory with a powerful recursion principle. This makes guarded recursion useful for many applications, from programming with infinite structures such as streams to reasoning about advanced programming language features using synthetic guarded domain theory. Sadly, guarded recursion is not directly supported by any major interactive theorem prover, which leaves users of guarded recursion with unmechanised pen-and-paper proofs or mechanisations that depend on unmaintained theorem provers. In this paper, we present an implementation of guarded recursion as an embedded language in Lean consisting of a simply-typed lambda calculus for definitions and a higher-order logic for reasoning. Using Lean's excellent support for metaprogramming, our language allows users to write guarded recursive definitions in an intuitive syntax and to prove properties about them using a dedicated proof mode. We give our language a presheaf model, which we use to prove the soundness of our language and to allow users to export guarded recursive definitions and their theorems into standard Lean developments. To demonstrate the usefulness of our language, we present several case studies for programming and reasoning with guarded recursion.

arXiv ID: 2609.24345 / 要約の誤りについて