Created
April 17, 2016 08:29
-
-
Save gallais/75100e26fc4be48eb3d31ae5ed6d1198 to your computer and use it in GitHub Desktop.
Postulating the LEM in Agda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LEM where | |
open import Data.Empty | |
open import Data.Product | |
open import Function | |
open import Relation.Nullary | |
∄⇒∀ : {A : Set} {B : A → Set} → | |
¬ (∃ λ a → B a) → | |
∀ a → ¬ (B a) | |
∄⇒∀ ¬∃ a b = ¬∃ (a , b) | |
postulate LEM : (A : Set) → Dec A | |
¬¬A⇒A : {A : Set} → ¬ (¬ A) → A | |
¬¬A⇒A {A} ¬¬p = | |
case LEM A of λ | |
{ (yes p) → p | |
; (no ¬p) → ⊥-elim $ ¬¬p ¬p | |
} | |
∀̸⇒∃ : {A : Set} {B : A → Set} → | |
¬ (∀ a → B a) → | |
∃ λ a → ¬ (B a) | |
∀̸⇒∃ {A} {B} ¬∀ = | |
case LEM (∃ λ a → ¬ B a) of λ | |
{ (yes p) → p | |
; (no ¬p) → ⊥-elim $ ¬∀ (¬¬A⇒A ∘ ∄⇒∀ ¬p) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment