1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/notation/relations/suptermopt_4.ma".
16 include "basic_2/relocation/fsup.ma".
18 (* OPTIONAL SUPCLOSURE ******************************************************)
20 inductive fsupq: bi_relation lenv term ≝
21 | fsupq_refl : ∀L,T. fsupq L T L T
22 | fsupq_lref_O : ∀I,L,V. fsupq (L.ⓑ{I}V) (#0) L V
23 | fsupq_pair_sn: ∀I,L,V,T. fsupq L (②{I}V.T) L V
24 | fsupq_bind_dx: ∀a,I,L,V,T. fsupq L (ⓑ{a,I}V.T) (L.ⓑ{I}V) T
25 | fsupq_flat_dx: ∀I,L,V,T. fsupq L (ⓕ{I}V.T) L T
26 | fsupq_ldrop : ∀L1,K1,K2,T1,T2,U1,d,e.
27 ⇩[d, e] L1 ≡ K1 → ⇧[d, e] T1 ≡ U1 →
28 fsupq K1 T1 K2 T2 → fsupq L1 U1 K2 T2
32 "optional structural successor (closure)"
33 'SupTermOpt L1 T1 L2 T2 = (fsupq L1 T1 L2 T2).
35 (* Basic properties *********************************************************)
37 lemma fsup_fsupq: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄.
38 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 // /2 width=7/ qed.
40 (* Basic properties *********************************************************)
42 lemma fsupq_lref_S_lt: ∀I,L,K,V,T,i. 0 < i → ⦃L, #(i-1)⦄ ⊃⸮ ⦃K, T⦄ → ⦃L.ⓑ{I}V, #i⦄ ⊃⸮ ⦃K, T⦄.
45 lemma fsupq_lref: ∀I,K,V,i,L. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃L, #i⦄ ⊃⸮ ⦃K, V⦄.
48 (* Basic forward lemmas *****************************************************)
50 lemma fsupq_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄ → ♯{L2, T2} ≤ ♯{L1, T1}.
51 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 // [1,2,3: /2 width=1/ ]
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 @(transitive_le … IHT12) -IHT12 /2 width=1/
58 fact fsupq_fwd_length_lref1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄ →
59 ∀i. T1 = #i → |L2| ≤ |L1|.
60 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 //
61 [ #a #I #L #V #T #j #H destruct
62 | #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #i #H destruct
63 lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 #HLK1
64 elim (lift_inv_lref2 … HTU1) -HTU1 * #Hdei #H destruct
65 @(transitive_le … HLK1) /2 width=2/
69 lemma fsupq_fwd_length_lref1: ∀L1,L2,T2,i. ⦃L1, #i⦄ ⊃⸮ ⦃L2, T2⦄ → |L2| ≤ |L1|.
70 /2 width=5 by fsupq_fwd_length_lref1_aux/