]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/reduction/cir.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / reduction / cir.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/notation/relations/prednotreducible_3.ma".
16 include "basic_2A/reduction/crr.ma".
17
18 (* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION ************************)
19
20 definition cir: relation3 genv lenv term ≝ λG,L,T. ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄ → ⊥.
21
22 interpretation "irreducibility for context-sensitive reduction (term)"
23    'PRedNotReducible G L T = (cir G L T).
24
25 (* Basic inversion lemmas ***************************************************)
26
27 lemma cir_inv_delta: ∀G,L,K,V,i. ⬇[i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ ➡ 𝐈⦃#i⦄ → ⊥.
28 /3 width=3 by crr_delta/ qed-.
29
30 lemma cir_inv_ri2: ∀I,G,L,V,T. ri2 I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃②{I}V.T⦄ → ⊥.
31 /3 width=1 by crr_ri2/ qed-.
32
33 lemma cir_inv_ib2: ∀a,I,G,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄ →
34                    ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄.
35 /4 width=1 by crr_ib2_sn, crr_ib2_dx, conj/ qed-.
36
37 lemma cir_inv_bind: ∀a,I,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄ →
38                     ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄ & ib2 a I.
39 #a * [ elim a -a ]
40 #G #L #V #T #H [ elim H -H /3 width=1 by crr_ri2, or_introl/ ]
41 elim (cir_inv_ib2 … H) -H /3 width=1 by and3_intro, or_introl/
42 qed-.
43
44 lemma cir_inv_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓐV.T⦄ →
45                     ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ & 𝐒⦃T⦄.
46 #G #L #V #T #HVT @and3_intro /3 width=1 by crr_appl_sn, crr_appl_dx/
47 generalize in match HVT; -HVT elim T -T //
48 * // #a * #U #T #_ #_ #H elim H -H /2 width=1 by crr_beta, crr_theta/
49 qed-.
50
51 lemma cir_inv_flat: ∀I,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓕ{I}V.T⦄ →
52                     ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ & 𝐒⦃T⦄ & I = Appl.
53 * #G #L #V #T #H
54 [ elim (cir_inv_appl … H) -H /2 width=1 by and4_intro/
55 | elim (cir_inv_ri2 … H) -H //
56 ]
57 qed-.
58
59 (* Basic properties *********************************************************)
60
61 lemma cir_sort: ∀G,L,k. ⦃G, L⦄ ⊢ ➡ 𝐈⦃⋆k⦄.
62 /2 width=4 by crr_inv_sort/ qed.
63
64 lemma cir_gref: ∀G,L,p. ⦃G, L⦄ ⊢ ➡ 𝐈⦃§p⦄.
65 /2 width=4 by crr_inv_gref/ qed.
66
67 lemma tir_atom: ∀G,I. ⦃G, ⋆⦄ ⊢ ➡ 𝐈⦃⓪{I}⦄.
68 /2 width=3 by trr_inv_atom/ qed.
69
70 lemma cir_ib2: ∀a,I,G,L,V,T.
71                ib2 a I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ → ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄.
72 #a #I #G #L #V #T #HI #HV #HT #H
73 elim (crr_inv_ib2 … HI H) -HI -H /2 width=1 by/
74 qed.
75
76 lemma cir_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ →  𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓐV.T⦄.
77 #G #L #V #T #HV #HT #H1 #H2
78 elim (crr_inv_appl … H2) -H2 /2 width=1 by/
79 qed.