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_2A/notation/relations/suptermopt_6.ma".
16 include "basic_2A/substitution/fqu.ma".
18 (* OPTIONAL SUPCLOSURE ******************************************************)
21 inductive fquq: tri_relation genv lenv term ≝
22 | fquq_lref_O : ∀I,G,L,V. fquq G (L.ⓑ{I}V) (#0) G L V
23 | fquq_pair_sn: ∀I,G,L,V,T. fquq G L (②{I}V.T) G L V
24 | fquq_bind_dx: ∀a,I,G,L,V,T. fquq G L (ⓑ{a,I}V.T) G (L.ⓑ{I}V) T
25 | fquq_flat_dx: ∀I,G, L,V,T. fquq G L (ⓕ{I}V.T) G L T
26 | fquq_drop : ∀G,L,K,T,U,m.
27 ⬇[m] L ≡ K → ⬆[0, m] T ≡ U → fquq G L U G K T
31 "optional structural successor (closure)"
32 'SupTermOpt G1 L1 T1 G2 L2 T2 = (fquq G1 L1 T1 G2 L2 T2).
34 (* Basic properties *********************************************************)
36 lemma fquq_refl: tri_reflexive … fquq.
37 /2 width=3 by fquq_drop/ qed.
39 lemma fqu_fquq: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄.
40 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 /2 width=3 by fquq_drop/
43 (* Basic forward lemmas *****************************************************)
45 lemma fquq_fwd_fw: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ → ♯{G2, L2, T2} ≤ ♯{G1, L1, T1}.
46 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 /2 width=1 by lt_to_le/
47 #G1 #L1 #K1 #T1 #U1 #m #HLK1 #HTU1
48 lapply (drop_fwd_lw … HLK1) -HLK1
49 lapply (lift_fwd_tw … HTU1) -HTU1
50 /2 width=1 by le_plus, le_n/
53 fact fquq_fwd_length_lref1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
54 ∀i. T1 = #i → |L2| ≤ |L1|.
55 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 //
56 [ #a #I #G #L #V #T #j #H destruct
57 | #G1 #L1 #K1 #T1 #U1 #m #HLK1 #HTU1 #i #H destruct
58 /2 width=3 by drop_fwd_length_le4/
62 lemma fquq_fwd_length_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐⸮ ⦃G2, L2, T2⦄ → |L2| ≤ |L1|.
63 /2 width=7 by fquq_fwd_length_lref1_aux/