]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/relocation/lex_tc.ma
partial commit in static_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / relocation / lex_tc.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 "static_2/syntax/ext2_tc.ma".
16 include "static_2/relocation/sex_tc.ma".
17 include "static_2/relocation/lex.ma".
18
19 alias symbol "subseteq" = "relation inclusion".
20
21 (* GENERIC EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS **************)
22
23 (* Inversion lemmas with transitive closure *********************************)
24
25 (* Basic_2A1: was: lpx_sn_LTC_TC_lpx_sn *)
26 lemma lex_inv_CTC (R): c_reflexive … R →
27                        lex (CTC … R) ⊆ TC … (lex R).
28 #R #HR #L1 #L2 *
29 /5 width=11 by sex_inv_tc_dx, sex_co, ext2_inv_tc, ext2_refl, monotonic_TC, ex2_intro/
30 qed-.
31
32 lemma s_rs_transitive_lex_inv_isid (R): s_rs_transitive … R (λ_.lex R) →
33                                         s_rs_transitive_isid cfull (cext2 R).
34 #R #HR #f #Hf #L2 #T1 #T2 #H #L1 #HL12
35 elim (ext2_tc … H) -H
36 [ /3 width=1 by ext2_inv_tc, ext2_unit/
37 | #I #V1 #V2 #HV12
38   @ext2_inv_tc @ext2_pair
39   @(HR … HV12) -HV12 /2 width=3 by ex2_intro/ (**) (* auto fails *)
40 ]
41 qed-.
42
43 (* Properties with transitive closure ***************************************)
44
45 (* Basic_2A1: was: TC_lpx_sn_inv_lpx_sn_LTC *)
46 lemma lex_CTC (R): s_rs_transitive … R (λ_. lex R) →
47                    TC … (lex R) ⊆ lex (CTC … R).
48 #R #HR #L1 #L2 #HL12
49 lapply (monotonic_TC … (sex cfull (cext2 R) 𝐢) … HL12) -HL12
50 [ #L1 #L2 * /3 width=3 by sex_eq_repl_fwd, pr_isi_inv_eq_id/
51 | /5 width=9 by s_rs_transitive_lex_inv_isid, sex_tc_dx, sex_co, ext2_tc, ex2_intro/
52 ]
53 qed-.
54
55 lemma lex_CTC_inj (R): s_rs_transitive … R (λ_. lex R) →
56                        (lex R) ⊆ lex (CTC … R).
57 /3 width=1 by lex_CTC, inj/ qed-.
58
59 lemma lex_CTC_step_dx (R): c_reflexive … R → s_rs_transitive … R (λ_. lex R) →
60                            ∀L1,L. lex (CTC … R) L1 L →
61                            ∀L2. lex R L L2 → lex (CTC … R) L1 L2.
62 /4 width=3 by lex_CTC, lex_inv_CTC, step/ qed-.
63
64 lemma lex_CTC_step_sn (R): c_reflexive … R → s_rs_transitive … R (λ_. lex R) →
65                            ∀L1,L. lex R L1 L →
66                            ∀L2. lex (CTC … R) L L2 → lex (CTC … R) L1 L2.
67 /4 width=3 by lex_CTC, lex_inv_CTC, TC_strap/ qed-.
68
69 (* Eliminators with transitive closure **************************************)
70
71 lemma lex_CTC_ind_sn (R) (L2): c_reflexive … R → s_rs_transitive … R (λ_. lex R) →
72                                ∀Q:predicate lenv. Q L2 →
73                                (∀L1,L. L1 ⪤[R] L → L ⪤[CTC … R] L2 → Q L → Q L1) →
74                                ∀L1. L1 ⪤[CTC … R] L2 → Q L1.
75 #R #L2 #H1R #H2R #Q #IH1 #IH2 #L1 #H
76 lapply (lex_inv_CTC … H1R … H) -H #H
77 @(TC_star_ind_dx ???????? H) -H
78 /3 width=4 by lex_CTC, lex_refl/
79 qed-.
80
81 lemma lex_CTC_ind_dx (R) (L1): c_reflexive … R → s_rs_transitive … R (λ_. lex R) →
82                                ∀Q:predicate lenv. Q L1 →
83                                (∀L,L2. L1 ⪤[CTC … R] L → L ⪤[R] L2 → Q L → Q L2) →
84                                ∀L2. L1 ⪤[CTC … R] L2 → Q L2.
85 #R #L1 #H1R #H2R #Q #IH1 #IH2 #L2 #H
86 lapply (lex_inv_CTC … H1R … H) -H #H
87 @(TC_star_ind ???????? H) -H
88 /3 width=4 by lex_CTC, lex_refl/
89 qed-.