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