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/supterm_6.ma".
16 include "basic_2/grammar/cl_weight.ma".
17 include "basic_2/relocation/ldrop.ma".
19 (* SUPCLOSURE ***************************************************************)
22 inductive fsup: tri_relation genv lenv term ≝
23 | fsup_lref_O : ∀I,G,L,V. fsup G (L.ⓑ{I}V) (#0) G L V
24 | fsup_pair_sn: ∀I,G,L,V,T. fsup G L (②{I}V.T) G L V
25 | fsup_bind_dx: ∀a,I,G,L,V,T. fsup G L (ⓑ{a,I}V.T) G (L.ⓑ{I}V) T
26 | fsup_flat_dx: ∀I,G,L,V,T. fsup G L (ⓕ{I}V.T) G L T
27 | fsup_drop : ∀G,L,K,T,U,e.
28 ⇩[0, e+1] L ≡ K → ⇧[0, e+1] T ≡ U → fsup G L U G K T
32 "structural successor (closure)"
33 'SupTerm G1 L1 T1 G2 L2 T2 = (fsup G1 L1 T1 G2 L2 T2).
35 (* Basic properties *********************************************************)
37 lemma fsup_drop_lt: ∀G,L,K,T,U,e. 0 < e →
38 ⇩[0, e] L ≡ K → ⇧[0, e] T ≡ U → fsup G L U G K T.
39 #G #L #K #T #U #e #He >(plus_minus_m_m e 1) /2 width=3 by fsup_drop/
42 lemma fsup_lref_S_lt: ∀I,G,L,V,i. 0 < i → ⦃G, L.ⓑ{I}V, #i⦄ ⊃ ⦃G, L, #(i-1)⦄.
43 /3 width=3 by fsup_drop, ldrop_ldrop, lift_lref_ge_minus/
46 (* Basic forward lemmas *****************************************************)
48 lemma fsup_fwd_fw: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → ♯{G2, L2, T2} < ♯{G1, L1, T1}.
49 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 //
50 #G #L #K #T #U #e #HLK #HTU
51 lapply (ldrop_fwd_lw_lt … HLK ?) -HLK // #HKL
52 lapply (lift_fwd_tw … HTU) -e #H
53 normalize in ⊢ (?%%); /2 width=1 by lt_minus_to_plus/
56 fact fsup_fwd_length_lref1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
57 ∀i. T1 = #i → |L2| < |L1|.
58 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
61 |5: /2 width=4 by ldrop_fwd_length_lt4/
62 ] #I #G #L #V #T #j #H destruct
65 lemma fsup_fwd_length_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊃ ⦃G2, L2, T2⦄ → |L2| < |L1|.
66 /2 width=7 by fsup_fwd_length_lref1_aux/