]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_depth.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / syntax / path_depth.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/flat_1.ma".
17 include "ground/arith/nat_plus.ma".
18
19 (* DEPTH FOR PATH ***********************************************************)
20
21 rec definition depth (p) on p: nat ≝
22 match p with
23 [ list_empty     ⇒ 𝟎
24 | list_lcons l q ⇒
25   match l with
26   [ label_d k ⇒ depth q
27   | label_m   ⇒ depth q
28   | label_L   ⇒ ↑(depth q)
29   | label_A   ⇒ depth q
30   | label_S   ⇒ depth q
31   ]
32 ].
33
34 interpretation
35   "depth (path)"
36   'Flat p = (depth p).
37
38 (* Basic constructions ******************************************************)
39
40 lemma depth_empty: 𝟎 = ♭𝐞.
41 // qed.
42
43 lemma depth_d_dx (p) (k):
44       ♭p = ♭(p◖𝗱k).
45 // qed.
46
47 lemma depth_m_dx (p):
48       ♭p = ♭(p◖𝗺).
49 // qed.
50
51 lemma depth_L_dx (p):
52       ↑♭p = ♭(p◖𝗟).
53 // qed.
54
55 lemma depth_A_dx (p):
56       ♭p = ♭(p◖𝗔).
57 // qed.
58
59 lemma depth_S_dx (p):
60       ♭p = ♭(p◖𝗦).
61 // qed.
62
63 (* Main constructions *******************************************************)
64
65 theorem depth_append (p) (q):
66         (♭p)+(♭q) = ♭(p●q).
67 #p #q elim q -q //
68 * [ #k ] #q #IH <list_append_lcons_sn
69 [ <depth_d_dx <depth_d_dx //
70 | <depth_m_dx <depth_m_dx //
71 | <depth_L_dx <depth_L_dx //
72 | <depth_A_dx <depth_A_dx //
73 | <depth_S_dx <depth_S_dx //
74 ]
75 qed.
76
77 (* Constructions with path_lcons ********************************************)
78
79 lemma depth_d_sn (p) (k):
80       ♭p = ♭(𝗱k◗p).
81 // qed.
82
83 lemma depth_m_sn (p):
84       ♭p = ♭(𝗺◗p).
85 // qed.
86
87 lemma depth_L_sn (p):
88       ↑♭p = ♭(𝗟◗p).
89 // qed.
90
91 lemma depth_A_sn (p):
92       ♭p = ♭(𝗔◗p).
93 // qed.
94
95 lemma depth_S_sn (p):
96       ♭p = ♭(𝗦◗p).
97 // qed.