@@ -28,8 +28,7 @@ open import Relation.Binary.Definitions
28
28
using (Decidable; Reflexive; Transitive; Antisymmetric; Minimum; Maximum; Total; Irrelevant; Irreflexive; Asymmetric; Trans; Trichotomous; tri≈; tri<; tri>; _Respects₂_)
29
29
open import Relation.Binary.PropositionalEquality.Core
30
30
open import Relation.Binary.PropositionalEquality.Properties
31
- open import Relation.Nullary.Reflects using (ofʸ; ofⁿ)
32
- open import Relation.Nullary.Decidable.Core using (True; does; proof; yes; no)
31
+ open import Relation.Nullary.Decidable.Core using (True; yes; no; fromWitness)
33
32
import Relation.Unary as U
34
33
35
34
open import Algebra.Definitions {A = Bool} _≡_
@@ -726,15 +725,17 @@ xor-∧-commutativeRing = ⊕-∧-commutativeRing
726
725
open XorRing _xor_ xor-is-ok
727
726
728
727
------------------------------------------------------------------------
729
- -- Miscellaneous other properties
728
+ -- Properties of if_then_else_
730
729
731
- ⇔→≡ : {x y z : Bool} → x ≡ z ⇔ y ≡ z → x ≡ y
732
- ⇔→≡ {true } {true } hyp = refl
733
- ⇔→≡ {true } {false} {true } hyp = sym (Equivalence.to hyp refl)
734
- ⇔→≡ {true } {false} {false} hyp = Equivalence.from hyp refl
735
- ⇔→≡ {false} {true } {true } hyp = Equivalence.from hyp refl
736
- ⇔→≡ {false} {true } {false} hyp = sym (Equivalence.to hyp refl)
737
- ⇔→≡ {false} {false} hyp = refl
730
+ if-float : ∀ (f : A → B) b {x y} →
731
+ f (if b then x else y) ≡ (if b then f x else f y)
732
+ if-float _ true = refl
733
+ if-float _ false = refl
734
+
735
+ ------------------------------------------------------------------------
736
+ -- Properties of T
737
+
738
+ open Relation.Nullary.Decidable.Core public using (T?)
738
739
739
740
T-≡ : ∀ {x} → T x ⇔ x ≡ true
740
741
T-≡ {false} = mk⇔ (λ ()) (λ ())
@@ -757,18 +758,20 @@ T-∨ {false} {false} = mk⇔ inj₁ [ id , id ]
757
758
T-irrelevant : U.Irrelevant T
758
759
T-irrelevant {true} _ _ = refl
759
760
760
- T? : U.Decidable T
761
- does (T? b) = b
762
- proof (T? true ) = ofʸ _
763
- proof (T? false) = ofⁿ λ ()
764
-
765
761
T?-diag : ∀ b → T b → True (T? b)
766
- T?-diag true _ = _
762
+ T?-diag b = fromWitness
763
+
764
+ ------------------------------------------------------------------------
765
+ -- Miscellaneous other properties
766
+
767
+ ⇔→≡ : {x y z : Bool} → x ≡ z ⇔ y ≡ z → x ≡ y
768
+ ⇔→≡ {true } {true } hyp = refl
769
+ ⇔→≡ {true } {false} {true } hyp = sym (Equivalence.to hyp refl)
770
+ ⇔→≡ {true } {false} {false} hyp = Equivalence.from hyp refl
771
+ ⇔→≡ {false} {true } {true } hyp = Equivalence.from hyp refl
772
+ ⇔→≡ {false} {true } {false} hyp = sym (Equivalence.to hyp refl)
773
+ ⇔→≡ {false} {false} hyp = refl
767
774
768
- if-float : ∀ (f : A → B) b {x y} →
769
- f (if b then x else y) ≡ (if b then f x else f y)
770
- if-float _ true = refl
771
- if-float _ false = refl
772
775
773
776
------------------------------------------------------------------------
774
777
-- DEPRECATED NAMES
0 commit comments