1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* ********************************************************************** *)
16 (* Progetto FreeScale *)
18 (* Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Cosimo Oliboni, oliboni@cs.unibo.it *)
21 (* ********************************************************************** *)
23 include "freescale/bool_lemmas.ma".
24 include "freescale/oct.ma".
30 ndefinition oct_destruct_aux ≝
31 Πn1,n2:oct.ΠP:Prop.n1 = n2 →
33 [ o0 ⇒ match n2 with [ o0 ⇒ P → P | _ ⇒ P ]
34 | o1 ⇒ match n2 with [ o1 ⇒ P → P | _ ⇒ P ]
35 | o2 ⇒ match n2 with [ o2 ⇒ P → P | _ ⇒ P ]
36 | o3 ⇒ match n2 with [ o3 ⇒ P → P | _ ⇒ P ]
37 | o4 ⇒ match n2 with [ o4 ⇒ P → P | _ ⇒ P ]
38 | o5 ⇒ match n2 with [ o5 ⇒ P → P | _ ⇒ P ]
39 | o6 ⇒ match n2 with [ o6 ⇒ P → P | _ ⇒ P ]
40 | o7 ⇒ match n2 with [ o7 ⇒ P → P | _ ⇒ P ]
43 ndefinition oct_destruct : oct_destruct_aux.
46 ##[ ##1: nelim n2; nnormalize; #H;
47 ##[ ##1: napply (λx:P.x)
48 ##| ##*: napply False_ind;
49 nchange with (match o0 with [ o0 ⇒ False | _ ⇒ True ]);
50 nrewrite > H; nnormalize; napply I
52 ##| ##2: nelim n2; nnormalize; #H;
53 ##[ ##2: napply (λx:P.x)
54 ##| ##*: napply False_ind;
55 nchange with (match o1 with [ o1 ⇒ False | _ ⇒ True ]);
56 nrewrite > H; nnormalize; napply I
58 ##| ##3: nelim n2; nnormalize; #H;
59 ##[ ##3: napply (λx:P.x)
60 ##| ##*: napply False_ind;
61 nchange with (match o2 with [ o2 ⇒ False | _ ⇒ True ]);
62 nrewrite > H; nnormalize; napply I
64 ##| ##4: nelim n2; nnormalize; #H;
65 ##[ ##4: napply (λx:P.x)
66 ##| ##*: napply False_ind;
67 nchange with (match o3 with [ o3 ⇒ False | _ ⇒ True ]);
68 nrewrite > H; nnormalize; napply I
70 ##| ##5: nelim n2; nnormalize; #H;
71 ##[ ##5: napply (λx:P.x)
72 ##| ##*: napply False_ind;
73 nchange with (match o4 with [ o4 ⇒ False | _ ⇒ True ]);
74 nrewrite > H; nnormalize; napply I
76 ##| ##6: nelim n2; nnormalize; #H;
77 ##[ ##6: napply (λx:P.x)
78 ##| ##*: napply False_ind;
79 nchange with (match o5 with [ o5 ⇒ False | _ ⇒ True ]);
80 nrewrite > H; nnormalize; napply I
82 ##| ##7: nelim n2; nnormalize; #H;
83 ##[ ##7: napply (λx:P.x)
84 ##| ##*: napply False_ind;
85 nchange with (match o6 with [ o6 ⇒ False | _ ⇒ True ]);
86 nrewrite > H; nnormalize; napply I
88 ##| ##8: nelim n2; nnormalize; #H;
89 ##[ ##8: napply (λx:P.x)
90 ##| ##*: napply False_ind;
91 nchange with (match o7 with [ o7 ⇒ False | _ ⇒ True ]);
92 nrewrite > H; nnormalize; napply I
97 nlemma symmetric_eqoct : symmetricT oct bool eq_oct.
105 nlemma eqoct_to_eq : ∀n1,n2.eq_oct n1 n2 = true → n1 = n2.
110 ##[ ##1,10,19,28,37,46,55,64: #H; napply refl_eq
111 ##| ##*: #H; napply (bool_destruct … H)
115 nlemma eq_to_eqoct : ∀n1,n2.n1 = n2 → eq_oct n1 n2 = true.
120 ##[ ##1,10,19,28,37,46,55,64: #H; napply refl_eq
121 ##| ##*: #H; napply (oct_destruct … H)