]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/relocation/fqu.ma
3b4690eddd11350cd48c5826e83f992360458802
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / fqu.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/supterm_6.ma".
16 include "basic_2/grammar/cl_weight.ma".
17 include "basic_2/grammar/bteq.ma".
18 include "basic_2/relocation/ldrop.ma".
19
20 (* SUPCLOSURE ***************************************************************)
21
22 (* activate genv *)
23 inductive fqu: tri_relation genv lenv term ≝
24 | fqu_lref_O : ∀I,G,L,V. fqu G (L.ⓑ{I}V) (#0) G L V
25 | fqu_pair_sn: ∀I,G,L,V,T. fqu G L (②{I}V.T) G L V
26 | fqu_bind_dx: ∀a,I,G,L,V,T. fqu G L (ⓑ{a,I}V.T) G (L.ⓑ{I}V) T
27 | fqu_flat_dx: ∀I,G,L,V,T. fqu G L (ⓕ{I}V.T) G L T
28 | fqu_drop   : ∀G,L,K,T,U,e.
29                ⇩[0, e+1] L ≡ K → ⇧[0, e+1] T ≡ U → fqu G L U G K T
30 .
31
32 interpretation
33    "structural successor (closure)"
34    'SupTerm G1 L1 T1 G2 L2 T2 = (fqu G1 L1 T1 G2 L2 T2).
35
36 (* Basic properties *********************************************************)
37
38 lemma fqu_drop_lt: ∀G,L,K,T,U,e. 0 < e →
39                    ⇩[0, e] L ≡ K → ⇧[0, e] T ≡ U → fqu G L U G K T.
40 #G #L #K #T #U #e #He >(plus_minus_m_m e 1) /2 width=3 by fqu_drop/
41 qed.
42
43 lemma fqu_lref_S_lt: ∀I,G,L,V,i. 0 < i → ⦃G, L.ⓑ{I}V, #i⦄ ⊃ ⦃G, L, #(i-1)⦄.
44 /3 width=3 by fqu_drop, ldrop_ldrop, lift_lref_ge_minus/
45 qed.
46
47 (* Basic forward lemmas *****************************************************)
48
49 lemma fqu_fwd_fw: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → ♯{G2, L2, T2} < ♯{G1, L1, T1}.
50 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 //
51 #G #L #K #T #U #e #HLK #HTU
52 lapply (ldrop_fwd_lw_lt … HLK ?) -HLK // #HKL
53 lapply (lift_fwd_tw … HTU) -e #H
54 normalize in ⊢ (?%%); /2 width=1 by lt_minus_to_plus/
55 qed-.
56
57 fact fqu_fwd_length_lref1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
58                                ∀i. T1 = #i → |L2| < |L1|.
59 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
60 [1: normalize //
61 |3: #a
62 |5: /2 width=4 by ldrop_fwd_length_lt4/
63 ] #I #G #L #V #T #j #H destruct
64 qed-.
65
66 lemma fqu_fwd_length_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊃ ⦃G2, L2, T2⦄ → |L2| < |L1|.
67 /2 width=7 by fqu_fwd_length_lref1_aux/
68 qed-.
69
70 lemma fqu_fwd_bteq: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
71                     ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥.
72 #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
73 [ #I #G #L #V * #_ #H elim (plus_xSy_x_false … H)
74 | #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_x … H)
75 | #a #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_y … H)
76 | #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_y … H)
77 | #G #L #K #T #U #e #HLK #_ * #_ #H
78   lapply (ldrop_fwd_length_lt4 … HLK ?) // >H -L #H
79   elim (lt_refl_false … H)
80 ]
81 qed-.
82
83 (* Advanced eliminators *****************************************************)
84
85 lemma fqu_wf_ind: ∀R:relation3 …. (
86                      ∀G1,L1,T1. (∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → R G2 L2 T2) →
87                                 R G1 L1 T1
88                   ) → ∀G1,L1,T1. R G1 L1 T1.
89 #R #HR @(f3_ind … fw) #n #IHn #G1 #L1 #T1 #H destruct /4 width=1 by fqu_fwd_fw/
90 qed-.