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/syntax/prototerm.ma".
16 include "delayed_updating/notation/functions/m_hook_1.ma".
17 include "delayed_updating/notation/functions/hash_1.ma".
18 include "delayed_updating/notation/functions/tau_2.ma".
19 include "delayed_updating/notation/functions/lamda_1.ma".
20 include "delayed_updating/notation/functions/at_2.ma".
22 (* CONSTRUCTORS FOR PROTOTERM ***********************************************)
24 definition prototerm_node_0 (l): prototerm ≝
27 definition prototerm_node_1 (l): prototerm → prototerm ≝
28 λt,p. ∃∃q. q ϵ t & l◗q = p.
30 definition prototerm_node_1_2 (l1) (l2): prototerm → prototerm ≝
31 λt,p. ∃∃q. q ϵ t & l1◗l2◗q = p.
33 definition prototerm_node_2 (l1) (l2): prototerm → prototerm → prototerm ≝
35 ∨∨ ∃∃q. q ϵ t1 & l1◗q = p
36 | ∃∃q. q ϵ t2 & l2◗q = p.
40 'MHook t = (prototerm_node_1 label_m t).
43 "outer variable reference by depth (prototerm)"
44 'Hash n = (prototerm_node_0 (label_d n)).
47 "inner variable reference by depth (prototerm)"
48 'Tau n t = (prototerm_node_1_2 (label_d n) label_m t).
51 "name-free functional abstraction (prototerm)"
52 'Lamda t = (prototerm_node_1 label_L t).
55 "application (prototerm)"
56 'At u t = (prototerm_node_2 label_S label_A u t).
58 (* Basic constructions *******************************************************)
60 lemma in_comp_iref (t) (q) (n):
61 q ϵ t → 𝗱n◗𝗺◗q ϵ 𝛕n.t.
62 /2 width=3 by ex2_intro/ qed.
64 (* Basic inversions *********************************************************)
66 lemma in_comp_inv_iref (t) (p) (n):
68 ∃∃q. 𝗱n◗𝗺◗q = p & q ϵ t.
70 /2 width=3 by ex2_intro/
73 lemma prototerm_in_root_inv_lcons_oref:
77 <list_append_lcons_sn #H0 destruct -H0
78 elim (eq_inv_list_empty_append … e0) -e0 #H0 #_
82 lemma prototerm_in_root_inv_lcons_iref:
83 ∀t,p,l,n. l◗p ϵ ▵𝛕n.t →
85 #t #p #l #n * #q * #r #Hr
86 <list_append_lcons_sn #H0 destruct -H0
87 /4 width=4 by ex2_intro, ex_intro, conj/
90 lemma prototerm_in_root_inv_lcons_mark:
93 #t #p #l * #q * #r #Hr
94 <list_append_lcons_sn #H0 destruct
95 /3 width=2 by ex_intro, conj/
98 lemma prototerm_in_root_inv_lcons_abst:
101 #t #p #l * #q * #r #Hr
102 <list_append_lcons_sn #H0 destruct
103 /3 width=2 by ex_intro, conj/
106 lemma prototerm_in_root_inv_lcons_appl:
107 ∀u,t,p,l. l◗p ϵ ▵@u.t →
110 #u #t #p #l * #q * * #r #Hr
111 <list_append_lcons_sn #H0 destruct
112 /4 width=2 by ex_intro, or_introl, or_intror, conj/