Skip to content

Commit f18481d

Browse files
committed
[add]: lemmata for if_then_else_
1 parent 9fca9dc commit f18481d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/Data/Bool/Properties.agda

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,50 @@ if-float : ∀ (f : A → B) b {x y} →
745745
if-float _ true = refl
746746
if-float _ false = refl
747747

748+
if-idemp : b {x : A}
749+
(if b then x else x) ≡ x
750+
if-idemp false = refl
751+
if-idemp true = refl
752+
753+
if-swap : b c {x y : A}
754+
(if b then x else (if c then x else y)) ≡ (if c then x else (if b then x else y))
755+
if-swap false _ = refl
756+
if-swap true false = refl
757+
if-swap true true = refl
758+
759+
if-not : b {x y : A}
760+
(if not b then x else y) ≡ (if b then y else x)
761+
if-not false = refl
762+
if-not true = refl
763+
764+
if-∧ : b {c} {x y : A}
765+
(if b ∧ c then x else y) ≡ (if b then (if c then x else y) else y)
766+
if-∧ false = refl
767+
if-∧ true = refl
768+
769+
if-∨ : b {c} {x y : A}
770+
(if b ∨ c then x else y) ≡ (if b then x else (if c then x else y))
771+
if-∨ false = refl
772+
if-∨ true = refl
773+
774+
if-xor : b {c} {x y : A}
775+
(if b xor c then x else y) ≡ (if b then (if c then y else x) else (if c then x else y))
776+
if-xor false = refl
777+
if-xor true {false} = refl
778+
if-xor true {true } = refl
779+
780+
if-congˡ : b {x y z : A} x ≡ z
781+
(if b then x else y) ≡ (if b then z else y)
782+
if-congˡ _ refl = refl
783+
784+
if-congʳ : b {x y z : A} y ≡ z
785+
(if b then x else y) ≡ (if b then x else z)
786+
if-congʳ _ refl = refl
787+
788+
if-cong : b {x y z w : A} x ≡ z y ≡ w
789+
(if b then x else y) ≡ (if b then z else w)
790+
if-cong _ refl refl = refl
791+
748792
------------------------------------------------------------------------
749793
-- Properties of T
750794

0 commit comments

Comments
 (0)