mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
some more refactor
This commit is contained in:
parent
98837f659c
commit
e4af840dc2
2 changed files with 30 additions and 3 deletions
|
@ -375,6 +375,24 @@ module DelayMonad where
|
|||
|
||||
open DelayMonad
|
||||
|
||||
-- custom definition of natural numbers together with the setoid on ℕ with propositional equality
|
||||
module nat {ℓ} where
|
||||
data ℕ : Set ℓ where
|
||||
zero : ℕ
|
||||
suc : ℕ → ℕ
|
||||
|
||||
ℕ-setoid : Setoid ℓ ℓ
|
||||
ℕ-setoid = record
|
||||
{ Carrier = ℕ
|
||||
; _≈_ = _≡_
|
||||
; isEquivalence = Eq.isEquivalence
|
||||
}
|
||||
|
||||
suc-inj : ∀ {n m} → suc n ≡ suc m → n ≡ m
|
||||
suc-inj Eq.refl = Eq.refl
|
||||
|
||||
open nat
|
||||
|
||||
module extra {A : Setoid c (c ⊔ ℓ)} where
|
||||
≲→≈ : {x y : Delay ∣ A ∣} → [ A ][ x ≲ y ] → [ A ][ x ≈ y ]
|
||||
≲→≈′ : {x y : Delay ∣ A ∣} → [ A ][ x ≲′ y ] → [ A ][ x ≈′ y ]
|
||||
|
|
|
@ -30,17 +30,18 @@ open import Categories.Category.Instance.Properties.Setoids.CCC using (Setoids-C
|
|||
module Monad.Instance.Setoids.K {ℓ : Level} where
|
||||
open _⟶_ using (cong)
|
||||
open import Category.Ambient.Setoids
|
||||
open Ambient (setoidAmbient {ℓ}) using (cocartesian; distributive)
|
||||
open Ambient (setoidAmbient {ℓ} {ℓ}) using (cocartesian; distributive)
|
||||
open import Monad.Instance.Setoids.Delay {ℓ} {ℓ}
|
||||
open import Monad.Instance.K (setoidAmbient {ℓ})
|
||||
open import Monad.Instance.K (setoidAmbient {ℓ} {ℓ})
|
||||
open import Algebra.Elgot cocartesian
|
||||
open import Algebra.Elgot.Free cocartesian
|
||||
open import Algebra.Elgot.Stable distributive
|
||||
open import Category.Construction.ElgotAlgebras {C = Setoids ℓ ℓ} cocartesian
|
||||
open import Monad.PreElgot (setoidAmbient {ℓ})
|
||||
open import Monad.PreElgot (setoidAmbient {ℓ} {ℓ})
|
||||
open Bisimilarity renaming (_≈_ to [_][_≈_]; _≈′_ to [_][_≈′_]; _∼_ to [_][_∼_]; _∼′_ to [_][_∼′_]; _↓_ to [_][_↓_])
|
||||
open DelayMonad
|
||||
open extra
|
||||
open nat
|
||||
open Setoid using () renaming (Carrier to ∣_∣; _≈_ to [_][_≡_])
|
||||
open eq using () renaming (refl to ≡-refl; sym to ≡-sym; trans to ≡-trans)
|
||||
|
||||
|
@ -297,6 +298,14 @@ module Monad.Instance.Setoids.K {ℓ : Level} where
|
|||
|
||||
delay-lift' = record { to = < helper # > ; cong = helper#≈-cong }
|
||||
|
||||
|
||||
-- interesting note:
|
||||
-- the following definition prevents more general universe levels, i.e. we would like to parametrize this module by two levels c and ℓ, one for carriers and one for proofs.
|
||||
-- but adopting this approach would force us to talk about setoids of type Setoid ℓ (c ⊔ ℓ), this does not work with the definition below,
|
||||
-- since propositional equality lives on the same level as values, this means the type below would have to look like:
|
||||
-- ‖_‖ : Setoid c (c ⊔ ℓ) → Setoid c c
|
||||
-- this in turn does not play together nicely with later definition.
|
||||
|
||||
-- discretize a setoid
|
||||
‖_‖ : Setoid ℓ ℓ → Setoid ℓ ℓ
|
||||
∣_∣ ‖ X ‖ = ∣ X ∣
|
||||
|
|
Loading…
Reference in a new issue