EraseRefl.agda 753 B

12345678910111213141516171819202122
  1. {-# OPTIONS -v treeless.opt:20 #-}
  2. module _ where
  3. open import Common.Prelude
  4. open import Common.Equality
  5. data Dec {a} (A : Set a) : Set a where
  6. yes : A → Dec A
  7. no : (A → ⊥) → Dec A
  8. decEq₂ : ∀ {a b c} {A : Set a} {B : Set b} {C : Set c} {f : A → B → C} →
  9. (∀ {x y z w} → f x y ≡ f z w → x ≡ z) →
  10. (∀ {x y z w} → f x y ≡ f z w → y ≡ w) →
  11. ∀ {x y z w} → Dec (x ≡ y) → Dec (z ≡ w) → Dec (f x z ≡ f y w)
  12. decEq₂ f-inj₁ f-inj₂ (no neq) _ = no λ eq → neq (f-inj₁ eq)
  13. decEq₂ f-inj₁ f-inj₂ _ (no neq) = no λ eq → neq (f-inj₂ eq)
  14. decEq₂ f-inj₁ f-inj₂ (yes refl) (yes refl) = yes refl
  15. main : IO Unit
  16. main = putStrLn ""