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 *)
19 (* Cosimo Oliboni, oliboni@cs.unibo.it *)
21 (* Questo materiale fa parte della tesi: *)
22 (* "Formalizzazione Interattiva dei Microcontroller a 8bit FreeScale" *)
24 (* data ultima modifica 15/11/2007 *)
25 (* ********************************************************************** *)
27 include "freescale/bool_lemmas.ma".
28 include "freescale/nat.ma".
34 nlemma nat_destruct : ∀n1,n2:nat.S n1 = S n2 → n1 = n2.
36 nchange with (match S n2 with [ O ⇒ False | S a ⇒ n1 = a ]);
42 nlemma nat_destruct_0_S : ∀n:nat.O = S n → False.
44 nchange with (match S n with [ O ⇒ True | S a ⇒ False ]);
50 nlemma nat_destruct_S_0 : ∀n:nat.S n = O → False.
52 nchange with (match S n with [ O ⇒ True | S a ⇒ False ]);
58 nlemma bsymmetric_eqnat : boolSymmetric nat eq_nat.
65 ##[ ##1: napply (refl_eq ??)
66 ##| ##2: #n3; #H; napply (refl_eq ??)
68 ##| ##2: #n2; #H; #n3;
72 ##[ ##1: napply (refl_eq ??)
73 ##| ##2: #n4; napply (H n4)
78 nlemma eq_to_eqnat : ∀n1,n2:nat.n1 = n2 → eq_nat n1 n2 = true.
84 ##[ ##1: #H; napply (refl_eq ??)
85 ##| ##2: #n3; #H; #H1; nelim (nat_destruct_0_S ? H1)
87 ##| ##2: #n2; #H; #n3; #H1;
88 ncases n3 in H1:(%) ⊢ %;
90 ##[ ##1: #H1; nelim (nat_destruct_S_0 ? H1)
92 napply (H n4 (nat_destruct ?? H1))
97 nlemma eqnat_to_eq : ∀n1,n2:nat.(eq_nat n1 n2 = true → n1 = n2).
103 ##[ ##1: #H; napply (refl_eq ??)
104 ##| ##2: #n3; #H; #H1; nelim (bool_destruct_false_true H1)
106 ##| ##2: #n2; #H; #n3; #H1;
107 ncases n3 in H1:(%) ⊢ %;
109 ##[ ##1: #H1; nelim (bool_destruct_false_true H1)
111 nrewrite > (H n4 H1);