证明与计算:无限鸽巢原理与可数选择
Proving and Computing: The Infinite Pigeonhole Principle and Countable Choice
AI总结:
本文探讨了结构性共递归在经典推理下的表达能力,通过结合经典调用cc操作符,展示了流处理算法和无限鸽巢原理的证明方法,并实现了可数选择公理的终止性证明。
摘要:
结构性递归是现代编程语言中常用的技术,也教授给初级计算机科学学生。但其对立面,结构性共递归呢?结构性共递归是一种优雅的技术,被Haskell等语言和证明助手如Rocq或Agda支持。它通过解耦潜在无限或大数据集合的生成和消耗,使设计组合性算法成为可能。尽管有这些优势,结构性共递归通常被认为比结构性递归更高级,并且主要在纯函数式编程的背景下研究。我们的目标是展示在经典推理存在的情况下,不同结构性共递归概念的表达能力。更具体地说,我们研究了共迭代和共递归与经典调用cc操作符的结合,后者提供了经典推理的计算解释。这种结合使有趣的流处理算法成为可能。作为应用,我们呈现了一个基于共递归和控制的无限鸽巢原理证明,并与Escardó和Oliva在Agda中的延续传递证明进行比较。为了进一步展示共递归和控制的结合力量,我们给出了可数选择公理的实现。与通常依赖一般递归的延续传递实现不同,我们的方法仅通过共迭代来证明终止性。
英文摘要:
Structural recursion is a common technique used by programmers in modern languages and is taught to introductory computer science students. But what about its dual, structural corecursion? Structural corecursion is an elegant technique, supported in languages like Haskell and proof assistants such as Rocq or Agda. It enables the design of compositional algorithms by decoupling the generation and consumption of potentially infinite or large data collections. Despite these strengths, structural corecursion is generally considered more advanced than structural recursion and is primarily studied in the context of pure functional programming. Our aim is to illustrate the expressive power of different notions of structural corecursion in the presence of classical reasoning. More specifically, we study coiteration and corecursion combined with the classical callcc operator, which provides a computational interpretation of classical reasoning. This combination enables interesting stream-processing algorithms. As an application, we present a corecursive, control-based proof of the Infinite Pigeonhole Principle and compare it with the continuation-passing proof of Escardó and Oliva in Agda. To further demonstrate the power of mixing corecursion and control, we give an implementation of the Axiom of Countable Choice. In contrast to the usual continuation-passing implementations of this axiom, which rely on general recursion whose termination is established externally, our approach justifies termination by coiteration alone.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。