]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/lib/lambda/subterms/subterms.ma
c4ec383b5765c6d7b2a98c007fa3533c9f2a99c7
[helm.git] / matita / matita / lib / lambda / subterms / subterms.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 "lambda/background/preamble.ma".
16
17 (* SUBSETS OF SUBTERMS ******************************************************)
18
19 (* Policy: boolean marks metavariables: b,c
20            subterms metavariables: F,G,T,U,V,W
21 *)
22 (* Note: each subterm is marked with true if it belongs to the subset *)
23 inductive subterms: Type[0] ≝
24 | SVRef: bool → nat  → subterms
25 | SAbst: bool → subterms → subterms
26 | SAppl: bool → subterms → subterms → subterms
27 .
28
29 interpretation "subterms construction (variable reference by index)"
30    'VariableReferenceByIndex b i = (SVRef b i).
31
32 interpretation "subterms construction (abstraction)"
33    'Abstraction b T = (SAbst b T).
34
35 interpretation "subterms construction (application)"
36    'Application b V T = (SAppl b V T).
37
38 (*
39 definition compatible_abst: predicate (relation term) ≝ λR.
40                             ∀A1,A2. R A1 A2 → R (𝛌.A1) (𝛌.A2).
41
42 definition compatible_sn: predicate (relation term) ≝ λR.
43                           ∀A,B1,B2. R B1 B2 → R (@B1.A) (@B2.A).
44
45 definition compatible_dx: predicate (relation term) ≝ λR.
46                           ∀B,A1,A2. R A1 A2 → R (@B.A1) (@B.A2).
47
48 definition compatible_appl: predicate (relation term) ≝ λR.
49                             ∀B1,B2. R B1 B2 → ∀A1,A2. R A1 A2 →
50                             R (@B1.A1) (@B2.A2).
51
52 lemma star_compatible_abst: ∀R. compatible_abst R → compatible_abst (star … R).
53 #R #HR #A1 #A2 #H elim H -A2 // /3 width=3/
54 qed.
55
56 lemma star_compatible_sn: ∀R. compatible_sn R → compatible_sn (star … R).
57 #R #HR #A #B1 #B2 #H elim H -B2 // /3 width=3/
58 qed.
59
60 lemma star_compatible_dx: ∀R. compatible_dx R → compatible_dx (star … R).
61 #R #HR #B #A1 #A2 #H elim H -A2 // /3 width=3/
62 qed.
63
64 lemma star_compatible_appl: ∀R. reflexive ? R →
65                             compatible_appl R → compatible_appl (star … R).
66 #R #H1R #H2R #B1 #B2 #H elim H -B2 /3 width=1/ /3 width=5/
67 qed.
68 *)