-
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
18 changed files
with
117 additions
and
69 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,49 @@ | ||
{-# 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 import Function | ||
|
||
open Theory th renaming (_∈_ to _∈ᵗ_; _∉_ to _∉ᵗ_) | ||
|
||
private variable A B X : Type | ||
|
||
record IsSet (A B : Type) : Type where | ||
field | ||
toSet : A → Set B | ||
|
||
infix 4 _∈_ _∉_ | ||
_∈_ _∉_ : B → A → Type | ||
a ∈ X = a ∈ᵗ (toSet X) | ||
a ∉ X = a ∉ᵗ (toSet X) | ||
|
||
open IsSet ⦃...⦄ public | ||
|
||
infix 2 All-syntax | ||
All-syntax : ∀ {A X} ⦃ _ : IsSet X A ⦄ → (A → Type) → X → Type | ||
All-syntax P X = All P (toSet X) | ||
syntax All-syntax (λ x → P) l = ∀[ x ∈ l ] P | ||
|
||
module _ ⦃ _ : IsSet X (A × B) ⦄ where | ||
dom : X → Set A | ||
dom = Rel.dom ∘ toSet | ||
|
||
range : X → Set B | ||
range = Rel.range ∘ toSet | ||
|
||
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
Oops, something went wrong.