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/tau_3.ma".
20 include "delayed_updating/notation/functions/lamda_1.ma".
21 include "delayed_updating/notation/functions/at_2.ma".
23 (* CONSTRUCTORS FOR PROTOTERM ***********************************************)
25 definition prototerm_node_0 (l): prototerm ≝
28 definition prototerm_node_1 (l): prototerm → prototerm ≝
29 λt,p. ∃∃q. q ϵ t & l◗q = p.
31 definition prototerm_node_1_2 (l1) (l2): prototerm → prototerm ≝
32 λt,p. ∃∃q. q ϵ t & l1◗l2◗q = p.
34 definition prototerm_node_2 (l1) (l2): prototerm → prototerm → prototerm ≝
36 ∨∨ ∃∃q. q ϵ t1 & l1◗q = p
37 | ∃∃q. q ϵ t2 & l2◗q = p.
41 'MHook t = (prototerm_node_1 label_m t).
44 "outer variable reference by depth (prototerm)"
45 'Hash k = (prototerm_node_0 (label_d k)).
48 "inner variable reference by depth (prototerm)"
49 'Tau k t = (prototerm_node_1_2 (label_d k) label_m t).
52 "inner variable reference by depth with offset (prototerm)"
53 'Tau k d t = (prototerm_node_1_2 (label_d2 k d) label_m t).
56 "name-free functional abstraction (prototerm)"
57 'Lamda t = (prototerm_node_1 label_L t).
60 "application (prototerm)"
61 'At u t = (prototerm_node_2 label_S label_A u t).
63 (* Basic constructions *******************************************************)
65 lemma in_comp_iref (t) (q) (k):
66 q ϵ t → 𝗱k◗𝗺◗q ϵ 𝛕k.t.
67 /2 width=3 by ex2_intro/ qed.
69 lemma in_comp_iref2 (t) (q) (k) (d):
70 q ϵ t → 𝗱❨k,d❩◗𝗺◗q ϵ 𝛕❨k,d❩.t.
71 /2 width=3 by ex2_intro/ qed.
73 (* Basic inversions *********************************************************)
75 lemma in_comp_inv_iref (t) (p) (k):
77 ∃∃q. 𝗱k◗𝗺◗q = p & q ϵ t.
79 /2 width=3 by ex2_intro/
82 lemma in_comp_inv_iref2 (t) (p) (k) (d):
84 ∃∃q. 𝗱❨k,d❩◗𝗺◗q = p & q ϵ t.
85 #t #p #k #d * #q #Hq #Hp
86 /2 width=3 by ex2_intro/
90 lemma prototerm_in_root_inv_lcons_oref:
94 <list_append_lcons_sn #H0 destruct -H0
95 elim (eq_inv_list_empty_append … e0) -e0 #H0 #_
99 lemma prototerm_in_root_inv_lcons_iref:
100 ∀t,p,l,n. l◗p ϵ ▵𝛕n.t →
101 ∧∧ 𝗱n = l & p ϵ ▵ɱ.t.
102 #t #p #l #n * #q * #r #Hr
103 <list_append_lcons_sn #H0 destruct -H0
104 /4 width=4 by ex2_intro, ex_intro, conj/
107 lemma prototerm_in_root_inv_lcons_mark:
110 #t #p #l * #q * #r #Hr
111 <list_append_lcons_sn #H0 destruct
112 /3 width=2 by ex_intro, conj/
115 lemma prototerm_in_root_inv_lcons_abst:
118 #t #p #l * #q * #r #Hr
119 <list_append_lcons_sn #H0 destruct
120 /3 width=2 by ex_intro, conj/
123 lemma prototerm_in_root_inv_lcons_appl:
124 ∀u,t,p,l. l◗p ϵ ▵@u.t →
127 #u #t #p #l * #q * * #r #Hr
128 <list_append_lcons_sn #H0 destruct
129 /4 width=2 by ex_intro, or_introl, or_intror, conj/