While reasoning modulo equivalences is standard for mathematicians, replacing structures in formal proofs by equivalent ones often bears considerable porting effort. Similarly, computer scientists like to write programs and proofs in terms of representation types but prefer to provide libraries in terms of different, though related, abstract types; again, replacing these representation types by their abstract counterparts is often not for free. Existing solutions facilitating the transport of terms along such equivalences are either based on univalence -- and hence not applicable to most proof assistants -- or restricted to partial quotient types. We present a framework that (1) does not require univalence, (2) is richer than previous approaches working on partial quotient types, and (3) is based on standard mathematical notions, particularly Galois connections and order equivalences. For this, we introduce the idea of partial Galois connections and Galois equivalences. We prove their closure properties under (dependent) function relators, (co)datatypes, and compositions. We formalised the framework in Isabelle/HOL and provide a simple prototype.
翻译:虽然在数学领域进行等价推理是标准而常见的,但是在正式证明中用等价结构来替换原有结构常常需要付出巨大的移植代价。同样,计算机科学家喜欢在表示类型上编写程序和证明,但更喜欢提供具有不同但相互关联的抽象类型的库。将这些表示类型替换为它们的抽象对应物通常也不是无代价的。现有的解决方案便于在这些等价物之间转移术语,但这些解决方案要么基于一致性(univalence),因此不适用于大多数证明助理,要么仅限于部分商类型。我们提出了一个框架,该框架(1)不需要一致性,(2)比以前的方法更丰富,可以在部分商类型上运行,并且(3)基于标准数学概念,特别是 Galois 连接和序关系。为此,我们引入了部分 Galois 连接和 Galois 等价的概念。我们证明了它们在(依赖)函数关系器,(共同)数据类型和组合方面具有封闭性。我们在 Isabelle/HOL 中 formalised 了该框架并提供了一个简单的原型。