Skip to content

Commit

Permalink
add non-diagonal cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tabareau committed Feb 8, 2021
1 parent 0d0cd2e commit 750c767
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion setoid_rr.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --rewriting --prop --confluence-check --cumulativity #-}
{-# OPTIONS --rewriting --prop --cumulativity #-}

open import Agda.Primitive
open import Agda.Builtin.Bool
Expand Down Expand Up @@ -38,6 +38,9 @@ variable ℓ ℓ₁ ℓ₂ ℓ₃ ℓ₄ : Level

data : Prop where

⊥-elim : {A : Set ℓ} A
⊥-elim ()

record ⊤P : Propwhere
constructor ttP

Expand Down Expand Up @@ -252,6 +255,23 @@ postulate Id-set : Id (Set (lsuc ℓ₁)) (Set ℓ₁) (Set ℓ₁) ≡ ⊤P

{-# REWRITE Id-set #-}

-- non-diagonal cases

{- There are n^2 cases, that's a pain, this is not exhaustive for the moment -}

postulate Id-set-nat : Id _ (Set ℓ) Nat ≡ ⊥
postulate Id-nat-set : Id (Set (lsuc ℓ)) Nat (Set ℓ) ≡ ⊥
postulate Id-set-bool : Id _ (Set ℓ) Bool ≡ ⊥
postulate Id-bool-set : Id (Set (lsuc ℓ)) Bool (Set ℓ) ≡ ⊥
postulate Id-bool-nat : Id (Set ℓ) Bool Nat ≡ ⊥
postulate Id-nat-bool : Id (Set ℓ) Nat Bool ≡ ⊥
postulate Id-set-pi : (A : Set ℓ₁) (B : A Set ℓ₂) Id (Set (lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂)) (Set ℓ) ((a : A) B a) ≡ ⊥
postulate Id-pi-set : (A : Set ℓ₁) (B : A Set ℓ₂) Id (Set (lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂)) ((a : A) B a) (Set ℓ) ≡ ⊥
postulate Id-set-sigma : (A : Set ℓ₁) (B : A Set ℓ₂) Id (Set (lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂)) (Set ℓ) (Σ A B) ≡ ⊥
postulate Id-sigma-set : (A : Set ℓ₁) (B : A Set ℓ₂) Id (Set (lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂)) (Σ A B) (Set ℓ) ≡ ⊥

{-# REWRITE Id-set-nat Id-nat-set Id-set-bool Id-bool-set Id-bool-nat Id-nat-bool Id-set-pi Id-pi-set Id-set-sigma Id-sigma-set #-}

--- Contractibility of singletons and J can be defined

contr-sing : (A : Set ℓ) {x y : A} (p : Id {ℓ} A x y)
Expand Down Expand Up @@ -362,6 +382,21 @@ postulate cast-Box : (A A' : Prop ℓ) (a : A) (f : _) (g : _) →

{-# REWRITE cast-Box #-}

-- impossible casts

postulate cast-set-nat : (e : _) (x : _) cast {lsuc ℓ} (Set ℓ) Nat e x ≡ ⊥-elim e
postulate cast-nat-set : (e : _) (x : _) cast {lsuc ℓ} Nat (Set ℓ) e x ≡ ⊥-elim e
postulate cast-set-bool : (e : _) (x : _) cast {lsuc ℓ} (Set ℓ) Bool e x ≡ ⊥-elim e
postulate cast-bool-set : (e : _) (x : _) cast {lsuc ℓ} Bool (Set ℓ) e x ≡ ⊥-elim e
postulate cast-bool-nat : (e : _) (x : _) cast {ℓ} Bool Nat e x ≡ ⊥-elim e
postulate cast-nat-bool : (e : _) (x : _) cast {ℓ} Nat Bool e x ≡ ⊥-elim e
postulate cast-set-pi : (A : Set ℓ₁) (B : A Set ℓ₂) (e : _) (x : _) cast {lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂} (Set ℓ) ((a : A) B a) e x ≡ ⊥-elim e
postulate cast-pi-set : (A : Set ℓ₁) (B : A Set ℓ₂) (e : _) (x : _) cast {lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂} ((a : A) B a) (Set ℓ) e x ≡ ⊥-elim e
postulate cast-set-sigma : (A : Set ℓ₁) (B : A Set ℓ₂) (e : _) (x : _) cast {lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂} (Set ℓ) (Σ {ℓ₁} {ℓ₂} A B) e x ≡ ⊥-elim e
postulate cast-sigma-set : (A : Set ℓ₁) (B : A Set ℓ₂) (e : _) (x : _) cast {lsuc ℓ ⊔ ℓ₁ ⊔ ℓ₂} (Σ {ℓ₁} {ℓ₂} A B) (Set ℓ) e x ≡ ⊥-elim e

{-# REWRITE cast-set-nat cast-nat-set cast-set-bool cast-bool-set cast-bool-nat cast-nat-bool cast-set-pi cast-pi-set cast-set-sigma cast-sigma-set #-}

-- sanity check on closed terms
{-
foo : transport-Id (λ (T : Σ {lsuc lzero} {lsuc lzero} Set (λ A → Σ {lzero} {lsuc lzero} A (λ _ → A → Set))) → ((snd (snd T)) (fst (snd T))))
Expand Down

0 comments on commit 750c767

Please sign in to comment.