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 "lambda/background/preamble.ma".
17 include "lambda/notation/functions/variablereferencebyindex_2.ma".
18 include "lambda/notation/functions/abstraction_2.ma".
19 include "lambda/notation/functions/application_3.ma".
21 (* SUBSETS OF SUBTERMS ******************************************************)
23 (* Policy: boolean marks metavariables: b,c
24 subterms metavariables: F,G,T,U,V,W
26 (* Note: each subterm is marked with true if it belongs to the subset *)
27 inductive subterms: Type[0] ≝
28 | SVRef: bool → nat → subterms
29 | SAbst: bool → subterms → subterms
30 | SAppl: bool → subterms → subterms → subterms
33 interpretation "subterms construction (variable reference by index)"
34 'VariableReferenceByIndex b i = (SVRef b i).
36 interpretation "subterms construction (abstraction)"
37 'Abstraction b T = (SAbst b T).
39 interpretation "subterms construction (application)"
40 'Application b V T = (SAppl b V T).
43 definition compatible_abst: predicate (relation term) ≝ λR.
44 ∀A1,A2. R A1 A2 → R (𝛌.A1) (𝛌.A2).
46 definition compatible_sn: predicate (relation term) ≝ λR.
47 ∀A,B1,B2. R B1 B2 → R (@B1.A) (@B2.A).
49 definition compatible_dx: predicate (relation term) ≝ λR.
50 ∀B,A1,A2. R A1 A2 → R (@B.A1) (@B.A2).
52 definition compatible_appl: predicate (relation term) ≝ λR.
53 ∀B1,B2. R B1 B2 → ∀A1,A2. R A1 A2 →
56 lemma star_compatible_abst: ∀R. compatible_abst R → compatible_abst (star … R).
57 #R #HR #A1 #A2 #H elim H -A2 // /3 width=3/
60 lemma star_compatible_sn: ∀R. compatible_sn R → compatible_sn (star … R).
61 #R #HR #A #B1 #B2 #H elim H -B2 // /3 width=3/
64 lemma star_compatible_dx: ∀R. compatible_dx R → compatible_dx (star … R).
65 #R #HR #B #A1 #A2 #H elim H -A2 // /3 width=3/
68 lemma star_compatible_appl: ∀R. reflexive ? R →
69 compatible_appl R → compatible_appl (star … R).
70 #R #H1R #H2R #B1 #B2 #H elim H -B2 /3 width=1/ /3 width=5/