]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/relocation/fsupq.ma
partial commit: just the components before "static" ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / fsupq.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/notation/relations/suptermopt_6.ma".
16 include "basic_2/relocation/fsup.ma".
17
18 (* OPTIONAL SUPCLOSURE ******************************************************)
19
20 (* activate genv *)
21 inductive fsupq: tri_relation genv lenv term ≝
22 | fsupq_refl   : ∀G,L,T. fsupq G L T G L T
23 | fsupq_lref_O : ∀I,G,L,V. fsupq G (L.ⓑ{I}V) (#0) G L V
24 | fsupq_pair_sn: ∀I,G,L,V,T. fsupq G L (②{I}V.T) G L V
25 | fsupq_bind_dx: ∀a,I,G,L,V,T. fsupq G L (ⓑ{a,I}V.T) G (L.ⓑ{I}V) T
26 | fsupq_flat_dx: ∀I,G, L,V,T. fsupq G L (ⓕ{I}V.T) G L T
27 | fsupq_ldrop  : ∀G1,G2,L1,K1,K2,T1,T2,U1,d,e.
28                  ⇩[d, e] L1 ≡ K1 → ⇧[d, e] T1 ≡ U1 →
29                  fsupq G1 K1 T1 G2 K2 T2 → fsupq G1 L1 U1 G2 K2 T2
30 .
31
32 interpretation
33    "optional structural successor (closure)"
34    'SupTermOpt G1 L1 T1 G2 L2 T2 = (fsupq G1 L1 T1 G2 L2 T2).
35
36 (* Basic properties *********************************************************)
37
38 lemma fsup_fsupq: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄.
39 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 // /2 width=7/ qed.
40
41 (* Basic properties *********************************************************)
42
43 lemma fsupq_lref_S_lt: ∀I,G1,G2,L,K,V,T,i.
44                        0 < i → ⦃G1, L, #(i-1)⦄ ⊃⸮ ⦃G2, K, T⦄ → ⦃G1, L.ⓑ{I}V, #i⦄ ⊃⸮ ⦃G2, K, T⦄.
45 /3 width=7/ qed.
46
47 lemma fsupq_lref: ∀I,G,K,V,i,L. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃G, L, #i⦄ ⊃⸮ ⦃G, K, V⦄.
48 /3 width=2/ qed.
49
50 (* Basic forward lemmas *****************************************************)
51
52 lemma fsupq_fwd_fw: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → ♯{G2, L2, T2} ≤ ♯{G1, L1, T1}.
53 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 // [1,2,3: /2 width=1/ ]
54 #G1 #G2 #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12
55 lapply (ldrop_fwd_lw … HLK1) -HLK1 #HLK1
56 lapply (lift_fwd_tw … HTU1) -HTU1 #HTU1
57 @(transitive_le … IHT12) -IHT12 /2 width=1/
58 qed-.
59
60 fact fsupq_fwd_length_lref1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
61                                  ∀i. T1 = #i → |L2| ≤ |L1|.
62 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 //
63 [ #a #I #G #L #V #T #j #H destruct
64 | #G1 #G2 #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #i #H destruct
65   lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 #HLK1
66   elim (lift_inv_lref2 … HTU1) -HTU1 * #Hdei #H destruct
67   @(transitive_le … HLK1) /2 width=2/
68 ]
69 qed-.
70
71 lemma fsupq_fwd_length_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊃⸮ ⦃G2, L2, T2⦄ → |L2| ≤ |L1|.
72 /2 width=7 by fsupq_fwd_length_lref1_aux/
73 qed-.