@@ -28,8 +28,7 @@ open import Relation.Binary.Definitions
2828 using (Decidable; Reflexive; Transitive; Antisymmetric; Minimum; Maximum; Total; Irrelevant; Irreflexive; Asymmetric; Trans; Trichotomous; tri≈; tri<; tri>; _Respects₂_)
2929open import Relation.Binary.PropositionalEquality.Core
3030open 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)
3332import Relation.Unary as U
3433
3534open import Algebra.Definitions {A = Bool} _≡_
@@ -726,15 +725,17 @@ xor-∧-commutativeRing = ⊕-∧-commutativeRing
726725 open XorRing _xor_ xor-is-ok
727726
728727------------------------------------------------------------------------
729- -- Miscellaneous other properties
728+ -- Properties of if_then_else_
730729
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?)
738739
739740T-≡ : ∀ {x} → T x ⇔ x ≡ true
740741T-≡ {false} = mk⇔ (λ ()) (λ ())
@@ -757,18 +758,20 @@ T-∨ {false} {false} = mk⇔ inj₁ [ id , id ]
757758T-irrelevant : U.Irrelevant T
758759T-irrelevant {true} _ _ = refl
759760
760- T? : U.Decidable T
761- does (T? b) = b
762- proof (T? true ) = ofʸ _
763- proof (T? false) = ofⁿ λ ()
764-
765761T?-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
767774
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
772775
773776------------------------------------------------------------------------
774777-- DEPRECATED NAMES
0 commit comments