]> matita.cs.unibo.it Git - helm.git/blob - matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/fwd.ma
contribs should now compile
[helm.git] / matita / contribs / LAMBDA-TYPES / LambdaDelta-1 / nf2 / fwd.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 (* This file was automatically generated: do not edit *********************)
16
17
18
19 include "nf2/defs.ma".
20
21 include "pr2/clen.ma".
22
23 include "subst0/dec.ma".
24
25 include "T/props.ma".
26
27 theorem nf2_gen_lref:
28  \forall (c: C).(\forall (d: C).(\forall (u: T).(\forall (i: nat).((getl i c 
29 (CHead d (Bind Abbr) u)) \to ((nf2 c (TLRef i)) \to (\forall (P: Prop).P))))))
30 \def
31  \lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda 
32 (H: (getl i c (CHead d (Bind Abbr) u))).(\lambda (H0: ((\forall (t2: T).((pr2 
33 c (TLRef i) t2) \to (eq T (TLRef i) t2))))).(\lambda (P: 
34 Prop).(lift_gen_lref_false (S i) O i (le_O_n i) (le_n (plus O (S i))) u (H0 
35 (lift (S i) O u) (pr2_delta c d u i H (TLRef i) (TLRef i) (pr0_refl (TLRef 
36 i)) (lift (S i) O u) (subst0_lref u i))) P))))))).
37
38 theorem nf2_gen_abst:
39  \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Abst) u 
40 t)) \to (land (nf2 c u) (nf2 (CHead c (Bind Abst) u) t)))))
41 \def
42  \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: 
43 T).((pr2 c (THead (Bind Abst) u t) t2) \to (eq T (THead (Bind Abst) u t) 
44 t2))))).(conj (\forall (t2: T).((pr2 c u t2) \to (eq T u t2))) (\forall (t2: 
45 T).((pr2 (CHead c (Bind Abst) u) t t2) \to (eq T t t2))) (\lambda (t2: 
46 T).(\lambda (H0: (pr2 c u t2)).(let H1 \def (f_equal T T (\lambda (e: 
47 T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow u | 
48 (TLRef _) \Rightarrow u | (THead _ t0 _) \Rightarrow t0])) (THead (Bind Abst) 
49 u t) (THead (Bind Abst) t2 t) (H (THead (Bind Abst) t2 t) (pr2_head_1 c u t2 
50 H0 (Bind Abst) t))) in (let H2 \def (eq_ind_r T t2 (\lambda (t0: T).(pr2 c u 
51 t0)) H0 u H1) in (eq_ind T u (\lambda (t0: T).(eq T u t0)) (refl_equal T u) 
52 t2 H1))))) (\lambda (t2: T).(\lambda (H0: (pr2 (CHead c (Bind Abst) u) t 
53 t2)).(let H1 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda 
54 (_: T).T) with [(TSort _) \Rightarrow t | (TLRef _) \Rightarrow t | (THead _ 
55 _ t0) \Rightarrow t0])) (THead (Bind Abst) u t) (THead (Bind Abst) u t2) (H 
56 (THead (Bind Abst) u t2) (let H_y \def (pr2_gen_cbind Abst c u t t2 H0) in 
57 H_y))) in (let H2 \def (eq_ind_r T t2 (\lambda (t0: T).(pr2 (CHead c (Bind 
58 Abst) u) t t0)) H0 t H1) in (eq_ind T t (\lambda (t0: T).(eq T t t0)) 
59 (refl_equal T t) t2 H1))))))))).
60
61 theorem nf2_gen_cast:
62  \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Flat Cast) u 
63 t)) \to (\forall (P: Prop).P))))
64 \def
65  \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: (nf2 c (THead 
66 (Flat Cast) u t))).(\lambda (P: Prop).(thead_x_y_y (Flat Cast) u t (H t 
67 (pr2_free c (THead (Flat Cast) u t) t (pr0_epsilon t t (pr0_refl t) u))) 
68 P))))).
69
70 theorem nf2_gen_beta:
71  \forall (c: C).(\forall (u: T).(\forall (v: T).(\forall (t: T).((nf2 c 
72 (THead (Flat Appl) u (THead (Bind Abst) v t))) \to (\forall (P: Prop).P)))))
73 \def
74  \lambda (c: C).(\lambda (u: T).(\lambda (v: T).(\lambda (t: T).(\lambda (H: 
75 ((\forall (t2: T).((pr2 c (THead (Flat Appl) u (THead (Bind Abst) v t)) t2) 
76 \to (eq T (THead (Flat Appl) u (THead (Bind Abst) v t)) t2))))).(\lambda (P: 
77 Prop).(let H0 \def (eq_ind T (THead (Flat Appl) u (THead (Bind Abst) v t)) 
78 (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) 
79 \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow 
80 (match k in K return (\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | 
81 (Flat _) \Rightarrow True])])) I (THead (Bind Abbr) u t) (H (THead (Bind 
82 Abbr) u t) (pr2_free c (THead (Flat Appl) u (THead (Bind Abst) v t)) (THead 
83 (Bind Abbr) u t) (pr0_beta v u u (pr0_refl u) t t (pr0_refl t))))) in 
84 (False_ind P H0))))))).
85
86 theorem nf2_gen_flat:
87  \forall (f: F).(\forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c 
88 (THead (Flat f) u t)) \to (land (nf2 c u) (nf2 c t))))))
89 \def
90  \lambda (f: F).(\lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: 
91 ((\forall (t2: T).((pr2 c (THead (Flat f) u t) t2) \to (eq T (THead (Flat f) 
92 u t) t2))))).(conj (\forall (t2: T).((pr2 c u t2) \to (eq T u t2))) (\forall 
93 (t2: T).((pr2 c t t2) \to (eq T t t2))) (\lambda (t2: T).(\lambda (H0: (pr2 c 
94 u t2)).(let H1 \def (f_equal T T (\lambda (e: T).(match e in T return 
95 (\lambda (_: T).T) with [(TSort _) \Rightarrow u | (TLRef _) \Rightarrow u | 
96 (THead _ t0 _) \Rightarrow t0])) (THead (Flat f) u t) (THead (Flat f) t2 t) 
97 (H (THead (Flat f) t2 t) (pr2_head_1 c u t2 H0 (Flat f) t))) in H1))) 
98 (\lambda (t2: T).(\lambda (H0: (pr2 c t t2)).(let H1 \def (f_equal T T 
99 (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) 
100 \Rightarrow t | (TLRef _) \Rightarrow t | (THead _ _ t0) \Rightarrow t0])) 
101 (THead (Flat f) u t) (THead (Flat f) u t2) (H (THead (Flat f) u t2) 
102 (pr2_head_2 c u t t2 (Flat f) (pr2_cflat c t t2 H0 f u)))) in H1)))))))).
103
104 theorem nf2_gen__aux:
105  \forall (b: B).(\forall (x: T).(\forall (u: T).(\forall (d: nat).((eq T 
106 (THead (Bind b) u (lift (S O) d x)) x) \to (\forall (P: Prop).P)))))
107 \def
108  \lambda (b: B).(\lambda (x: T).(T_ind (\lambda (t: T).(\forall (u: 
109 T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to 
110 (\forall (P: Prop).P))))) (\lambda (n: nat).(\lambda (u: T).(\lambda (d: 
111 nat).(\lambda (H: (eq T (THead (Bind b) u (lift (S O) d (TSort n))) (TSort 
112 n))).(\lambda (P: Prop).(let H0 \def (eq_ind T (THead (Bind b) u (lift (S O) 
113 d (TSort n))) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) 
114 with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ 
115 _) \Rightarrow True])) I (TSort n) H) in (False_ind P H0))))))) (\lambda (n: 
116 nat).(\lambda (u: T).(\lambda (d: nat).(\lambda (H: (eq T (THead (Bind b) u 
117 (lift (S O) d (TLRef n))) (TLRef n))).(\lambda (P: Prop).(let H0 \def (eq_ind 
118 T (THead (Bind b) u (lift (S O) d (TLRef n))) (\lambda (ee: T).(match ee in T 
119 return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) 
120 \Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H) in 
121 (False_ind P H0))))))) (\lambda (k: K).(\lambda (t: T).(\lambda (_: ((\forall 
122 (u: T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to 
123 (\forall (P: Prop).P)))))).(\lambda (t0: T).(\lambda (H0: ((\forall (u: 
124 T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t0)) t0) \to 
125 (\forall (P: Prop).P)))))).(\lambda (u: T).(\lambda (d: nat).(\lambda (H1: 
126 (eq T (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t 
127 t0))).(\lambda (P: Prop).(let H2 \def (f_equal T K (\lambda (e: T).(match e 
128 in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow (Bind b) | (TLRef 
129 _) \Rightarrow (Bind b) | (THead k0 _ _) \Rightarrow k0])) (THead (Bind b) u 
130 (lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let H3 \def (f_equal T 
131 T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) 
132 \Rightarrow u | (TLRef _) \Rightarrow u | (THead _ t1 _) \Rightarrow t1])) 
133 (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let 
134 H4 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) 
135 with [(TSort _) \Rightarrow (THead k ((let rec lref_map (f: ((nat \to nat))) 
136 (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort 
137 n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i 
138 | false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 
139 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: 
140 nat).(plus x0 (S O))) d t) ((let rec lref_map (f: ((nat \to nat))) (d0: nat) 
141 (t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort n) | 
142 (TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i | 
143 false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 (lref_map 
144 f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: nat).(plus 
145 x0 (S O))) (s k d) t0)) | (TLRef _) \Rightarrow (THead k ((let rec lref_map 
146 (f: ((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort 
147 n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) 
148 with [true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) 
149 \Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in 
150 lref_map) (\lambda (x0: nat).(plus x0 (S O))) d t) ((let rec lref_map (f: 
151 ((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) 
152 \Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with 
153 [true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) 
154 \Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in 
155 lref_map) (\lambda (x0: nat).(plus x0 (S O))) (s k d) t0)) | (THead _ _ t1) 
156 \Rightarrow t1])) (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t 
157 t0) H1) in (\lambda (_: (eq T u t)).(\lambda (H6: (eq K (Bind b) k)).(let H7 
158 \def (eq_ind_r K k (\lambda (k0: K).(eq T (lift (S O) d (THead k0 t t0)) t0)) 
159 H4 (Bind b) H6) in (let H8 \def (eq_ind T (lift (S O) d (THead (Bind b) t 
160 t0)) (\lambda (t1: T).(eq T t1 t0)) H7 (THead (Bind b) (lift (S O) d t) (lift 
161 (S O) (S d) t0)) (lift_bind b t t0 (S O) d)) in (H0 (lift (S O) d t) (S d) H8 
162 P)))))) H3)) H2))))))))))) x)).
163
164 theorem nf2_gen_abbr:
165  \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Abbr) u 
166 t)) \to (\forall (P: Prop).P))))
167 \def
168  \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: 
169 T).((pr2 c (THead (Bind Abbr) u t) t2) \to (eq T (THead (Bind Abbr) u t) 
170 t2))))).(\lambda (P: Prop).(let H_x \def (dnf_dec u t O) in (let H0 \def H_x 
171 in (ex_ind T (\lambda (v: T).(or (subst0 O u t (lift (S O) O v)) (eq T t 
172 (lift (S O) O v)))) P (\lambda (x: T).(\lambda (H1: (or (subst0 O u t (lift 
173 (S O) O x)) (eq T t (lift (S O) O x)))).(or_ind (subst0 O u t (lift (S O) O 
174 x)) (eq T t (lift (S O) O x)) P (\lambda (H2: (subst0 O u t (lift (S O) O 
175 x))).(let H3 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda 
176 (_: T).T) with [(TSort _) \Rightarrow t | (TLRef _) \Rightarrow t | (THead _ 
177 _ t0) \Rightarrow t0])) (THead (Bind Abbr) u t) (THead (Bind Abbr) u (lift (S 
178 O) O x)) (H (THead (Bind Abbr) u (lift (S O) O x)) (pr2_free c (THead (Bind 
179 Abbr) u t) (THead (Bind Abbr) u (lift (S O) O x)) (pr0_delta u u (pr0_refl u) 
180 t t (pr0_refl t) (lift (S O) O x) H2)))) in (let H4 \def (eq_ind T t (\lambda 
181 (t0: T).(subst0 O u t0 (lift (S O) O x))) H2 (lift (S O) O x) H3) in 
182 (subst0_refl u (lift (S O) O x) O H4 P)))) (\lambda (H2: (eq T t (lift (S O) 
183 O x))).(let H3 \def (eq_ind T t (\lambda (t0: T).(\forall (t2: T).((pr2 c 
184 (THead (Bind Abbr) u t0) t2) \to (eq T (THead (Bind Abbr) u t0) t2)))) H 
185 (lift (S O) O x) H2) in (nf2_gen__aux Abbr x u O (H3 x (pr2_free c (THead 
186 (Bind Abbr) u (lift (S O) O x)) x (pr0_zeta Abbr not_abbr_abst x x (pr0_refl 
187 x) u))) P))) H1))) H0))))))).
188
189 theorem nf2_gen_void:
190  \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Void) u 
191 (lift (S O) O t))) \to (\forall (P: Prop).P))))
192 \def
193  \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: 
194 T).((pr2 c (THead (Bind Void) u (lift (S O) O t)) t2) \to (eq T (THead (Bind 
195 Void) u (lift (S O) O t)) t2))))).(\lambda (P: Prop).(nf2_gen__aux Void t u O 
196 (H t (pr2_free c (THead (Bind Void) u (lift (S O) O t)) t (pr0_zeta Void 
197 not_void_abst t t (pr0_refl t) u))) P))))).
198