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: Ing. Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Sviluppo: 2008-2010 *)
21 (* ********************************************************************** *)
23 include "common/ascii.ma".
24 include "num/bool_lemmas.ma".
26 (* ************************** *)
27 (* DEFINIZIONE ASCII MINIMALE *)
28 (* ************************** *)
31 ndefinition ascii_destruct_aux ≝
32 Πc1,c2.ΠP:Prop.c1 = c2 →
33 match eq_ascii c1 c2 with [ true ⇒ P → P | false ⇒ P ].
35 nlemma ascii_destruct : ascii_destruct_aux.
44 nlemma eq_to_eqascii : ∀n1,n2.n1 = n2 → eq_ascii n1 n2 = true.
52 nlemma neqascii_to_neq : ∀n1,n2.eq_ascii n1 n2 = false → n1 ≠ n2.
54 napply (not_to_not (n1 = n2) (eq_ascii n1 n2 = true) …);
55 ##[ ##1: napply (eq_to_eqascii n1 n2)
56 ##| ##2: napply (eqfalse_to_neqtrue … H)
60 (* !!! per brevita... *)
61 naxiom eqascii_to_eq : ∀c1,c2.eq_ascii c1 c2 = true → c1 = c2.
63 nlemma neq_to_neqascii : ∀n1,n2.n1 ≠ n2 → eq_ascii n1 n2 = false.
65 napply (neqtrue_to_eqfalse (eq_ascii n1 n2));
66 napply (not_to_not (eq_ascii n1 n2 = true) (n1 = n2) ? H);
67 napply (eqascii_to_eq n1 n2).
70 nlemma decidable_ascii : ∀x,y:ascii.decidable (x = y).
72 napply (or2_elim (eq_ascii x y = true) (eq_ascii x y = false) ? (decidable_bexpr ?));
73 ##[ ##1: #H; napply (or2_intro1 (x = y) (x ≠ y) (eqascii_to_eq … H))
74 ##| ##2: #H; napply (or2_intro2 (x = y) (x ≠ y) (neqascii_to_neq … H))
78 nlemma symmetric_eqascii : symmetricT ascii bool eq_ascii.
80 napply (or2_elim (n1 = n2) (n1 ≠ n2) ? (decidable_ascii n1 n2));
81 ##[ ##1: #H; nrewrite > H; napply refl_eq
82 ##| ##2: #H; nrewrite > (neq_to_neqascii n1 n2 H);
83 napply (symmetric_eq ? (eq_ascii n2 n1) false);
84 napply (neq_to_neqascii n2 n1 (symmetric_neq ? n1 n2 H))