]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr.etc
basic properties of cpr ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_transition / cpr.etc
1 (* Basic_1: includes: pr2_delta1 *)
2 | cpr_delta: ∀G,L,K,V,V2,W2,i.
3              ⬇[i] L ≡ K. ⓓV → cpr G K V V2 →
4              ⬆[0, i + 1] V2 ≡ W2 → cpr G L (#i) W2
5
6 lemma cpr_cpx: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T1 ➡[h] T2.
7 #h #o #G #L #T1 #T2 #H elim H -L -T1 -T2
8 /2 width=7 by cpx_delta, cpx_bind, cpx_flat, cpx_zeta, cpx_eps, cpx_beta, cpx_theta/
9 qed.
10
11 lemma lsubr_cpr_trans: ∀G. lsub_trans … (cpr G) lsubr.
12 #G #L1 #T1 #T2 #H elim H -G -L1 -T1 -T2
13 [ //
14 | #G #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12
15   elim (lsubr_fwd_drop2_abbr … HL12 … HLK1) -L1 *
16   /3 width=6 by cpr_delta/
17 |3,7: /4 width=1 by lsubr_pair, cpr_bind, cpr_beta/
18 |4,6: /3 width=1 by cpr_flat, cpr_eps/
19 |5,8: /4 width=3 by lsubr_pair, cpr_zeta, cpr_theta/
20 ]
21 qed-.
22
23 (* Basic_1: was by definition: pr2_free *)
24 lemma tpr_cpr: ∀G,T1,T2. ⦃G, ⋆⦄ ⊢ T1 ➡ T2 → ∀L. ⦃G, L⦄ ⊢ T1 ➡ T2.
25 #G #T1 #T2 #HT12 #L
26 lapply (lsubr_cpr_trans … HT12 L ?) //
27 qed.
28
29 lemma cpr_delift: ∀G,K,V,T1,L,l. ⬇[l] L ≡ (K.ⓓV) →
30                   ∃∃T2,T. ⦃G, L⦄ ⊢ T1 ➡ T2 & ⬆[l, 1] T ≡ T2.
31 #G #K #V #T1 elim T1 -T1
32 [ * /2 width=4 by cpr_atom, lift_sort, lift_gref, ex2_2_intro/
33   #i #L #l #HLK elim (lt_or_eq_or_gt i l)
34   #Hil [1,3: /4 width=4 by lift_lref_ge_minus, lift_lref_lt, ylt_inj, yle_inj, ex2_2_intro/ ]
35   destruct
36   elim (lift_total V 0 (i+1)) #W #HVW
37   elim (lift_split … HVW i i) /3 width=6 by cpr_delta, ex2_2_intro/
38 | * [ #a ] #I #W1 #U1 #IHW1 #IHU1 #L #l #HLK
39   elim (IHW1 … HLK) -IHW1 #W2 #W #HW12 #HW2
40   [ elim (IHU1 (L. ⓑ{I}W1) (l+1)) -IHU1 /3 width=9 by drop_drop, cpr_bind, lift_bind, ex2_2_intro/
41   | elim (IHU1 … HLK) -IHU1 -HLK /3 width=8 by cpr_flat, lift_flat, ex2_2_intro/
42   ]
43 ]
44 qed-.
45
46 fact lstas_cpr_aux: ∀h,G,L,T1,T2,d. ⦃G, L⦄ ⊢ T1 •*[h, d] T2 →
47                     d = 0 → ⦃G, L⦄ ⊢ T1 ➡ T2.
48 #h #G #L #T1 #T2 #d #H elim H -G -L -T1 -T2 -d
49 /3 width=1 by cpr_eps, cpr_flat, cpr_bind/
50 [ #G #L #K #V1 #V2 #W2 #i #d #HLK #_ #HVW2 #IHV12 #H destruct
51   /3 width=6 by cpr_delta/
52 | #G #L #K #V1 #V2 #W2 #i #d #_ #_ #_ #_ <plus_n_Sm #H destruct
53 ]
54 qed-.
55
56 lemma lstas_cpr: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 •*[h, 0] T2 → ⦃G, L⦄ ⊢ T1 ➡ T2.
57 /2 width=4 by lstas_cpr_aux/ qed.
58
59 lemma cpr_inv_atom1: ∀I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ➡ T2 →
60                      T2 = ⓪{I} ∨
61                      ∃∃K,V,V2,i. ⬇[i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V ➡ V2 &
62                                  ⬆[O, i + 1] V2 ≡ T2 & I = LRef i.
63 /2 width=3 by cpr_inv_atom1_aux/ qed-.
64
65 (* Basic_1: includes: pr0_gen_lref pr2_gen_lref *)
66 lemma cpr_inv_lref1: ∀G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡ T2 →
67                      T2 = #i ∨
68                      ∃∃K,V,V2. ⬇[i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V ➡ V2 &
69                                ⬆[O, i + 1] V2 ≡ T2.
70 #G #L #T2 #i #H
71 elim (cpr_inv_atom1 … H) -H /2 width=1 by or_introl/
72 * #K #V #V2 #j #HLK #HV2 #HVT2 #H destruct /3 width=6 by ex3_3_intro, or_intror/
73 qed-.
74
75 (* Note: the main property of simple terms *)
76 lemma cpr_inv_appl1_simple: ∀G,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1. T1 ➡ U → 𝐒⦃T1⦄ →
77                             ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ T1 ➡ T2 &
78                                      U = ⓐV2. T2.
79 #G #L #V1 #T1 #U #H #HT1
80 elim (cpr_inv_appl1 … H) -H *
81 [ /2 width=5 by ex3_2_intro/
82 | #a #V2 #W1 #W2 #U1 #U2 #_ #_ #_ #H #_ destruct
83   elim (simple_inv_bind … HT1)
84 | #a #V #V2 #W1 #W2 #U1 #U2 #_ #_ #_ #_ #H #_ destruct
85   elim (simple_inv_bind … HT1)
86 ]
87 qed-.