]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/static/lsubf_lsubf.ma
update in ground and delayed updating
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / static / lsubf_lsubf.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/static/frees_frees.ma".
16 include "static_2/static/lsubf.ma".
17
18 (* RESTRICTED REFINEMENT FOR CONTEXT-SENSITIVE FREE VARIABLES ***************)
19
20 (* Main properties **********************************************************)
21
22 theorem lsubf_sor:
23         ∀K,L,g1,f1. ❨K,g1❩ ⫃𝐅+ ❨L,f1❩ →
24         ∀g2,f2. ❨K,g2❩ ⫃𝐅+ ❨L,f2❩ →
25         ∀g. g1 ⋓ g2 ≘ g → ∀f. f1 ⋓ f2 ≘ f → ❨K,g❩ ⫃𝐅+ ❨L,f❩.
26 #K elim K -K
27 [ #L #g1 #f1 #H1 #g2 #f2 #H2 #g #Hg #f #Hf
28   elim (lsubf_inv_atom1 … H1) -H1 #H1 #H destruct
29   lapply (lsubf_inv_atom … H2) -H2 #H2
30   /5 width=4 by lsubf_atom, pr_sor_mono, pr_sor_eq_repl_back_dx, pr_sor_eq_repl_back_sn/
31 | #K #J #IH #L #g1 #f1 #H1 #g2 #f2 #H2 #g #Hg #f #Hf
32   elim (pr_map_split_tl g1) * #y1 #H destruct
33   elim (pr_map_split_tl g2) * #y2 #H destruct
34   [ elim (pr_sor_inv_push_bi … Hg) -Hg [|*: // ] #y #Hy #H destruct
35     elim (lsubf_inv_push1 … H1) -H1 #x1 #Z1 #Y1 #H1 #H #H0 destruct
36     elim (lsubf_inv_push_sn … H2) -H2 #x2 #H2 #H destruct
37     elim (pr_sor_inv_push_bi … Hf) -Hf [|*: // ] #x #Hx #H destruct
38     /3 width=8 by lsubf_push/
39   | elim (pr_sor_inv_push_next … Hg) -Hg [|*: // ] #y #Hy #H destruct
40     elim (lsubf_inv_push1 … H1) -H1 #x1 #Z1 #Y1 #H1 #H #H0 destruct
41     generalize in match H2; -H2 cases J -J #J [| #V ] #H2
42     [ elim (lsubf_inv_unit1 … H2) -H2 #x2 #Y2 #H2 #H #H0 destruct
43     | elim (lsubf_inv_pair1 … H2) -H2 *
44       [ #x2 #Z2 #H2 #H #H0 destruct
45       | #y3 #y4 #x2 #Y2 #W #U #H2 #Hy3 #Hy2 #H #H0 #H3 #H4 destruct
46       | #y3 #y4 #x2 #Z2 #Y2 #H2 #Hy3 #Hy2 #H #H0 destruct
47       ]
48     ]
49     elim (pr_sor_inv_push_next … Hf) -Hf [1,6,11,16:|*: // ] #x #Hx #H destruct
50     /3 width=12 by lsubf_unit, lsubf_beta, lsubf_bind, pr_sor_assoc_sn/
51   | elim (pr_sor_inv_next_push … Hg) -Hg [|*: // ] #y #Hy #H destruct
52     elim (lsubf_inv_push1 … H2) -H2 #x2 #Z2 #Y2 #H2 #H #H0 destruct
53     generalize in match H1; -H1 cases J -J #J [| #V ] #H1
54     [ elim (lsubf_inv_unit1 … H1) -H1 #x1 #Y1 #H1 #H #H0 destruct
55     | elim (lsubf_inv_pair1 … H1) -H1 *
56       [ #x1 #Z1 #H1 #H #H0 destruct
57       | #y3 #y4 #x1 #Y1 #W #U #H1 #Hy3 #Hy1 #H #H0 #H3 #H4 destruct
58       | #y3 #y4 #x1 #Z1 #Y1 #H1 #Hy3 #Hy1 #H #H0 destruct
59       ]
60     ]
61     elim (pr_sor_inv_next_push … Hf) -Hf [1,6,11,16:|*: // ] #x #Hx #H destruct
62     /3 width=12 by lsubf_unit, lsubf_beta, lsubf_bind, pr_sor_comm_23/
63   | elim (pr_sor_inv_next_bi … Hg) -Hg [|*: // ] #y #Hy #H destruct
64     generalize in match H2; generalize in match H1; -H1 -H2 cases J -J #J [| #V ] #H1 #H2
65     [ elim (lsubf_inv_unit1 … H1) -H1 #x1 #Y1 #H1 #H #H0 destruct
66       elim (lsubf_inv_bind_sn … H2) -H2 #x2 #H2 #H destruct
67     | elim (lsubf_inv_pair1 … H1) -H1 *
68       [ #x1 #Z1 #H1 #H #H0 destruct
69         elim (lsubf_inv_bind_sn … H2) -H2 #x2 #H2 #H destruct
70       | #y3 #y4 #x1 #Y1 #W #U #H1 #Hy3 #Hy1 #H #H0 #H3 #H4 destruct
71         elim (lsubf_inv_beta_sn … H2) -H2 #z3 #z4 #x2 #H2 #Hz3 #Hy2 #H destruct
72         lapply (frees_mono … Hz3 … Hy3) -Hz3 #H3
73         lapply (pr_sor_eq_repl_back_dx … Hy2 … H3) -z3 #Hy2
74       | #y3 #y4 #x1 #Z1 #Y1 #H1 #Hy3 #Hy1 #H #H0 destruct
75         elim (lsubf_inv_unit_sn … H2) -H2 #z3 #z4 #x2 #H2 #Hz3 #Hy2 #H destruct
76         lapply (frees_mono … Hz3 … Hy3) -Hz3 #H3
77         lapply (pr_sor_eq_repl_back_dx … Hy2 … H3) -z3 #Hy2
78       ]
79     ]
80     elim (pr_sor_inv_next_bi … Hf) -Hf [1,6,11,16:|*: // ] #x #Hx #H destruct
81     /3 width=12 by lsubf_unit, lsubf_beta, lsubf_bind, pr_sor_coll_dx/
82   ]
83 ]
84 qed-.