简体   繁体   English

如何在Agda中构造一个可能非空的Set

[英]How to construct a possibly nonempty Set in Agda

I know that (A \\/ ~A) is not provable in general. 我知道(A \\ / ~A)一般不可证明。 How does one go about constructing an example of a set A where (A \\/ ~A) is not provable, is this possible? 如何构建一个集合A的例子,其中(A \\ / ~A)是不可证明的,这可能吗? And if it is possible, is it possible without quantifiers? 如果有可能,没有量词可能吗?

I know that (A / ~A) is not provable in general. 我知道(A / ~A)一般不可证明。 How does one go about constructing an example of a set A where (A / ~A) is not provable, 如何构建集合A的示例,其中(A / ~A)不可证明,

You have already given an example: A \\/ ~A itself. 你已经给出了一个例子: A \\/ ~A本身。

open import Level
open import Data.Empty
open import Relation.Nullary
open import Data.Sum

lem-for : ∀ {α} -> Set α -> Set α
lem-for A = A ⊎ ¬ A

lem : ∀ {α} -> Set (suc α)
lem = ∀ {A} -> lem-for A

lem-lem : ∀ {α} -> Set (suc α)
lem-lem = lem-for lem

lem says "for all A A is either true or false". lem说“因为所有A A都是真或假”。 lem-lem says "the law of excluded middle is either true or false". lem-lem说“排除中间的法律是真是假”。 But we know that constructively lem is not true and, since Agda is not anti-classical, lem is not false either. 但是我们知道建设性的lem是不正确的,因为Agda不是反经典的,所以lem也不是假的。

Other classical logic axioms (taken from the Software Foundations book) are 其他经典逻辑公理(取自Software Foundations一书)是

Definition peirce := ∀P Q: Prop,
  ((P→Q)→P)→P.
Definition classic := ∀P:Prop,
  ~~P → P.
Definition de_morgan_not_and_not := ∀P Q:Prop,
  ~(~P ∧ ¬Q) → P∨Q.
Definition implies_to_or := ∀P Q:Prop,
  (P→Q) → (¬P∨Q).

These all + lem are equivalent. 这些全+ lem是等价的。


Here is a fancier example: 这是一个更好的例子:

open import Relation.Binary.PropositionalEquality
open import Data.Bool.Base
open import Data.Fin

eq : Set₁
eq = Fin 2 ≡ Bool

"Extensional" predicates are of the same sort. “Extensional”谓词属于同一类。 The simplest is function extensionality, but we can also say 最简单的是功能扩展性,但我们也可以这么说

open import Coinduction
open import Data.Nat.Base
open import Data.Stream

zeros : Stream ℕ
zeros = 0 ∷ ♯ zeros

eq₂ : Set
eq₂ = zeros ≡ 0 ∷ ♯ zeros

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM