]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/fwd.ma
- matitaInit matitaprover matitadep matitamake:
[helm.git] / matita / contribs / LAMBDA-TYPES / LambdaDelta-1 / nf2 / fwd.ma
index 27a629724bea9fe9b1eacd717c1467f55304f06a..849e860904d603e79a610557eb7d561fde347984 100644 (file)
@@ -20,6 +20,8 @@ include "nf2/defs.ma".
 
 include "pr2/clen.ma".
 
+include "subst0/dec.ma".
+
 include "T/props.ma".
 
 theorem nf2_gen_lref:
@@ -65,6 +67,22 @@ t)) \to (\forall (P: Prop).P))))
 (pr2_free c (THead (Flat Cast) u t) t (pr0_epsilon t t (pr0_refl t) u))) 
 P))))).
 
+theorem nf2_gen_beta:
+ \forall (c: C).(\forall (u: T).(\forall (v: T).(\forall (t: T).((nf2 c 
+(THead (Flat Appl) u (THead (Bind Abst) v t))) \to (\forall (P: Prop).P)))))
+\def
+ \lambda (c: C).(\lambda (u: T).(\lambda (v: T).(\lambda (t: T).(\lambda (H: 
+((\forall (t2: T).((pr2 c (THead (Flat Appl) u (THead (Bind Abst) v t)) t2) 
+\to (eq T (THead (Flat Appl) u (THead (Bind Abst) v t)) t2))))).(\lambda (P: 
+Prop).(let H0 \def (eq_ind T (THead (Flat Appl) u (THead (Bind Abst) v t)) 
+(\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) 
+\Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow 
+(match k in K return (\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | 
+(Flat _) \Rightarrow True])])) I (THead (Bind Abbr) u t) (H (THead (Bind 
+Abbr) u t) (pr2_free c (THead (Flat Appl) u (THead (Bind Abst) v t)) (THead 
+(Bind Abbr) u t) (pr0_beta v u u (pr0_refl u) t t (pr0_refl t))))) in 
+(False_ind P H0))))))).
+
 theorem nf2_gen_flat:
  \forall (f: F).(\forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c 
 (THead (Flat f) u t)) \to (land (nf2 c u) (nf2 c t))))))
@@ -83,3 +101,98 @@ u t2)).(let H1 \def (f_equal T T (\lambda (e: T).(match e in T return
 (THead (Flat f) u t) (THead (Flat f) u t2) (H (THead (Flat f) u t2) 
 (pr2_head_2 c u t t2 (Flat f) (pr2_cflat c t t2 H0 f u)))) in H1)))))))).
 
+theorem nf2_gen__aux:
+ \forall (b: B).(\forall (x: T).(\forall (u: T).(\forall (d: nat).((eq T 
+(THead (Bind b) u (lift (S O) d x)) x) \to (\forall (P: Prop).P)))))
+\def
+ \lambda (b: B).(\lambda (x: T).(T_ind (\lambda (t: T).(\forall (u: 
+T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to 
+(\forall (P: Prop).P))))) (\lambda (n: nat).(\lambda (u: T).(\lambda (d: 
+nat).(\lambda (H: (eq T (THead (Bind b) u (lift (S O) d (TSort n))) (TSort 
+n))).(\lambda (P: Prop).(let H0 \def (eq_ind T (THead (Bind b) u (lift (S O) 
+d (TSort n))) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) 
+with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ 
+_) \Rightarrow True])) I (TSort n) H) in (False_ind P H0))))))) (\lambda (n: 
+nat).(\lambda (u: T).(\lambda (d: nat).(\lambda (H: (eq T (THead (Bind b) u 
+(lift (S O) d (TLRef n))) (TLRef n))).(\lambda (P: Prop).(let H0 \def (eq_ind 
+T (THead (Bind b) u (lift (S O) d (TLRef n))) (\lambda (ee: T).(match ee in T 
+return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) 
+\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H) in 
+(False_ind P H0))))))) (\lambda (k: K).(\lambda (t: T).(\lambda (_: ((\forall 
+(u: T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to 
+(\forall (P: Prop).P)))))).(\lambda (t0: T).(\lambda (H0: ((\forall (u: 
+T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t0)) t0) \to 
+(\forall (P: Prop).P)))))).(\lambda (u: T).(\lambda (d: nat).(\lambda (H1: 
+(eq T (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t 
+t0))).(\lambda (P: Prop).(let H2 \def (f_equal T K (\lambda (e: T).(match e 
+in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow (Bind b) | (TLRef 
+_) \Rightarrow (Bind b) | (THead k0 _ _) \Rightarrow k0])) (THead (Bind b) u 
+(lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let H3 \def (f_equal T 
+T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) 
+\Rightarrow u | (TLRef _) \Rightarrow u | (THead _ t1 _) \Rightarrow t1])) 
+(THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let 
+H4 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) 
+with [(TSort _) \Rightarrow (THead k ((let rec lref_map (f: ((nat \to nat))) 
+(d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort 
+n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i 
+| false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 
+(lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: 
+nat).(plus x0 (S O))) d t) ((let rec lref_map (f: ((nat \to nat))) (d0: nat) 
+(t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort n) | 
+(TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i | 
+false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 (lref_map 
+f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: nat).(plus 
+x0 (S O))) (s k d) t0)) | (TLRef _) \Rightarrow (THead k ((let rec lref_map 
+(f: ((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort 
+n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) 
+with [true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) 
+\Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in 
+lref_map) (\lambda (x0: nat).(plus x0 (S O))) d t) ((let rec lref_map (f: 
+((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) 
+\Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with 
+[true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) 
+\Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in 
+lref_map) (\lambda (x0: nat).(plus x0 (S O))) (s k d) t0)) | (THead _ _ t1) 
+\Rightarrow t1])) (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t 
+t0) H1) in (\lambda (_: (eq T u t)).(\lambda (H6: (eq K (Bind b) k)).(let H7 
+\def (eq_ind_r K k (\lambda (k0: K).(eq T (lift (S O) d (THead k0 t t0)) t0)) 
+H4 (Bind b) H6) in (let H8 \def (eq_ind T (lift (S O) d (THead (Bind b) t 
+t0)) (\lambda (t1: T).(eq T t1 t0)) H7 (THead (Bind b) (lift (S O) d t) (lift 
+(S O) (S d) t0)) (lift_bind b t t0 (S O) d)) in (H0 (lift (S O) d t) (S d) H8 
+P)))))) H3)) H2))))))))))) x)).
+
+theorem nf2_gen_abbr:
+ \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Abbr) u 
+t)) \to (\forall (P: Prop).P))))
+\def
+ \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: 
+T).((pr2 c (THead (Bind Abbr) u t) t2) \to (eq T (THead (Bind Abbr) u t) 
+t2))))).(\lambda (P: Prop).(let H_x \def (dnf_dec u t O) in (let H0 \def H_x 
+in (ex_ind T (\lambda (v: T).(or (subst0 O u t (lift (S O) O v)) (eq T t 
+(lift (S O) O v)))) P (\lambda (x: T).(\lambda (H1: (or (subst0 O u t (lift 
+(S O) O x)) (eq T t (lift (S O) O x)))).(or_ind (subst0 O u t (lift (S O) O 
+x)) (eq T t (lift (S O) O x)) P (\lambda (H2: (subst0 O u t (lift (S O) O 
+x))).(let H3 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda 
+(_: T).T) with [(TSort _) \Rightarrow t | (TLRef _) \Rightarrow t | (THead _ 
+_ t0) \Rightarrow t0])) (THead (Bind Abbr) u t) (THead (Bind Abbr) u (lift (S 
+O) O x)) (H (THead (Bind Abbr) u (lift (S O) O x)) (pr2_free c (THead (Bind 
+Abbr) u t) (THead (Bind Abbr) u (lift (S O) O x)) (pr0_delta u u (pr0_refl u) 
+t t (pr0_refl t) (lift (S O) O x) H2)))) in (let H4 \def (eq_ind T t (\lambda 
+(t0: T).(subst0 O u t0 (lift (S O) O x))) H2 (lift (S O) O x) H3) in 
+(subst0_refl u (lift (S O) O x) O H4 P)))) (\lambda (H2: (eq T t (lift (S O) 
+O x))).(let H3 \def (eq_ind T t (\lambda (t0: T).(\forall (t2: T).((pr2 c 
+(THead (Bind Abbr) u t0) t2) \to (eq T (THead (Bind Abbr) u t0) t2)))) H 
+(lift (S O) O x) H2) in (nf2_gen__aux Abbr x u O (H3 x (pr2_free c (THead 
+(Bind Abbr) u (lift (S O) O x)) x (pr0_zeta Abbr not_abbr_abst x x (pr0_refl 
+x) u))) P))) H1))) H0))))))).
+
+theorem nf2_gen_void:
+ \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Void) u 
+(lift (S O) O t))) \to (\forall (P: Prop).P))))
+\def
+ \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: 
+T).((pr2 c (THead (Bind Void) u (lift (S O) O t)) t2) \to (eq T (THead (Bind 
+Void) u (lift (S O) O t)) t2))))).(\lambda (P: Prop).(nf2_gen__aux Void t u O 
+(H t (pr2_free c (THead (Bind Void) u (lift (S O) O t)) t (pr0_zeta Void 
+not_void_abst t t (pr0_refl t) u))) P))))).
+