]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnh_tdeq.ma
update in ground_2 static_2 basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_transition / cnh_tdeq.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_2/rt_transition/cpr_tdeq.ma".
16 include "basic_2/rt_transition/cnh_simple.ma".
17 include "basic_2/rt_transition/cnh_drops.ma".
18
19 (* NORMAL TERMS FOR HEAD T-UNUNBOUND RT-TRANSITION **************************)
20
21 (* Properties with context-free sort-irrelevant equivalence for terms *******)
22
23 lemma cnh_dec_tdeq (h) (G) (L):
24       ∀T1. ∨∨ ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T1⦄
25             | ∃∃n,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 & (T1 ≛ T2 → ⊥).
26 #h #G #L * *
27 [ #s /3 width=5 by cnh_sort, or_introl/
28 | #i elim (drops_F_uni L i)
29   [ /3 width=7 by cnh_atom_drops, or_introl/
30   | * * [ #I | * #V ] #K #HLK
31     [ /3 width=8 by cnh_unit_drops, or_introl/
32     | elim (lifts_total V 𝐔❴↑i❵) #W #HVW
33       @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpm_delta_drops/ ] #H
34       lapply (tdeq_inv_lref1 … H) -H #H destruct
35       /2 width=5 by lifts_inv_lref2_uni_lt/
36     | elim (lifts_total V 𝐔❴↑i❵) #W #HVW
37       @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpm_ell_drops/ ] #H
38       lapply (tdeq_inv_lref1 … H) -H #H destruct
39       /2 width=5 by lifts_inv_lref2_uni_lt/
40     ]
41   ]
42 | #l /3 width=5 by cnh_gref, or_introl/
43 | #p * [ cases p ] #V1 #T1
44   [ elim (cpr_subst h G (L.ⓓV1) T1 0 L V1) [| /2 width=1 by drops_refl/ ] #T2 #X2 #HT12 #HXT2
45     elim (tdeq_dec T1 T2) [ -HT12 #HT12 | #HnT12 ]
46     [ elim (tdeq_inv_lifts_dx … HT12 … HXT2) -T2 #X1 #HXT1 #_ -X2
47       @or_intror @(ex2_2_intro … X1) [1,2: /2 width=4 by cpm_zeta/ ] #H
48       /2 width=7 by tdeq_lifts_inv_pair_sn/
49     | @or_intror @(ex2_2_intro … (+ⓓV1.T2)) [1,2: /2 width=2 by cpm_bind/ ] #H
50       elim (tdeq_inv_pair … H) -H /2 width=1 by/
51     ]
52   | /3 width=5 by cnh_abbr_neg, or_introl/
53   | /3 width=5 by cnh_abst, or_introl/
54   ]
55 | * #V1 #T1
56   [ elim (simple_dec_ex T1) [ #HT1 | * #p * #W1 #U1 #H destruct ]
57     [ /3 width=5 by cnh_appl_simple, or_introl/
58     | elim (lifts_total V1 𝐔❴1❵) #X1 #HVX1
59       @or_intror @(ex2_2_intro … (ⓓ{p}W1.ⓐX1.U1)) [1,2: /2 width=3 by cpm_theta/ ] #H
60       elim (tdeq_inv_pair … H) -H #H destruct
61     | @or_intror @(ex2_2_intro … (ⓓ{p}ⓝW1.V1.U1)) [1,2: /2 width=2 by cpm_beta/ ] #H
62       elim (tdeq_inv_pair … H) -H #H destruct
63     ]
64   | @or_intror @(ex2_2_intro … T1) [1,2: /2 width=2 by cpm_eps/ ] #H
65     /2 width=4 by tdeq_inv_pair_xy_y/
66   ]
67 ]
68 qed-.