annotate logic.agda @ 2:250c1d4e683b default tip

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