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/cpr.ma".
17 (* EXAMPLES *****************************************************************)
19 (* A reduction cycle in exactly three steps: the term Omega *****************)
21 definition Delta (s): term ≝ +ⓛ⋆s.ⓐ#0.#0.
23 definition Omega1 (s): term ≝ ⓐ(Delta s).(Delta s).
25 definition Omega2 (s): term ≝ +ⓓⓝ⋆s.(Delta s).ⓐ#0.#0.
27 definition Omega3 (s): term ≝ +ⓓⓝ⋆s.(Delta s).(Omega1 s).
29 (* Basic properties *********************************************************)
31 lemma Delta_lifts (f) (s): ⇧*[f] (Delta s) ≘ (Delta s).
32 /4 width=1 by lifts_lref, lifts_bind, lifts_flat/ qed.
34 (* Basic inversion properties ***********************************************)
36 lemma cpr_inv_Delta1_body_sn (h) (G) (L) (s):
37 ∀X. ❨G,L.ⓛ⋆s❩ ⊢ ⓐ#O.#O ➡[h,0] X → ⓐ#O.#O = X.
39 lapply (cpm_inv_appl1 … H) -H * *
40 [ #W2 #T2 #HW2 #HT2 #H destruct
41 elim (cpr_inv_zero1 … HW2) -HW2
42 elim (cpr_inv_zero1 … HT2) -HT2
44 | * #Y #X1 #X2 #_ #_ #H #_ destruct
45 | #_ * #Y #X1 #X2 #_ #_ #H destruct
46 | #_ * #Y #X1 #X2 #_ #_ #H destruct
48 | #p #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #H #_ destruct
49 | #p #V2 #V #W1 #W2 #T1 #T2 #_ #_ #_ #_ #H #_ destruct
53 lemma cpr_inv_Delta_sn (h) (G) (L) (s):
54 ∀X. ❨G,L❩ ⊢ Delta s ➡[h,0] X → Delta s = X.
56 elim (cpm_inv_abst1 … H) -H #X1 #X2 #H1 #H2 #H destruct
57 lapply (cpr_inv_sort1 … H1) -H1 #H destruct
58 <(cpr_inv_Delta1_body_sn … H2) -X2 //
61 (* Main properties **********************************************************)
63 theorem cpr_Omega_12 (h) (G) (L) (s): ❨G,L❩ ⊢ Omega1 s ➡[h,0] Omega2 s.
64 /2 width=1 by cpm_beta/ qed.
66 theorem cpr_Omega_23 (h) (G) (L) (s): ❨G,L❩ ⊢ Omega2 s ➡[h,0] Omega3 s.
67 /5 width=3 by cpm_eps, cpm_appl, cpm_bind, cpm_delta, Delta_lifts/ qed.
69 theorem cpr_Omega_31 (h) (G) (L) (s): ❨G,L❩ ⊢ Omega3 s ➡[h,0] Omega1 s.
70 /4 width=3 by cpm_zeta, Delta_lifts, lifts_flat/ qed.
72 (* Main inversion properties ************************************************)
74 theorem cpr_inv_Omega1_sn (h) (G) (L) (s):
75 ∀X. ❨G,L❩ ⊢ Omega1 s ➡[h,0] X →
76 ∨∨ Omega1 s = X | Omega2 s = X.
77 #h #G #L #s #X #H elim (cpm_inv_appl1 … H) -H *
78 [ #W2 #T2 #HW2 #HT2 #H destruct
79 <(cpr_inv_Delta_sn … HW2) -W2
80 <(cpr_inv_Delta_sn … HT2) -T2
81 /3 width=1 by refl, or_introl/
82 | #p #V2 #W1 #W2 #T1 #T2 #HV #HW #HT whd in ⊢ (??%?→?); #H1 #H2 destruct
83 <(cpr_inv_Delta_sn … HV) -V2
84 >(cpr_inv_sort1 … HW) -W2
85 <(cpr_inv_Delta1_body_sn … HT) -T2 //
86 | #p #V2 #V #W1 #W2 #T1 #T2 #_ #_ #_ #_ whd in ⊢ (??%?→?); #H #_ destruct
90 theorem cpr_Omega_21_false (h) (G) (L) (s): ❨G,L❩ ⊢ Omega2 s ➡[h,0] Omega1 s → ⊥.
91 #h #G #L #s #H elim (cpm_inv_bind1 … H) -H *
92 [ #W #T #_ #_ whd in ⊢ (??%?→?); #H destruct
94 elim (lifts_inv_flat2 … H) -H #X1 #X2 #H1 #_ #_
95 @(lifts_inv_lref2_uni_lt … H1) -H1 //