-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
119 additions
and
70 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{-# OPTIONS --safe --no-import-sorts #-} | ||
|
||
open import Agda.Primitive renaming (Set to Type) | ||
open import Axiom.Set | ||
|
||
module Interface.IsSet (th : Theory) where | ||
|
||
import Axiom.Set.Rel th as Rel | ||
open import Axiom.Set.Map th as Map | ||
open import Axiom.Set.TotalMap th as TotalMap | ||
open import Data.Product | ||
|
||
open Theory th renaming (_∈_ to _∈ᵗ_; _∉_ to _∉ᵗ_) | ||
|
||
private variable A B X : Type | ||
|
||
record IsSet (A B : Type) : Type where | ||
field | ||
toSet : A → Set B | ||
|
||
open IsSet ⦃...⦄ public | ||
|
||
infix 4 _∈_ _∉_ | ||
|
||
_∈_ : ⦃ IsSet X A ⦄ → A → X → Type | ||
a ∈ X = a ∈ᵗ (toSet X) | ||
|
||
_∉_ : ⦃ IsSet X A ⦄ → A → X → Type | ||
a ∉ X = a ∉ᵗ (toSet X) | ||
|
||
dom : ⦃ IsSet X (A × B) ⦄ → X → Set A | ||
dom X = Rel.dom (toSet X) | ||
|
||
range : ⦃ IsSet X (A × B) ⦄ → X → Set B | ||
range X = Rel.range (toSet X) | ||
|
||
instance | ||
IsSet-Set : IsSet (Set A) A | ||
IsSet-Set .toSet A = A | ||
|
||
IsSet-Map : IsSet (Map A B) (A × B) | ||
IsSet-Map .toSet = _ˢ | ||
|
||
IsSet-TotalMap : IsSet (TotalMap A B) (A × B) | ||
IsSet-TotalMap .toSet = TotalMap.rel |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.