--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/relocation/drops_weight.ma".
+include "basic_2/s_computation/fqup_weight.ma".
+include "basic_2/s_computation/fqus_weight.ma".
+include "basic_2/static/frees.ma".
+
+(* CONTEXT-SENSITIVE FREE VARIABLES *****************************************)
+
+(* Properties with star-iterated supclosure *********************************)
+
+(* Note: Restrict fqu_drop on atoms to prove frees_fqus_drops
+ Counterex: ⦃⋆, ⋆.ⓛ#0, ⓛ#1.#0⦄ ⊐ ⦃⋆, ⋆, ⓛ#0.#0⦄ ⊐ ⦃⋆, ⋆.ⓛ#0, #0⦄
+*)
+lemma frees_fqus_drops: ∀G,L1,T1,f1. L1 ⊢ 𝐅*⦃T1⦄ ≡ f1 →
+ ∀L2,T2. ⦃G, L1, T1⦄ ⊐* ⦃G, L2, T2⦄ →
+ ∀I,n. ⬇*[n] L1 ≡ L2.ⓑ{I}T2 →
+ ∃∃f2. L2 ⊢ 𝐅*⦃T2⦄ ≡ f2 & f2 ⊆ ⫱*[⫯n] f1.
+#G #L1 #T1 @(fqup_wf_ind_eq … G L1 T1) -G -L1 -T1
+#G0 #L0 #T0 #IH #G #L1 * *
+[ #s #HG #HL #HT #f1 #Hf1 #L2 #T2 #H12 #I #n #HL12 destruct
+ lapply (frees_inv_sort … Hf1) -Hf1 #Hf1
+ elim (fqus_inv_sort1 … H12) -H12 * [| elim (nat_split n) ]
+ [ -IH #H1 #H2 #H3 destruct
+ lapply (drops_fwd_lw … HL12) -HL12 #HL12
+ elim (lt_le_false … HL12) -HL12 //
+ | -IH #Hn #J #L #V #H12 #H destruct
+ lapply (drops_fwd_isid … HL12 ?) -HL12 // #H destruct
+ <(fqus_inv_refl_atom3 … H12) -H12
+ /3 width=3 by frees_sort_gen, sle_isid_sn, ex2_intro/
+ | * #m #Hn #J #L #V #H12 #H destruct
+ lapply (drops_inv_drop1 … HL12) -HL12 #HL12
+ elim (IH … H12 … HL12) -IH -H12 -HL12
+ /3 width=3 by frees_sort_gen, fqu_fqup, fqu_drop, lifts_sort, isid_tl, ex2_intro/
+ ]
+| #i #HG #HL #HT #f1 #Hf1 #L2 #T2 #H12 #I #n #HL12 destruct
+ elim (fqus_inv_lref1 … H12) -H12 * [|2,3: elim (nat_split n) ]
+ [ -IH #H1 #H2 #H3 destruct
+ lapply (drops_fwd_lw … HL12) -HL12 #HL12
+ elim (lt_le_false … HL12) -HL12 //
+ | -IH #Hn #J #L #V #H12 #H1 #H2 destruct
+ elim (frees_inv_zero_pair … Hf1) -Hf1 #g1 #Hg1 #H destruct
+ lapply (drops_fwd_isid … HL12 ?) -HL12 -H12 // #H destruct
+ /2 width=3 by sle_refl, ex2_intro/
+ | * #m #Hn #J #L #V #H12 #H1 #H2 destruct
+ elim (frees_inv_zero_pair … Hf1) -Hf1 #g1 #Hg1 #H destruct
+ lapply (drops_inv_drop1 … HL12) -HL12 #HL12
+ elim (IH … H12 … HL12) -IH -H12 -HL12
+ /2 width=3 by fqu_fqup, fqu_lref_O, ex2_intro/
+ | -IH #Hn #J #L #V #j #H12 #H1 #H2 destruct
+ elim (frees_inv_lref_pair … Hf1) -Hf1 #g1 #Hg1 #H destruct
+ lapply (drops_fwd_isid … HL12 ?) -HL12 // #H destruct
+ <(fqus_inv_refl_atom3 … H12) -H12 /2 width=3 by sle_refl, ex2_intro/
+ | * #m #Hn #J #L #V #j #H12 #H1 #H2 destruct
+ elim (frees_inv_lref_pair … Hf1) -Hf1 #g1 #Hg1 #H destruct
+ lapply (drops_inv_drop1 … HL12) -HL12 #HL12
+ elim (IH … H12 … HL12) -IH -H12 -HL12 /2 width=3 by fqu_fqup, ex2_intro/
+ ]
+| #l #HG #HL #HT #f1 #Hf1 #L2 #T2 #H12 #I #n #HL12 destruct
+ lapply (frees_inv_gref … Hf1) -Hf1 #Hf1
+ elim (fqus_inv_gref1 … H12) -H12 * [| elim (nat_split n) ]
+ [ -IH #H1 #H2 #H3 destruct
+ lapply (drops_fwd_lw … HL12) -HL12 #HL12
+ elim (lt_le_false … HL12) -HL12 //
+ | -IH #Hn #J #L #V #H12 #H destruct
+ lapply (drops_fwd_isid … HL12 ?) -HL12 // #H destruct
+ <(fqus_inv_refl_atom3 … H12) -H12
+ /3 width=3 by frees_gref_gen, sle_isid_sn, ex2_intro/
+ | * #m #Hn #J #L #V #H12 #H destruct
+ lapply (drops_inv_drop1 … HL12) -HL12 #HL12
+ elim (IH … H12 … HL12) -IH -H12 -HL12
+ /3 width=3 by frees_gref_gen, fqu_fqup, fqu_drop, lifts_sort, isid_tl, ex2_intro/
+ ]
+| #p #I #V1 #T1 #HG #HL #HT #f1 #Hf1 #L2 #T2 #H12 #I #n #HL12 destruct
+ elim (frees_inv_bind … Hf1) -Hf1 #f1V #f1T #Hf1V #Hf1T #Hf1
+ elim (fqus_inv_bind1 … H12) -H12
+ [ -IH -f1V -f1T * #H1 #H2 #H3 destruct
+ lapply (drops_fwd_lw … HL12) -HL12 #HL12
+ elim (lt_le_false … HL12) -HL12 //
+ | #H12 elim (IH … H12 … HL12) -IH -H12 -HL12
+ /4 width=6 by sor_tls, sor_inv_sle_sn_trans, ex2_intro/
+ | #H12 elim (IH … H12 I (⫯n)) -IH -H12 [|*: /2 width=3 by drops_drop, drops_refl/ ] -HL12
+ <tls_xn /4 width=6 by ex2_intro, sor_tls, sor_inv_sle_dx_trans/
+ | * #J #L #V #X1 #H12 #HXT1 #H destruct
+ ]
+| #I #V1 #T1 #HG #HL #HT #f1 #Hf1 #L2 #T2 #H12 #I #n #HL12 destruct
+ elim (frees_inv_flat … Hf1) -Hf1 #f1V #f1T #Hf1V #Hf1T #Hf1
+ elim (fqus_inv_flat1 … H12) -H12
+ [ -IH -f1V -f1T * #H1 #H2 #H3 destruct
+ lapply (drops_fwd_lw … HL12) -HL12 #HL12
+ elim (lt_le_false … HL12) -HL12 //
+ | #H12 elim (IH … H12 … HL12) -IH -H12 -HL12
+ /4 width=6 by sor_tls, sor_inv_sle_sn_trans, ex2_intro/
+ | #H12 elim (IH … H12 … HL12) -IH -H12 -HL12
+ /4 width=6 by ex2_intro, sor_tls, sor_inv_sle_dx_trans/
+ | * #J #L #V #X1 #H12 #HXT1 #H destruct
+ ]
+]
+qed-.
(* UNCOUNTED CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS *************)
+include "basic_2/s_computation/fqus_fqup.ma".
+include "basic_2/rt_transition/cpx_drops.ma".
+
(* Properties on supclosure *************************************************)
-lemma fqu_cpx_trans: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h, o] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h, o] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
-#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
+lemma fqu_cpx_trans: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
+#h #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
/3 width=3 by fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, cpx_pair_sn, cpx_bind, cpx_flat, ex2_intro/
-[ #I #G #L #V2 #U2 #HVU2
- elim (lift_total U2 0 1)
- /4 width=7 by fqu_drop, cpx_delta, drop_pair, drop_drop, ex2_intro/
-| #G #L #K #T1 #U1 #k #HLK1 #HTU1 #T2 #HTU2
- elim (lift_total T2 0 (k+1))
- /3 width=11 by cpx_lift, fqu_drop, ex2_intro/
+[ #I #G #L2 #V2 #X2 #HVX2
+ elim (lifts_total X2 (𝐔❴1❵))
+ /3 width=3 by fqu_drop, cpx_delta, ex2_intro/
+| #I #G #L2 #V #T2 #X2 #HTX2 #U2 #HTU2
+ elim (cpx_lifts … HTU2 (Ⓣ) … (L2.ⓑ{I}V) … HTX2)
+ /3 width=3 by fqu_drop, drops_refl, drops_drop, ex2_intro/
]
qed-.
-lemma fquq_cpx_trans: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h, o] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h, o] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
-#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H
-[ #HT12 elim (fqu_cpx_trans … HT12 … HTU2) /3 width=3 by fqu_fquq, ex2_intro/
+lemma fquq_cpx_trans: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+#h #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -H
+[ #HT12 #U2 #HTU2 elim (fqu_cpx_trans … HT12 … HTU2) /3 width=3 by fqu_fquq, ex2_intro/
| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
]
qed-.
-lemma fqup_cpx_trans: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h, o] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h, o] U1 & ⦃G1, L1, U1⦄ ⊐+ ⦃G2, L2, U2⦄.
-#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2
+lemma fqup_cpx_trans: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐+ ⦃G2, L2, U2⦄.
+#h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2
[ #G2 #L2 #T2 #H12 #U2 #HTU2 elim (fqu_cpx_trans … H12 … HTU2) -T2
/3 width=3 by fqu_fqup, ex2_intro/
| #G #G2 #L #L2 #T #T2 #_ #HT2 #IHT1 #U2 #HTU2
]
qed-.
-lemma fqus_cpx_trans: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h, o] U2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h, o] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
-#h #o #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fqus_inv_gen … H) -H
-[ #HT12 elim (fqup_cpx_trans … HT12 … HTU2) /3 width=3 by fqup_fqus, ex2_intro/
+lemma fqus_cpx_trans: ∀h,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
+#h #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqus_inv_fqup … H) -H
+[ #HT12 #U2 #HTU2 elim (fqup_cpx_trans … HT12 … HTU2) /3 width=3 by fqup_fqus, ex2_intro/
| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
]
qed-.
-
+(*
lemma fqu_cpx_trans_neq: ∀h,o,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈[h, o] U2 → (T2 = U2 → ⊥) →
∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈[h, o] U1 & T1 = U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
| * #HG #HL #HT destruct /3 width=4 by ex3_intro/
]
qed-.
+*)
\ No newline at end of file
(* PLUS-ITERATED SUPCLOSURE *************************************************)
(* Properties with generic slicing for local environments *******************)
-(*
+
lemma fqup_drops_succ: ∀G,K,T,l,L,U. ⬇*[⫯l] L ≡ K → ⬆*[⫯l] T ≡ U →
⦃G, L, U⦄ ⊐+ ⦃G, K, T⦄.
#G #K #T #l elim l -l
| /3 width=5 by fqup_strap1, fqup_drops_succ/
]
qed-.
-*)
-axiom fqup_lref: ∀I,G,L,K,V,i. ⬇*[i] L ≡ K.ⓑ{I}V → ⦃G, L, #i⦄ ⊐+ ⦃G, K, V⦄.
-(* /2 width=6 by fqup_drops_strap1/ qed. *)
+
+lemma fqup_lref: ∀I,G,L,K,V,i. ⬇*[i] L ≡ K.ⓑ{I}V → ⦃G, L, #i⦄ ⊐+ ⦃G, K, V⦄.
+/2 width=6 by fqup_drops_strap1/ qed.
* #HG #HL #HT #_ destruct //
qed-.
+lemma fqus_inv_sort1: ∀G1,G2,L1,L2,T2,s. ⦃G1, L1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄ →
+ (∧∧ G1 = G2 & L1 = L2 & ⋆s = T2) ∨
+ ∃∃J,L,V. ⦃G1, L, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V.
+#G1 #G2 #L1 #L2 #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
+#G #L #T #H elim (fqu_inv_sort1 … H) -H /3 width=5 by ex2_3_intro, or_intror/
+qed-.
+
+lemma fqus_inv_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∨∨ ∧∧ G1 = G2 & L1 = L2 & #i = T2
+ | ∃∃J,L,V. ⦃G1, L, V⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V & i = 0
+ | ∃∃J,L,V,j. ⦃G1, L, #j⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V & i = ⫯j.
+#G1 #G2 #L1 #L2 #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or3_intro0/
+#G #L #T #H elim (fqu_inv_lref1 … H) -H * /3 width=7 by or3_intro1, or3_intro2, ex3_4_intro, ex3_3_intro/
+qed-.
+
+lemma fqus_inv_gref1: ∀G1,G2,L1,L2,T2,l. ⦃G1, L1, §l⦄ ⊐* ⦃G2, L2, T2⦄ →
+ (∧∧ G1 = G2 & L1 = L2 & §l = T2) ∨
+ ∃∃J,L,V. ⦃G1, L, §l⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V.
+#G1 #G2 #L1 #L2 #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
+#G #L #T #H elim (fqu_inv_gref1 … H) -H /3 width=5 by ex2_3_intro, or_intror/
+qed-.
+
+lemma fqus_inv_bind1: ∀p,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓑ{p,I}V1.T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓑ{p,I}V1.T1 = T2
+ | ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄
+ | ⦃G1, L1.ⓑ{I}V1, T1⦄ ⊐* ⦃G2, L2, T2⦄
+ | ∃∃J,L,V,T. ⦃G1, L, T⦄ ⊐* ⦃G2, L2, T2⦄ & ⬆*[1] T ≡ ⓑ{p,I}V1.T1 & L1 = L.ⓑ{J}V.
+#p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or4_intro0/
+#G #L #T #H elim (fqu_inv_bind1 … H) -H *
+[3: #J #V ] #H1 #H2 #H3 #H destruct
+/3 width=7 by or4_intro1, or4_intro2, or4_intro3, ex3_4_intro/
+qed-.
+
+lemma fqus_inv_flat1: ∀I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓕ{I}V1.T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓕ{I}V1.T1 = T2
+ | ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄
+ | ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄
+ | ∃∃J,L,V,T. ⦃G1, L, T⦄ ⊐* ⦃G2, L2, T2⦄ & ⬆*[1] T ≡ ⓕ{I}V1.T1 & L1 = L.ⓑ{J}V.
+#I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or4_intro0/
+#G #L #T #H elim (fqu_inv_flat1 … H) -H *
+[3: #J #V ] #H1 #H2 #H3 #H destruct
+/3 width=7 by or4_intro1, or4_intro2, or4_intro3, ex3_4_intro/
+qed-.
+
+(* Advanced inversion lemmas ************************************************)
+
lemma fqus_inv_atom1: ∀I,G1,G2,L2,T2. ⦃G1, ⋆, ⓪{I}⦄ ⊐* ⦃G2, L2, T2⦄ →
∧∧ G1 = G2 & ⋆ = L2 & ⓪{I} = T2.
#I #G1 #G2 #L2 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /2 width=1 by and3_intro/
#G #L #T #H elim (fqu_inv_atom1 … H)
qed-.
-lemma fqus_inv_sort1: ∀I,G1,G2,L1,L2,V1,T2,s. ⦃G1, L1.ⓑ{I}V1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄ →
- (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & ⋆s = T2) ∨ ⦃G1, L1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄.
+lemma fqus_inv_sort1_pair: ∀I,G1,G2,L1,L2,V1,T2,s. ⦃G1, L1.ⓑ{I}V1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄ →
+ (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & ⋆s = T2) ∨ ⦃G1, L1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄.
#I #G1 #G2 #L1 #L2 #V #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
-#G #L #T #H elim (fqu_inv_sort1 … H) -H
+#G #L #T #H elim (fqu_inv_sort1_pair … H) -H
#H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
qed-.
-lemma fqus_inv_zero1: ∀I,G1,G2,L1,L2,V1,T2. ⦃G1, L1.ⓑ{I}V1, #0⦄ ⊐* ⦃G2, L2, T2⦄ →
- (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #0 = T2) ∨ ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄.
+lemma fqus_inv_zero1_pair: ∀I,G1,G2,L1,L2,V1,T2. ⦃G1, L1.ⓑ{I}V1, #0⦄ ⊐* ⦃G2, L2, T2⦄ →
+ (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #0 = T2) ∨ ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄.
#I #G1 #G2 #L1 #L2 #V1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
-#G #L #T #H elim (fqu_inv_zero1 … H) -H
+#G #L #T #H elim (fqu_inv_zero1_pair … H) -H
#H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
qed-.
-lemma fqus_inv_lref1: ∀I,G1,G2,L1,L2,V1,T2,i. ⦃G1, L1.ⓑ{I}V1, #⫯i⦄ ⊐* ⦃G2, L2, T2⦄ →
- (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #(⫯i) = T2) ∨ ⦃G1, L1, #i⦄ ⊐* ⦃G2, L2, T2⦄.
+lemma fqus_inv_lref1_pair: ∀I,G1,G2,L1,L2,V1,T2,i. ⦃G1, L1.ⓑ{I}V1, #⫯i⦄ ⊐* ⦃G2, L2, T2⦄ →
+ (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #(⫯i) = T2) ∨ ⦃G1, L1, #i⦄ ⊐* ⦃G2, L2, T2⦄.
#I #G1 #G2 #L1 #L2 #V #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
-#G #L #T #H elim (fqu_inv_lref1 … H) -H
+#G #L #T #H elim (fqu_inv_lref1_pair … H) -H
#H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
qed-.
-lemma fqus_inv_gref1: ∀I,G1,G2,L1,L2,V1,T2,l. ⦃G1, L1.ⓑ{I}V1, §l⦄ ⊐* ⦃G2, L2, T2⦄ →
- (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & §l = T2) ∨ ⦃G1, L1, §l⦄ ⊐* ⦃G2, L2, T2⦄.
+lemma fqus_inv_gref1_pair: ∀I,G1,G2,L1,L2,V1,T2,l. ⦃G1, L1.ⓑ{I}V1, §l⦄ ⊐* ⦃G2, L2, T2⦄ →
+ (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & §l = T2) ∨ ⦃G1, L1, §l⦄ ⊐* ⦃G2, L2, T2⦄.
#I #G1 #G2 #L1 #L2 #V #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
-#G #L #T #H elim (fqu_inv_gref1 … H) -H
+#G #L #T #H elim (fqu_inv_gref1_pair … H) -H
#H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
qed-.
-lemma fqus_inv_bind1: ∀p,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓑ{p,I}V1.T1⦄ ⊐* ⦃G2, L2, T2⦄ →
- ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓑ{p,I}V1.T1 = T2
- | ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄
- | ⦃G1, L1.ⓑ{I}V1, T1⦄ ⊐* ⦃G2, L2, T2⦄.
-#p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or3_intro0/
-#G #L #T #H elim (fqu_inv_bind1 … H) -H *
-#H1 #H2 #H3 #H destruct /2 width=1 by or3_intro1, or3_intro2/
-qed-.
-
-lemma fqus_inv_flat1: ∀I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓕ{I}V1.T1⦄ ⊐* ⦃G2, L2, T2⦄ →
- ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓕ{I}V1.T1 = T2
- | ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄
- | ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄.
-#I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or3_intro0/
-#G #L #T #H elim (fqu_inv_flat1 … H) -H *
-#H1 #H2 #H3 #H destruct /2 width=1 by or3_intro1, or3_intro2/
-qed-.
-
(* Basic_2A1: removed theorems 1: fqus_drop *)
(* STAR-ITERATED SUPCLOSURE *************************************************)
(* Properties with generic slicing for local environments *******************)
-(*
+
lemma fqus_drops: ∀G,L,K,T,U,l. ⬇*[l] L ≡ K → ⬆*[l] T ≡ U →
⦃G, L, U⦄ ⊐* ⦃G, K, T⦄.
#G #L #K #T #U * /3 width=3 by fqup_drops_succ, fqup_fqus/
#HLK #HTU <(lifts_fwd_isid … HTU) -U // <(drops_fwd_isid … HLK) -K //
qed.
-*)
\ No newline at end of file
(* SUPCLOSURE ***************************************************************)
(* activate genv *)
-(* Note: frees_total requires fqu_drop for all atoms *)
+(* Note: frees_total requires fqu_drop for all atoms
+ fqu_cpx_trans requires fqu_drop for all terms
+ frees_fqus_drops requires fqu_drop restricted on atoms
+*)
inductive fqu: tri_relation genv lenv term ≝
| fqu_lref_O : ∀I,G,L,V. fqu G (L.ⓑ{I}V) (#0) G L V
| fqu_pair_sn: ∀I,G,L,V,T. fqu G L (②{I}V.T) G L V
| fqu_bind_dx: ∀p,I,G,L,V,T. fqu G L (ⓑ{p,I}V.T) G (L.ⓑ{I}V) T
| fqu_flat_dx: ∀I,G,L,V,T. fqu G L (ⓕ{I}V.T) G L T
-| fqu_drop : ∀I,I1,I2,G,L,V. ⬆*[1] ⓪{I2} ≡ ⓪{I1} →
- fqu G (L.ⓑ{I}V) (⓪{I1}) G L (⓪{I2})
+| fqu_drop : ∀I,G,L,V,T,U. ⬆*[1] T ≡ U → fqu G (L.ⓑ{I}V) U G L T
.
interpretation
(* Basic properties *********************************************************)
-lemma fqu_lref_S: ∀I,G,L,V,i. ⦃G, L.ⓑ{I}V, #(⫯i)⦄ ⊐ ⦃G, L, #(i)⦄.
+lemma fqu_lref_S: ∀I,G,L,V,i. ⦃G, L.ⓑ{I}V, #⫯i⦄ ⊐ ⦃G, L, #i⦄.
/2 width=1 by fqu_drop/ qed.
(* Basic inversion lemmas ***************************************************)
-fact fqu_inv_atom1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∀I. L1 = ⋆ → T1 = ⓪{I} → ⊥.
-#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2
-[ #I #G #L #T #J #H destruct
-| #I #G #L #V #T #J #_ #H destruct
-| #p #I #G #L #V #T #J #_ #H destruct
-| #I #G #L #V #T #J #_ #H destruct
-| #I #I1 #I2 #G #L #V #_ #J #H destruct
-]
-qed-.
-
-lemma fqu_inv_atom1: ∀I,G1,G2,L2,T2. ⦃G1, ⋆, ⓪{I}⦄ ⊐ ⦃G2, L2, T2⦄ → ⊥.
-/2 width=10 by fqu_inv_atom1_aux/ qed-.
-
fact fqu_inv_sort1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∀I,K,V,s. L1 = K.ⓑ{I}V → T1 = ⋆s →
- ∧∧ G1 = G2 & L2 = K & T2 = ⋆s.
-#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2
-[ #I #G #L #T #J #K #W #s #_ #H destruct
-| #I #G #L #V #T #J #K #W #s #_ #H destruct
-| #p #I #G #L #V #T #J #K #W #s #_ #H destruct
-| #I #G #L #V #T #J #K #W #s #_ #H destruct
-| #I #I1 #I2 #G #L #V #HI12 #J #K #W #s #H1 #H2 destruct
- lapply (lifts_inv_sort2 … HI12) -HI12 /2 width=1 by and3_intro/
-]
-qed-.
-
-lemma fqu_inv_sort1: ∀I,G1,G2,K,L2,V,T2,s. ⦃G1, K.ⓑ{I}V, ⋆s⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∧∧ G1 = G2 & L2 = K & T2 = ⋆s.
-/2 width=7 by fqu_inv_sort1_aux/ qed-.
-
-fact fqu_inv_zero1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∀I,K,V. L1 = K.ⓑ{I}V → T1 = #0 →
- ∧∧ G1 = G2 & L2 = K & T2 = V.
+ ∀s. T1 = ⋆s →
+ ∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & T2 = ⋆s.
#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2
-[ #I #G #L #T #J #K #W #H1 #H2 destruct /2 width=1 by and3_intro/
-| #I #G #L #V #T #J #K #W #_ #H destruct
-| #p #I #G #L #V #T #J #K #W #_ #H destruct
-| #I #G #L #V #T #J #K #W #_ #H destruct
-| #I #I1 #I2 #G #L #V #HI12 #J #K #W #H1 #H2 destruct
- elim (lifts_inv_lref2_uni_lt … HI12) -HI12 //
+[ #I #G #L #T #s #H destruct
+| #I #G #L #V #T #s #H destruct
+| #p #I #G #L #V #T #s #H destruct
+| #I #G #L #V #T #s #H destruct
+| #I #G #L #V #T #U #HI12 #s #H destruct
+ lapply (lifts_inv_sort2 … HI12) -HI12 /2 width=3 by ex3_2_intro/
]
qed-.
-lemma fqu_inv_zero1: ∀I,G1,G2,K,L2,V,T2. ⦃G1, K.ⓑ{I}V, #0⦄ ⊐ ⦃G2, L2, T2⦄ →
- â\88§â\88§ G1 = G2 & L2 = K & T2 = V.
-/2 width=9 by fqu_inv_zero1_aux/ qed-.
+lemma fqu_inv_sort1: ∀G1,G2,L1,L2,T2,s. ⦃G1, L1, ⋆s⦄ ⊐ ⦃G2, L2, T2⦄ →
+ â\88\83â\88\83J,V. G1 = G2 & L1 = L2.â\93\91{J}V & T2 = â\8b\86s.
+/2 width=3 by fqu_inv_sort1_aux/ qed-.
fact fqu_inv_lref1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∀I,K,V,i. L1 = K.ⓑ{I}V → T1 = #(⫯i) →
- ∧∧ G1 = G2 & L2 = K & T2 = #i.
+ ∀i. T1 = #i →
+ (∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & T2 = V & i = 0) ∨
+ ∃∃J,V,j. G1 = G2 & L1 = L2.ⓑ{J}V & T2 = #j & i = ⫯j.
#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2
-[ #I #G #L #T #J #K #W #i #_ #H destruct
-| #I #G #L #V #T #J #K #W #i #_ #H destruct
-| #p #I #G #L #V #T #J #K #W #i #_ #H destruct
-| #I #G #L #V #T #J #K #W #i #_ #H destruct
-| #I #I1 #I2 #G #L #V #HI12 #J #K #W #i #H1 #H2 destruct
- lapply (lifts_inv_lref2_uni_ge … HI12) -HI12 /2 width=1 by and3_intro/
+[ #I #G #L #T #i #H destruct /3 width=4 by ex4_2_intro, or_introl/
+| #I #G #L #V #T #i #H destruct
+| #p #I #G #L #V #T #i #H destruct
+| #I #G #L #V #T #i #H destruct
+| #I #G #L #V #T #U #HI12 #i #H destruct
+ elim (lifts_inv_lref2_uni … HI12) -HI12 /3 width=3 by ex4_3_intro, or_intror/
]
qed-.
-lemma fqu_inv_lref1: ∀I,G1,G2,K,L2,V,T2,i. ⦃G1, K.ⓑ{I}V, #(⫯i)⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∧∧ G1 = G2 & L2 = K & T2 = #i.
-/2 width=9 by fqu_inv_lref1_aux/ qed-.
+lemma fqu_inv_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐ ⦃G2, L2, T2⦄ →
+ (∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & T2 = V & i = 0) ∨
+ ∃∃J,V,j. G1 = G2 & L1 = L2.ⓑ{J}V & T2 = #j & i = ⫯j.
+/2 width=3 by fqu_inv_lref1_aux/ qed-.
fact fqu_inv_gref1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∀I,K,V,l. L1 = K.ⓑ{I}V → T1 = §l →
- â\88§â\88§ G1 = G2 & L2 = K & T2 = §l.
+ ∀l. T1 = §l →
+ â\88\83â\88\83J,V. G1 = G2 & L1 = L2.â\93\91{J}V & T2 = §l.
#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2
-[ #I #G #L #T #J #K #W #l #_ #H destruct
-| #I #G #L #V #T #J #K #W #l #_ #H destruct
-| #p #I #G #L #V #T #J #K #W #l #_ #H destruct
-| #I #G #L #V #T #J #K #W #l #_ #H destruct
-| #I #I1 #I2 #G #L #V #HI12 #J #K #W #l #H1 #H2 destruct
- lapply (lifts_inv_gref2 … HI12) -HI12 /2 width=1 by and3_intro/
+[ #I #G #L #T #l #H destruct
+| #I #G #L #V #T #l #H destruct
+| #p #I #G #L #V #T #l #H destruct
+| #I #G #L #V #T #s #H destruct
+| #I #G #L #V #T #U #HI12 #l #H destruct
+ lapply (lifts_inv_gref2 … HI12) -HI12 /2 width=3 by ex3_2_intro/
]
qed-.
-lemma fqu_inv_gref1: ∀I,G1,G2,K,L2,V,T2,l. ⦃G1, K.ⓑ{I}V, §l⦄ ⊐ ⦃G2, L2, T2⦄ →
- â\88§â\88§ G1 = G2 & L2 = K & T2 = §l.
-/2 width=7 by fqu_inv_gref1_aux/ qed-.
+lemma fqu_inv_gref1: ∀G1,G2,L1,L2,T2,l. ⦃G1, L1, §l⦄ ⊐ ⦃G2, L2, T2⦄ →
+ â\88\83â\88\83J,V. G1 = G2 & L1 = L2.â\93\91{J}V & T2 = §l.
+/2 width=3 by fqu_inv_gref1_aux/ qed-.
fact fqu_inv_bind1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
∀p,I,V1,U1. T1 = ⓑ{p,I}V1.U1 →
- (∧∧ G1 = G2 & L1 = L2 & V1 = T2) ∨
- (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2).
+ ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2
+ | ∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2
+ | ∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & ⬆*[1] T2 ≡ ⓑ{p,I}V1.U1.
#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2
-[ #I #G #L #T #q #J #W #U #H destruct
-| #I #G #L #V #T #q #J #W #U #H destruct /3 width=1 by and3_intro, or_introl/
-| #p #I #G #L #V #T #q #J #W #U #H destruct /3 width=1 by and3_intro, or_intror/
-| #I #G #L #V #T #q #J #W #U #H destruct
-| #I #I1 #I2 #G #L #V #_ #q #J #W #U #H destruct
+[ #I #G #L #T #q #J #V0 #U0 #H destruct
+| #I #G #L #V #T #q #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or3_intro0/
+| #p #I #G #L #V #T #q #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or3_intro1/
+| #I #G #L #V #T #q #J #V0 #U0 #H destruct
+| #I #G #L #V #T #U #HTU #q #J #V0 #U0 #H destruct /3 width=3 by or3_intro2, ex3_2_intro/
]
qed-.
lemma fqu_inv_bind1: ∀p,I,G1,G2,L1,L2,V1,U1,T2. ⦃G1, L1, ⓑ{p,I}V1.U1⦄ ⊐ ⦃G2, L2, T2⦄ →
- (∧∧ G1 = G2 & L1 = L2 & V1 = T2) ∨
- (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2).
+ ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2
+ | ∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & U1 = T2
+ | ∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & ⬆*[1] T2 ≡ ⓑ{p,I}V1.U1.
/2 width=4 by fqu_inv_bind1_aux/ qed-.
fact fqu_inv_flat1_aux: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
∀I,V1,U1. T1 = ⓕ{I}V1.U1 →
- (∧∧ G1 = G2 & L1 = L2 & V1 = T2) ∨
- (∧∧ G1 = G2 & L1 = L2 & U1 = T2).
+ ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2
+ | ∧∧ G1 = G2 & L1 = L2 & U1 = T2
+ | ∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & ⬆*[1] T2 ≡ ⓕ{I}V1.U1.
#G1 #G2 #L1 #L2 #T1 #T2 * -G1 -G2 -L1 -L2 -T1 -T2
-[ #I #G #L #T #J #W #U #H destruct
-| #I #G #L #V #T #J #W #U #H destruct /3 width=1 by and3_intro, or_introl/
-| #p #I #G #L #V #T #J #W #U #H destruct
-| #I #G #L #V #T #J #W #U #H destruct /3 width=1 by and3_intro, or_intror/
-| #I #I1 #I2 #G #L #V #_ #J #W #U #H destruct
+[ #I #G #L #T #J #V0 #U0 #H destruct
+| #I #G #L #V #T #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or3_intro0/
+| #p #I #G #L #V #T #J #V0 #U0 #H destruct
+| #I #G #L #V #T #J #V0 #U0 #H destruct /3 width=1 by and3_intro, or3_intro1/
+| #I #G #L #V #T #U #HTU #J #V0 #U0 #H destruct /3 width=3 by or3_intro2, ex3_2_intro/
]
qed-.
lemma fqu_inv_flat1: ∀I,G1,G2,L1,L2,V1,U1,T2. ⦃G1, L1, ⓕ{I}V1.U1⦄ ⊐ ⦃G2, L2, T2⦄ →
- (∧∧ G1 = G2 & L1 = L2 & V1 = T2) ∨
- (∧∧ G1 = G2 & L1 = L2 & U1 = T2).
+ ∨∨ ∧∧ G1 = G2 & L1 = L2 & V1 = T2
+ | ∧∧ G1 = G2 & L1 = L2 & U1 = T2
+ | ∃∃J,V. G1 = G2 & L1 = L2.ⓑ{J}V & ⬆*[1] T2 ≡ ⓕ{I}V1.U1.
/2 width=4 by fqu_inv_flat1_aux/ qed-.
+(* Advanced inversion lemmas ************************************************)
+
+lemma fqu_inv_atom1: ∀I,G1,G2,L2,T2. ⦃G1, ⋆, ⓪{I}⦄ ⊐ ⦃G2, L2, T2⦄ → ⊥.
+* #x #G1 #G2 #L2 #T2 #H
+[ elim (fqu_inv_sort1 … H) | elim (fqu_inv_lref1 … H) * | elim (fqu_inv_gref1 … H) ] -H
+#I #V [3: #i ] #_ #H destruct
+qed-.
+
+lemma fqu_inv_sort1_pair: ∀I,G1,G2,K,L2,V,T2,s. ⦃G1, K.ⓑ{I}V, ⋆s⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∧∧ G1 = G2 & L2 = K & T2 = ⋆s.
+#I #G1 #G2 #K #L2 #V #T2 #s #H elim (fqu_inv_sort1 … H) -H
+#Z #X #H1 #H2 #H3 destruct /2 width=1 by and3_intro/
+qed-.
+
+lemma fqu_inv_zero1_pair: ∀I,G1,G2,K,L2,V,T2. ⦃G1, K.ⓑ{I}V, #0⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∧∧ G1 = G2 & L2 = K & T2 = V.
+#I #G1 #G2 #K #L2 #V #T2 #H elim (fqu_inv_lref1 … H) -H *
+#Z #X [2: #x ] #H1 #H2 #H3 #H4 destruct /2 width=1 by and3_intro/
+qed-.
+
+lemma fqu_inv_lref1_pair: ∀I,G1,G2,K,L2,V,T2,i. ⦃G1, K.ⓑ{I}V, #(⫯i)⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∧∧ G1 = G2 & L2 = K & T2 = #i.
+#I #G1 #G2 #K #L2 #V #T2 #i #H elim (fqu_inv_lref1 … H) -H *
+#Z #X [2: #x ] #H1 #H2 #H3 #H4 destruct /2 width=1 by and3_intro/
+qed-.
+
+lemma fqu_inv_gref1_pair: ∀I,G1,G2,K,L2,V,T2,l. ⦃G1, K.ⓑ{I}V, §l⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∧∧ G1 = G2 & L2 = K & T2 = §l.
+#I #G1 #G2 #K #L2 #V #T2 #l #H elim (fqu_inv_gref1 … H) -H
+#Z #X #H1 #H2 #H3 destruct /2 width=1 by and3_intro/
+qed-.
+
(* Basic_2A1: removed theorems 3:
fqu_drop fqu_drop_lt fqu_lref_S_lt
*)
∃∃f1,f2. L ⊢ 𝐅*⦃V⦄ ≡ f1 & L ⊢ 𝐅*⦃T⦄ ≡ f2 & f1 ⋓ f2 ≡ f.
/2 width=4 by frees_inv_flat_aux/ qed-.
+(* Advanced inversion lemmas ***********************************************)
+
+lemma frees_inv_zero_pair: ∀f,I,K,V. K.ⓑ{I}V ⊢ 𝐅*⦃#0⦄ ≡ f →
+ ∃∃g. K ⊢ 𝐅*⦃V⦄ ≡ g & f = ⫯g.
+#f #I #K #V #H elim (frees_inv_zero … H) -H *
+[ #H destruct
+| #g #Z #Y #X #Hg #H1 #H2 destruct /3 width=3 by ex2_intro/
+]
+qed-.
+
+lemma frees_inv_lref_pair: ∀f,I,K,V,i. K.ⓑ{I}V ⊢ 𝐅*⦃#(⫯i)⦄ ≡ f →
+ ∃∃g. K ⊢ 𝐅*⦃#i⦄ ≡ g & f = ↑g.
+#f #I #K #V #i #H elim (frees_inv_lref … H) -H *
+[ #H destruct
+| #g #Z #Y #X #Hg #H1 #H2 destruct /3 width=3 by ex2_intro/
+]
+qed-.
+
(* Basic forward lemmas ****************************************************)
lemma frees_fwd_isfin: ∀f,L,T. L ⊢ 𝐅*⦃T⦄ ≡ f → 𝐅⦃f⦄.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/relocation/drops_weight.ma".
-include "basic_2/s_computation/fqus_weight.ma".
-include "basic_2/static/frees.ma".
-
-(* CONTEXT-SENSITIVE FREE VARIABLES *****************************************)
-
-(* Properties with star-iterated supclosure *********************************)
-
-lemma frees_fqus_drops: ∀f1,G,L1,T1. L1 ⊢ 𝐅*⦃T1⦄ ≡ f1 →
- ∀L2,T2. ⦃G, L1, T1⦄ ⊐* ⦃G, L2, T2⦄ →
- ∀I,n. ⬇*[n] L1 ≡ L2.ⓑ{I}T2 →
- ∃∃f2. L2 ⊢ 𝐅*⦃T2⦄ ≡ f2 & f2 ⊆ ⫱*[⫯n] f1.
-#f1 #G #L1 #T1 #H elim H -f1 -L1 -T1
-[ #f1 #J #Hf1 #L2 #T2 #H12 #I #n #HL12
- elim (fqus_inv_atom1 … H12) -H12 #H1 #H2 #H3 destruct
- lapply (drops_fwd_lw … HL12) -HL12 #HL12
- elim (lt_le_false … HL12) -HL12 //
-| #f1 #J #L1 #V1 #s #Hf1 #IH #L2 #T2 #H12
- elim (fqus_inv_sort1 … H12) -H12 [ * | #H12 #I * ]
- [ -IH -Hf1 #H1 #H2 #H3 #I #n #HL12 destruct
- lapply (drops_fwd_lw … HL12) -HL12 #HL12
- elim (lt_le_false … HL12) -HL12 //
- | -IH #HL12 lapply (drops_fwd_isid … HL12 ?) -HL12 //
- #H destruct <(fqus_inv_refl_atom3 … H12) -H12 /2 width=3 by sle_refl, ex2_intro/
- | -Hf1 #I #HL12 lapply (drops_inv_drop1 … HL12) -HL12
- #HL12 elim (IH … H12 … HL12) -IH -H12 -HL12 /3 width=3 by ex2_intro/
- ]
-| #f1 #J #L1 #V1 #Hf1 #IH #L2 #T2 #H12
- elim (fqus_inv_zero1 … H12) -H12 [ * | #H12 #I * ]
- [ -IH -Hf1 #H1 #H2 #H3 #I #n #HL12 destruct
- lapply (drops_fwd_lw … HL12) -HL12 #HL12
- elim (lt_le_false … HL12) -HL12 //
- | -IH -H12 #HL12 lapply (drops_fwd_isid … HL12 ?) -HL12 //
- #H destruct /3 width=3 by sle_refl, ex2_intro/
- | -Hf1 #n #HL12 lapply (drops_inv_drop1 … HL12) -HL12
- #HL12 elim (IH … H12 … HL12) -IH -H12 -HL12 /3 width=3 by ex2_intro/
- ]
-| #f1 #J #L1 #V1 #i #Hf1 #IH #L2 #T2 #H12
- elim (fqus_inv_lref1 … H12) -H12 [ * | #H12 #I * ]
- [ -IH -Hf1 #H1 #H2 #H3 #I #n #HL12 destruct
- lapply (drops_fwd_lw … HL12) -HL12 #HL12
- elim (lt_le_false … HL12) -HL12 //
- | -IH #HL12 lapply (drops_fwd_isid … HL12 ?) -HL12 //
- #H destruct <(fqus_inv_refl_atom3 … H12) -H12 /2 width=3 by sle_refl, ex2_intro/
- | -Hf1 #I #HL12 lapply (drops_inv_drop1 … HL12) -HL12
- #HL12 elim (IH … H12 … HL12) -IH -H12 -HL12 /3 width=3 by ex2_intro/
- ]
-| #f1 #J #L1 #V1 #l #Hf1 #IH #L2 #T2 #H12
- elim (fqus_inv_gref1 … H12) -H12 [ * | #H12 #I * ]
- [ -IH -Hf1 #H1 #H2 #H3 #I #n #HL12 destruct
- lapply (drops_fwd_lw … HL12) -HL12 #HL12
- elim (lt_le_false … HL12) -HL12 //
- | -IH #HL12 lapply (drops_fwd_isid … HL12 ?) -HL12 //
- #H destruct <(fqus_inv_refl_atom3 … H12) -H12 /2 width=3 by sle_refl, ex2_intro/
- | -Hf1 #I #HL12 lapply (drops_inv_drop1 … HL12) -HL12
- #HL12 elim (IH … H12 … HL12) -IH -H12 -HL12 /3 width=3 by ex2_intro/
- ]
-| #f1V #f1T #f1 #p #J #L1 #V #T #_ #_ #Hf1 #IHV #IHT #L2 #T2 #H12 #I #n #HL12
- elim (fqus_inv_bind1 … H12) -H12 [ * |*: #H12 ]
- [ -IHV -IHT -Hf1 #H1 #H2 #H3 destruct
- lapply (drops_fwd_lw … HL12) -HL12 #HL12
- elim (lt_le_false … HL12) -HL12 //
- | -IHT elim (IHV … H12 … HL12) -IHV -H12 -HL12
- /4 width=6 by sor_tls, sor_inv_sle_sn_trans, ex2_intro/
- | -IHV elim (IHT … H12 I (⫯n)) -IHT -H12 /2 width=1 by drops_drop/ -HL12
- <tls_xn /4 width=6 by ex2_intro, sor_tls, sor_inv_sle_dx_trans/
- ]
-| #f1V #f1T #f1 #J #L1 #V #T #_ #_ #Hf1 #IHV #IHT #L2 #T2 #H12 #I #n #HL12
- elim (fqus_inv_flat1 … H12) -H12 [ * |*: #H12 ]
- [ -IHV -IHT -Hf1 #H1 #H2 #H3 destruct
- lapply (drops_fwd_lw … HL12) -HL12 #HL12
- elim (lt_le_false … HL12) -HL12 //
- | -IHT elim (IHV … H12 … HL12) -IHV -H12 -HL12
- /4 width=6 by sor_tls, sor_inv_sle_sn_trans, ex2_intro/
- | -IHV elim (IHT … H12 … HL12) -IHT -H12 -HL12
- /4 width=6 by ex2_intro, sor_tls, sor_inv_sle_dx_trans/
- ]
-]
-qed-.
}
]
[ { "context-sensitive free variables" * } {
- [ "frees ( ? ⊢ 𝐅*⦃?⦄ ≡ ? )" "frees_weight" + "frees_lreq" + "frees_drops" + "frees_fqup" + "frees_fqus" + "frees_frees" * ]
+ [ "frees ( ? ⊢ 𝐅*⦃?⦄ ≡ ? )" "frees_weight" + "frees_lreq" + "frees_drops" + "frees_fqup" + "frees_frees" * ]
}
]
[ { "restricted ref. for local env." * } {
(* Inversion & forward lemmas ***********************************************)
+lemma nat_split: ∀x. x = 0 ∨ ∃y. ⫯y = x.
+* /3 width=2 by ex_intro, or_introl, or_intror/
+qed-.
+
lemma max_inv_O3: ∀x,y. (x ∨ y) = 0 → 0 = x ∧ 0 = y.
/4 width=2 by le_maxr, le_maxl, le_n_O_to_eq, conj/
qed-.