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 include "delayed_updating/substitution/lift_length.ma".
16 include "delayed_updating/notation/functions/black_downtriangle_1.ma".
17 include "ground/relocation/tr_uni.ma".
19 (* BASIC UNWIND FOR PATH ****************************************************)
21 rec definition unwind1_path_pnat (n) (p) on n ā
31 [ list_empty ā lā(unwind1_path_pnat m q)
32 | list_lcons _ _ ā unwind1_path_pnat m (ā[š®āØnā©]q)
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)
42 definition unwind1_path (p) ā
43 unwind1_path_pnat (āāpā) p.
47 'BlackDownTriangle p = (unwind1_path p).
49 (* Basic constructions ******************************************************)
51 lemma unwind1_path_unfold (p):
52 unwind1_path_pnat (āāpā) p = ā¼p.
55 lemma unwind1_path_empty:
59 lemma unwind1_path_d_empty (n):
60 (š±nāš) = ā¼(š±nāš).
63 lemma unwind1_path_d_lcons (p) (l) (n:pnat):
64 ā¼(ā[š®āØnā©](lāp)) = ā¼(š±nālāp).
66 <unwind1_path_unfold <lift_path_length //
69 lemma unwind1_path_m_sn (p):
73 lemma unwind1_path_L_sn (p):
74 (šāā¼p) = ā¼(šāp).
77 lemma unwind1_path_A_sn (p):
78 (šāā¼p) = ā¼(šāp).
81 lemma unwind1_path_S_sn (p):
82 (š¦āā¼p) = ā¼(š¦āp).
85 (* Main constructions *******************************************************)
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 //
92 [ #H0 elim (eq_inv_nsucc_zero ā¦ 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 //
106 theorem unwind1_path_fix (p):
108 /2 width=2 by unwind1_path_fix_aux/ qed.