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 "basic_2/rt_transition/cnr_tdeq.ma".
16 include "basic_2/rt_transition/cnu_drops.ma".
17 include "basic_2/rt_transition/cnu_cnr.ma".
18 include "basic_2/rt_transition/cnu_cnr_simple.ma".
20 (* NORMAL TERMS FOR T-UNUNBOUND RT-TRANSITION *******************************)
22 (* Properties with context-free sort-irrelevant equivalence for terms *******)
24 lemma cnu_dec_tdeq (h) (G) (L):
25 ∀T1. ∨∨ ⦃G,L⦄ ⊢ ⥲[h] 𝐍⦃T1⦄
26 | ∃∃n,T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 & (T1 ≛ T2 → ⊥).
28 @(fqup_wf_ind_eq (Ⓣ) … G L T1) -G -L -T1 #G0 #L0 #T0 #IH #G #L * *
29 [ #s #HG #HL #HT destruct -IH
30 /3 width=5 by cnu_sort, or_introl/
31 | #i #HG #HL #HT destruct -IH
32 elim (drops_F_uni L i)
33 [ /3 width=7 by cnu_atom_drops, or_introl/
34 | * * [ #I | * #V ] #K #HLK
35 [ /3 width=8 by cnu_unit_drops, or_introl/
36 | elim (lifts_total V 𝐔❴↑i❵) #W #HVW
37 @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpm_delta_drops/ ] #H
38 lapply (tdeq_inv_lref1 … H) -H #H destruct
39 /2 width=5 by lifts_inv_lref2_uni_lt/
40 | elim (lifts_total V 𝐔❴↑i❵) #W #HVW
41 @or_intror @(ex2_2_intro … W) [1,2: /2 width=7 by cpm_ell_drops/ ] #H
42 lapply (tdeq_inv_lref1 … H) -H #H destruct
43 /2 width=5 by lifts_inv_lref2_uni_lt/
46 | #l #HG #HL #HT destruct -IH
47 /3 width=5 by cnu_gref, or_introl/
48 | #p * [ cases p ] #V1 #T1 #HG #HL #HT destruct
49 [ elim (cpr_subst h G (L.ⓓV1) T1 0 L V1) [| /2 width=1 by drops_refl/ ] #T2 #X2 #HT12 #HXT2 -IH
50 elim (tdeq_dec T1 T2) [ -HT12 #HT12 | #HnT12 ]
51 [ elim (tdeq_inv_lifts_dx … HT12 … HXT2) -T2 #X1 #HXT1 #_ -X2
52 @or_intror @(ex2_2_intro … X1) [1,2: /2 width=4 by cpm_zeta/ ] #H
53 /2 width=7 by tdeq_lifts_inv_pair_sn/
54 | @or_intror @(ex2_2_intro … (+ⓓV1.T2)) [1,2: /2 width=2 by cpm_bind/ ] #H
55 elim (tdeq_inv_pair … H) -H /2 width=1 by/
57 | elim (cnr_dec_tdeq h G L V1) [ elim (IH G (L.ⓓV1) T1) [| * | // ] | * ] -IH
58 [ #HT1 #HV1 /3 width=7 by cnu_abbr_neg, or_introl/
59 | #n #T2 #HT12 #HnT12 #_
60 @or_intror @(ex2_2_intro … (-ⓓV1.T2)) [1,2: /2 width=2 by cpm_bind/ ] #H
61 elim (tdeq_inv_pair … H) -H /2 width=1 by/
63 @or_intror @(ex2_2_intro … (-ⓓV2.T1)) [1,2: /2 width=2 by cpr_pair_sn/ ] #H
64 elim (tdeq_inv_pair … H) -H /2 width=1 by/
66 | elim (cnr_dec_tdeq h G L V1) [ elim (IH G (L.ⓛV1) T1) [| * | // ] | * ] -IH
67 [ #HT1 #HV1 /3 width=7 by cnu_abst, or_introl/
68 | #n #T2 #HT12 #HnT12 #_
69 @or_intror @(ex2_2_intro … (ⓛ{p}V1.T2)) [1,2: /2 width=2 by cpm_bind/ ] #H
70 elim (tdeq_inv_pair … H) -H /2 width=1 by/
72 @or_intror @(ex2_2_intro … (ⓛ{p}V2.T1)) [1,2: /2 width=2 by cpr_pair_sn/ ] #H
73 elim (tdeq_inv_pair … H) -H /2 width=1 by/
76 | * #V1 #T1 #HG #HL #HT destruct [| -IH ]
77 [ elim (cnr_dec_tdeq h G L V1) [ elim (IH G L T1) [| * | // ] | * ] -IH
79 elim (simple_dec_ex T1) [| * #p * #W1 #U1 #H destruct ]
80 [ /3 width=7 by cnu_appl_simple, or_introl/
81 | elim (lifts_total V1 𝐔❴1❵) #X1 #HVX1
82 @or_intror @(ex2_2_intro … (ⓓ{p}W1.ⓐX1.U1)) [1,2: /2 width=3 by cpm_theta/ ] #H
83 elim (tdeq_inv_pair … H) -H #H destruct
84 | @or_intror @(ex2_2_intro … (ⓓ{p}ⓝW1.V1.U1)) [1,2: /2 width=2 by cpm_beta/ ] #H
85 elim (tdeq_inv_pair … H) -H #H destruct
87 | #n #T2 #HT12 #HnT12 #_
88 @or_intror @(ex2_2_intro … (ⓐV1.T2)) [1,2: /2 width=2 by cpm_appl/ ] #H
89 elim (tdeq_inv_pair … H) -H /2 width=1 by/
91 @or_intror @(ex2_2_intro … (ⓐV2.T1)) [1,2: /2 width=2 by cpr_pair_sn/ ] #H
92 elim (tdeq_inv_pair … H) -H /2 width=1 by/
94 | @or_intror @(ex2_2_intro … T1) [1,2: /2 width=2 by cpm_eps/ ] #H
95 /2 width=4 by tdeq_inv_pair_xy_y/