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 "ground/arith/nat_plus.ma".
16 include "delayed_updating/syntax/path.ma".
17 include "delayed_updating/notation/functions/sharp_1.ma".
19 (* HEIGHT FOR PATH **********************************************************)
21 rec definition height (p) on p: nat ≝
26 [ label_d n ⇒ n + height q
36 'Sharp p = (height p).
38 (* Basic constructions ******************************************************)
40 lemma height_empty: 𝟎 = ♯𝐞.
43 lemma height_d_sn (q) (n): ninj n+♯q = ♯(𝗱n◗q).
46 lemma height_m_sn (q): ♯q = ♯(𝗺◗q).
49 lemma height_L_sn (q): ♯q = ♯(𝗟◗q).
52 lemma height_A_sn (q): ♯q = ♯(𝗔◗q).
55 lemma height_S_sn (q): ♯q = ♯(𝗦◗q).
58 (* Main constructions *******************************************************)
60 theorem height_append (p1) (p2):
63 * [ #n ] #p1 #IH #p2 <list_append_lcons_sn
64 [ <height_d_sn <height_d_sn //
65 | <height_m_sn <height_m_sn //
66 | <height_L_sn <height_L_sn //
67 | <height_A_sn <height_A_sn //
68 | <height_S_sn <height_S_sn //
72 (* Constructions with list_rcons ********************************************)
74 lemma height_d_dx (p) (n):
75 (♯p)+(ninj n) = ♯(p◖𝗱n).
78 lemma height_m_dx (p):
82 lemma height_L_dx (p):
86 lemma height_A_dx (p):
90 lemma height_S_dx (p):