annotate logic.agda @ 72:09fa2ab75703

add utilties
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 24 Aug 2020 23:06:10 +0900
parents
children 69ed81f8e212
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 module logic where
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 open import Level
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 open import Relation.Nullary
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 open import Relation.Binary
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import Data.Empty
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 data Bool : Set where
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 true : Bool
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 false : Bool
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 record _∧_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 constructor ⟪_,_⟫
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 field
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 proj1 : A
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 proj2 : B
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 data _∨_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 case1 : A → A ∨ B
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 case2 : B → A ∨ B
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 _⇔_ : {n m : Level } → ( A : Set n ) ( B : Set m ) → Set (n ⊔ m)
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 _⇔_ A B = ( A → B ) ∧ ( B → A )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 contra-position : {n m : Level } {A : Set n} {B : Set m} → (A → B) → ¬ B → ¬ A
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 contra-position {n} {m} {A} {B} f ¬b a = ¬b ( f a )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 double-neg : {n : Level } {A : Set n} → A → ¬ ¬ A
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 double-neg A notnot = notnot A
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 double-neg2 : {n : Level } {A : Set n} → ¬ ¬ ¬ A → ¬ A
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 double-neg2 notnot A = notnot ( double-neg A )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 de-morgan : {n : Level } {A B : Set n} → A ∧ B → ¬ ( (¬ A ) ∨ (¬ B ) )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 de-morgan {n} {A} {B} and (case1 ¬A) = ⊥-elim ( ¬A ( _∧_.proj1 and ))
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 de-morgan {n} {A} {B} and (case2 ¬B) = ⊥-elim ( ¬B ( _∧_.proj2 and ))
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 dont-or : {n m : Level} {A : Set n} { B : Set m } → A ∨ B → ¬ A → B
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 dont-or {A} {B} (case1 a) ¬A = ⊥-elim ( ¬A a )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 dont-or {A} {B} (case2 b) ¬A = b
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 dont-orb : {n m : Level} {A : Set n} { B : Set m } → A ∨ B → ¬ B → A
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 dont-orb {A} {B} (case2 b) ¬B = ⊥-elim ( ¬B b )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 dont-orb {A} {B} (case1 a) ¬B = a
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 infixr 130 _∧_
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 infixr 140 _∨_
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 infixr 150 _⇔_
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 _/\_ : Bool → Bool → Bool
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 true /\ true = true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 _ /\ _ = false
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 _\/_ : Bool → Bool → Bool
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 false \/ false = false
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 _ \/ _ = true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 not_ : Bool → Bool
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 not true = false
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 not false = true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 _<=>_ : Bool → Bool → Bool
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 true <=> true = true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 false <=> false = true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 _ <=> _ = false
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 infixr 130 _\/_
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 infixr 140 _/\_
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 open import Relation.Binary.PropositionalEquality
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 ≡-Bool-func : {A B : Bool } → ( A ≡ true → B ≡ true ) → ( B ≡ true → A ≡ true ) → A ≡ B
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 ≡-Bool-func {true} {true} a→b b→a = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 ≡-Bool-func {false} {true} a→b b→a with b→a refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 ... | ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 ≡-Bool-func {true} {false} a→b b→a with a→b refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 ... | ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 ≡-Bool-func {false} {false} a→b b→a = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 bool-≡-? : (a b : Bool) → Dec ( a ≡ b )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 bool-≡-? true true = yes refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 bool-≡-? true false = no (λ ())
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 bool-≡-? false true = no (λ ())
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 bool-≡-? false false = yes refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 ¬-bool-t : {a : Bool} → ¬ ( a ≡ true ) → a ≡ false
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 ¬-bool-t {true} ne = ⊥-elim ( ne refl )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 ¬-bool-t {false} ne = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 ¬-bool-f : {a : Bool} → ¬ ( a ≡ false ) → a ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 ¬-bool-f {true} ne = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 ¬-bool-f {false} ne = ⊥-elim ( ne refl )
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 ¬-bool : {a : Bool} → a ≡ false → a ≡ true → ⊥
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 ¬-bool refl ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 lemma-∧-0 : {a b : Bool} → a /\ b ≡ true → a ≡ false → ⊥
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 lemma-∧-0 {true} {true} refl ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 lemma-∧-0 {true} {false} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 lemma-∧-0 {false} {true} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 lemma-∧-0 {false} {false} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 lemma-∧-1 : {a b : Bool} → a /\ b ≡ true → b ≡ false → ⊥
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 lemma-∧-1 {true} {true} refl ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 lemma-∧-1 {true} {false} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 lemma-∧-1 {false} {true} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 lemma-∧-1 {false} {false} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 bool-and-tt : {a b : Bool} → a ≡ true → b ≡ true → ( a /\ b ) ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 bool-and-tt refl refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 bool-∧→tt-0 : {a b : Bool} → ( a /\ b ) ≡ true → a ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 bool-∧→tt-0 {true} {true} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 bool-∧→tt-0 {false} {_} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 bool-∧→tt-1 : {a b : Bool} → ( a /\ b ) ≡ true → b ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 bool-∧→tt-1 {true} {true} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 bool-∧→tt-1 {true} {false} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 bool-∧→tt-1 {false} {false} ()
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 bool-or-1 : {a b : Bool} → a ≡ false → ( a \/ b ) ≡ b
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 bool-or-1 {false} {true} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 bool-or-1 {false} {false} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 bool-or-2 : {a b : Bool} → b ≡ false → (a \/ b ) ≡ a
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 bool-or-2 {true} {false} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 bool-or-2 {false} {false} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 bool-or-3 : {a : Bool} → ( a \/ true ) ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 bool-or-3 {true} = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 bool-or-3 {false} = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 bool-or-31 : {a b : Bool} → b ≡ true → ( a \/ b ) ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 bool-or-31 {true} {true} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 bool-or-31 {false} {true} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 bool-or-4 : {a : Bool} → ( true \/ a ) ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 bool-or-4 {true} = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 bool-or-4 {false} = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 bool-or-41 : {a b : Bool} → a ≡ true → ( a \/ b ) ≡ true
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 bool-or-41 {true} {b} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 bool-and-1 : {a b : Bool} → a ≡ false → (a /\ b ) ≡ false
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 bool-and-1 {false} {b} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 bool-and-2 : {a b : Bool} → b ≡ false → (a /\ b ) ≡ false
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 bool-and-2 {true} {false} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 bool-and-2 {false} {false} refl = refl
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
09fa2ab75703 add utilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151