]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/relocation/fsup.ma
- we are committing just the components before "reducibility"
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / fsup.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 "basic_2/relocation/ldrop.ma".
16
17 (* SUPCLOSURE ***************************************************************)
18
19 inductive fsup: bi_relation lenv term ≝
20 | fsup_lref   : ∀I,L,V. fsup (L.ⓑ{I}V) (#0) L V
21 | fsup_bind_sn: ∀a,I,L,V,T. fsup L (ⓑ{a,I}V.T) L V
22 | fsup_bind_dx: ∀a,I,L,V,T. fsup L (ⓑ{a,I}V.T) (L.ⓑ{I}V) T
23 | fsup_flat_sn: ∀I,L,V,T.   fsup L (ⓕ{I}V.T) L V
24 | fsup_flat_dx: ∀I,L,V,T.   fsup L (ⓕ{I}V.T) L T
25 | fsup_ldrop  : ∀L1,K1,K2,T1,T2,U1,d,e.
26                 ⇩[d, e] L1 ≡ K1 → ⇧[d, e] T1 ≡ U1 →
27                 fsup K1 T1 K2 T2 → fsup L1 U1 K2 T2
28 .
29
30 interpretation
31    "structural successor (closure)"
32    'SupTerm L1 T1 L2 T2 = (fsup L1 T1 L2 T2).
33
34 (* Basic properties *********************************************************)
35
36 lemma fsup_lref_S_lt: ∀I,L,K,V,T,i. 0 < i → ⦃L, #(i-1)⦄ ⊃ ⦃K, T⦄ → ⦃L.ⓑ{I}V, #i⦄ ⊃ ⦃K, T⦄.
37 /3 width=7/ qed.
38
39 lemma fsup_lref: ∀I,K,V,i,L. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃L, #i⦄ ⊃ ⦃K, V⦄.
40 #I #K #V #i @(nat_elim1 i) -i #i #IH #L #H
41 elim (ldrop_inv_O1_pair2 … H) -H *
42 [ #H1 #H2 destruct //
43 | #I1 #K1 #V1 #HK1 #H #Hi destruct
44   lapply (IH … HK1) /2 width=1/
45 ]
46 qed.
47
48 (* Basic forward lemmas *****************************************************)
49
50 lemma fsup_fwd_cw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ♯{L2, T2} < ♯{L1, T1}.
51 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 //
52 #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12
53 lapply (ldrop_fwd_lw … HLK1) -HLK1 #HLK1
54 lapply (lift_fwd_tw … HTU1) -HTU1 #HTU1
55 @(lt_to_le_to_lt … IHT12) -IHT12 /2 width=1/
56 qed-.
57
58 fact fsup_fwd_length_lref1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀i. T1 = #i → |L2| < |L1|.
59 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2
60 [ 6: #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #i #H destruct
61      lapply (ldrop_fwd_length … HLK1) -HLK1 #HLK1
62      elim (lift_inv_lref2 … HTU1) -HTU1 * #Hdei #H destruct
63      @(lt_to_le_to_lt … HLK1) /2 width=2/
64 | normalize // |2,3: #a
65 ] #I #L #V #T #j #H destruct
66 qed-.
67
68 lemma fsup_fwd_length_lref1: ∀L1,L2,T2,i. ⦃L1, #i⦄ ⊃ ⦃L2, T2⦄ → |L2| < |L1|.
69 /2 width=5 by fsup_fwd_length_lref1_aux/
70 qed-.