Skip to content

Commit

Permalink
cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
effectfully committed Jul 12, 2016
1 parent 75542d1 commit 7df5195
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Core.agda
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ data Desc {i b} {ι : Level i} (I : Type ι) (β : Level b) : Set where
-> (A : Univ α) -> (⟦ A ⟧ -> Desc I β) -> Desc I β
_⊛_ : Desc I β -> Desc I β -> Desc I β

_⇨_ : {i a b} {ι : Level i} {α : Level a} {β : Level b} {I : Type ι} .{{_ : a ≤ₘ b}}
-> (A : Univ α) -> Desc I β -> Desc I β
A ⇨ D = π A λ _ -> D

⟦_⟧ᵈ : {i a} {ι : Level i} {α : Level a} {I : Type ι}
-> Desc I α -> (⟦ I ⟧ -> Set) -> Set
⟦ var i ⟧ᵈ B = B i
Expand Down Expand Up @@ -91,6 +87,10 @@ knot : ∀ {i a} {ι : Level i} {α : Level a} {I : Type ι} {D : Desc I α} {j}
-> μ D j -> Extend D (μ D) j
knot (node e) = e

_⇨_ : {i a b} {ι : Level i} {α : Level a} {β : Level b} {I : Type ι} .{{_ : a ≤ₘ b}}
-> Univ α -> Desc I β -> Desc I β
A ⇨ D = π A λ _ -> D

data Univ where
bot : Prop
top : Prop
Expand Down
12 changes: 12 additions & 0 deletions Lib/Decidable.agda
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,15 @@ dhcong₂ : ∀ {α β γ} {A : Set α} {B : A -> Set β} {C : Set γ} {x₁ x
-> f x₁ y₁ # f x₂ y₂
dhcong₂ f inj (yes refl) q = dcong (f _) (homo ∘ inj) (q _)
dhcong₂ f inj (no c) q = no (c ∘ inds ∘ inj)

,-inj : {α β} {A : Set α} {B : A -> Set β} {x₁ x₂} {y₁ : B x₁} {y₂ : B x₂}
-> (x₁ , y₁) ≡ (x₂ , y₂) -> [ B ] y₁ ≅ y₂
,-inj refl = irefl

_<,>ᵈ_ : {α β} {A : Set α} {B : Set β} {x₁ x₂ : A} {y₁ y₂ : B}
-> x₁ # x₂ -> y₁ # y₂ -> x₁ , y₁ # x₂ , y₂
_<,>ᵈ_ = dcong₂ _,_ (inds-homo ∘ ,-inj)

_<,>ᵈⁱ_ : {α β} {A : Set α} {B : A -> Set β} {x₁ x₂} {y₁ : B x₁} {y₂ : B x₂}
-> x₁ # x₂ -> ( y₂ -> y₁ # y₂) -> x₁ , y₁ # x₂ , y₂
_<,>ᵈⁱ_ = dhcong₂ _,_ ,-inj
12 changes: 0 additions & 12 deletions Prelude.agda
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ instance
pright : {α} {A : Set α} {x y z : A} -> x ≡ y -> x ≡ z -> y ≡ z
pright prefl prefl = prefl

,-inj : {α β} {A : Set α} {B : A -> Set β} {x₁ x₂} {y₁ : B x₁} {y₂ : B x₂}
-> (x₁ , y₁) ≡ (x₂ , y₂) -> [ B ] y₁ ≅ y₂
,-inj prefl = irefl

_<,>ᵈ_ : {α β} {A : Set α} {B : Set β} {x₁ x₂ : A} {y₁ y₂ : B}
-> x₁ # x₂ -> y₁ # y₂ -> x₁ , y₁ # x₂ , y₂
_<,>ᵈ_ = dcong₂ _,_ (inds-homo ∘ ,-inj)

_<,>ᵈᵒ_ : {α β} {A : Set α} {B : A -> Set β} {x₁ x₂} {y₁ : B x₁} {y₂ : B x₂}
-> x₁ # x₂ -> ( y₂ -> y₁ # y₂) -> x₁ , y₁ # x₂ , y₂
_<,>ᵈᵒ_ = dhcong₂ _,_ ,-inj

record Apply {α β} {A : Set α} (B : A -> Set β) x : Set β where
constructor tag
field detag : B x
Expand Down
4 changes: 2 additions & 2 deletions Property/Eq.agda
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mutual
-> (D : Desc I α) {{eqD : ExtendEq D}} -> IsSet (Extend D (μ D₀) j)
decExtend (var i) q₁ q₂ = yes contr
decExtend (π A D) {{eqA , eqD}} (x₁ , e₁) (x₂ , e₂) =
_≟_ {{eqA}} x₁ x₂ <,>ᵈᵒ decExtend (D x₁) {{apply eqD x₁}} e₁
_≟_ {{eqA}} x₁ x₂ <,>ᵈⁱ decExtend (D x₁) {{apply eqD x₁}} e₁
decExtend (D ⊛ E) {{eqD , eqE}} (s₁ , e₁) (s₂ , e₂) =
decSem D {{eqD}} s₁ s₂ <,>ᵈ decExtend E {{eqE}} e₁ e₂

Expand All @@ -66,7 +66,7 @@ mutual
_≟_ {A = enum n } (tag e₁) (tag e₂) = dcong tag tag-inj (decEnum n e₁ e₂)
_≟_ {A = univ α } {{()}}
_≟_ {A = σ A B } {{eqA , eqB}} (x₁ , y₁) (x₂ , y₂) =
_≟_ {{eqA}} x₁ x₂ <,>ᵈᵒ _≟_ {{apply eqB x₁}} y₁
_≟_ {{eqA}} x₁ x₂ <,>ᵈⁱ _≟_ {{apply eqB x₁}} y₁
_≟_ {A = π A B } {{()}}
_≟_ {A = desc I α} {{()}}
_≟_ {A = imu D j } d₁ d₂ = decMu d₁ d₂
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ It's an implementation of Observational Type Theory as an Agda library. The univ

## Details

(The readme is a bit old: a `Level` now fully reifies the corresponding `MetaLevel` and there is also a [generic machinery](https://github.com/effectfully/OTT/blob/master/Function/Elim.agda) which allows to derive intensional-type-theory-like eliminators which is annoying to do by hand when a data type is indexed and you need to explicitly use `J`)
(The readme is a bit old: a `Level` now fully reifies the corresponding `MetaLevel` and there is also a [generic machinery](https://github.com/effectfully/OTT/blob/master/Function/Elim.agda) which allows to derive intensional-type-theory-like eliminators which is annoying to do by hand when a data type is indexed so you need to explicitly use `J`)

There are two main kinds of universe levels (there is also yet another one, but it's not important): metatheory levels (the usual `Level` type renamed to `MetaLevel`) and target theory levels, indexed by metalevels:

Expand Down

0 comments on commit 7df5195

Please sign in to comment.