]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/substitution/fsupp.ma
- induction on supclosure replaces induction on weight for closures everywhere
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / substitution / fsupp.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/relocation/fsup.ma".
16
17 (* PLUS-ITERATED SUPCLOSURE *************************************************)
18
19 definition fsupp: bi_relation lenv term ≝ bi_TC … fsup.
20
21 interpretation "plus-iterated structural successor (closure)"
22    'SupTermPlus L1 T1 L2 T2 = (fsupp L1 T1 L2 T2).
23
24 (* Basic properties *********************************************************)
25
26 lemma fsup_fsupp: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄.
27 /2 width=1/ qed.
28
29 lemma fsupp_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⊃+ ⦃L, T⦄ → ⦃L, T⦄ ⊃ ⦃L2, T2⦄ →
30                     ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄.
31 /2 width=4/ qed.
32
33 lemma fsupp_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⊃ ⦃L, T⦄ → ⦃L, T⦄ ⊃+ ⦃L2, T2⦄ →
34                     ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄.
35 /2 width=4/ qed.
36
37 lemma fsupp_lref: ∀I,K,V,i,L. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃L, #i⦄ ⊃+ ⦃K, V⦄.
38 /3 width=2/ qed.
39
40 lemma fsupp_pair_sn: ∀I,L,V,T. ⦃L, ②{I}V.T⦄ ⊃+ ⦃L, V⦄.
41 /2 width=1/ qed.
42
43 lemma fsupp_bind_dx: ∀a,K,I,V,T. ⦃K, ⓑ{a,I}V.T⦄ ⊃+ ⦃K.ⓑ{I}V, T⦄.
44 /2 width=1/ qed.
45
46 lemma fsupp_flat_dx: ∀I,L,V,T. ⦃L, ⓕ{I}V.T⦄ ⊃+ ⦃L, T⦄.
47 /2 width=1/ qed.
48
49 lemma fsupp_flat_dx_pair_sn: ∀I1,I2,L,V1,V2,T. ⦃L, ⓕ{I1}V1.②{I2}V2.T⦄ ⊃+ ⦃L, V2⦄.
50 /2 width=4/ qed.
51
52 lemma fsupp_bind_dx_flat_dx: ∀a,I1,I2,L,V1,V2,T. ⦃L, ⓑ{a,I1}V1.ⓕ{I2}V2.T⦄ ⊃+ ⦃L.ⓑ{I1}V1, T⦄.
53 /2 width=4/ qed.
54
55 lemma fsupp_flat_dx_bind_dx: ∀a,I1,I2,L,V1,V2,T. ⦃L, ⓕ{I1}V1.ⓑ{a,I2}V2.T⦄ ⊃+ ⦃L.ⓑ{I2}V2, T⦄.
56 /2 width=4/ qed.
57 (*
58 lemma fsupp_append_sn: ∀I,L,K,V,T. ⦃L.ⓑ{I}V@@K, T⦄ ⊃+ ⦃L, V⦄.
59 #I #L #K #V *
60 [ * #i
61 normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ (**) (* auto too slow without trace *)
62 qed.
63 *)
64 (* Basic eliminators ********************************************************)
65
66 lemma fsupp_ind: ∀L1,T1. ∀R:relation2 lenv term.
67                  (∀L2,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → R L2 T2) →
68                  (∀L,T,L2,T2. ⦃L1, T1⦄ ⊃+ ⦃L, T⦄ → ⦃L, T⦄ ⊃ ⦃L2, T2⦄ → R L T → R L2 T2) →
69                  ∀L2,T2. ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄ → R L2 T2.
70 #L1 #T1 #R #IH1 #IH2 #L2 #T2 #H
71 @(bi_TC_ind … IH1 IH2 ? ? H)
72 qed-.
73
74 lemma fsupp_ind_dx: ∀L2,T2. ∀R:relation2 lenv term.
75                     (∀L1,T1. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → R L1 T1) →
76                     (∀L1,L,T1,T. ⦃L1, T1⦄ ⊃ ⦃L, T⦄ → ⦃L, T⦄ ⊃+ ⦃L2, T2⦄ → R L T → R L1 T1) →
77                     ∀L1,T1. ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄ → R L1 T1.
78 #L2 #T2 #R #IH1 #IH2 #L1 #T1 #H
79 @(bi_TC_ind_dx … IH1 IH2 ? ? H)
80 qed-.
81
82 (* Basic forward lemmas *****************************************************)
83
84 lemma fsupp_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄ → ♯{L2, T2} < ♯{L1, T1}.
85 #L1 #L2 #T1 #T2 #H @(fsupp_ind … H) -L2 -T2
86 /3 width=3 by fsup_fwd_fw, transitive_lt/
87 qed-.
88
89 (* Advanced eliminators *****************************************************)
90
91 lemma fsupp_wf_ind: ∀R:relation2 lenv term. (
92                        ∀L1,T1. (∀L2,T2. ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄ → R L2 T2) →
93                        ∀L2,T2. L1 = L2 → T1 = T2 → R L2 T2
94                     ) → ∀L1,T1. R L1 T1.
95 #R #HR @(f2_ind … fw) #n #IHn #L1 #T1 #H destruct /4 width=5 by fsupp_fwd_fw/
96 qed-.