]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/fsb_csx.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / fsb_csx.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 "basic_2A/computation/fpbs_fpb.ma".
16 include "basic_2A/computation/fpbs_fpbs.ma".
17 include "basic_2A/computation/csx_fpbs.ma".
18 include "basic_2A/computation/lsx_csx.ma".
19 include "basic_2A/computation/fsb_alt.ma".
20
21 (* "QRST" STRONGLY NORMALIZING CLOSURES *************************************)
22
23 (* Advanced propreties on context-sensitive extended normalizing terms ******)
24
25 lemma csx_fsb_fpbs: ∀h,g,G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬊*[h, g] T1 →
26                     ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → ⦥[h, g] ⦃G2, L2, T2⦄.
27 #h #g #G1 #L1 #T1 #H @(csx_ind … H) -T1
28 #T1 #HT1 #IHc #G2 #L2 #T2 @(fqup_wf_ind … G2 L2 T2) -G2 -L2 -T2
29 #G0 #L0 #T0 #IHu #H10 lapply (csx_fpbs_conf … H10) // -HT1
30 #HT0 generalize in match IHu; -IHu generalize in match H10; -H10
31 @(lsx_ind … (csx_lsx … HT0 0)) -L0
32 #L0 #_ #IHd #H10 #IHu @fsb_intro
33 #G2 #L2 #T2 * -G2 -L2 -T2 [ -IHd -IHc | -IHu -IHd |  ]
34 [ /4 width=5 by fpbs_fqup_trans, fqu_fqup/
35 | #T2 #HT02 #HnT02 elim (fpbs_cpx_trans_neq … H10 … HT02 HnT02) -T0
36   /3 width=4 by/
37 | #L2 #HL02 #HnL02 @(IHd … HL02 HnL02) -IHd -HnL02 [ -IHu -IHc | ]
38   [ /3 width=3 by fpbs_lpxs_trans, lpx_lpxs/
39   | #G3 #L3 #T3 #H03 #_ elim (lpx_fqup_trans … H03 … HL02) -L2
40     #L4 #T4 elim (eq_term_dec T0 T4) [ -IHc | -IHu ]
41     [ #H destruct /5 width=5 by fsb_fpbs_trans, lpxs_fpbs, fpbs_fqup_trans, lpx_lpxs/
42     | #HnT04 #HT04 #H04 #HL43 elim (cpxs_neq_inv_step_sn … HT04 HnT04) -HT04 -HnT04
43       #T2 #HT02 #HnT02 #HT24 elim (fpbs_cpx_trans_neq … H10 … HT02 HnT02) -T0
44       lapply (fpbs_intro_alt … G3 … L4 … L3 L3 … T3 … HT24 ? ? ?) -HT24
45       /3 width=8 by fpbs_trans, lpx_lpxs, fqup_fqus/ (**) (* full auto too slow *)
46     ]
47   ]
48 ]
49 qed.
50
51 lemma csx_fsb: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ⦥[h, g] ⦃G, L, T⦄.
52 /2 width=5 by csx_fsb_fpbs/ qed.
53
54 (* Advanced eliminators *****************************************************)
55
56 lemma csx_ind_fpb: ∀h,g. ∀R:relation3 genv lenv term.
57                    (∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬊*[h, g] T1 →
58                                (∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2) →
59                                R G1 L1 T1
60                    ) →
61                    ∀G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → R G L T.
62 /4 width=4 by fsb_inv_csx, csx_fsb, fsb_ind_alt/ qed-.
63
64 lemma csx_ind_fpbg: ∀h,g. ∀R:relation3 genv lenv term.
65                     (∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⬊*[h, g] T1 →
66                                 (∀G2,L2,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2) →
67                                 R G1 L1 T1
68                     ) →
69                     ∀G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → R G L T.
70 /4 width=4 by fsb_inv_csx, csx_fsb, fsb_ind_fpbg/ qed-.