Skip to content

Commit 99167f7

Browse files
authored
De Morgan's laws for Pred (#2832)
* Add De Morgan's law for Pred * Add more of De Morgan's laws * Don't name unused variables * Use curry
1 parent a3eb2ef commit 99167f7

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,13 @@ Additions to existing modules
349349
randomIO : IO Bool
350350
randomRIO : RandomRIO {A = Bool} _≤_
351351
```
352+
353+
* In Relation.Unary.Properites
354+
```agda
355+
¬∃⟨P⟩⇒Π[∁P] : ¬ ∃⟨ P ⟩ → Π[ ∁ P ]
356+
¬∃⟨P⟩⇒∀[∁P] : ¬ ∃⟨ P ⟩ → ∀[ ∁ P ]
357+
∃⟨∁P⟩⇒¬Π[P] : ∃⟨ ∁ P ⟩ → ¬ Π[ P ]
358+
∃⟨∁P⟩⇒¬∀[P] : ∃⟨ ∁ P ⟩ → ¬ ∀[ P ]
359+
Π[∁P]⇒¬∃[P] : Π[ ∁ P ] → ¬ ∃⟨ P ⟩
360+
∀[∁P]⇒¬∃[P] : ∀[ ∁ P ] → ¬ ∃⟨ P ⟩
361+
```

src/Relation/Unary/Properties.agda

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module Relation.Unary.Properties where
1010

11-
open import Data.Product.Base as Product using (_×_; _,_; swap; proj₁; zip′)
11+
open import Data.Product.Base as Product using (_×_; _,_; -,_; swap; proj₁; zip′; curry)
1212
open import Data.Sum.Base using (inj₁; inj₂)
1313
open import Data.Unit.Base using (tt)
1414
open import Function.Base using (id; _$_; _∘_; _∘₂_)
@@ -52,6 +52,27 @@ U-Universal = λ _ → _
5252
∁U-Empty : Empty {A = A} (∁ U)
5353
∁U-Empty = λ x x∈∁U x∈∁U _
5454

55+
------------------------------------------------------------------------
56+
-- De Morgan's laws
57+
58+
¬∃⟨P⟩⇒Π[∁P] : {P : Pred A ℓ} ¬ ∃⟨ P ⟩ Π[ ∁ P ]
59+
¬∃⟨P⟩⇒Π[∁P] ¬sat = curry ¬sat
60+
61+
¬∃⟨P⟩⇒∀[∁P] : {P : Pred A ℓ} ¬ ∃⟨ P ⟩ ∀[ ∁ P ]
62+
¬∃⟨P⟩⇒∀[∁P] ¬sat = curry ¬sat _
63+
64+
∃⟨∁P⟩⇒¬Π[P] : {P : Pred A ℓ} ∃⟨ ∁ P ⟩ ¬ Π[ P ]
65+
∃⟨∁P⟩⇒¬Π[P] (x , ¬Px) ΠP = ¬Px (ΠP x)
66+
67+
∃⟨∁P⟩⇒¬∀[P] : {P : Pred A ℓ} ∃⟨ ∁ P ⟩ ¬ ∀[ P ]
68+
∃⟨∁P⟩⇒¬∀[P] (_ , ¬Px) ∀P = ¬Px ∀P
69+
70+
Π[∁P]⇒¬∃[P] : {P : Pred A ℓ} Π[ ∁ P ] ¬ ∃⟨ P ⟩
71+
Π[∁P]⇒¬∃[P] Π∁P (x , Px) = Π∁P x Px
72+
73+
∀[∁P]⇒¬∃[P] : {P : Pred A ℓ} ∀[ ∁ P ] ¬ ∃⟨ P ⟩
74+
∀[∁P]⇒¬∃[P] ∀∁P (_ , Px) = ∀∁P Px
75+
5576
------------------------------------------------------------------------
5677
-- Subset properties
5778

0 commit comments

Comments
 (0)