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 "static_2/syntax/fold.ma".
16 include "apps_2/models/vpushs.ma".
18 (* MULTIPLE PUSH FOR MODEL EVALUATIONS **************************************)
20 (* Properties with fold for restricted closures *****************************)
22 lemma vpushs_fold (M): is_model M → is_extensional M →
24 (∀v. L ⨁[gv] lv ≘ v → ⟦T1⟧[gv,v] ≗ ⟦T2⟧[gv,v]) →
25 ⟦L+T1⟧[gv,lv] ≗{M} ⟦L+T2⟧[gv,lv].
26 #M #H1M #H2M #L elim L -L [| #K * [| * ]]
27 [ #T1 #T2 #gv #lv #H12
29 /4 width=1 by vpushs_atom, veq_refl/
30 | #I #IH #T1 #T2 #gv #lv #H12
32 /5 width=1 by vpushs_unit, mx, mr/
33 | #V #IH #T1 #T2 #gv #lv #H12
36 @(mq … H1M) [3:|*: /3 width=2 by seq_sym, md/ ]
37 /4 width=1 by vpushs_abbr, mc, mr/
38 | #W #IH #T1 #T2 #gv #lv #H12
40 /5 width=1 by vpushs_abst, mx, mr/
44 (* Inversion lemmas with fold for restricted closures ***********************)
46 lemma vpushs_inv_fold (M): is_model M → is_injective M →
47 ∀L,T1,T2,gv,lv. ⟦L+T1⟧[gv,lv] ≗{M} ⟦L+T2⟧[gv,lv] →
48 ∀v. L ⨁[gv] lv ≘ v → ⟦T1⟧[gv,v] ≗ ⟦T2⟧[gv,v].
49 #M #H1M #H2M #L elim L -L [| #K * [| * ]]
51 >fold_atom >fold_atom #H12 #v #H
52 lapply (vpushs_inv_atom … H) -H // #Hv
53 /4 width=7 by ti_comp, veq_refl, mq/
54 | #I #IH #T1 #T2 #gv #lv
55 >fold_unit >fold_unit #H12 #y #H
56 elim (vpushs_inv_unit … H) -H // #v #d #Hlv #Hv
57 lapply (IH … H12 … Hlv) -IH -H12 -Hlv #H12
58 /4 width=7 by ti_comp, ti_fwd_mx_dx, veq_refl, mq/
59 | #V #IH #T1 #T2 #gv #lv
60 >fold_pair >fold_pair #H12 #y #H
61 elim (vpushs_inv_abbr … H) -H // #v #Hlv #Hv
62 lapply (IH … H12 … Hlv) -IH -H12 -Hlv #H12
63 @(mq … H1M) [4,5: @(ti_comp … Hv) /3 width=2 by veq_refl/ |1,2: skip ]
64 /4 width=7 by ti_comp, ti_fwd_abbr_dx, veq_refl, mq/
65 | #W #IH #T1 #T2 #gv #lv
66 >fold_pair >fold_pair #H12 #y #H
67 elim (vpushs_inv_abst … H) -H // #v #d #Hlv #Hv
68 lapply (IH … H12 … Hlv) -IH -H12 -Hlv #H12
69 /4 width=7 by ti_comp, ti_fwd_mx_dx, veq_refl, mq/