]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/nlibrary/datatypes/bool-setoids.ma
Preparing for 0.5.9 release.
[helm.git] / helm / software / matita / nlibrary / datatypes / bool-setoids.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 "datatypes/bool.ma".
16 include "sets/setoids.ma".
17
18 ndefinition eq_bool ≝ 
19   λa,b.match a with 
20        [ true  ⇒ match b with [ true ⇒ True  | _ ⇒ False ]
21        | false ⇒ match b with [ false ⇒ True | _ ⇒ False ]].
22
23  (* XXX move to bool *)
24 interpretation "bool eq" 'eq_low a b = (eq_bool a b). 
25
26 ndefinition BOOL : setoid.
27 @bool; @(eq_bool); #x; ncases x; //; #y; ncases y; //; #z; ncases z; //; nqed.
28
29 alias symbol "hint_decl" (instance 1) = "hint_decl_Type1".
30 alias id "refl" = "cic:/matita/ng/properties/relations/refl.fix(0,1,3)".
31 unification hint 0 ≔ ;
32   P1 ≟ refl ? (eq0 BOOL),
33   P2 ≟ sym ? (eq0 BOOL),
34   P3 ≟ trans ? (eq0 BOOL),
35   X ≟ mk_setoid bool (mk_equivalence_relation ? (eq_bool) P1 P2 P3)
36 (*-----------------------------------------------------------------------*) ⊢
37      carr X ≡ bool.
38
39 unification hint 0 ≔ a,b;
40    R ≟ eq0 BOOL,
41    L ≟ bool
42 (* -------------------------------------------- *) ⊢
43    eq_bool a b ≡ eq_rel L R a b.