]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind_gen.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / unwind / unwind_gen.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 "delayed_updating/syntax/path.ma".
16 include "delayed_updating/notation/functions/black_diamond_2.ma".
17 include "ground/relocation/tr_pap.ma".
18
19 (* GENERIC UNWIND FOR PATH **************************************************)
20
21 rec definition unwind_gen (f) (p) on p ā‰
22 match p with
23 [ list_empty     ā‡’ šž
24 | list_lcons l q ā‡’
25   match l with
26   [ label_d n ā‡’
27     match q with
28     [ list_empty     ā‡’ š—±((f n)ļ¼ ā§£āØnā©)ā——(unwind_gen f q)
29     | list_lcons _ _ ā‡’ unwind_gen f q
30     ]
31   | label_m   ā‡’ unwind_gen f q
32   | label_L   ā‡’ lā——(unwind_gen f q)
33   | label_A   ā‡’ lā——(unwind_gen f q)
34   | label_S   ā‡’ lā——(unwind_gen f q)
35   ]
36 ].
37
38 interpretation
39   "generic unwind (path)"
40   'BlackDiamond f p = (unwind_gen f p).
41
42 (* Basic constructions ******************************************************)
43
44 lemma unwind_gen_empty (f):
45       (šž) = ā—†[f]šž.
46 // qed.
47
48 lemma unwind_gen_d_empty (f) (n):
49       š—±((f n)ļ¼ ā§£āØnā©)ā——šž = ā—†[f](š—±nā——šž).
50 // qed.
51
52 lemma unwind_gen_d_lcons (f) (p) (l) (n):
53       ā—†[f](lā——p) = ā—†[f](š—±nā——lā——p).
54 // qed.
55
56 lemma unwind_gen_m_sn (f) (p):
57       ā—†[f]p = ā—†[f](š—ŗā——p).
58 // qed.
59
60 lemma unwind_gen_L_sn (f) (p):
61       (š—Ÿā——ā—†[f]p) = ā—†[f](š—Ÿā——p).
62 // qed.
63
64 lemma unwind_gen_A_sn (f) (p):
65       (š—”ā——ā—†[f]p) = ā—†[f](š—”ā——p).
66 // qed.
67
68 lemma unwind_gen_S_sn (f) (p):
69       (š—¦ā——ā—†[f]p) = ā—†[f](š—¦ā——p).
70 // qed.
71
72 (* Advanced eliminations with path ******************************************)
73
74 lemma path_ind_unwind (Q:predicate ā€¦):
75       Q (šž) ā†’
76       (āˆ€n. Q (šž) ā†’ Q (š—±nā——šž)) ā†’
77       (āˆ€n,l,p. Q (lā——p) ā†’ Q (š—±nā——lā——p)) ā†’
78       (āˆ€p. Q p ā†’ Q (š—ŗā——p)) ā†’
79       (āˆ€p. Q p ā†’ Q (š—Ÿā——p)) ā†’
80       (āˆ€p. Q p ā†’ Q (š—”ā——p)) ā†’
81       (āˆ€p. Q p ā†’ Q (š—¦ā——p)) ā†’
82       āˆ€p. Q p.
83 #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #p
84 elim p -p [| * [ #n * ] ]
85 /2 width=1 by/
86 qed-.