]> matita.cs.unibo.it Git - helm.git/blob - bool.ma
01f2780ff82d42e8c82eb914e7853651c3d63a91
[helm.git] / bool.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basics/bool.ma".
16 include "ground_2/lib/relations.ma".
17 include "ground_2/notation/constructors/no_0.ma".
18 include "ground_2/notation/constructors/yes_0.ma".
19
20 (* BOOLEAN PROPERTIES *******************************************************)
21
22 interpretation "boolean false" 'no = false.
23
24 interpretation "boolean true" 'yes = true.
25
26 (* Basic properties *********************************************************)
27
28 lemma commutative_orb: commutative … orb.
29 * * // qed.
30
31 lemma orb_true_dx: ∀b. (b ∨ Ⓣ) = Ⓣ.
32 * // qed.
33
34 lemma orb_true_sn: ∀b. (Ⓣ ∨ b) = Ⓣ.
35 // qed.
36
37 lemma commutative_andb: commutative … andb.
38 * * // qed.
39
40 lemma andb_false_dx: ∀b. (b ∧ Ⓕ) = Ⓕ.
41 * // qed.
42
43 lemma andb_false_sn: ∀b. (Ⓕ ∧ b) = Ⓕ.
44 // qed.
45
46 lemma eq_bool_dec: ∀b1,b2:bool. Decidable (b1 = b2).
47 * * /2 width=1 by or_introl/
48 @or_intror #H destruct
49 qed-.
50
51 (* Basic inversion lemmas ***************************************************)
52
53 lemma orb_inv_false_dx: ∀b1,b2:bool. (b1 ∨ b2) = Ⓕ → b1 = Ⓕ ∧ b2 = Ⓕ.
54 * normalize /2 width=1 by conj/ #b2 #H destruct
55 qed-.
56
57 lemma andb_inv_true_dx: ∀b1,b2:bool. (b1 ∧ b2) = Ⓣ → b1 = Ⓣ ∧ b2 = Ⓣ.
58 * normalize /2 width=1 by conj/ #b2 #H destruct
59 qed-.