]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/etc/csup/csups.etc
7f58794261c840d59fbc002d72b399c96f04fb40
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / etc / csup / csups.etc
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 notation "hvbox( ⦃ L1, break T1 ⦄ > * break ⦃ L2 , break T2 ⦄ )"
16    non associative with precedence 45
17    for @{ 'SupTermStar $L1 $T1 $L2 $T2 }.
18
19 include "basic_2/substitution/csup.ma".
20 include "basic_2/unfold/csupp.ma".
21
22 (* STAR-ITERATED SUPCLOSURE *************************************************)
23
24 definition csups: bi_relation lenv term ≝ bi_star … csup.
25
26 interpretation "star-iterated structural predecessor (closure)"
27    'SupTermStar L1 T1 L2 T2 = (csups L1 T1 L2 T2).
28
29 (* Basic eliminators ********************************************************)
30
31 lemma csups_ind: ∀L1,T1. ∀R:relation2 lenv term. R L1 T1 →
32                  (∀L,L2,T,T2. ⦃L1, T1⦄ >* ⦃L, T⦄ → ⦃L, T⦄ > ⦃L2, T2⦄ → R L T → R L2 T2) →
33                  ∀L2,T2. ⦃L1, T1⦄ >* ⦃L2, T2⦄ → R L2 T2.
34 #L1 #T1 #R #IH1 #IH2 #L2 #T2 #H
35 @(bi_star_ind … IH1 IH2 ? ? H)
36 qed-.
37
38 lemma csups_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. R L2 T2 →
39                     (∀L1,L,T1,T. ⦃L1, T1⦄ > ⦃L, T⦄ → ⦃L, T⦄ >* ⦃L2, T2⦄ → R L T → R L1 T1) →
40                     ∀L1,T1. ⦃L1, T1⦄ >* ⦃L2, T2⦄ → R L1 T1.
41 #L2 #T2 #R #IH1 #IH2 #L1 #T1 #H
42 @(bi_star_ind_dx … IH1 IH2 ? ? H)
43 qed-.
44
45 (* Basic properties *********************************************************)
46
47 lemma csups_refl: bi_reflexive … csups.
48 /2 width=1/ qed.
49
50 lemma csupp_csups: ∀L1,L2,T1,T2. ⦃L1, T1⦄ >+ ⦃L2, T2⦄ → ⦃L1, T1⦄ >* ⦃L2, T2⦄.
51 /2 width=1/ qed.
52
53 lemma csup_csups: ∀L1,L2,T1,T2. ⦃L1, T1⦄ > ⦃L2, T2⦄ → ⦃L1, T1⦄ >* ⦃L2, T2⦄.
54 /2 width=1/ qed.
55
56 lemma csups_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ >* ⦃L, T⦄ → ⦃L, T⦄ > ⦃L2, T2⦄ →
57                     ⦃L1, T1⦄ >* ⦃L2, T2⦄.
58 /2 width=4/ qed.
59
60 lemma csups_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ > ⦃L, T⦄ → ⦃L, T⦄ >* ⦃L2, T2⦄ →
61                     ⦃L1, T1⦄ >* ⦃L2, T2⦄.
62 /2 width=4/ qed.
63
64 lemma csups_csupp_csupp: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ >* ⦃L, T⦄ →
65                          ⦃L, T⦄ >+ ⦃L2, T2⦄ → ⦃L1, T1⦄ >+ ⦃L2, T2⦄.
66 /2 width=4/ qed.
67
68 lemma csupp_csups_csupp: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ >+ ⦃L, T⦄ →
69                           ⦃L, T⦄ >* ⦃L2, T2⦄ → ⦃L1, T1⦄ >+ ⦃L2, T2⦄.
70 /2 width=4/ qed.
71
72 (* Basic forward lemmas *****************************************************)
73
74 lemma csups_fwd_cw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ >* ⦃L2, T2⦄ → #{L2, T2} ≤ #{L1, T1}.
75 #L1 #L2 #T1 #T2 #H @(csups_ind … H) -L2 -T2 //
76 /4 width=3 by csup_fwd_cw, lt_to_le_to_lt, lt_to_le/ (**) (* slow even with trace *)
77 qed-.
78
79 (* Advanced inversion lemmas for csupp **************************************)
80
81 lemma csupp_inv_atom1_csups: ∀J,L1,L2,T2. ⦃L1, ⓪{J}⦄ >+ ⦃L2, T2⦄ →
82                              ∃∃I,K,V,i. ⇩[0, i] L1 ≡ K.ⓑ{I}V &
83                              ⦃K, V⦄ >* ⦃L2, T2⦄ & J = LRef i.
84 #J #L1 #L2 #T2 #H @(csupp_ind … H) -L2 -T2
85 [ #L2 #T2 #H
86   elim (csup_inv_atom1 … H) -H * #i #HL12 #H destruct /2 width=7/
87 | #L #T #L2 #T2 #_ #HT2 * #I #K #V #i #HLK #HVT #H destruct /3 width=8/
88 ]
89 qed-.
90
91 lemma csupp_inv_bind1_csups: ∀b,J,L1,L2,W,U,T2. ⦃L1, ⓑ{b,J}W.U⦄ >+ ⦃L2, T2⦄ →
92                              ⦃L1, W⦄ >* ⦃L2, T2⦄ ∨ ⦃L1.ⓑ{J}W, U⦄ >* ⦃L2, T2⦄.
93 #b #J #L1 #L2 #W #U #T2 #H @(csupp_ind … H) -L2 -T2
94 [ #L2 #T2 #H
95   elim (csup_inv_bind1 … H) -H * #H1 #H2 destruct /2 width=1/
96 | #L #T #L2 #T2 #_ #HT2 * /3 width=4/
97 ]
98 qed-.
99
100 lemma csupp_inv_flat1_csups: ∀J,L1,L2,W,U,T2. ⦃L1, ⓕ{J}W.U⦄ >+ ⦃L2, T2⦄ →
101                              ⦃L1, W⦄ >* ⦃L2, T2⦄ ∨ ⦃L1, U⦄ >* ⦃L2, T2⦄.
102 #J #L1 #L2 #W #U #T2 #H @(csupp_ind … H) -L2 -T2
103 [ #L2 #T2 #H
104   elim (csup_inv_flat1 … H) -H #H1 * #H2 destruct /2 width=1/
105 | #L #T #L2 #T2 #_ #HT2 * /3 width=4/
106 ]
107 qed-.