annotate src/logic.agda @ 1485:5dacb669f13b

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