mirror of
https://github.com/Smaug123/agdaproofs
synced 2025-10-20 02:28:39 +00:00
Move Bool to live on its own (#118)
This commit is contained in:
16
Decidable/Reduction.agda
Normal file
16
Decidable/Reduction.agda
Normal file
@@ -0,0 +1,16 @@
|
||||
{-# OPTIONS --safe --warning=error --without-K #-}
|
||||
|
||||
open import LogicalFormulae
|
||||
open import Decidable.Relations
|
||||
open import Boolean.Definition
|
||||
|
||||
module Decidable.Reduction where
|
||||
|
||||
squash : {a b : _} {A : Set a} {f : A → Set b} → DecidableRelation f → A → Bool
|
||||
squash rel a with rel a
|
||||
... | inl x = BoolTrue
|
||||
... | inr x = BoolFalse
|
||||
|
||||
unsquash : {a b : _} {A : Set a} {f : A → Set b} → (rel : DecidableRelation f) → {x : A} → .(squash rel x ≡ BoolTrue) → f x
|
||||
unsquash rel {x} pr with rel x
|
||||
... | inl ans = ans
|
Reference in New Issue
Block a user