File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -795,6 +795,18 @@ if-xor false = refl
795795if-xor true {false} = refl
796796if-xor true {true } = refl
797797
798+ -- The following congruence lemmas are short hands for
799+ -- cong (if_then x else y)
800+ -- cong (if b then_else y)
801+ -- cong (if b then x else_)
802+ -- cong (if b then_else_)
803+ -- on the different sub-terms in an if_then_else_ expression.
804+ -- With these short hands, the branches x and y can be inferred
805+ -- automatically (i.e., they are implicit arguments) whereas
806+ -- the branches have to be spelled out explicitly when using cong.
807+ -- (Using underscores as in "cong (if b then _ else_)"
808+ -- unfortunately fails to resolve the omitted argument.)
809+
798810if-cong : ∀ {b c} {x y : A} → b ≡ c →
799811 (if b then x else y) ≡ (if c then x else y)
800812if-cong refl = refl
You can’t perform that action at this time.
0 commit comments