]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/lcosx.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / lcosx.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/cosn_5.ma".
16 include "basic_2A/computation/lsx.ma".
17
18 (* SN EXTENDED STRONGLY CONORMALIZING LOCAL ENVIRONMENTS ********************)
19
20 inductive lcosx (h) (g) (G): relation2 ynat lenv ≝
21 | lcosx_sort: ∀l. lcosx h g G l (⋆)
22 | lcosx_skip: ∀I,L,T. lcosx h g G 0 L → lcosx h g G 0 (L.ⓑ{I}T)
23 | lcosx_pair: ∀I,L,T,l. G ⊢ ⬊*[h, g, T, l] L →
24               lcosx h g G l L → lcosx h g G (⫯l) (L.ⓑ{I}T)
25 .
26
27 interpretation
28    "sn extended strong conormalization (local environment)"
29    'CoSN h g l G L = (lcosx h g G l L).
30
31 (* Basic properties *********************************************************)
32
33 lemma lcosx_O: ∀h,g,G,L. G ⊢ ~⬊*[h, g, 0] L.
34 #h #g #G #L elim L /2 width=1 by lcosx_skip/
35 qed.
36
37 lemma lcosx_drop_trans_lt: ∀h,g,G,L,l. G ⊢ ~⬊*[h, g, l] L →
38                             ∀I,K,V,i. ⬇[i] L ≡ K.ⓑ{I}V → i < l →
39                             G ⊢ ~⬊*[h, g, ⫰(l-i)] K ∧ G ⊢ ⬊*[h, g, V, ⫰(l-i)] K.
40 #h #g #G #L #l #H elim H -L -l
41 [ #l #J #K #V #i #H elim (drop_inv_atom1 … H) -H #H destruct
42 | #I #L #T #_ #_ #J #K #V #i #_ #H elim (ylt_yle_false … H) -H //
43 | #I #L #T #l #HT #HL #IHL #J #K #V #i #H #Hil
44   elim (drop_inv_O1_pair1 … H) -H * #Hi #HLK destruct
45   [ >ypred_succ /2 width=1 by conj/
46   | lapply (ylt_pred … Hil ?) -Hil /2 width=1 by ylt_inj/ >ypred_succ #Hil
47     elim (IHL … HLK ?) -IHL -HLK <yminus_inj >yminus_SO2 //
48     <(ypred_succ l) in ⊢ (%→%→?); >yminus_pred /2 width=1 by ylt_inj, conj/
49   ]
50 ]
51 qed-.
52
53 (* Basic inversion lemmas ***************************************************)
54
55 fact lcosx_inv_succ_aux: ∀h,g,G,L,x. G ⊢ ~⬊*[h, g, x] L → ∀l. x = ⫯l →
56                          L = ⋆ ∨
57                          ∃∃I,K,V. L = K.ⓑ{I}V & G ⊢ ~⬊*[h, g, l] K &
58                                   G ⊢ ⬊*[h, g, V, l] K.
59 #h #g #G #L #l * -L -l /2 width=1 by or_introl/
60 [ #I #L #T #_ #x #H elim (ysucc_inv_O_sn … H)
61 | #I #L #T #l #HT #HL #x #H <(ysucc_inj … H) -x
62   /3 width=6 by ex3_3_intro, or_intror/
63 ]
64 qed-.
65
66 lemma lcosx_inv_succ: ∀h,g,G,L,l. G ⊢ ~⬊*[h, g, ⫯l] L → L = ⋆ ∨
67                       ∃∃I,K,V. L = K.ⓑ{I}V & G ⊢ ~⬊*[h, g, l] K &
68                                G ⊢ ⬊*[h, g, V, l] K.
69 /2 width=3 by lcosx_inv_succ_aux/ qed-.
70
71 lemma lcosx_inv_pair: ∀h,g,I,G,L,T,l. G ⊢ ~⬊*[h, g, ⫯l] L.ⓑ{I}T →
72                       G ⊢ ~⬊*[h, g, l] L ∧ G ⊢ ⬊*[h, g, T, l] L.
73 #h #g #I #G #L #T #l #H elim (lcosx_inv_succ … H) -H
74 [ #H destruct
75 | * #Z #Y #X #H destruct /2 width=1 by conj/
76 ]
77 qed-.