logic - 如何在 Agda 中证明 `theorem : ¬ ⊤ ≡ ⊥`?

标签 logic proof agda

沿着 The Haskell Road to Logic, Maths and Programming,你可以找到第 48 页 定理 2.12.1 ¬ ⊤ ≡ ⊥和它的反面 ¬ ⊥ ≡ ⊤
本书使用 Haskell 并假设

  • ⊥ = False
  • ⊤ = True

  • 这将产生 Agda 类型 theorem : (p q : Bool) → not p ≡ q通过 refl 证明这是微不足道的.

    但是,不假设 1 和 2 就可以证明原始定理吗?


    -- from software foundations (https://plfa.github.io/Negation/)
    postulate
      excluded-middle : ∀ {A : Set} → A ⊎ ¬ A
    
    theorem : ¬ ⊤ ≡ ⊥
    theorem x = {!!}
    

    当然没有解决方案,因为我们不能构造 ,所以我猜需要一个反证法?另外,我是否正确,这假设了排中律,因此需要作为附加假设?

    Agda 说:

    I'm not sure if there should be a case for the constructor refl, because I get stuck when trying to solve the following unification problems (inferred index ≟ expected index): ⊤ ≟ ⊥ when checking that the expression ? has type ⊥



    谢谢!

    最佳答案

    这在没有假设的普通 Agda 中是可以证明的。解决方案是⊤ ≡ ⊥允许我们转任何证明 的证明.

    open import Data.Unit
    open import Data.Empty
    open import Relation.Binary.PropositionalEquality
    open import Relation.Nullary
    
    theorem : ¬ (⊤ ≡ ⊥)
    theorem eq = subst (λ A → A) eq tt
    

    关于logic - 如何在 Agda 中证明 `theorem : ¬ ⊤ ≡ ⊥`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58906691/

    相关文章:

    C++ 将一个对象传递给另一个对象?

    python - 扩展逻辑语句(相乘)

    math - 误解 MixColumns 步骤

    algorithm - 两种图灵可判定语言的交集是图灵可判定的

    boolean - 当 `T b` 已经匹配时证明 `b`

    c - 省略 char 中的前导 0 并追加

    证明 L = {a^n b^m | n>=m} 是不规则语言

    proof - 证明程序的等效性

    agda - 如何在 Agda 中排长队

    bash - 从 .sh 脚本启动时,Emacs 看不到 agda