]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/apps_2/models/vpushs_fold.ma
some restyling ...
[helm.git] / matita / matita / contribs / lambdadelta / apps_2 / models / vpushs_fold.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 "static_2/syntax/fold.ma".
16 include "apps_2/models/vpushs.ma".
17
18 (* MULTIPLE PUSH FOR MODEL EVALUATIONS **************************************)
19
20 (* Properties with fold for restricted closures *****************************)
21
22 lemma vpushs_fold (M): is_model M → is_extensional M →
23                        ∀L,T1,T2,gv,lv.
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
28   >fold_atom >fold_atom
29   /4 width=1 by vpushs_atom, veq_refl/
30 | #I #IH #T1 #T2 #gv #lv #H12
31   >fold_unit >fold_unit
32   /5 width=1 by vpushs_unit, mx, mr/
33 | #V #IH #T1 #T2 #gv #lv #H12
34   >fold_pair >fold_pair
35   @IH -IH #v #Hv
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
39   >fold_pair >fold_pair
40   /5 width=1 by vpushs_abst, mx, mr/
41 ]
42 qed.
43
44 (* Inversion lemmas with fold for restricted closures ***********************)
45
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 * [| * ]]
50 [ #T1 #T2 #gv #lv
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/
70 ]
71 qed-.