希尔伯特系统 - 自动证明

发布于 2024-08-07 20:32:52 字数 178 浏览 13 评论 0原文

我试图证明以下陈述 ~(a->~b) => a 希尔伯特风格系统。不幸的是,似乎不可能提出一个通用算法来找到证明,但我正在寻找一种强力类型的策略。欢迎任何有关如何解决此问题的想法。

I'm trying to prove the statement ~(a->~b) => a in a Hilbert style system. Unfortunately it seems like it is impossible to come up with a general algorithm to find a proof, but I'm looking for a brute force type strategy. Any ideas on how to attack this are welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

别再吹冷风 2024-08-14 20:32:52

如果您喜欢组合逻辑中的“编程”,那么

  • 您可以自动将一些逻辑问题“翻译”为另一个领域:证明组合逻辑项的相等性。
  • 通过良好的函数式编程实践,您可以解决这个问题,
  • 然后,您可以将答案转换回原始逻辑问题的希尔伯特风格证明。

这种翻译的可能性由库里-霍华德通信保证。

不幸的是,仅对于(命题)逻辑的子集,情况是如此简单:使用条件受到限制。否定是一个复杂的问题,我对此一无所知。因此我无法回答这个具体问题:

Ø (α ⊃ Øβ)   ⊢   α

但在否定不是问题的一部分的情况下,提到的自动翻译(和反向翻译)可能会有所帮助,前提是您已经练习过函数式编程或组合逻辑。


当然,还有其他帮助,我们可以留在逻辑领域内:

  • 在一些更直观的演绎系统中证明问题(例如自然演绎
  • ,然后使用元定理 “编译器”可能性:将自然演绎的“高级”证明翻译为希尔伯特式演绎系统的“机器代码”。我的意思是,例如,称为“演绎定理”的元逻辑定理。

至于定理证明者,据我所知,其中一些的能力得到了扩展,以便他们能够利用交互式人类辅助。例如 Coq 就是这样。



附录

让我们看一个例子。如何证明αα

希尔伯特系统

  • Verum ex quolibetα,β 被假定为公理方案,陈述句子 α βα 预计是可推导的,可为任何子句 α,β
  • < strong>链式法则α,β,γ被假设为一个公理方案,指出句子 (αβγ) ⊃ (αβ) ⊃ αγ 预计是可推导的,可实例化任何子句 α,β
  • Modus ponens< /strong> 被假设为推理规则:假设 αβ 是可推导的,并且 α 也是可推导的,那么我们期望有理由推断 αβ 也是可推论的。

让我们证明定理:αα 对于任何 α 命题都是可推论的。

让我们引入以下符号和缩写,开发“证明演算”:

证明演算

  • VEQα,β :   ⊢   αβα
  • CRα,β ,γ:   ⊢   (αβγ) ⊃ (αβ) ⊃ < em>α⊃ γ
  • MP:如果⊢   αβ 和   ⊢   α,那么还有   ⊢   β

树形图表示法:

Axiom 方案 — Verum ex quolibet:

   ––––––––––––––––– [VEQα,β ]
        ⊢   αβα

公理方案 — 链式法则:

   ────────────────────────────────────────────────────────────────── [CRα,β,γ]
        ⊢   (αβγ) ⊃ (αβ) ⊃ < em>α⊃ γ

推理规则 — modus ponens:

     ⊢   αβ          ⊢   α
   ────────────────────────────────────── [MP]
                ⊢   β

证明树

让我们看一下证明的树形图表示:

◈ⅩⅩⅩⅩⅩⅩⅩⅩⅩⅩⅤ ⊃α,αα ⊃α α]
   
α,α α]

⊢   [α⊃(αα)⊃α]⊃(ααα)⊃αα
                 
⊢   α ⊃ (αα) ⊃ α

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ──────────── [MP]     ────────────────────── [VEQα,α]
                    sp;             
⊢   (ααα) ⊃ αα
                    sp;               
⊢   ααα

                    sp;             
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ────────[MP]
                    sp;                     sp;                     sp;        
⊢   αα

证明公式

让我们看看证明的更简洁的(代数?微积分?)表示:

(CRα,αα,α VEQα,αα) VEQα,< em>α:   ⊢   αα

因此,我们可以用一个公式来表示证明树:

  • 树的分叉(modus ponens)通过简单的串联(括号)呈现,
  • 并且树的叶子由相应公理名称的缩写呈现。

值得记录具体的实例化,它是用子索引参数在这里排版的。

从下面的一系列示例中可以看出,我们可以开发一个证明演算,其中公理被表示为基本组合子,而肯定前件被表示为仅仅应用其“前提”子证明:

示例 1

VEQα,β :   ⊢   αβα

表示用

α 实例化的 Verum ex quolibet 公理方案,β 为以下陈述提供了证明:αβα 是可推论的。

示例 2

VEQα,α: ⊢   ααα

Verum ex quolibet 公理方案实例化 α,< em>α 为以下陈述提供了证明,即 ααα 是可推论的。

示例 3

VEQααα: ⊢   α ⊃ (αα) ⊃ α

表示

Verum ex quolibet 公理用 α 实例化的方案,αα 提供了该语句的证明,即 α ⊃ ( αα) ⊃ α 是可推导的。

示例 4

CRαβγ: ⊢   (αβγ) ⊃ (αβ) ⊃ < em>α⊃ γ

表示

αβ、<实例化的链式法则公理方案em>γ 为以下陈述提供了证明: (αβγ) ⊃ (α< /em> ⊃ β) ⊃ αγ 是可推导的。

例5

CRα,αα,α:   ⊢   [α ⊃ (αα) ⊃ α] ⊃ (ααα) ⊃ αα

表示

实例化的链式法则公理方案其中 α,αα,α 提供了该陈述的证明,即 [α< /em> ⊃ (αα) ⊃ α] ⊃ (αα em>⊃α) ⊃ αα 是可推导的。

例6

CRα,αα,α VEQα,αα:   ⊢   (ααα) ⊃ αα

意思是

如果我们组合CRα,αα,αVEQα,αα 一起通过 modus ponens ,那么我们就得到了证明以下命题的证明: (ααα) ⊃ α< /em>⊃ α 是可推导的。

例7

(CRα,αα,α< /sub> VEQα,αα) VEQ< /strong>α,α:   ⊢   αα

如果我们结合复合证明 (CRα,α⊃α,α) 与 VEQα, αα(通过modus ponens),然后我们得到一个更复杂的证明。这证明了以下命题: αα 是可推论的。

组合逻辑

虽然上面的这一切确实为预期的定理提供了证明,但是看起来很不直观。不知道人们如何才能“找出”证据。

让我们看看另一个研究类似问题的领域。

无类型组合逻辑

组合逻辑也可以被视为一种极其简约的函数式编程语言。尽管它是极简主义的,但它完全是图灵完备的,但更重要的是,即使使用这种看似混乱的语言,人们也可以以模块化和可重用的方式编写非常直观和复杂的程序,并从“正常”函数式编程和一些代数见解中获得一些实践, 。

添加类型规则

组合逻辑也有类型变体。语法通过类型进行了增强,甚至除了归约规则之外,还添加了类型规则。

对于基本组合子:

  • 选择Kαβ作为基本组合子,居住类型 αβα
  • 选择Sα,β,γ作为基本组合子,驻留类型(αβγ) → (αβ) → < em>α → γ

应用的打字规则:

  • 如果X属于α类型→βY属于α类型em>,然后
    X Y 属于 β 类型。

符号和缩写

  • Kα,β: αβ< /em> → α
  • Sα,β,γ< /sub>: (αβγ) → (αβ >)* → αγ
  • 如果XαβYα,那么
    X Yβ

柯里-霍华德对应

可以看出,“模式”在证明演算和这种类型化组合逻辑中是同构的。

  • 证明演算的 Verum ex quolibet 公理对应于组合逻辑的 K 基组合子
  • 证明演算的 链式法则 公理对应于组合逻辑的S基组合子
  • 证明演算中的Modus ponens推理规则对应于组合逻辑中的“应用”操作。
  • 逻辑的“条件”连接词 ⊃ 对应于类型理论(和类型化组合逻辑)的类型构造函数 →

函数式编程

但有什么好处呢?为什么我们要把问题转化为组合逻辑?我个人认为它有时很有用,因为函数式编程是一个拥有大量文献并应用于实际问题的东西。当被迫在日常编程任务和练习中使用它时,人们会习惯它。函数式编程实践的一些技巧和提示可以在组合逻辑简化中得到很好的利用。如果“转移”实践在组合逻辑中得到发展,那么它也可以用于在希尔伯特系统中寻找证明。

外部链接

链接如何将函数式编程(lambda 演算、组合逻辑)中的类型转换为逻辑证明和定理:

如何学习直接用组合逻辑进行编程的方法和实践的链接(或书籍):

If You like "programming" in combinatory logic, then

  • You can automatically "translate" some logic problems into another field: proving equality of combinatory logic terms.
  • With a good functional programming practice, You can solve that,
  • and afterwards, You can translate the answer back to a Hilbert style proof of Your original logic problem.

The possibility of this translation in ensured by Curry-Howard correspondence.

Unfortunately, the situation is so simple only for a subset of (propositional) logic: restricted using conditionals. Negation is a complication, I know nothing about that. Thus I cannot answer this concrete question:

¬ (α ⊃ ¬β)   ⊢   α

But in cases where negation is not part of the question, the mentioned automatic translation (and back-translation) can be a help, provided that You have already practice in functional programming or combinatory logic.


Of course, there are other helps, too, where we can remain inside the realm of logic:

  • proving the problem in some more intuitive deductive system (e.g. natural deduction)
  • and afterwards using metatheorems that provide a "compiler" possibility: translating the "high-level" proof of natural deduction to the "machine-code" of Hilbert-style deduction system. I mean, for example, the metalogical theorem called "deduction theorem".

As for theorem provers, as far as I know, the capabilities of some of them are extended so that they can harness interactive human assistance. E.g. Coq is such.



Appendix

Let us see an example. How to prove αα?

Hilbert system

  • Verum ex quolibetα,β is assumed as an axiom scheme, stating that sentence αβα is expected to be deducible, instantiated for any subsentences α,β
  • Chain ruleα,β,γ is assumed as an axiom scheme, stating that sentence (αβγ) ⊃ (αβ) ⊃ αγ is expected to be deducible, instantiated for any subsentences α,β
  • Modus ponens is assumed as a rule of inference: provided that αβ is deducible, and also α is deducible, then we expect to be justified to infer that also αβ is deducible.

Let us prove theorem: αα is deducible for any α proposition.

Let us introduce the following notations and abbreviations, developing a "proof calculus":

Proof calculus

  • VEQα,β:   ⊢   αβα
  • CRα,β,γ:   ⊢   (αβγ) ⊃ (αβ) ⊃ αγ
  • MP: If   ⊢   αβ and   ⊢   α, then also   ⊢   β

A tree diagram notation:

Axiom scheme — Verum ex quolibet:

    ━━━━━━━━━━━━━━━━━ [VEQα,β]
          ⊢   αβα

Axiom scheme — chain rule:

    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [CRα,β,γ]
          ⊢   (αβγ) ⊃ (αβ) ⊃ αγ

Rule of inference — modus ponens:

     ⊢   αβ           ⊢   α
    ━━━━━━━━━━━━━━━━━━━ [MP]
                     ⊢   β

Proof tree

Let us see a tree diagram representation of the proof:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [CRα, αα, α]
  
━━━━━━━━━━━━━━━ [VEQα, αα]

⊢   [α⊃(αα)⊃α]⊃(ααα)⊃αα
                       
⊢   α ⊃ (αα) ⊃ α

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [MP]      ━━━━━━━━━━━ [VEQα,α]
                                         
⊢   (ααα) ⊃ αα
                                            
⊢   ααα

                                         
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [MP]
                                                                                    
⊢   αα

Proof formulae

Let us see an even conciser (algebraic? calculus?) representation of the proof:

(CRα,αα,α VEQα,αα) VEQα,α:   ⊢   αα

so, we can represent the proof tree by a single formula:

  • the forking of the tree (modus ponens) is rendered by simple concatenation (parentheses),
  • and the leaves of the tree are rendered by the abbreviations of the corresponding axiom names.

It is worth of keep record about the concrete instantiation, that' is typeset here with subindexical parameters.

As it will be seen from the series of examples below, we can develop a proof calculus, where axioms are notated as sort of base combinators, and modus ponens is notated as a mere application of its "premise" subproofs:

Example 1

VEQα,β:   ⊢   αβα

meant as

Verum ex quolibet axiom scheme instantiated with α,β provides a proof for the statement, that αβα is deducible.

Example 2

VEQα,α:   ⊢   ααα

Verum ex quolibet axiom scheme instantiated with α,α provides a proof for the statement, that ααα is deducible.

Example 3

VEQα, αα:   ⊢   α ⊃ (αα) ⊃ α

meant as

Verum ex quolibet axiom scheme instantiated with α, αα provides a proof for the statement, that α ⊃ (αα) ⊃ α is deducible.

Example 4

CRα,β,γ:   ⊢   (αβγ) ⊃ (αβ) ⊃ αγ

meant as

Chain rule axiom scheme instantiated with α,β,γ provides a proof for the statement, that (αβγ) ⊃ (αβ) ⊃ αγ is deducible.

Example 5

CRα,αα,α:   ⊢   [α ⊃ (αα) ⊃ α] ⊃ (ααα) ⊃ αα

meant as

Chain rule axiom scheme instantiated with α,αα,α provides a proof for the statement, that [α ⊃ (αα) ⊃ α] ⊃ (ααα) ⊃ αα is deducible.

Example 6

CRα,αα,α VEQα,αα:   ⊢   (ααα) ⊃ αα

meant as

If we combine CRα,αα,α and VEQα,αα together via modus ponens, then we get a proof that proves the following statement: (ααα) ⊃ αα is deducible.

Example 7

(CRα,αα,α VEQα,αα) VEQα,α:   ⊢   αα

If we combine the compund proof (CRα,αα,α) together with VEQα,αα (via modus ponens), then we get an even more compund proof. This proves the following statement: αα is deducible.

Combinatory logic

Although all this above has indeed provided a proof for the expected theorem, but it seems very unintuitive. It cannot be seen how people can "find out" the proof.

Let us see another field, where similar problems are investigated.

Untyped combinatory logic

Combinatory logic can be regarded also as an extremely minimalistic functional programming language. Despite of its minimalism, it entirely Turing complete, but evenmore, one can write quite intuitive and complex programs even in this seemingly obfuscated language, in a modular and reusable way, with some practice gained from "normal" functional programming and some algebraic insights, .

Adding typing rules

Combinatory logic also has typed variants. Syntax is augmented with types, and evenmore, in addition to reduction rules, also typing rules are added.

For base combinators:

  • Kα,β is selected as a basic combinator, inhabiting type αβα
  • Sα,β,γ is selected as a basic combinator, inhabiting type (αβγ) → (αβ) → αγ.

Typing rule of application:

  • If X inhabits type αβ and Y inhabits type α, then
    X Y inhabits type β.

Notations and abbreviations

  • Kα,β: αβα
  • Sα,β,γ: (αβγ) → (αβ)* → αγ.
  • If X: αβ and Y: α, then
    X Y: β.

Curry-Howard correspondence

It can be seen that the "patterns" are isomorphic in the proof calculus and in this typed combinatory logic.

  • The Verum ex quolibet axiom of the proof calculus corresponds to the K base combinator of combinatory logic
  • The Chain rule axiom of the proof calculus corresponds to the S base combinator of combinatory logic
  • The Modus ponens rule of inference in the proof calculus corresponds to the operation "application" in combinatory logic.
  • The "conditional" connective ⊃ of logic corresponds to type constructor → of type theory (and typed combinatory logic)

Functional programming

But what is the gain? Why should we translate problems to combinatory logic? I, personally, find it sometimes useful, because functional programming is a thing which has a large literature and is applied in practical problems. People can get used to it, when forced to use it in erveryday programming tasks ans pracice. And some tricks and hints of functional programming practice can be exploited very well in combinatory logic reductions. And if a "transferred" practice develops in combinatory logic, then it can be harnessed also in finding proofs in Hilbert system.

External links

Links how types in functional programming (lambda calculus, combinatory logic) can be translated into logical proofs and theorems:

Links (or books) how to learn methods and practice to program directly in combinatory logic:

北斗星光 2024-08-14 20:32:52

希尔伯特系统通常不用于自动定理证明。编写计算机程序来使用自然演绎进行证明要容易得多。来自CS 课程材料

有关希尔伯特系统的一些常见问题解答:
问:如何知道哪条公理
要使用的模式,以及
进行替换?由于有
无限多种可能性,就是
即使在
原则。 A:没有算法;在
至少不简单。相反,一个人有
要聪明。在纯数学中,
这不被视为一个问题,因为
其中最关心的是
一个证明的存在。然而,在
计算机科学应用,一是
对自动扣除感兴趣
过程,所以这是一个致命的缺陷。这
希尔伯特系统通常不用于
自动定理证明。问:那么,为什么
人们关心希尔伯特吗
系统?答:以肯定前件为原则
单一演绎规则,它提供了
人类如何设计的可口模型
数学证明。正如我们将看到的,
更适合的方法
计算机实现产生证明
不太“像人类”。

The Hilbert system is not normally used in automated theorem proving. It is much easier to write a computer program to do proofs using natural deduction. From the material of a CS course:

Some FAQ’s about the Hilbert system:
Q: How does one know which axiom
schemata to use, and which
substitutions to make? Since there are
infinitely many possibilities, it is
not possible to try them all, even in
princple. A: There is no algorithm; at
least no simple one. Rather, one has
to be clever. In pure mathematics,
this is not viewed as a problem, since
one is most concerned about the
existence of a proof. However, in
computer science applications, one is
interested in automating the deduction
process, so this is a fatal flaw. The
Hilbert system is not normally used in
automated theorem proving. Q: So, why
do people care about the Hilbert
system? A: With modus ponens as its
single deductive rule, it provides a
palatable model of how humans devise
mathematical proofs. As we shall see,
methods which are more amenable to
computer implementation produce proofs
which are less “human like.”

如果没有你 2024-08-14 20:32:52

您也可以通过设置 ← α = α → ⊥ 来解决该问题。然后,我们可以采用希尔伯特风格系统,如答案之一的附录所示,并通过添加以下两个公理分别为常量使其成为经典:

Ex Falso Quodlibet: Eα : ⊥ → α< br>
奇迹后果: Mα : (Ø α → α) → α

Ø (α → Ø β) → α 的后续证明如下:

  1. α ⊢ α (恒等式)
  2. ⊥ ⊢ β → ⊥ (Ex Falso Quodlibet)
  3. α → ⊥, α ⊢ β → ⊥ (Impl Intro Left 1 & 2)
  4. α → ⊥ ⊢ α → (β → ⊥) (Impl Intro Right 3)
  5. ⊥ ⊢ α (Ex Falso Quodlibet)
  6. (α → (β → ⊥)) → ⊥, α → ⊥ ⊢ α (Impl Intro Left 4 & 5)
  7. (α → (β → ⊥)) → ⊥ ⊢ α (Consequentia Mirabilis 6)
  8. ⊢ ((α → (β → ⊥)) → ⊥) → α (Impl Intro Right 7)

从这个后续证明中,我们可以提取一个 lambda 表达式。一个可能的
上述后续证明的 lambda 表达式如下:

λy.(M λz.(E (y λx.(E (zx)))))

该 lambda 表达式可以转换为 SKI 项。一个可能的
上述 lambda 表达式的 SKI 术语如下:

S (KM)) (L2 (L1 (K (L2 (L1 (KI))))))
其中 L1 = (S ((S (KS)) ((S (KK)) I)))
且 L2 = (S (K (S (KE))))

这给出了以下希尔伯特式证明:

引理 1:链式法则的弱化形式:
1:((A → B) → ((C → A) → (C → B))) → (((A → B) → (C → A)) → ((A → B) → (C → B) ))) [链]
2:((A → B) → ((C → (A → B)) → ((C → A) → (C → B)))) → (((A → B) → (C → (A → B))) → ((A → B) → ((C → A) → (C → B)))) [链]
3:((C → (A → B)) → ((C → A) → (C → B))) → ((A → B) → ((C → (A → B)) → ((C → A) → (C → B)))) [Verum Ex]
4: (C → (A → B)) → ((C → A) → (C → B)) [链]
5: (A → B) → ((C → (A → B)) → ((C → A) → (C → B))) [MP 3, 4]
6: ((A → B) → (C → (A → B))) → ((A → B) → ((C → A) → (C → B))) [MP 2, 5]
7: ((A → B) → ((A → B) → (C → (A → B)))) → (((A → B) → (A → B)) → ((A → B) → (C → (A → B)))) [链]
8: ((A → B) → (C → (A → B))) → ((A → B) → ((A → B) → (C → (A → B)))) [Verum Ex]< br>
9: (A → B) → (C → (A → B)) [Verum Ex]
10: (A → B) → ((A → B) → (C → (A → B))) [MP 8, 9]
11: ((A → B) → (A → B)) → ((A → B) → (C → (A → B))) [MP 7, 10]
12: (A → B) → (A → B) [恒等式]
13: (A → B) → (C → (A → B)) [MP 11, 12]
14: (A → B) → ((C → A) → (C → B)) [MP 6, 13]
15: ((A → B) → (C → A)) → ((A → B) → (C → B)) [MP 1, 14]

引理 2:Ex Falso 的弱化形式:
1: (A → ((B → ⊥) → (B → C))) → ((A → (B → ⊥)) → (A → (B → C))) [链]
2: ((B → ⊥) → (B → C)) → (A → ((B → ⊥) → (B → C))) [Verum Ex]
3: (B → (⊥ → C)) → ((B → ⊥) → (B → C)) [链]
4: (⊥ → C) → (B → (⊥ → C)) [Verum Ex]
5: ⊥ → C [Ex Falso]
6: B → (⊥ → C) [MP 4, 5]
7: (B → ⊥) → (B → C) [MP 3, 6]
8: A → ((B → ⊥) → (B → C)) [MP 2, 7]
9: (A → (B → ⊥)) → (A → (B → C)) [MP 1, 8]

最终证明:
1: (((A → (B → ⊥)) → ⊥) → (((A → ⊥) → A) → A)) → ((((A → (B → ⊥)) → ⊥) → (( A → ⊥) → A)) → (((A → (B → ⊥)) → ⊥) → A)) [链]
2: (((A → ⊥) → A) → A) → (((A → (B → ⊥)) → ⊥) → (((A → ⊥) → A) → A)) [Verum Ex]< br>
3: ((A → ⊥) → A) → A [紫茉莉]
4: ((A → (B → ⊥)) → ⊥) → (((A → ⊥) → A) → A) [MP 2, 3]
5: (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → A)) → (((A → (B → ⊥)) → ⊥) → A) [MP 1, 4 ]
6: (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → ⊥)) → (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → A)) [引理 2]
7: (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → (A → (B → ⊥)))) → (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → ⊥)) [引理 1]
8: ((A → ⊥) → (A → (B → ⊥))) → (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → (A → (B → ⊥) ))) [Verum Ex]
9: ((A → ⊥) → (A → ⊥)) → ((A → ⊥) → (A → (B → ⊥))) [引理 2]
10: ((A → ⊥) → (A → A)) → ((A → ⊥) → (A → ⊥)) [引理 1]
11: (A → A) → ((A → ⊥) → (A → A)) [Verum Ex]
12:A → A [身份]
13: (A → ⊥) → (A → A) [MP 11, 12]
14: (A → ⊥) → (A → ⊥) [MP 10, 13]
15: (A → ⊥) → (A → (B → ⊥)) [MP 9, 14]
16: ((A → (B → ⊥)) → ⊥) → ((A → ⊥) → (A → (B → ⊥))) [MP 8, 15]
17: ((A → (B → ⊥)) → ⊥) → ((A → ⊥) → ⊥) [MP 7, 16]
18: ((A → (B → ⊥)) → ⊥) → ((A → ⊥) → A) [MP 6, 17]
19: ((A → (B → ⊥)) → ⊥) → A [MP 5, 18]

相当长的证明!

再见

You can approach the problem also by setting ¬ α = α → ⊥. We can then adopt the Hilbert style system as shown in the appendix of one of the answers, and make it classical by adding the following two axioms respectively constants:

Ex Falso Quodlibet: Eα : ⊥ → α
Consequentia Mirabilis: Mα : (¬ α → α) → α

A sequent proof of ¬ (α → ¬ β) → α then reads as follows:

  1. α ⊢ α (Identity)
  2. ⊥ ⊢ β → ⊥ (Ex Falso Quodlibet)
  3. α → ⊥, α ⊢ β → ⊥ (Impl Intro Left 1 & 2)
  4. α → ⊥ ⊢ α → (β → ⊥) (Impl Intro Right 3)
  5. ⊥ ⊢ α (Ex Falso Quodlibet)
  6. (α → (β → ⊥)) → ⊥, α → ⊥ ⊢ α (Impl Intro Left 4 & 5)
  7. (α → (β → ⊥)) → ⊥ ⊢ α (Consequentia Mirabilis 6)
  8. ⊢ ((α → (β → ⊥)) → ⊥) → α (Impl Intro Right 7)

From this sequent proof, one can extract a lambda expression. A possible
lambda expressions for the above sequent proof reads as follows:

λy.(M λz.(E (y λx.(E (z x)))))

This lambda expression can be converted into a SKI term. A possible
SKI term for the above lambda expression reads as follows:

S (K M)) (L2 (L1 (K (L2 (L1 (K I))))))
where L1 = (S ((S (K S)) ((S (K K)) I)))
and L2 = (S (K (S (K E))))

This gives the following Hilbert style proofs:

Lemma 1: A weakened form of the chain rule:
1: ((A → B) → ((C → A) → (C → B))) → (((A → B) → (C → A)) → ((A → B) → (C → B))) [Chain]
2: ((A → B) → ((C → (A → B)) → ((C → A) → (C → B)))) → (((A → B) → (C → (A → B))) → ((A → B) → ((C → A) → (C → B)))) [Chain]
3: ((C → (A → B)) → ((C → A) → (C → B))) → ((A → B) → ((C → (A → B)) → ((C → A) → (C → B)))) [Verum Ex]
4: (C → (A → B)) → ((C → A) → (C → B)) [Chain]
5: (A → B) → ((C → (A → B)) → ((C → A) → (C → B))) [MP 3, 4]
6: ((A → B) → (C → (A → B))) → ((A → B) → ((C → A) → (C → B))) [MP 2, 5]
7: ((A → B) → ((A → B) → (C → (A → B)))) → (((A → B) → (A → B)) → ((A → B) → (C → (A → B)))) [Chain]
8: ((A → B) → (C → (A → B))) → ((A → B) → ((A → B) → (C → (A → B)))) [Verum Ex]
9: (A → B) → (C → (A → B)) [Verum Ex]
10: (A → B) → ((A → B) → (C → (A → B))) [MP 8, 9]
11: ((A → B) → (A → B)) → ((A → B) → (C → (A → B))) [MP 7, 10]
12: (A → B) → (A → B) [Identity]
13: (A → B) → (C → (A → B)) [MP 11, 12]
14: (A → B) → ((C → A) → (C → B)) [MP 6, 13]
15: ((A → B) → (C → A)) → ((A → B) → (C → B)) [MP 1, 14]

Lemma 2: A weakened form of Ex Falso:
1: (A → ((B → ⊥) → (B → C))) → ((A → (B → ⊥)) → (A → (B → C))) [Chain]
2: ((B → ⊥) → (B → C)) → (A → ((B → ⊥) → (B → C))) [Verum Ex]
3: (B → (⊥ → C)) → ((B → ⊥) → (B → C)) [Chain]
4: (⊥ → C) → (B → (⊥ → C)) [Verum Ex]
5: ⊥ → C [Ex Falso]
6: B → (⊥ → C) [MP 4, 5]
7: (B → ⊥) → (B → C) [MP 3, 6]
8: A → ((B → ⊥) → (B → C)) [MP 2, 7]
9: (A → (B → ⊥)) → (A → (B → C)) [MP 1, 8]

Final Proof:
1: (((A → (B → ⊥)) → ⊥) → (((A → ⊥) → A) → A)) → ((((A → (B → ⊥)) → ⊥) → ((A → ⊥) → A)) → (((A → (B → ⊥)) → ⊥) → A)) [Chain]
2: (((A → ⊥) → A) → A) → (((A → (B → ⊥)) → ⊥) → (((A → ⊥) → A) → A)) [Verum Ex]
3: ((A → ⊥) → A) → A [Mirabilis]
4: ((A → (B → ⊥)) → ⊥) → (((A → ⊥) → A) → A) [MP 2, 3]
5: (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → A)) → (((A → (B → ⊥)) → ⊥) → A) [MP 1, 4]
6: (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → ⊥)) → (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → A)) [Lemma 2]
7: (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → (A → (B → ⊥)))) → (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → ⊥)) [Lemma 1]
8: ((A → ⊥) → (A → (B → ⊥))) → (((A → (B → ⊥)) → ⊥) → ((A → ⊥) → (A → (B → ⊥)))) [Verum Ex]
9: ((A → ⊥) → (A → ⊥)) → ((A → ⊥) → (A → (B → ⊥))) [Lemma 2]
10: ((A → ⊥) → (A → A)) → ((A → ⊥) → (A → ⊥)) [Lemma 1]
11: (A → A) → ((A → ⊥) → (A → A)) [Verum Ex]
12: A → A [Identity]
13: (A → ⊥) → (A → A) [MP 11, 12]
14: (A → ⊥) → (A → ⊥) [MP 10, 13]
15: (A → ⊥) → (A → (B → ⊥)) [MP 9, 14]
16: ((A → (B → ⊥)) → ⊥) → ((A → ⊥) → (A → (B → ⊥))) [MP 8, 15]
17: ((A → (B → ⊥)) → ⊥) → ((A → ⊥) → ⊥) [MP 7, 16]
18: ((A → (B → ⊥)) → ⊥) → ((A → ⊥) → A) [MP 6, 17]
19: ((A → (B → ⊥)) → ⊥) → A [MP 5, 18]

Quite a long proof!

Bye

筱武穆 2024-08-14 20:32:52

在希尔伯特微积分中找到证明非常困难。

您可以尝试将序列微积分或自然演绎中的证明转换为希尔伯特微积分。

Finding proofs in Hilbert calculus is very hard.

You could try to translate proofs in sequent calculus or natural deduction to Hilbert calculus.

红衣飘飘貌似仙 2024-08-14 20:32:52
  1. 具体是哪个希尔伯特系统?有很多。
  2. 也许最好的方法是在后续微积分中找到证明并将其转换为希尔伯特系统。
  1. Which specific Hilbert system? There are tons.
  2. Probably the best way is to find a proof in a sequent calculus and convert it to the Hilbert system.
霊感 2024-08-14 20:32:52

我使用波兰语表示法

由于您引用了维基百科,我们假设我们的基础是

1 CpCqp。

2 CCpCqrCCpqCpr。

3 CCNpNqCqp。

我们想要证明

NCaNb |- a。

我使用定理证明器 Prover9。因此,我们需要将所有内容括起来。此外,Prover9 的变量为 (x, y, z, u, w, v5, v6, ..., vn)。所有其他符号都被解释为函数、关系或谓词。所有公理都需要在它们之前有一个谓词符号“P”,我们可以将其视为“可以证明......”或更简单地“可证明”的意思。 Prover9 中的所有句子都需要以句号结束。因此,公理 1、2 和 3 分别变为:

1 P(C(x,C(y,x)))。

2 P(C(C(x,C(y,z)),C(C(x,y),C(x,z))))。

3 P(C(C(N(x),N(y)),C(y,x)))。

我们可以将统一替换和分离的规则合并为 condensed 脱离。在 Prover9 中,我们可以将其表示为:-P

(C(x,y)) | -P(x)| P(y)。

“|”表示逻辑或,“-”表示否定。 Prover9 通过反证法证明。该规则用文字表述可以被解释为“要么不是如果 x 则 y 是可证明的情况,或者不是 x 是可证明的情况,或者 y 是可证明的情况”。因此,如果确实成立如果 x,则 y 是可证明的,则第一个析取失败。如果它确实证明 x 是可证明的,则第二个析取失败。因此,如果,如果 x,则 y 可证明,如果 x 可证明,则第三个析取项,即 y 可证明,遵循该规则。

现在我们不能在 NCaNb 中进行替换,因为它不是同义反复。也不是“a”。因此,如果我们输入

P(N(C(a,N(b))))。

作为一个假设,Prover9 会将“a”和“b”解释为无效函数,这有效地将它们转换为常量。我们也想把P(a)作为我们的目标。

现在我们还可以使用各种定理证明策略“调整”Prover9,例如加权、共振、子公式、选择给定比率、水平饱和(甚至发明我们自己的策略)。我将稍微使用一下提示策略,将所有假设(包括推理规则)和目标都放入提示中。我还将最大权重降低到 40,并将最大变量数设置为 5。

我使用带有图形界面的版本,但这是完整的输入:

set(ignore_option_dependencies). % GUI handles dependencies

if(Prover9). % Options for Prover9
assign(max_seconds, -1).
assign(max_weight, 40).
end_if.

if(Mace4).   % Options for Mace4
assign(max_seconds, 60).
end_if.

if(Prover9). % Additional input for Prover9
formulas(hints).
-P(C(x,y))|-P(x)|P(y).
P(C(x,C(y,x))).
P(C(C(x,C(y,z)),C(C(x,y),C(x,z)))).
P(C(C(N(x),N(y)),C(y,x))).
P(N(C(a,N(b)))).
P(a).
end_of_list.
assign(max_vars,5).
end_if.

formulas(assumptions).

-P(C(x,y))|-P(x)|P(y).
P(C(x,C(y,x))).
P(C(C(x,C(y,z)),C(C(x,y),C(x,z)))).
P(C(C(N(x),N(y)),C(y,x))).
P(N(C(a,N(b)))).

end_of_list.

formulas(goals).

P(a).

end_of_list.

这是它给我的证明:

============================== prooftrans ============================
Prover9 (32) version Dec-2007, Dec 2007.
Process 1312 was started by Doug on Machina2,
Mon Jun  9 22:35:37 2014
The command was "/cygdrive/c/Program Files (x86)/Prover9-Mace43/bin-win32/prover9".
============================== end of head ===========================

============================== end of input ==========================

============================== PROOF =================================

% -------- Comments from original proof --------
% Proof 1 at 0.01 (+ 0.01) seconds.
% Length of proof is 23.
% Level of proof is 9.
% Maximum clause weight is 20.
% Given clauses 49.

1 P(a) # label(non_clause) # label(goal).  [goal].
2 -P(C(x,y)) | -P(x) | P(y).  [assumption].
3 P(C(x,C(y,x))).  [assumption].
4 P(C(C(x,C(y,z)),C(C(x,y),C(x,z)))).  [assumption].
5 P(C(C(N(x),N(y)),C(y,x))).  [assumption].
6 P(N(C(a,N(b)))).  [assumption].
7 -P(a).  [deny(1)].
8 P(C(x,C(y,C(z,y)))).  [hyper(2,a,3,a,b,3,a)].
9 P(C(C(C(x,C(y,z)),C(x,y)),C(C(x,C(y,z)),C(x,z)))).  [hyper(2,a,4,a,b,4,a)].
12 P(C(C(C(N(x),N(y)),y),C(C(N(x),N(y)),x))).  [hyper(2,a,4,a,b,5,a)].
13 P(C(x,C(C(N(y),N(z)),C(z,y)))).  [hyper(2,a,3,a,b,5,a)].
14 P(C(x,N(C(a,N(b))))).  [hyper(2,a,3,a,b,6,a)].
23 P(C(C(a,N(b)),x)).  [hyper(2,a,5,a,b,14,a)].
28 P(C(C(x,C(C(y,x),z)),C(x,z))).  [hyper(2,a,9,a,b,8,a)].
30 P(C(x,C(C(a,N(b)),y))).  [hyper(2,a,3,a,b,23,a)].
33 P(C(C(x,C(a,N(b))),C(x,y))).  [hyper(2,a,4,a,b,30,a)].
103 P(C(N(b),x)).  [hyper(2,a,33,a,b,3,a)].
107 P(C(x,b)).  [hyper(2,a,5,a,b,103,a)].
113 P(C(C(N(x),N(b)),x)).  [hyper(2,a,12,a,b,107,a)].
205 P(C(N(x),C(x,y))).  [hyper(2,a,28,a,b,13,a)].
209 P(C(N(a),x)).  [hyper(2,a,33,a,b,205,a)].
213 P(a).  [hyper(2,a,113,a,b,209,a)].
214 $F.  [resolve(213,a,7,a)].

============================== end of proof ==========================

I use Polish notation.

Since you referenced the Wikipedia, we'll suppose our basis is

1 CpCqp.

2 CCpCqrCCpqCpr.

3 CCNpNqCqp.

We want to prove

NCaNb |- a.

I use the theorem prover Prover9. So, we'll need to parenthesize everything. Also, the variables of Prover9 go (x, y, z, u, w, v5, v6, ..., vn). All other symbols get interpreted as functions or relations or predicates. All axioms need a predicate symbol "P" before them also, which we can think of as meaning "it is provable that..." or more simply "provable". And all sentences in Prover9 need to get ended by a period. Thus, axioms 1, 2, and 3 become respectively:

1 P(C(x,C(y,x))).

2 P(C(C(x,C(y,z)),C(C(x,y),C(x,z)))).

3 P(C(C(N(x),N(y)),C(y,x))).

We can combine the rules of uniform substitution and detachment into the rule of condensed detachment. In Prover9 we can represent this as:

-P(C(x,y)) | -P(x) | P(y).

The "|" indicates logical disjunction, and "-" indicates negation. Prover9 proves by contradiction. The rule says in words can get interpreted as saying "either it is not the case that if x, then y is provable, or it is not the case that x is provable, or y is provable." Thus, if it does hold that if x, then y is provable, the first disjunct fails. If it does hold that x is provable, then the second disjunct fails. So, if, if x, then y is provable, if x is provable, then the third disjunct, that y is provable follows by the rule.

Now we can't make substitutions in NCaNb, since it's not a tautology. Nor is "a". Thus, if we put

P(N(C(a,N(b)))).

as an assumption, Prover9 will interpret "a" and "b" as nullary functions, which effectively turns them into constants. We also want to make P(a) as our goal.

Now we can also "tune" Prover9 using various theorem-proving strategies such as weighting, resonance, subformula, pick-given ratio, level saturation (or even invent our own). I'll use the hints strategy a little bit, by making all of the assumptions (including the rule of inference), and the goal into hints. I'll also turn the max weight down to 40, and make 5 the number of maximum variables.

I use the version with the graphical interface, but here's the entire input:

set(ignore_option_dependencies). % GUI handles dependencies

if(Prover9). % Options for Prover9
assign(max_seconds, -1).
assign(max_weight, 40).
end_if.

if(Mace4).   % Options for Mace4
assign(max_seconds, 60).
end_if.

if(Prover9). % Additional input for Prover9
formulas(hints).
-P(C(x,y))|-P(x)|P(y).
P(C(x,C(y,x))).
P(C(C(x,C(y,z)),C(C(x,y),C(x,z)))).
P(C(C(N(x),N(y)),C(y,x))).
P(N(C(a,N(b)))).
P(a).
end_of_list.
assign(max_vars,5).
end_if.

formulas(assumptions).

-P(C(x,y))|-P(x)|P(y).
P(C(x,C(y,x))).
P(C(C(x,C(y,z)),C(C(x,y),C(x,z)))).
P(C(C(N(x),N(y)),C(y,x))).
P(N(C(a,N(b)))).

end_of_list.

formulas(goals).

P(a).

end_of_list.

Here's the proof it gave me:

============================== prooftrans ============================
Prover9 (32) version Dec-2007, Dec 2007.
Process 1312 was started by Doug on Machina2,
Mon Jun  9 22:35:37 2014
The command was "/cygdrive/c/Program Files (x86)/Prover9-Mace43/bin-win32/prover9".
============================== end of head ===========================

============================== end of input ==========================

============================== PROOF =================================

% -------- Comments from original proof --------
% Proof 1 at 0.01 (+ 0.01) seconds.
% Length of proof is 23.
% Level of proof is 9.
% Maximum clause weight is 20.
% Given clauses 49.

1 P(a) # label(non_clause) # label(goal).  [goal].
2 -P(C(x,y)) | -P(x) | P(y).  [assumption].
3 P(C(x,C(y,x))).  [assumption].
4 P(C(C(x,C(y,z)),C(C(x,y),C(x,z)))).  [assumption].
5 P(C(C(N(x),N(y)),C(y,x))).  [assumption].
6 P(N(C(a,N(b)))).  [assumption].
7 -P(a).  [deny(1)].
8 P(C(x,C(y,C(z,y)))).  [hyper(2,a,3,a,b,3,a)].
9 P(C(C(C(x,C(y,z)),C(x,y)),C(C(x,C(y,z)),C(x,z)))).  [hyper(2,a,4,a,b,4,a)].
12 P(C(C(C(N(x),N(y)),y),C(C(N(x),N(y)),x))).  [hyper(2,a,4,a,b,5,a)].
13 P(C(x,C(C(N(y),N(z)),C(z,y)))).  [hyper(2,a,3,a,b,5,a)].
14 P(C(x,N(C(a,N(b))))).  [hyper(2,a,3,a,b,6,a)].
23 P(C(C(a,N(b)),x)).  [hyper(2,a,5,a,b,14,a)].
28 P(C(C(x,C(C(y,x),z)),C(x,z))).  [hyper(2,a,9,a,b,8,a)].
30 P(C(x,C(C(a,N(b)),y))).  [hyper(2,a,3,a,b,23,a)].
33 P(C(C(x,C(a,N(b))),C(x,y))).  [hyper(2,a,4,a,b,30,a)].
103 P(C(N(b),x)).  [hyper(2,a,33,a,b,3,a)].
107 P(C(x,b)).  [hyper(2,a,5,a,b,103,a)].
113 P(C(C(N(x),N(b)),x)).  [hyper(2,a,12,a,b,107,a)].
205 P(C(N(x),C(x,y))).  [hyper(2,a,28,a,b,13,a)].
209 P(C(N(a),x)).  [hyper(2,a,33,a,b,205,a)].
213 P(a).  [hyper(2,a,113,a,b,209,a)].
214 $F.  [resolve(213,a,7,a)].

============================== end of proof ==========================
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文