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