]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/syntax/prototerm_constructors.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / syntax / prototerm_constructors.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/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".
21
22 (* CONSTRUCTORS FOR PROTOTERM ***********************************************)
23
24 definition prototerm_node_0 (l): prototerm ≝
25            λp. l◗𝐞 = p.
26
27 definition prototerm_node_1 (l): prototerm → prototerm ≝
28            λt,p. ∃∃q. q ϵ t & l◗q = p.
29
30 definition prototerm_node_1_2 (l1) (l2): prototerm → prototerm ≝
31            λt,p. ∃∃q. q ϵ t & l1◗l2◗q = p.
32
33 definition prototerm_node_2 (l1) (l2): prototerm → prototerm → prototerm ≝
34            λt1,t2,p.
35            ∨∨ ∃∃q. q ϵ t1 & l1◗q = p
36             | ∃∃q. q ϵ t2 & l2◗q = p.
37
38 interpretation
39   "mark (prototerm)"
40   'MHook t = (prototerm_node_1 label_m t).
41
42 interpretation
43   "outer variable reference by depth (prototerm)"
44   'Hash k = (prototerm_node_0 (label_d k)).
45
46 interpretation
47   "inner variable reference by depth (prototerm)"
48   'Tau k t = (prototerm_node_1_2 (label_d k) label_m t).
49
50 interpretation
51   "name-free functional abstraction (prototerm)"
52   'Lamda t = (prototerm_node_1 label_L t).
53
54 interpretation
55   "application (prototerm)"
56   'At u t = (prototerm_node_2 label_S label_A u t).
57
58 (* Basic constructions *******************************************************)
59
60 lemma in_comp_iref (t) (q) (k):
61       q ϵ t → 𝗱k◗𝗺◗q ϵ 𝛕k.t.
62 /2 width=3 by ex2_intro/ qed.
63
64 (* Basic inversions *********************************************************)
65
66 lemma in_comp_inv_iref (t) (p) (k):
67       p ϵ 𝛕k.t →
68       ∃∃q. 𝗱k◗𝗺◗q = p & q ϵ t.
69 #t #p #k * #q #Hq #Hp
70 /2 width=3 by ex2_intro/
71 qed-.
72
73 (* COMMENT
74 lemma prototerm_in_root_inv_lcons_oref:
75       ∀p,l,n. l◗p ϵ ▵#n →
76       ∧∧ 𝗱n = l & 𝐞 = p.
77 #p #l #n * #q
78 <list_append_lcons_sn #H0 destruct -H0
79 elim (eq_inv_list_empty_append … e0) -e0 #H0 #_
80 /2 width=1 by conj/
81 qed-.
82
83 lemma prototerm_in_root_inv_lcons_iref:
84       ∀t,p,l,n. l◗p ϵ ▵𝛕n.t →
85       ∧∧ 𝗱n = l & p ϵ ▵ɱ.t.
86 #t #p #l #n * #q * #r #Hr
87 <list_append_lcons_sn #H0 destruct -H0
88 /4 width=4 by ex2_intro, ex_intro, conj/
89 qed-.
90
91 lemma prototerm_in_root_inv_lcons_mark:
92       ∀t,p,l. l◗p ϵ ▵ɱ.t →
93       ∧∧ 𝗺 = l & p ϵ ▵t.
94 #t #p #l * #q * #r #Hr
95 <list_append_lcons_sn #H0 destruct
96 /3 width=2 by ex_intro, conj/
97 qed-.
98
99 lemma prototerm_in_root_inv_lcons_abst:
100       ∀t,p,l. l◗p ϵ ▵𝛌.t →
101       ∧∧ 𝗟 = l & p ϵ ▵t.
102 #t #p #l * #q * #r #Hr
103 <list_append_lcons_sn #H0 destruct
104 /3 width=2 by ex_intro, conj/
105 qed-.
106
107 lemma prototerm_in_root_inv_lcons_appl:
108       ∀u,t,p,l. l◗p ϵ ▵@u.t →
109       ∨∨ ∧∧ 𝗦 = l & p ϵ ▵u
110        | ∧∧ 𝗔 = l & p ϵ ▵t.
111 #u #t #p #l * #q * * #r #Hr
112 <list_append_lcons_sn #H0 destruct
113 /4 width=2 by ex_intro, or_introl, or_intror, conj/
114 qed-.
115 *)