]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/unwind0/unwind1_path.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / unwind0 / unwind1_path.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/substitution/lift_length.ma".
16 include "delayed_updating/notation/functions/black_downtriangle_1.ma".
17 include "ground/relocation/tr_uni.ma".
18
19 (* BASIC UNWIND FOR PATH ****************************************************)
20
21 rec definition unwind1_path_pnat (n) (p) on n ā‰
22 match n with
23 [ punit   ā‡’ p
24 | psucc m ā‡’
25   match p with
26   [ list_empty     ā‡’ šž
27   | list_lcons l q ā‡’
28     match l with
29     [ label_d n ā‡’
30       match q with
31       [ list_empty     ā‡’ lā——(unwind1_path_pnat m q)
32       | list_lcons _ _ ā‡’ unwind1_path_pnat m (ā†‘[š®āØnā©]q)
33       ]
34     | label_m   ā‡’ unwind1_path_pnat m q
35     | label_L   ā‡’ š—Ÿā——(unwind1_path_pnat m q)
36     | label_A   ā‡’ š—”ā——(unwind1_path_pnat m q)
37     | label_S   ā‡’ š—¦ā——(unwind1_path_pnat m q)
38     ]
39   ]
40 ].
41
42 definition unwind1_path (p) ā‰
43            unwind1_path_pnat (ā†‘ā˜pā˜) p.
44
45 interpretation
46   "basic unwind (path)"
47   'BlackDownTriangle p = (unwind1_path p).
48
49 (* Basic constructions ******************************************************)
50
51 lemma unwind1_path_unfold (p):
52       unwind1_path_pnat (ā†‘ā˜pā˜) p = ā–¼p.
53 // qed-.
54
55 lemma unwind1_path_empty:
56       (šž) = ā–¼šž.
57 // qed.
58
59 lemma unwind1_path_d_empty (n):
60       (š—±nā——šž) = ā–¼(š—±nā——šž).
61 // qed.
62
63 lemma unwind1_path_d_lcons (p) (l) (n:pnat):
64       ā–¼(ā†‘[š®āØnā©](lā——p)) = ā–¼(š—±nā——lā——p).
65 #p #l #n
66 <unwind1_path_unfold <lift_path_length //
67 qed.
68
69 lemma unwind1_path_m_sn (p):
70       ā–¼p = ā–¼(š—ŗā——p).
71 // qed.
72
73 lemma unwind1_path_L_sn (p):
74       (š—Ÿā——ā–¼p) = ā–¼(š—Ÿā——p).
75 // qed.
76
77 lemma unwind1_path_A_sn (p):
78       (š—”ā——ā–¼p) = ā–¼(š—”ā——p).
79 // qed.
80
81 lemma unwind1_path_S_sn (p):
82       (š—¦ā——ā–¼p) = ā–¼(š—¦ā——p).
83 // qed.
84
85 (* Main constructions *******************************************************)
86
87 fact unwind1_path_fix_aux (k) (p):
88      k = ā˜pā˜ ā†’ ā–¼p = ā–¼ā–¼p.
89 #k @(nat_ind_succ ā€¦ k) -k
90 [ #p #H0 >(list_length_inv_zero_sn ā€¦ H0) -p //
91 | #k #IH *
92   [ #H0 elim (eq_inv_nsucc_zero ā€¦ H0)
93   | * [ #n ] #p #H0
94     lapply (eq_inv_nsucc_bi ā€¦ H0) -H0
95     [ cases p -p [ -IH | #l #p ] #H0 destruct //
96       <unwind1_path_d_lcons <IH -IH //
97     | #H0 destruct <unwind1_path_m_sn <IH -IH //
98     | #H0 destruct <unwind1_path_L_sn <unwind1_path_L_sn <IH -IH //
99     | #H0 destruct <unwind1_path_A_sn <unwind1_path_A_sn <IH -IH //
100     | #H0 destruct <unwind1_path_S_sn <unwind1_path_S_sn <IH -IH //
101     ]
102   ]
103 ]
104 qed-.
105
106 theorem unwind1_path_fix (p):
107         ā–¼p = ā–¼ā–¼p.
108 /2 width=2 by unwind1_path_fix_aux/ qed.