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