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/relocation/fsup.ma".
17 (* PLUS-ITERATED SUPCLOSURE *************************************************)
19 definition fsupp: bi_relation lenv term ≝ bi_TC … fsup.
21 interpretation "plus-iterated structural successor (closure)"
22 'SupTermPlus L1 T1 L2 T2 = (fsupp L1 T1 L2 T2).
24 (* Basic properties *********************************************************)
26 lemma fsup_fsupp: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⊃+ ⦃L2, T2⦄.
29 lemma fsupp_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⊃+ ⦃L, T⦄ → ⦃L, T⦄ ⊃ ⦃L2, T2⦄ →
33 lemma fsupp_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⊃ ⦃L, T⦄ → ⦃L, T⦄ ⊃+ ⦃L2, T2⦄ →
37 lemma fsupp_lref: ∀I,K,V,i,L. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃L, #i⦄ ⊃+ ⦃K, V⦄.
40 lemma fsupp_pair_sn: ∀I,L,V,T. ⦃L, ②{I}V.T⦄ ⊃+ ⦃L, V⦄.
43 lemma fsupp_bind_dx: ∀a,K,I,V,T. ⦃K, ⓑ{a,I}V.T⦄ ⊃+ ⦃K.ⓑ{I}V, T⦄.
46 lemma fsupp_flat_dx: ∀I,L,V,T. ⦃L, ⓕ{I}V.T⦄ ⊃+ ⦃L, T⦄.
49 lemma fsupp_flat_dx_pair_sn: ∀I1,I2,L,V1,V2,T. ⦃L, ⓕ{I1}V1.②{I2}V2.T⦄ ⊃+ ⦃L, V2⦄.
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⦄.
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⦄.
58 lemma fsupp_append_sn: ∀I,L,K,V,T. ⦃L.ⓑ{I}V@@K, T⦄ ⊃+ ⦃L, V⦄.
61 normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ (**) (* auto too slow without trace *)
64 (* Basic eliminators ********************************************************)
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)
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)
82 (* Basic forward lemmas *****************************************************)
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/
89 (* Advanced eliminators *****************************************************)
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
95 #R #HR @(f2_ind … fw) #n #IHn #L1 #T1 #H destruct /4 width=5 by fsupp_fwd_fw/