]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_ind.ma
2e655049e9d864e5c6ebb1662b402c5ac8882671
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / nta_ind.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/dynamic/nta_drops.ma".
16 include "basic_2/dynamic/nta_cpms.ma".
17 include "basic_2/dynamic/nta_cpcs.ma".
18 include "basic_2/dynamic/nta_preserve.ma".
19
20 (* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************)
21
22 (* Advanced eliminators *****************************************************)
23
24 lemma nta_ind_rest_cnv (h) (Q:relation4 …):
25       (∀G,L,s. Q G L (⋆s) (⋆(next h s))) →
26       (∀G,K,V,W,U.
27         ⦃G,K⦄ ⊢ V :[h] W → ⬆*[1] W ≘ U →
28         Q G K V W → Q G (K.ⓓV) (#0) U
29       ) →
30       (∀G,K,W,U. ⦃G,K⦄ ⊢ W ![h] → ⬆*[1] W ≘ U → Q G (K.ⓛW) (#0) U) →
31       (∀I,G,K,W,U,i.
32         ⦃G,K⦄ ⊢ #i :[h] W → ⬆*[1] W ≘ U →
33         Q G K (#i) W → Q G (K.ⓘ{I}) (#↑i) U
34       ) →
35       (∀p,I,G,K,V,T,U.
36         ⦃G,K⦄ ⊢ V ![h] → ⦃G,K.ⓑ{I}V⦄ ⊢ T :[h] U →
37         Q G (K.ⓑ{I}V) T U → Q G K (ⓑ{p,I}V.T) (ⓑ{p,I}V.U)
38       ) →
39       (∀p,G,L,V,W,T,U.
40         ⦃G,L⦄ ⊢ V :[h] W → ⦃G,L⦄ ⊢ T :[h] ⓛ{p}W.U →
41         Q G L V W → Q G L T (ⓛ{p}W.U) → Q G L (ⓐV.T) (ⓐV.ⓛ{p}W.U)
42       ) →
43       (∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h] U → Q G L T U → Q G L (ⓝU.T) U
44       ) →
45       (∀G,L,T,U1,U2.
46         ⦃G,L⦄ ⊢ T :[h] U1 → ⦃G,L⦄ ⊢ U1 ⬌*[h] U2 → ⦃G,L⦄ ⊢ U2 ![h] →
47         Q G L T U1 → Q G L T U2
48       ) →
49       ∀G,L,T,U. ⦃G,L⦄ ⊢ T :[h] U → Q G L T U.
50 #h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #G #L #T
51 @(fqup_wf_ind_eq (Ⓣ) … G L T) -G -L -T #G0 #L0 #T0 #IH #G #L * * [|||| * ]
52 [ #s #HG #HL #HT #X #H destruct -IH
53   elim (nta_inv_sort_sn … H) -H #HUX #HX
54   /2 width=4 by/
55 | * [| #i ] #HG #HL #HT #X #H destruct
56   [ elim (nta_inv_lref_sn_drops_cnv … H) -H *
57     [ #K #V #W #U #H #HVW #HWU #HUX #HX
58       lapply (drops_fwd_isid … H ?) -H [ // ] #H destruct
59       /5 width=7 by nta_ldef, fqu_fqup, fqu_lref_O/
60     | #K #W #U #H #HW #HWU #HUX #HX
61       lapply (drops_fwd_isid … H ?) -H [ // ] #H destruct
62       /3 width=4 by nta_ldec_cnv/
63     ]
64   | elim (nta_inv_lref_sn … H) -H #I #K #T #U #HT #HTU #HUX #HX #H destruct
65     /5 width=7 by nta_lref, fqu_fqup/
66   ]
67 | #l #HG #HL #HT #U #H destruct -IH
68   elim (nta_inv_gref_sn … H)
69 | #p #I #V #T #HG #HL #HT #X #H destruct
70   elim (nta_inv_bind_sn_cnv … H) -H #U #HV #HTU #HUX #HX
71   /4 width=5 by nta_bind_cnv/
72 | #V #T #HG #HL #HT #X #H destruct
73   elim (nta_inv_appl_sn … H) -H #p #W #U #HVW #HTU #HUX #HX
74   /4 width=9 by nta_appl/
75 | #U #T #HG #HL #HT #X #H destruct
76   elim (nta_inv_cast_sn … H) -H #HTU #HUX #HX
77   /4 width=4 by nta_cast/
78 ]
79 qed-.