Skip to content

Commit 29d1632

Browse files
bsauljamesmckinnaMatthewDaggitt
authored
Adds unary disjoint relation (#2595)
* add disjoint relation * update changelog * try out perp instead of # * fix infix * Adds a few properties of disjoint relation * specialize Negation import to Core * Update CHANGELOG.md Co-authored-by: jamesmckinna <[email protected]> * Update src/Relation/Unary/Properties.agda Refactor to achieve greater level polymorphism * Update CHANGELOG.md Simplify types --------- Co-authored-by: jamesmckinna <[email protected]> Co-authored-by: Matthew Daggitt <[email protected]>
1 parent f5e4c2b commit 29d1632

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,20 @@ Additions to existing modules
377377
⊥-dec : Dec {a} ⊥
378378
```
379379

380+
* In `Relation.Unary`:
381+
```agda
382+
_⊥_ _⊥′_ : Pred A ℓ₁ → Pred A ℓ₂ → Set _
383+
```
384+
385+
* In `Relation.Unary.Properties`:
386+
```agda
387+
≬-symmetric : Sym _≬_ _≬_
388+
⊥-symmetric : Sym _⊥_ _⊥_
389+
≬-sym : Symmetric _≬_
390+
⊥-sym : Symmetric _⊥_
391+
≬⇒¬⊥ : _≬_ ⇒ (¬_ ∘₂ _⊥_)
392+
⊥⇒¬≬ : _⊥_ ⇒ (¬_ ∘₂ _≬_)
393+
380394
* In `Relation.Nullary.Negation.Core`:
381395
```agda
382396
contra-diagonal : (A → ¬ A) → ¬ A

src/Relation/Unary.agda

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ infixr 8 _⇒_
207207
infixr 7 _∩_
208208
infixr 6 _∪_
209209
infixr 6 _∖_
210-
infix 4 _≬_
210+
infix 4 _≬_ _⊥_ _⊥′_
211211

212212
-- Complement.
213213

@@ -253,6 +253,14 @@ syntax ⋂ I (λ i → P) = ⋂[ i ∶ I ] P
253253
_≬_ : Pred A ℓ₁ Pred A ℓ₂ Set _
254254
P ≬ Q =λ x x ∈ P × x ∈ Q
255255

256+
-- Disjoint
257+
258+
_⊥_ : Pred A ℓ₁ Pred A ℓ₂ Set _
259+
P ⊥ Q = P ∩ Q ⊆ ∅
260+
261+
_⊥′_ : Pred A ℓ₁ Pred A ℓ₂ Set _
262+
P ⊥′ Q = P ∩ Q ⊆′ ∅
263+
256264
-- Update.
257265

258266
_⊢_ : (A B) Pred B ℓ Pred A ℓ

src/Relation/Unary/Properties.agda

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ module Relation.Unary.Properties where
1111
open import Data.Product.Base as Product using (_×_; _,_; swap; proj₁; zip′)
1212
open import Data.Sum.Base using (inj₁; inj₂)
1313
open import Data.Unit.Base using (tt)
14+
open import Function.Base using (id; _$_; _∘_; _∘₂_)
1415
open import Level using (Level)
1516
open import Relation.Binary.Core as Binary
1617
open import Relation.Binary.Definitions
1718
hiding (Decidable; Universal; Irrelevant; Empty)
1819
open import Relation.Binary.PropositionalEquality.Core using (refl; _≗_)
19-
open import Relation.Unary
2020
open import Relation.Nullary.Decidable as Dec
2121
using (yes; no; _⊎-dec_; _×-dec_; ¬?; map′; does)
22-
open import Function.Base using (id; _$_; _∘_)
22+
open import Relation.Nullary.Negation.Core using (¬_)
23+
open import Relation.Unary
2324

2425
private
2526
variable
@@ -198,6 +199,27 @@ U-Universal = λ _ → _
198199
≐′⇒≐ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _≐_
199200
≐′⇒≐ = Product.map ⊆′⇒⊆ ⊆′⇒⊆
200201

202+
------------------------------------------------------------------------
203+
-- Between/Disjoint properties
204+
205+
≬-symmetric : Sym {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≬_ _≬_
206+
≬-symmetric = Product.map₂ swap
207+
208+
⊥-symmetric : Sym {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊥_ _⊥_
209+
⊥-symmetric = _∘ swap
210+
211+
≬-sym : Symmetric {A = Pred A ℓ₁} _≬_
212+
≬-sym = ≬-symmetric
213+
214+
⊥-sym : Symmetric {A = Pred A ℓ₁} _⊥_
215+
⊥-sym = ⊥-symmetric
216+
217+
≬⇒¬⊥ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≬_ (¬_ ∘₂ _⊥_)
218+
≬⇒¬⊥ P≬Q ¬P⊥Q = ¬P⊥Q (Product.proj₂ P≬Q)
219+
220+
⊥⇒¬≬ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊥_ (¬_ ∘₂ _≬_)
221+
⊥⇒¬≬ P⊥Q = P⊥Q ∘ Product.proj₂
222+
201223
------------------------------------------------------------------------
202224
-- Decidability properties
203225

0 commit comments

Comments
 (0)