From 1b21075e987872a2e3103203b4e67c939e4a9f6a Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Fri, 3 Jun 2005 21:03:39 +0000 Subject: [PATCH] contribution about \lambda-\delta --- helm/coq-contribs/LAMBDA-TYPES.tgz | Bin 40969 -> 0 bytes helm/coq-contribs/LAMBDA-TYPES/.cvsignore | 1 + helm/coq-contribs/LAMBDA-TYPES/.depend | 65 ++++ helm/coq-contribs/LAMBDA-TYPES/Base.v | 7 + helm/coq-contribs/LAMBDA-TYPES/LambdaDelta.v | 58 +++ helm/coq-contribs/LAMBDA-TYPES/Make | 66 ++++ helm/coq-contribs/LAMBDA-TYPES/Makefile | 352 ++++++++++++++++++ helm/coq-contribs/LAMBDA-TYPES/README | 61 +++ helm/coq-contribs/LAMBDA-TYPES/base_blt.v | 33 ++ helm/coq-contribs/LAMBDA-TYPES/base_hints.v | 262 +++++++++++++ helm/coq-contribs/LAMBDA-TYPES/base_rewrite.v | 76 ++++ helm/coq-contribs/LAMBDA-TYPES/base_tactics.v | 45 +++ helm/coq-contribs/LAMBDA-TYPES/base_types.v | 159 ++++++++ .../coq-contribs/LAMBDA-TYPES/contexts_defs.v | 71 ++++ helm/coq-contribs/LAMBDA-TYPES/cpr0_defs.v | 11 + helm/coq-contribs/LAMBDA-TYPES/cpr0_props.v | 103 +++++ helm/coq-contribs/LAMBDA-TYPES/csub0_defs.v | 186 +++++++++ helm/coq-contribs/LAMBDA-TYPES/csubst0_defs.v | 198 ++++++++++ helm/coq-contribs/LAMBDA-TYPES/csubst1_defs.v | 101 +++++ helm/coq-contribs/LAMBDA-TYPES/description | 13 + helm/coq-contribs/LAMBDA-TYPES/drop_defs.v | 125 +++++++ helm/coq-contribs/LAMBDA-TYPES/drop_props.v | 259 +++++++++++++ helm/coq-contribs/LAMBDA-TYPES/lift_defs.v | 236 ++++++++++++ helm/coq-contribs/LAMBDA-TYPES/lift_gen.v | 126 +++++++ helm/coq-contribs/LAMBDA-TYPES/lift_props.v | 43 +++ helm/coq-contribs/LAMBDA-TYPES/lift_tlt.v | 89 +++++ helm/coq-contribs/LAMBDA-TYPES/pc1_defs.v | 79 ++++ helm/coq-contribs/LAMBDA-TYPES/pc3_defs.v | 160 ++++++++ helm/coq-contribs/LAMBDA-TYPES/pc3_gen.v | 80 ++++ .../LAMBDA-TYPES/pc3_gen_context.v | 22 ++ helm/coq-contribs/LAMBDA-TYPES/pc3_props.v | 163 ++++++++ helm/coq-contribs/LAMBDA-TYPES/pc3_subst0.v | 141 +++++++ .../LAMBDA-TYPES/pr0_confluence.v | 176 +++++++++ helm/coq-contribs/LAMBDA-TYPES/pr0_defs.v | 91 +++++ helm/coq-contribs/LAMBDA-TYPES/pr0_gen.v | 104 ++++++ helm/coq-contribs/LAMBDA-TYPES/pr0_lift.v | 39 ++ helm/coq-contribs/LAMBDA-TYPES/pr0_subst0.v | 105 ++++++ helm/coq-contribs/LAMBDA-TYPES/pr0_subst1.v | 63 ++++ .../LAMBDA-TYPES/pr1_confluence.v | 64 ++++ helm/coq-contribs/LAMBDA-TYPES/pr1_defs.v | 24 ++ .../LAMBDA-TYPES/pr2_confluence.v | 77 ++++ helm/coq-contribs/LAMBDA-TYPES/pr2_defs.v | 120 ++++++ helm/coq-contribs/LAMBDA-TYPES/pr2_gen.v | 81 ++++ .../LAMBDA-TYPES/pr2_gen_context.v | 59 +++ helm/coq-contribs/LAMBDA-TYPES/pr2_lift.v | 34 ++ helm/coq-contribs/LAMBDA-TYPES/pr2_subst1.v | 46 +++ .../LAMBDA-TYPES/pr3_confluence.v | 60 +++ helm/coq-contribs/LAMBDA-TYPES/pr3_defs.v | 75 ++++ helm/coq-contribs/LAMBDA-TYPES/pr3_gen.v | 184 +++++++++ .../LAMBDA-TYPES/pr3_gen_context.v | 42 +++ helm/coq-contribs/LAMBDA-TYPES/pr3_props.v | 113 ++++++ helm/coq-contribs/LAMBDA-TYPES/pr3_subst1.v | 33 ++ .../LAMBDA-TYPES/subst0_confluence.v | 80 ++++ helm/coq-contribs/LAMBDA-TYPES/subst0_defs.v | 55 +++ helm/coq-contribs/LAMBDA-TYPES/subst0_gen.v | 130 +++++++ helm/coq-contribs/LAMBDA-TYPES/subst0_lift.v | 49 +++ .../coq-contribs/LAMBDA-TYPES/subst0_subst0.v | 68 ++++ helm/coq-contribs/LAMBDA-TYPES/subst0_tlt.v | 62 +++ .../LAMBDA-TYPES/subst1_confluence.v | 82 ++++ helm/coq-contribs/LAMBDA-TYPES/subst1_defs.v | 58 +++ helm/coq-contribs/LAMBDA-TYPES/subst1_gen.v | 44 +++ helm/coq-contribs/LAMBDA-TYPES/subst1_lift.v | 23 ++ .../coq-contribs/LAMBDA-TYPES/subst1_subst1.v | 60 +++ helm/coq-contribs/LAMBDA-TYPES/terms_defs.v | 78 ++++ helm/coq-contribs/LAMBDA-TYPES/tlt_defs.v | 115 ++++++ helm/coq-contribs/LAMBDA-TYPES/ty0_defs.v | 302 +++++++++++++++ .../LAMBDA-TYPES/ty0_gen_context.v | 227 +++++++++++ helm/coq-contribs/LAMBDA-TYPES/ty0_lift.v | 65 ++++ helm/coq-contribs/LAMBDA-TYPES/ty0_props.v | 107 ++++++ helm/coq-contribs/LAMBDA-TYPES/ty0_sred.v | 250 +++++++++++++ .../LAMBDA-TYPES/ty0_sred_props.v | 175 +++++++++ helm/coq-contribs/LAMBDA-TYPES/ty0_subst0.v | 333 +++++++++++++++++ helm/coq-contribs/SUBSETS.tgz | Bin 20442 -> 0 bytes 73 files changed, 7344 insertions(+) delete mode 100644 helm/coq-contribs/LAMBDA-TYPES.tgz create mode 100644 helm/coq-contribs/LAMBDA-TYPES/.cvsignore create mode 100644 helm/coq-contribs/LAMBDA-TYPES/.depend create mode 100644 helm/coq-contribs/LAMBDA-TYPES/Base.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/LambdaDelta.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/Make create mode 100644 helm/coq-contribs/LAMBDA-TYPES/Makefile create mode 100644 helm/coq-contribs/LAMBDA-TYPES/README create mode 100644 helm/coq-contribs/LAMBDA-TYPES/base_blt.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/base_hints.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/base_rewrite.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/base_tactics.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/base_types.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/contexts_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/cpr0_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/cpr0_props.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/csub0_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/csubst0_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/csubst1_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/description create mode 100644 helm/coq-contribs/LAMBDA-TYPES/drop_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/drop_props.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/lift_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/lift_gen.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/lift_props.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/lift_tlt.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pc1_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pc3_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pc3_gen.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pc3_gen_context.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pc3_props.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pc3_subst0.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr0_confluence.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr0_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr0_gen.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr0_lift.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr0_subst0.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr0_subst1.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr1_confluence.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr1_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr2_confluence.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr2_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr2_gen.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr2_gen_context.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr2_lift.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr2_subst1.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr3_confluence.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr3_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr3_gen.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr3_gen_context.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr3_props.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/pr3_subst1.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst0_confluence.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst0_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst0_gen.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst0_lift.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst0_subst0.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst0_tlt.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst1_confluence.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst1_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst1_gen.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst1_lift.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/subst1_subst1.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/terms_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/tlt_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/ty0_defs.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/ty0_gen_context.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/ty0_lift.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/ty0_props.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/ty0_sred.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/ty0_sred_props.v create mode 100644 helm/coq-contribs/LAMBDA-TYPES/ty0_subst0.v delete mode 100644 helm/coq-contribs/SUBSETS.tgz diff --git a/helm/coq-contribs/LAMBDA-TYPES.tgz b/helm/coq-contribs/LAMBDA-TYPES.tgz deleted file mode 100644 index 35fa962dd06759607e737af943e3d949072dd44b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40969 zcmV(rK<>XEiwFP~%zHur1MFREQ`<<^&S(FMuI$#to-#x?!@l-1tOuBonq=aMnVoFd zluO701hVAFGT2mVe*1e)U!-o`EE7X2wI~5weLa27b1vO2HE;TFe?IJQo&0BTG<^B& zVJ=OxjNMKLJ~e%}qsgD*dZufJxwC8SXvWSnO*ahPdPX`AM2~XKXR#d-^6dO#?v1_j za;x&c)9Z~a|My4z!?#Bp??clyZO5|88( zrX70$5b~LX=j6F>PtL~n*4Xu9`+1w#4W1A$r|y{W8^`vYxj&zgTQ9yO_SsqF-gvaB z*>;ZJcsVoj^c?M#Mu8qIGN64HzGsFa|6e1 zlRpCQ#*JoPyu^IYp=={>?Z~+#hNg8IM_Uuy^GTO5B>l^oZO;SmEZp|u#-D%wiKV;b zGLEO+moIN`Z?~oVmw&N3jmGN$;OhH~JJTq1-0?heyN#{ls{!(P|_#%wM+187)c4?G^Q_`h_K)h3hOoTLxkY)#C;>AdU8@Zq79>~F+@&10cXKq?D z>F)|uopz(tAx#{Tza+D8;sVtGoQW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v >>.depend + +xml:: + +install: + mkdir -p `$(COQC) -where`/user-contrib + cp -f *.vo `$(COQC) -where`/user-contrib + +Makefile: Make + mv -f Makefile Makefile.bak + $(COQBIN)coq_makefile -f Make -o Makefile + +clean: + rm -f *.cmo *.cmi *.cmx *.o *.vo *.vi *.g *~ + rm -f all.ps all-gal.ps $(HTMLFILES) $(GHTMLFILES) + +archclean: + rm -f *.cmx *.o + +# WARNING +# +# This Makefile has been automagically generated by coq_makefile +# Edit at your own risks ! +# +# END OF WARNING + diff --git a/helm/coq-contribs/LAMBDA-TYPES/README b/helm/coq-contribs/LAMBDA-TYPES/README new file mode 100644 index 000000000..d35c2dd39 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/README @@ -0,0 +1,61 @@ + + Contribution Bologna/LAMBDA-TYPES + ================================== + +This directory contains a formalization in Coq of "lambda-delta", a +lambda-typed lambda-calculus with abbreviations. + +Author & Date: Ferruccio Guidi + Department of Computer Science, University of Bologna + March 2005 +E-mail : fguidi@cs.unibo.it +WWW : http://www.cs.unibo.it/~fguidi + +Installation procedure: +----------------------- + + To get this contribution compiled, type + + make + + or + + make opt + + The main modules produced by the compilation are: + + LambdaDelta provides the theory of the "lambda-delta" calculus + and its prerequisites + + Base provides just the prerequisites (mainly some arithmetic + properties missing in the standard library of Coq) + +Description: +------------ + + The present work, which is meant to be improved in the future, contains + a formalization of the "lambda-delta" calculus, defined in "item notation" + and with De Bruijn indices, and includes the proofs of some standard + properties of this calculus. In particular the user will find: + + - Confluence of reduction + - Generation lemma + - Thinning lemma + - Substitution lemma + - Type Correctness + - Type Uniqueness + - Subject Reduction + + Other properties to be added in the future versions of this contribution + include (but are not limited to): + + - Strong Normalization + - Decidability of Type Inference and Type Checking + +Further information on this contribution: +----------------------------------------- + + The latest version of this development is maintained in the CVS repository + of the HELM project and can be downloaded at: + + www.cs.unibo.it/cgi-bin/viewcvs.cgi/helm/coq-contribs/LAMBDA-TYPES.tgz diff --git a/helm/coq-contribs/LAMBDA-TYPES/base_blt.v b/helm/coq-contribs/LAMBDA-TYPES/base_blt.v new file mode 100644 index 000000000..ae00365c6 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/base_blt.v @@ -0,0 +1,33 @@ +Require Arith. +Require base_tactics. +Require base_hints. + +(*#* #stop file *) + + Fixpoint blt [m,n: nat] : bool := Cases n m of + | (0) m => false + | (S n) (0) => true + | (S n) (S m) => (blt m n) + end. + + Section blt_props. (******************************************************) + + Theorem lt_blt: (x,y:?) (lt y x) -> (blt y x) = true. + XElim x; [ Intros; Inversion H | XElim y; Simpl; XAuto ]. + Qed. + + Theorem le_bge: (x,y:?) (le x y) -> (blt y x) = false. + XElim x; [ XAuto | XElim y; Intros; [ Inversion H0 | Simpl; XAuto ] ]. + Qed. + + Theorem blt_lt: (x,y:?) (blt y x) = true -> (lt y x). + XElim x; [ Intros; Inversion H | XElim y; Simpl; XAuto ]. + Qed. + + Theorem bge_le: (x,y:?) (blt y x) = false -> (le x y). + XElim x; [ XAuto | XElim y; Intros; [ Inversion H0 | Simpl; XAuto ] ]. + Qed. + + End blt_props. + + Hints Resolve lt_blt le_bge : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/base_hints.v b/helm/coq-contribs/LAMBDA-TYPES/base_hints.v new file mode 100644 index 000000000..a364406a3 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/base_hints.v @@ -0,0 +1,262 @@ +(*#* #stop file *) + +Require Arith. +Require base_tactics. + +(* eq ***********************************************************************) + +Hint eq : ltlc := Constructors eq. + +Hint f1N : ltlc := Resolve (f_equal nat). + +Hint f2NN : ltlc := Resolve (f_equal2 nat nat). + +Hints Resolve sym_equal : ltlc. + +Hints Resolve plus_sym plus_n_Sm plus_assoc_r simpl_plus_l : ltlc. + +Hints Resolve minus_n_O : ltlc. + +(* le ***********************************************************************) + +Hint le : ltlc := Constructors le. + +Hints Resolve le_O_n le_n_S le_S_n le_trans : ltlc. + +Hints Resolve lt_le_S : ltlc. + +Hints Resolve le_plus_plus le_plus_trans le_plus_l le_plus_r : ltlc. + +(* lt ***********************************************************************) + +Hints Resolve lt_trans : ltlc. + +Hints Resolve lt_le_trans le_lt_n_Sm : ltlc. + +Hints Resolve lt_reg_r lt_le_plus_plus le_lt_plus_plus : ltlc. + +(* not **********************************************************************) + +Hints Resolve sym_not_equal : ltlc. + +(* missing in the standard library ******************************************) + + Theorem simpl_plus_r: (n,m,p:?) (plus m n) = (plus p n) -> m = p. + Intros. + Apply (simpl_plus_l n). + Rewrite plus_sym. + Rewrite H; XAuto. + Qed. + + Theorem minus_plus_r: (m,n:?) (minus (plus m n) n) = m. + Intros. + Rewrite plus_sym. + Apply minus_plus. + Qed. + + Theorem plus_permute_2_in_3: (x,y,z:?) (plus (plus x y) z) = (plus (plus x z) y). + Intros. + Rewrite plus_assoc_r. + Rewrite (plus_sym y z). + Rewrite <- plus_assoc_r; XAuto. + Qed. + + Theorem plus_permute_2_in_3_assoc: (n,h,k:?) (plus (plus n h) k) = (plus n (plus k h)). + Intros. + Rewrite plus_permute_2_in_3; Rewrite plus_assoc_l; XAuto. + Qed. + + Theorem plus_O: (x,y:?) (plus x y) = (0) -> x = (O) /\ y = (O). + XElim x; [ XAuto | Intros; Inversion H0 ]. + Qed. + + Theorem minus_Sx_SO: (x:?) (minus (S x) (1)) = x. + Intros; Simpl; Rewrite <- minus_n_O; XAuto. + Qed. + + Theorem eq_nat_dec: (i,j:nat) ~i=j \/ i=j. + XElim i; XElim j; Intros; XAuto. + Elim (H n0); XAuto. + Qed. + + Theorem neq_eq_e: (i,j:nat; P:Prop) (~i=j -> P) -> (i=j -> P) -> P. + Intros. + Pose (eq_nat_dec i j). + XElim o; XAuto. + Qed. + + Theorem le_false: (m,n:?; P:Prop) (le m n) -> (le (S n) m) -> P. + XElim m. +(* case 1 : m = 0 *) + Intros; Inversion H0. +(* case 2 : m > 0 *) + XElim n0; Intros. +(* case 2.1 : n = 0 *) + Inversion H0. +(* case 2.2 : n > 0 *) + Simpl in H1. + Apply (H n0); XAuto. + Qed. + + Theorem le_plus_minus_sym: (n,m:?) (le n m) -> m = (plus (minus m n) n). + Intros. + Rewrite plus_sym; Apply le_plus_minus; XAuto. + Qed. + + Theorem le_minus_minus: (x,y:?) (le x y) -> (z:?) (le y z) -> + (le (minus y x) (minus z x)). + Intros. + EApply simpl_le_plus_l. + Rewrite le_plus_minus_r; [ Idtac | XAuto ]. + Rewrite le_plus_minus_r; XEAuto. + Qed. + + Theorem le_minus_plus: (z,x:?) (le z x) -> (y:?) + (minus (plus x y) z) = (plus (minus x z) y). + XElim z. +(* case 1 : z = 0 *) + Intros x H; Inversion H; XAuto. +(* case 2 : z > 0 *) + Intros z; XElim x; Intros. +(* case 2.1 : x = 0 *) + Inversion H0. +(* case 2.2 : x > 0 *) + Simpl; XAuto. + Qed. + + Theorem le_minus: (x,z,y:?) (le (plus x y) z) -> (le x (minus z y)). + Intros. + Rewrite <- (minus_plus_r x y); XAuto. + Apply le_minus_minus; XAuto. + Qed. + + Theorem le_trans_plus_r: (x,y,z:?) (le (plus x y) z) -> (le y z). + Intros. + EApply le_trans; [ EApply le_plus_r | Idtac ]; XEAuto. + Qed. + + Theorem le_gen_S: (m,x:?) (le (S m) x) -> + (EX n | x = (S n) & (le m n)). + Intros; Inversion H; XEAuto. + Qed. + + Theorem lt_x_plus_x_Sy: (x,y:?) (lt x (plus x (S y))). + Intros; Rewrite plus_sym; Simpl; XAuto. + Qed. + + Theorem simpl_lt_plus_r: (p,n,m:?) (lt (plus n p) (plus m p)) -> (lt n m). + Intros. + EApply simpl_lt_plus_l. + Rewrite plus_sym in H; Rewrite (plus_sym m p) in H; Apply H. + Qed. + + Theorem minus_x_Sy: (x,y:?) (lt y x) -> + (minus x y) = (S (minus x (S y))). + XElim x. +(* case 1 : x = 0 *) + Intros; Inversion H. +(* case 2 : x > 0 *) + XElim y; Intros; Simpl. +(* case 2.1 : y = 0 *) + Rewrite <- minus_n_O; XAuto. +(* case 2.2 : y > 0 *) + Cut (lt n0 n); XAuto. + Qed. + + Theorem lt_plus_minus: (x,y:?) (lt x y) -> + y = (S (plus x (minus y (S x)))). + Intros. + Apply (le_plus_minus (S x) y); XAuto. + Qed. + + Theorem lt_plus_minus_r: (x,y:?) (lt x y) -> + y = (S (plus (minus y (S x)) x)). + Intros. + Rewrite plus_sym; Apply lt_plus_minus; XAuto. + Qed. + + Theorem minus_x_SO: (x:?) (lt (0) x) -> x = (S (minus x (1))). + Intros. + Rewrite <- minus_x_Sy; [ Rewrite <- minus_n_O; XEAuto | XEAuto ]. + Qed. + + Theorem lt_le_minus: (x,y:?) (lt x y) -> (le x (minus y (1))). + Intros; Apply le_minus; Rewrite plus_sym; Simpl; XAuto. + Qed. + + Theorem lt_le_e: (n,d:?; P:Prop) + ((lt n d) -> P) -> ((le d n) -> P) -> P. + Intros. + Cut (le d n) \/ (lt n d); [ Intros H1; XElim H1; XAuto | Apply le_or_lt ]. + Qed. + + Theorem lt_eq_e: (x,y:?; P:Prop) ((lt x y) -> P) -> + (x = y -> P) -> (le x y) -> P. + Intros. + LApply (le_lt_or_eq x y); [ Clear H1; Intros H1 | XAuto ]. + XElim H1; XAuto. + Qed. + + Theorem lt_eq_gt_e: (x,y:?; P:Prop) ((lt x y) -> P) -> + (x = y -> P) -> ((lt y x) -> P) -> P. + Intros. + Apply (lt_le_e x y); [ XAuto | Intros ]. + Apply (lt_eq_e y x); XAuto. + Qed. + + Theorem lt_gen_S': (x,n:?) (lt x (S n)) -> + x = (0) \/ (EX m | x = (S m) & (lt m n)). + XElim x; XEAuto. + Qed. + +Hints Resolve le_lt_trans : ltlc. + +Hints Resolve simpl_plus_r minus_plus_r minus_x_Sy + plus_permute_2_in_3 plus_permute_2_in_3_assoc : ltlc. + +Hints Resolve le_minus_minus le_minus_plus le_minus le_trans_plus_r : ltlc. + +Hints Resolve lt_x_plus_x_Sy simpl_lt_plus_r lt_le_minus lt_plus_minus + lt_plus_minus_r : ltlc. + + Theorem lt_neq: (x,y:?) (lt x y) -> ~x=y. + Unfold not; Intros; Rewrite H0 in H; Clear H0 x. + LApply (lt_n_n y); XAuto. + Qed. + +Hints Resolve lt_neq : ltlc. + + Theorem arith0: (h2,d2,n:?) (le (plus d2 h2) n) -> + (h1:?) (le (plus d2 h1) (minus (plus n h1) h2)). + Intros. + Rewrite <- (minus_plus h2 (plus d2 h1)). + Apply le_minus_minus; [ XAuto | Idtac ]. + Rewrite plus_assoc_l; Rewrite (plus_sym h2 d2); XAuto. + Qed. + +Hints Resolve arith0 : ltlc. + + Tactic Definition EqFalse := + Match Context With + [ H: ~?1=?1 |- ? ] -> + LApply H; [ Clear H; Intros H; Inversion H | XAuto ]. + + Tactic Definition PlusO := + Match Context With + | [ H: (plus ?0 ?1) = (0) |- ? ] -> + LApply (plus_O ?0 ?1); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + + Tactic Definition SymEqual := + Match Context With + | [ H: ?1 = ?2 |- ? ] -> + Cut ?2 = ?1; [ Clear H; Intros H | Apply sym_equal; XAuto ]. + + Tactic Definition LeLtGen := + Match Context With + | [ H: (le (S ?1) ?2) |- ? ] -> + LApply (le_gen_S ?1 ?2); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (lt ?1 (S ?2)) |- ? ] -> + LApply (lt_gen_S' ?1 ?2); [ Clear H; Intros H | XAuto ]; + XElim H; [ Intros | Intros H; XElim H; Intros ]. diff --git a/helm/coq-contribs/LAMBDA-TYPES/base_rewrite.v b/helm/coq-contribs/LAMBDA-TYPES/base_rewrite.v new file mode 100644 index 000000000..68490ee3f --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/base_rewrite.v @@ -0,0 +1,76 @@ +(*#* #stop file *) + +Require Arith. + + Tactic Definition Arith0 x := + Replace (S x) with (plus (1) x); XAuto. + + Tactic Definition Arith1 x := + Replace x with (plus x (0)); [XAuto | Auto with arith]. + + Tactic Definition Arith1In H x := + XReplaceIn H x '(plus x (0)). + + Tactic Definition Arith2 x := + Replace x with (plus (0) x); XAuto. + + Tactic Definition Arith3 x := + Replace (S x) with (S (plus (0) x)); XAuto. + + Tactic Definition Arith3In H x := + XReplaceIn H '(S x) '(S (plus (0) x)). + + Tactic Definition Arith4 x y := + Replace (S (plus x y)) with (plus (S x) y); XAuto. + + Tactic Definition Arith4In H x y := + XReplaceIn H '(S (plus x y)) '(plus (S x) y). + + Tactic Definition Arith4c x y := + Arith4 x y; Rewrite plus_sym. + + Tactic Definition Arith5 x y := + Replace (S (plus x y)) with (plus x (S y)); Auto with arith. + + Tactic Definition Arith5In H x y := + XReplaceIn H '(S (plus x y)) '(plus x (S y)); Auto with arith. + + Tactic Definition Arith5' x y := + Replace (plus x (S y)) with (S (plus x y)); Auto with arith. + + Tactic Definition Arith5'In H x y := + XReplaceIn H '(plus x (S y)) '(S (plus x y)); Auto with arith. + + Tactic Definition Arith5'c x y := + Arith5' x y; Rewrite plus_sym. + + Tactic Definition Arith6In H x y := + XReplaceIn H '(plus x (S y)) '(plus (1) (plus x y)); + [ Idtac | Simpl; Auto with arith ]. + + Tactic Definition Arith7 x := + Replace (S x) with (plus x (1)); + [ Idtac | Rewrite plus_sym; Auto with arith ]. + + Tactic Definition Arith7In H x := + XReplaceIn H '(S x) '(plus x (1)) ; + [ Idtac | Rewrite plus_sym; Auto with arith ]. + + Tactic Definition Arith7' x := + Replace (plus x (1)) with (S x); + [ Idtac | Rewrite plus_sym; Auto with arith ]. + + Tactic Definition Arith8 x y := + Replace x with (plus y (minus x y)); + [ Idtac | Auto with arith ]. + + Tactic Definition Arith8' x y := + Replace (plus y (minus x y)) with x; + [ Idtac | Auto with arith ]. + + Tactic Definition Arith9'In H x := + XReplaceIn H '(S (plus x (0))) '(S x). + + Tactic Definition Arith10 x := + Replace x with (minus (S x) (1)); + [ Idtac | Simpl; Rewrite <- minus_n_O; Auto with arith ]. diff --git a/helm/coq-contribs/LAMBDA-TYPES/base_tactics.v b/helm/coq-contribs/LAMBDA-TYPES/base_tactics.v new file mode 100644 index 000000000..daa6facca --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/base_tactics.v @@ -0,0 +1,45 @@ +(*#* #stop file *) + + Tactic Definition XAuto := Auto with ltlc. + + Tactic Definition XEAuto := EAuto with ltlc. + + Tactic Definition XDEAuto d := EAuto d with ltlc. + + Tactic Definition XElimUsing e v := + Try Intros until v; Elim v using e; Try Clear v. + + Tactic Definition XElim v := Try Intros until v; Elim v; Try Clear v. + + Tactic Definition XCase v := Try Intros until v; Case v; Try Clear v. + + Tactic Definition XReplaceIn Z0 y1 y2 := + Cut y1=y2; [ Intros Z; Rewrite Z in Z0; Clear Z | XAuto ]. + + Theorem insert_eq: (S:Set; x:S; P:S->Prop; G:Prop) + ((y:S) (P y) -> y = x -> G) -> (P x) -> G. + EAuto. Qed. + + Tactic Definition InsertEq H y := + Pattern 1 y in H; Match Context With [ _: (?1 y) |- ? ] -> + Apply insert_eq with x:=y P:=?1; + [ Clear H; Intros until 1 | Pattern y; Apply H ]. + + Theorem unintro : (A:Set; a:A; P:A->Prop) ((x:A) (P x)) -> (P a). + Auto. + Qed. + + Tactic Definition UnIntro Last H := + Move H after Last; + Match Context With [ y: ?1 |- ?2 ] -> + Apply (unintro ?1 y); Clear y. + + Tactic Definition NonLinear := + Match Context With + [ H: ?1 |- ? ] -> Cut ?1; [ Intros | XAuto ]. + + Tactic Definition XRewrite x := + Match Context With + | [ H0: x = ? |- ? ] -> Try Rewrite H0 + | [ H0: ? = x |- ? ] -> Try Rewrite <- H0 + | _ -> Idtac. diff --git a/helm/coq-contribs/LAMBDA-TYPES/base_types.v b/helm/coq-contribs/LAMBDA-TYPES/base_types.v new file mode 100644 index 000000000..0b1c870f3 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/base_types.v @@ -0,0 +1,159 @@ +(* This file was generated by coqgen *) + +Require base_tactics. +Require base_hints. + +(*#* #stop file *) + +(* extensions for ex2 *) + +Syntactic Definition ex2_intro := ex_intro2. + +Theorem ex2_sym: (A:Set; P,Q:A->Prop) + (EX x | (P x) & (Q x)) -> (EX x | (Q x) & (P x)). + Intros; XElim H; XEAuto. + Qed. + +Hints Resolve ex2_sym : ltlc. + +(* or3 *) + +Inductive or3 [P0,P1,P2:Prop] : Prop := + | or3_intro0 : P0 -> (or3 P0 P1 P2) + | or3_intro1 : P1 -> (or3 P0 P1 P2) + | or3_intro2 : P2 -> (or3 P0 P1 P2). + +Hint or3 : ltlc := Constructors or3. + +Grammar constr constr10 := + | or3 + [ "OR" constr($c0) "|" constr($c1) "|" constr($c2) ] -> + [ (or3 $c0 $c1 $c2) ]. + +(* or4 *) + +Inductive or4 [P0,P1,P2,P3:Prop] : Prop := + | or4_intro0 : P0 -> (or4 P0 P1 P2 P3) + | or4_intro1 : P1 -> (or4 P0 P1 P2 P3) + | or4_intro2 : P2 -> (or4 P0 P1 P2 P3) + | or4_intro3 : P3 -> (or4 P0 P1 P2 P3). + +Hint or4 : ltlc := Constructors or4. + +Grammar constr constr10 := + | or4 + [ "OR" constr($c0) "|" constr($c1) "|" constr($c2) "|" constr($c3) ] -> + [ (or4 $c0 $c1 $c2 $c3) ]. + +(* ex2_2 *) + +Inductive ex2_2 [A0,A1:Set; P0,P1:A0->A1->Prop] : Prop := + ex2_2_intro : (x0:A0; x1:A1)(P0 x0 x1)->(P1 x0 x1)->(ex2_2 A0 A1 P0 P1). + +Hint ex2_2 : ltlc := Constructors ex2_2. + +Syntactic Definition Ex2_2 := ex2_2 | 1. + +Grammar constr constr10 := + | ex2_2implicit + [ "EX" ident($v0) ident($v1) "|" constr($c0) "&" constr($c1) ] -> + [ (ex2_2 ? ? [$v0;$v1]$c0 [$v0;$v1]$c1) ]. + +(* ex3_2 *) + +Inductive ex3_2 [A0,A1:Set; P0,P1,P2:A0->A1->Prop] : Prop := + ex3_2_intro : (x0:A0; x1:A1)(P0 x0 x1)->(P1 x0 x1)->(P2 x0 x1)->(ex3_2 A0 A1 P0 P1 P2). + +Hint ex3_2 : ltlc := Constructors ex3_2. + +Syntactic Definition Ex3_2 := ex3_2 | 1. + +Grammar constr constr10 := + | ex3_2implicit + [ "EX" ident($v0) ident($v1) "|" constr($c0) "&" constr($c1) "&" constr($c2) ] -> + [ (ex3_2 ? ? [$v0;$v1]$c0 [$v0;$v1]$c1 [$v0;$v1]$c2) ]. + +(* ex3_3 *) + +Inductive ex3_3 [A0,A1,A2:Set; P0,P1,P2:A0->A1->A2->Prop] : Prop := + ex3_3_intro : (x0:A0; x1:A1; x2:A2)(P0 x0 x1 x2)->(P1 x0 x1 x2)->(P2 x0 x1 x2)->(ex3_3 A0 A1 A2 P0 P1 P2). + +Hint ex3_3 : ltlc := Constructors ex3_3. + +Syntactic Definition Ex3_3 := ex3_3 | 1. + +Grammar constr constr10 := + | ex3_3implicit + [ "EX" ident($v0) ident($v1) ident($v2) "|" constr($c0) "&" constr($c1) "&" constr($c2) ] -> + [ (ex3_3 ? ? ? [$v0;$v1;$v2]$c0 [$v0;$v1;$v2]$c1 [$v0;$v1;$v2]$c2) ]. + +(* ex4_3 *) + +Inductive ex4_3 [A0,A1,A2:Set; P0,P1,P2,P3:A0->A1->A2->Prop] : Prop := + ex4_3_intro : (x0:A0; x1:A1; x2:A2)(P0 x0 x1 x2)->(P1 x0 x1 x2)->(P2 x0 x1 x2)->(P3 x0 x1 x2)->(ex4_3 A0 A1 A2 P0 P1 P2 P3). + +Hint ex4_3 : ltlc := Constructors ex4_3. + +Syntactic Definition Ex4_3 := ex4_3 | 1. + +Grammar constr constr10 := + | ex4_3implicit + [ "EX" ident($v0) ident($v1) ident($v2) "|" constr($c0) "&" constr($c1) "&" constr($c2) "&" constr($c3) ] -> + [ (ex4_3 ? ? ? [$v0;$v1;$v2]$c0 [$v0;$v1;$v2]$c1 [$v0;$v1;$v2]$c2 [$v0;$v1;$v2]$c3) ]. + +(* ex3_4 *) + +Inductive ex3_4 [A0,A1,A2,A3:Set; P0,P1,P2:A0->A1->A2->A3->Prop] : Prop := + ex3_4_intro : (x0:A0; x1:A1; x2:A2; x3:A3)(P0 x0 x1 x2 x3)->(P1 x0 x1 x2 x3)->(P2 x0 x1 x2 x3)->(ex3_4 A0 A1 A2 A3 P0 P1 P2). + +Hint ex3_4 : ltlc := Constructors ex3_4. + +Syntactic Definition Ex3_4 := ex3_4 | 1. + +Grammar constr constr10 := + | ex3_4implicit + [ "EX" ident($v0) ident($v1) ident($v2) ident($v3) "|" constr($c0) "&" constr($c1) "&" constr($c2) ] -> + [ (ex3_4 ? ? ? ? [$v0;$v1;$v2;$v3]$c0 [$v0;$v1;$v2;$v3]$c1 [$v0;$v1;$v2;$v3]$c2) ]. + +(* ex4_4 *) + +Inductive ex4_4 [A0,A1,A2,A3:Set; P0,P1,P2,P3:A0->A1->A2->A3->Prop] : Prop := + ex4_4_intro : (x0:A0; x1:A1; x2:A2; x3:A3)(P0 x0 x1 x2 x3)->(P1 x0 x1 x2 x3)->(P2 x0 x1 x2 x3)->(P3 x0 x1 x2 x3)->(ex4_4 A0 A1 A2 A3 P0 P1 P2 P3). + +Hint ex4_4 : ltlc := Constructors ex4_4. + +Syntactic Definition Ex4_4 := ex4_4 | 1. + +Grammar constr constr10 := + | ex4_4implicit + [ "EX" ident($v0) ident($v1) ident($v2) ident($v3) "|" constr($c0) "&" constr($c1) "&" constr($c2) "&" constr($c3) ] -> + [ (ex4_4 ? ? ? ? [$v0;$v1;$v2;$v3]$c0 [$v0;$v1;$v2;$v3]$c1 [$v0;$v1;$v2;$v3]$c2 [$v0;$v1;$v2;$v3]$c3) ]. + +(* ex4_5 *) + +Inductive ex4_5 [A0,A1,A2,A3,A4:Set; P0,P1,P2,P3:A0->A1->A2->A3->A4->Prop] : Prop := + ex4_5_intro : (x0:A0; x1:A1; x2:A2; x3:A3; x4:A4)(P0 x0 x1 x2 x3 x4)->(P1 x0 x1 x2 x3 x4)->(P2 x0 x1 x2 x3 x4)->(P3 x0 x1 x2 x3 x4)->(ex4_5 A0 A1 A2 A3 A4 P0 P1 P2 P3). + +Hint ex4_5 : ltlc := Constructors ex4_5. + +Syntactic Definition Ex4_5 := ex4_5 | 1. + +Grammar constr constr10 := + | ex4_5implicit + [ "EX" ident($v0) ident($v1) ident($v2) ident($v3) ident($v4) "|" constr($c0) "&" constr($c1) "&" constr($c2) "&" constr($c3) ] -> + [ (ex4_5 ? ? ? ? ? [$v0;$v1;$v2;$v3;$v4]$c0 [$v0;$v1;$v2;$v3;$v4]$c1 [$v0;$v1;$v2;$v3;$v4]$c2 [$v0;$v1;$v2;$v3;$v4]$c3) ]. + +(* ex6_6 *) + +Inductive ex6_6 [A0,A1,A2,A3,A4,A5:Set; P0,P1,P2,P3,P4,P5:A0->A1->A2->A3->A4->A5->Prop] : Prop := + ex6_6_intro : (x0:A0; x1:A1; x2:A2; x3:A3; x4:A4; x5:A5)(P0 x0 x1 x2 x3 x4 x5)->(P1 x0 x1 x2 x3 x4 x5)->(P2 x0 x1 x2 x3 x4 x5)->(P3 x0 x1 x2 x3 x4 x5)->(P4 x0 x1 x2 x3 x4 x5)->(P5 x0 x1 x2 x3 x4 x5)->(ex6_6 A0 A1 A2 A3 A4 A5 P0 P1 P2 P3 P4 P5). + +Hint ex6_6 : ltlc := Constructors ex6_6. + +Syntactic Definition Ex6_6 := ex6_6 | 1. + +Grammar constr constr10 := + | ex6_6implicit + [ "EX" ident($v0) ident($v1) ident($v2) ident($v3) ident($v4) ident($v5) "|" constr($c0) "&" constr($c1) "&" constr($c2) "&" constr($c3) "&" constr($c4) "&" constr($c5) ] -> + [ (ex6_6 ? ? ? ? ? ? [$v0;$v1;$v2;$v3;$v4;$v5]$c0 [$v0;$v1;$v2;$v3;$v4;$v5]$c1 [$v0;$v1;$v2;$v3;$v4;$v5]$c2 [$v0;$v1;$v2;$v3;$v4;$v5]$c3 [$v0;$v1;$v2;$v3;$v4;$v5]$c4 [$v0;$v1;$v2;$v3;$v4;$v5]$c5) ]. + diff --git a/helm/coq-contribs/LAMBDA-TYPES/contexts_defs.v b/helm/coq-contribs/LAMBDA-TYPES/contexts_defs.v new file mode 100644 index 000000000..ec1f9e758 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/contexts_defs.v @@ -0,0 +1,71 @@ +(*#* #stop file *) + +Require Export terms_defs. + + Inductive Set C := CSort : nat -> C + | CTail : C -> K -> T -> C. + + Hint f3CKT : ltlc := Resolve (f_equal3 C K T). + + Definition r: K -> nat -> nat := [k;i] Cases k of + | (Bind _) => i + | (Flat _) => (S i) + end. + + Fixpoint app [c:C] : nat -> T -> T := [j;t]Cases j c of + | (0) _ => t + | _ (CSort _) => t + | (S i) (CTail c k u) => (app c (r k i) (TTail k u t)) + end. + + Section r_props. (********************************************************) + + Theorem r_S: (k:?; i:?) (r k (S i)) = (S (r k i)). + XElim k; XAuto. + Qed. + + Theorem r_plus_sym: (k:?; i,j:?) (r k (plus i j)) = (plus i (r k j)). + XElim k; Intros; Simpl; XAuto. + Qed. + + Theorem r_minus: (i,n:?) (lt n i) -> + (k:?) (minus (r k i) (S n)) = (r k (minus i (S n))). + XElim k; Intros; Simpl; XEAuto. + Qed. + + Theorem r_dis: (k:?; P:Prop) + (((i:?) (r k i) = i) -> P) -> + (((i:?) (r k i) = (S i)) -> P) -> P. + XElim k; XAuto. + Qed. + + End r_props. + + Tactic Definition RRw := + Repeat (Rewrite r_S Orelse Rewrite r_plus_sym). + + Section r_arith. (********************************************************) + + Theorem r_arith0: (k:?; i:?) (minus (r k (S i)) (1)) = (r k i). + Intros; RRw; Rewrite minus_Sx_SO; XAuto. + Qed. + + Theorem r_arith1: (k:?; i,j:?) (minus (r k (S i)) (S j)) = (minus (r k i) j). + Intros; RRw; XAuto. + Qed. + + End r_arith. + + Section app_props. (******************************************************) + + Theorem app_csort : (t:?; i,n:?) (app (CSort n) i t) = t. + XElim i; Intros; Simpl; XAuto. + Qed. + + Theorem app_O : (c:?; t:?) (app c (0) t) = t. + XElim c; XAuto. + Qed. + + End app_props. + + Hints Resolve app_csort app_O : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/cpr0_defs.v b/helm/coq-contribs/LAMBDA-TYPES/cpr0_defs.v new file mode 100644 index 000000000..ce6faccba --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/cpr0_defs.v @@ -0,0 +1,11 @@ +(*#* #stop file *) + +Require Export contexts_defs. +Require Export pr0_defs. + + Inductive cpr0 : C -> C -> Prop := + | cpr0_refl : (c:?) (cpr0 c c) + | cpr0_cont : (c1,c2:?) (cpr0 c1 c2) -> (u1,u2:?) (pr0 u1 u2) -> + (k:?) (cpr0 (CTail c1 k u1) (CTail c2 k u2)). + + Hint cpr0 : ltlc := Constructors cpr0. diff --git a/helm/coq-contribs/LAMBDA-TYPES/cpr0_props.v b/helm/coq-contribs/LAMBDA-TYPES/cpr0_props.v new file mode 100644 index 000000000..1050288ee --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/cpr0_props.v @@ -0,0 +1,103 @@ +(*#* #stop file *) + +Require pr0_subst0. +Require pr3_defs. +Require pr3_props. +Require cpr0_defs. + + Section cpr0_drop. (******************************************************) + + Theorem cpr0_drop : (c1,c2:?) (cpr0 c1 c2) -> (h:?; e1:?; u1:?; k:?) + (drop h (0) c1 (CTail e1 k u1)) -> + (EX e2 u2 | (drop h (0) c2 (CTail e2 k u2)) & + (cpr0 e1 e2) & (pr0 u1 u2) + ). + Intros until 1; XElim H. +(* case 1 : cpr0_refl *) + XEAuto. +(* case 2 : cpr0_cont *) + XElim h. +(* case 2.1 : h = 0 *) + Intros; DropGenBase. + Inversion H2; Rewrite H6 in H1; Rewrite H4 in H; XEAuto. +(* case 2.2 : h > 0 *) + XElim k; Intros; DropGenBase. +(* case 2.2.1 : Bind *) + LApply (H0 n e1 u0 k); [ Clear H0 H3; Intros H0 | XAuto ]. + XElim H0; XEAuto. +(* case 2.2.2 : Flat *) + LApply (H0 (S n) e1 u0 k); [ Clear H0 H3; Intros H0 | XAuto ]. + XElim H0; XEAuto. + Qed. + + Theorem cpr0_drop_back : (c1,c2:?) (cpr0 c2 c1) -> (h:?; e1:?; u1:?; k:?) + (drop h (0) c1 (CTail e1 k u1)) -> + (EX e2 u2 | (drop h (0) c2 (CTail e2 k u2)) & + (cpr0 e2 e1) & (pr0 u2 u1) + ). + Intros until 1; XElim H. +(* case 1 : cpr0_refl *) + XEAuto. +(* case 2 : cpr0_cont *) + XElim h. +(* case 2.1 : h = 0 *) + Intros; DropGenBase. + Inversion H2; Rewrite H6 in H1; Rewrite H4 in H; XEAuto. +(* case 2.2 : h > 0 *) + XElim k; Intros; DropGenBase. +(* case 2.2.1 : Bind *) + LApply (H0 n e1 u0 k); [ Clear H0 H3; Intros H0 | XAuto ]. + XElim H0; XEAuto. +(* case 2.2.2 : Flat *) + LApply (H0 (S n) e1 u0 k); [ Clear H0 H3; Intros H0 | XAuto ]. + XElim H0; XEAuto. + Qed. + + End cpr0_drop. + + Tactic Definition Cpr0Drop := + Match Context With + | [ _: (drop ?1 (0) ?2 (CTail ?3 ?4 ?5)); + _: (cpr0 ?2 ?6) |- ? ] -> + LApply (cpr0_drop ?2 ?6); [ Intros H_x | XAuto ]; + LApply (H_x ?1 ?3 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros + | [ _: (drop ?1 (0) ?2 (CTail ?3 ?4 ?5)); + _: (cpr0 ?6 ?2) |- ? ] -> + LApply (cpr0_drop_back ?2 ?6); [ Intros H_x | XAuto ]; + LApply (H_x ?1 ?3 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros + | [ _: (drop ?1 (0) (CTail ?2 ?7 ?8) (CTail ?3 ?4 ?5)); + _: (cpr0 ?2 ?6) |- ? ] -> + LApply (cpr0_drop (CTail ?2 ?7 ?8) (CTail ?6 ?7 ?8)); [ Intros H_x | XAuto ]; + LApply (H_x ?1 ?3 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros + | [ _: (drop ?1 (0) (CTail ?2 ?7 ?8) (CTail ?3 ?4 ?5)); + _: (cpr0 ?6 ?2) |- ? ] -> + LApply (cpr0_drop_back (CTail ?2 ?7 ?8) (CTail ?6 ?7 ?8)); [ Intros H_x | XAuto ]; + LApply (H_x ?1 ?3 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros. + + Section cpr0_pr3. (*******************************************************) + + Theorem cpr0_pr3_t : (c1,c2:?) (cpr0 c2 c1) -> (t1,t2:?) (pr3 c1 t1 t2) -> + (pr3 c2 t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : cpr0_refl *) + XAuto. +(* case 2 : cpr0_cont *) + Pr3Context. + XElim H1; Intros. +(* case 2.1 : pr3_r *) + XAuto. +(* case 2.2 : pr3_u *) + EApply pr3_t; [ Idtac | XEAuto ]. Clear H2 H3 c1 c2 t1 t2 t4 u2. + Inversion_clear H1. +(* case 2.2.1 : pr2_pr0 *) + XAuto. +(* case 2.2.1 : pr2_delta *) + Cpr0Drop; Pr0Subst0. + EApply pr3_u; [ EApply pr2_delta; XEAuto | XAuto ]. + Qed. + + End cpr0_pr3. diff --git a/helm/coq-contribs/LAMBDA-TYPES/csub0_defs.v b/helm/coq-contribs/LAMBDA-TYPES/csub0_defs.v new file mode 100644 index 000000000..7aa8a2c9b --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/csub0_defs.v @@ -0,0 +1,186 @@ +(*#* #stop file *) + +Require Export ty0_defs. + + Inductive csub0 [g:G] : C -> C -> Prop := +(* structural rules *) + | csub0_sort : (n:?) (csub0 g (CSort n) (CSort n)) + | csub0_tail : (c1,c2:?) (csub0 g c1 c2) -> (k,u:?) + (csub0 g (CTail c1 k u) (CTail c2 k u)) +(* axioms *) + | csub0_void : (c1,c2:?) (csub0 g c1 c2) -> (b:?) ~b=Void -> (u1,u2:?) + (csub0 g (CTail c1 (Bind Void) u1) (CTail c2 (Bind b) u2)) + | csub0_abst : (c1,c2:?) (csub0 g c1 c2) -> (u,t:?) (ty0 g c2 u t) -> + (csub0 g (CTail c1 (Bind Abst) t) (CTail c2 (Bind Abbr) u)). + + Hint csub0 : ltlc := Constructors csub0. + + Section csub0_props. (****************************************************) + + Theorem csub0_refl : (g:?; c:?) (csub0 g c c). + XElim c; XAuto. + Qed. + + End csub0_props. + + Hints Resolve csub0_refl : ltlc. + + Section csub0_drop. (*****************************************************) + + Theorem csub0_drop_abbr : (g:?; n:?; c1,c2:?) (csub0 g c1 c2) -> (d1,u:?) + (drop n (0) c1 (CTail d1 (Bind Abbr) u)) -> + (EX d2 | (csub0 g d1 d2) & + (drop n (0) c2 (CTail d2 (Bind Abbr) u)) + ). + XElim n. +(* case 1 : n = 0 *) + Intros; DropGenBase; Rewrite H0 in H; Inversion H; XEAuto. +(* case 2 : n > 0 *) + Intros until 2; XElim H0. +(* case 2.1 : csub0_sort *) + Intros; Inversion H0. +(* case 2.2 : csub0_tail *) + XElim k; Intros; DropGenBase. +(* case 2.2.1 : Bind *) + LApply (H c0 c3); [ Clear H; Intros H | XAuto ]. + LApply (H d1 u0); [ Clear H; Intros H | XAuto ]. + XElim H; XEAuto. +(* case 2.2.2 : Flat *) + LApply (H1 d1 u0); [ Clear H1; Intros H1 | XAuto ]. + XElim H1; XEAuto. +(* case 2.3 : csub0_void *) + Intros; DropGenBase. + LApply (H c0 c3); [ Clear H; Intros H | XAuto ]. + LApply (H d1 u); [ Clear H; Intros H | XAuto ]. + XElim H; XEAuto. +(* case 2.4 : csub0_abst *) + Intros; DropGenBase. + LApply (H c0 c3); [ Clear H; Intros H | XAuto ]. + LApply (H d1 u0); [ Clear H; Intros H | XAuto ]. + XElim H; XEAuto. + Qed. + + Theorem csub0_drop_abst : (g:?; n:?; c1,c2:?) (csub0 g c1 c2) -> (d1,t:?) + (drop n (0) c1 (CTail d1 (Bind Abst) t)) -> + (EX d2 | (csub0 g d1 d2) & + (drop n (0) c2 (CTail d2 (Bind Abst) t)) + + ) \/ + (EX d2 u | (csub0 g d1 d2) & + (drop n (0) c2 (CTail d2 (Bind Abbr) u)) & + (ty0 g d2 u t) + ). + XElim n. +(* case 1 : n = 0 *) + Intros; DropGenBase; Rewrite H0 in H; Inversion H; XEAuto. +(* case 2 : n > 0 *) + Intros until 2; XElim H0. +(* case 2.1 : csub0_sort *) + Intros; Inversion H0. +(* case 2.2 : csub0_tail *) + XElim k; Intros; DropGenBase. +(* case 2.2.1 : Bind *) + LApply (H c0 c3); [ Clear H; Intros H | XAuto ]. + LApply (H d1 t); [ Clear H; Intros H | XAuto ]. + XElim H; Intros; XElim H; XEAuto. +(* case 2.2.2 : Flat *) + LApply (H1 d1 t); [ Clear H1; Intros H1 | XAuto ]. + XElim H1; Intros; XElim H1; XEAuto. +(* case 2.3 : csub0_void *) + Intros; DropGenBase. + LApply (H c0 c3); [ Clear H; Intros H | XAuto ]. + LApply (H d1 t); [ Clear H; Intros H | XAuto ]. + XElim H; Intros; XElim H; XEAuto. +(* case 2.4 : csub0_abst *) + Intros; DropGenBase. + LApply (H c0 c3); [ Clear H; Intros H | XAuto ]. + LApply (H d1 t0); [ Clear H; Intros H | XAuto ]. + XElim H; Intros; XElim H; XEAuto. + Qed. + + End csub0_drop. + + Tactic Definition CSub0Drop := + Match Context With + | [ H1: (csub0 ?1 ?2 ?3); + H2: (drop ?4 (0) ?2 (CTail ?5 (Bind Abbr) ?6)) |- ? ] -> + LApply (csub0_drop_abbr ?1 ?4 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?5 ?6); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (csub0 ?1 ?2 ?3); + H2: (drop ?4 (0) ?2 (CTail ?5 (Bind Abst) ?6)) |- ? ] -> + LApply (csub0_drop_abst ?1 ?4 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?5 ?6); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros H1; XElim H1; Intros. + + Section csub0_pc3. (*****************************************************) + + Theorem csub0_pr2 : (g:?; c1:?; t1,t2:?) (pr2 c1 t1 t2) -> + (c2:?) (csub0 g c1 c2) -> (pr2 c2 t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : pr2_pr0 *) + XAuto. +(* case 2 : pr2_delta *) + CSub0Drop; XEAuto. + Qed. + + Theorem csub0_pc2 : (g:?; c1:?; t1,t2:?) (pc2 c1 t1 t2) -> + (c2:?) (csub0 g c1 c2) -> (pc2 c2 t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : pc2_r *) + Apply pc2_r; EApply csub0_pr2; XEAuto. +(* case 2 : pc2_x *) + Apply pc2_x; EApply csub0_pr2; XEAuto. + Qed. + + Theorem csub0_pc3 : (g:?; c1:?; t1,t2:?) (pc3 c1 t1 t2) -> + (c2:?) (csub0 g c1 c2) -> (pc3 c2 t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : pc3_r *) + XAuto. +(* case 2 : pc3_u *) + EApply pc3_u; [ EApply csub0_pc2; XEAuto | XAuto ]. + Qed. + + End csub0_pc3. + + Hints Resolve csub0_pc3 : ltlc. + + Section csub0_ty0. (*****************************************************) + + Theorem csub0_ty0 : (g:?; c1:?; t1,t2:?) (ty0 g c1 t1 t2) -> + (c2:?) (wf0 g c2) -> (csub0 g c1 c2) -> + (ty0 g c2 t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : ty0_conv *) + EApply ty0_conv; XEAuto. +(* case 2 : ty0_sort *) + XEAuto. +(* case 3 : ty0_abbr *) + CSub0Drop; EApply ty0_abbr; XEAuto. +(* case 4 : ty0_abst *) + CSub0Drop; [ EApply ty0_abst | EApply ty0_abbr ]; XEAuto. +(* case 5 : ty0_bind *) + EApply ty0_bind; XEAuto. +(* case 6 : ty0_appl *) + EApply ty0_appl; XEAuto. +(* case 7 : ty0_cast *) + EApply ty0_cast; XAuto. + Qed. + + Theorem csub0_ty0_ld : (g:?; c:?; u,v:?) (ty0 g c u v) -> (t1,t2:?) + (ty0 g (CTail c (Bind Abst) v) t1 t2) -> + (ty0 g (CTail c (Bind Abbr) u) t1 t2). + Intros; EApply csub0_ty0; XEAuto. + Qed. + + End csub0_ty0. + + Hints Resolve csub0_ty0 csub0_ty0_ld : ltlc. + + Tactic Definition CSub0Ty0 := + Match Context With + [ _: (ty0 ?1 ?2 ?4 ?); _: (ty0 ?1 ?2 ?3 ?7); _: (pc3 ?2 ?4 ?7); + H: (ty0 ?1 (CTail ?2 (Bind Abst) ?4) ?5 ?6) |- ? ] -> + LApply (csub0_ty0_ld ?1 ?2 ?3 ?4); [ Intros H_x | EApply ty0_conv; XEAuto ]; + LApply (H_x ?5 ?6); [ Clear H_x H; Intros | XAuto ]. diff --git a/helm/coq-contribs/LAMBDA-TYPES/csubst0_defs.v b/helm/coq-contribs/LAMBDA-TYPES/csubst0_defs.v new file mode 100644 index 000000000..a452fd3f0 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/csubst0_defs.v @@ -0,0 +1,198 @@ +(*#* #stop file *) + +Require Export contexts_defs. +Require Export subst0_defs. +Require Export drop_defs. + + Inductive csubst0 : nat -> T -> C -> C -> Prop := + | csubst0_fst : (k:?; i:?; u,v,w:?) (subst0 (r k i) v u w) -> (c:?) + (csubst0 (S i) v (CTail c k u) (CTail c k w)) + | csubst0_snd : (k:?; i:?; c1,c2:?; v:?) (csubst0 (r k i) v c1 c2) -> + (u:?) (csubst0 (S i) v (CTail c1 k u) (CTail c2 k u)) + | csubst0_both : (k:?; i:?; u,v,w:?) (subst0 (r k i) v u w) -> + (c1,c2:?) (csubst0 (r k i) v c1 c2) -> + (csubst0 (S i) v (CTail c1 k u) (CTail c2 k w)). + + Hint csubst0 : ltlc := Constructors csubst0. + + Inductive fsubst0 [i:nat; v:T; c1:C; t1:T] : C -> T -> Prop := + | fsubst0_t : (t2:?) (subst0 i v t1 t2) -> (fsubst0 i v c1 t1 c1 t2) + | fsubst0_c : (c2:?) (csubst0 i v c1 c2) -> (fsubst0 i v c1 t1 c2 t1) + | fsubst0_b : (t2:?) (subst0 i v t1 t2) -> + (c2:?) (csubst0 i v c1 c2) -> (fsubst0 i v c1 t1 c2 t2). + + Hint fsubst0 : ltlc := Constructors fsubst0. + + Section csubst0_gen_base. (***********************************************) + + Theorem csubst0_gen_tail: (k:?; c1,x:?; u1,v:?; i:?) + (csubst0 (S i) v (CTail c1 k u1) x) -> (OR + (EX u2 | x = (CTail c1 k u2) & + (subst0 (r k i) v u1 u2) + ) | + (EX c2 | x = (CTail c2 k u1) & + (csubst0 (r k i) v c1 c2) + ) | + (EX u2 c2 | x = (CTail c2 k u2) & + (subst0 (r k i) v u1 u2) & + (csubst0 (r k i) v c1 c2) + )). + Intros until 1; InsertEq H '(S i); InsertEq H '(CTail c1 k u1). + XCase H; Clear x v y y0; Intros; Inversion H1. +(* case 1: csubst0_fst *) + Inversion H0; Rewrite H3 in H; Rewrite H5 in H; Rewrite H6 in H; XEAuto. +(* case 2: csubst0_snd *) + Inversion H0; Rewrite H3 in H; Rewrite H4 in H; Rewrite H5 in H; XEAuto. +(* case 2: csubst0_both *) + Inversion H2; Rewrite H5 in H; Rewrite H6 in H; Rewrite H7 in H; + Rewrite H4 in H0; Rewrite H5 in H0; Rewrite H7 in H0; XEAuto. + Qed. + + End csubst0_gen_base. + + Tactic Definition CSubst0GenBase := + Match Context With + | [ H: (csubst0 (S ?1) ?2 (CTail ?3 ?4 ?5) ?6) |- ? ] -> + LApply (csubst0_gen_tail ?4 ?3 ?6 ?5 ?2 ?1); [ Clear H; Intros H | XAuto ]; + XElim H; Intros H; XElim H; Intros. + + Section csubst0_drop. (***************************************************) + + Theorem csubst0_drop_ge : (i,n:?) (le i n) -> + (c1,c2:?; v:?) (csubst0 i v c1 c2) -> + (e:?) (drop n (0) c1 e) -> + (drop n (0) c2 e). + XElim i. +(* case 1: i = 0 *) + Intros; Inversion H0. +(* case 2: i > 0 *) + Intros i; XElim n. +(* case 2.1: n = 0 *) + Intros; Inversion H0. +(* case 2.2: n > 0 *) + Intros until 3; Clear H0; InsertEq H2 '(S i); XElim H0; Intros. + DropGenBase. +(* case 2.2.1: csubst0_fst *) + XAuto. +(* case 2.2.2: csubst0_snd *) + XReplaceIn H0 i0 i; DropGenBase; NewInduction k; XEAuto. +(* case 2.2.3: csubst0_both *) + XReplaceIn H0 i0 i; XReplaceIn H2 i0 i. + DropGenBase; NewInduction k; XEAuto. + Qed. + + Tactic Definition IH := + Match Context With + | [ H0: (n:?) (lt n ?1) -> (c1,c2:?; v:?) (csubst0 ?1 v c1 c2) -> (e:C) (drop n (0) c1 e) -> ?; + H1: (csubst0 ?1 ?2 ?3 ?4); H2: (drop ?5 (0) ?3 ?6) |- ? ] -> + LApply (H0 ?5); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?3 ?4 ?2); [ Clear H0 H1; Intros H0 | XAuto ]; + LApply (H0 ?6); [ Clear H0 H2; Intros H0 | XAuto ]; + XElim H0; Intros H0; [ Idtac | XElim H0 | XElim H0 | XElim H0 ]; Intros + | [ H0: (r ? ?1) = (S ?1) -> (e:?) (drop (S ?2) (0) ?3 e) -> ?; + H1: (drop (S ?2) (0) ?3 ?4) |- ? ] -> + LApply H0; [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?4); [ Clear H0 H1; Intros H0 | XAuto ]; + XElim H0; Intros H0; [ Idtac | XElim H0 | XElim H0 | XElim H0 ]; Intros. + + Theorem csubst0_drop_lt : (i,n:?) (lt n i) -> + (c1,c2:?; v:?) (csubst0 i v c1 c2) -> + (e:?) (drop n (0) c1 e) -> (OR + (drop n (0) c2 e) | + (EX k e0 u w | e = (CTail e0 k u) & + (drop n (0) c2 (CTail e0 k w)) & + (subst0 (minus (r k i) (S n)) v u w) + ) | + (EX k e1 e2 u | e = (CTail e1 k u) & + (drop n (0) c2 (CTail e2 k u)) & + (csubst0 (minus (r k i) (S n)) v e1 e2) + ) | + (EX k e1 e2 u w | e = (CTail e1 k u) & + (drop n (0) c2 (CTail e2 k w)) & + (subst0 (minus (r k i) (S n)) v u w) & + (csubst0 (minus (r k i) (S n)) v e1 e2) + )). + XElim i. +(* case 1: i = 0 *) + Intros; Inversion H. +(* case 2: i > 0 *) + Intros i; XElim n. +(* case 2.1: n = 0 *) + Intros H0; Clear H0; Intros until 1; InsertEq H0 '(S i); XElim H0; + Clear H c1 c2 v y; Intros; DropGenBase; XRewrite e; + Rewrite <- r_arith0 in H; Try Rewrite <- r_arith0 in H0; Replace i with i0; XEAuto. +(* case 2.2: n > 0 *) + Intros until 3; Clear H0; InsertEq H2 '(S i); XElim H0; Clear c1 c2 v y; + Intros; DropGenBase. +(* case 2.2.1: csubst0_fst *) + XEAuto. +(* case 2.2.2: csubst0_snd *) + Replace i0 with i; XAuto; XReplaceIn H0 i0 i; XReplaceIn H2 i0 i; Clear H3 i0. + Apply (r_dis k); Intros; Rewrite (H3 i) in H0; Rewrite (H3 n) in H4. +(* case 2.2.2.1: bind *) + IH; XRewrite e; Try Rewrite <- (H3 n) in H; Try Rewrite <- (H3 n) in H0; + Try Rewrite <- r_arith1 in H4; Try Rewrite <- r_arith1 in H5; XEAuto. +(* case 2.2.2.2: flat *) + IH; XRewrite e; Try Rewrite <- (H3 n) in H2; Try Rewrite <- (H3 n) in H4; XEAuto. +(* case 2.2.3: csubst0_both *) + Replace i0 with i; XAuto; XReplaceIn H0 i0 i; XReplaceIn H2 i0 i; XReplaceIn H3 i0 i; Clear H4 i0. + Apply (r_dis k); Intros; Rewrite (H4 i) in H2; Rewrite (H4 n) in H5. +(* case 2.2.2.1: bind *) + IH; XRewrite e; Try Rewrite <- (H4 n) in H; Try Rewrite <- (H4 n) in H2; + Try Rewrite <- r_arith1 in H5; Try Rewrite <- r_arith1 in H6; XEAuto. +(* case 2.2.3.2: flat *) + IH; XRewrite e; Try Rewrite <- (H4 n) in H3; Try Rewrite <- (H4 n) in H5; XEAuto. + Qed. + + Theorem csubst0_drop_ge_back : (i,n:?) (le i n) -> + (c1,c2:?; v:?) (csubst0 i v c1 c2) -> + (e:?) (drop n (0) c2 e) -> + (drop n (0) c1 e). + XElim i. +(* case 1 : i = 0 *) + Intros; Inversion H0. +(* case 2 : i > 0 *) + Intros i; XElim n. +(* case 2.1 : n = 0 *) + Intros; Inversion H0. +(* case 2.2 : n > 0 *) + Intros until 3; Clear H0; InsertEq H2 '(S i); XElim H0; Intros; + DropGenBase. +(* case 2.2.1 : csubst0_fst *) + XAuto. +(* case 2.2.2 : csubst0_snd *) + XReplaceIn H0 i0 i; NewInduction k; XEAuto. +(* case 2.2.3 : csubst0_both *) + XReplaceIn H0 i0 i; XReplaceIn H2 i0 i; NewInduction k; XEAuto. + Qed. + + End csubst0_drop. + + Tactic Definition CSubst0Drop := + Match Context With + | [ H1: (lt ?2 ?1); + H2: (csubst0 ?1 ?3 ?4 ?5); H3: (drop ?2 (0) ?4 ?6) |- ? ] -> + LApply (csubst0_drop_lt ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x H3; Intros H3 | XAuto ]; + XElim H3; + [ Intros | Intros H3; XElim H3; Intros + | Intros H3; XElim H3; Intros | Intros H3; XElim H3; Intros ] + | [ H1: (le ?1 ?2); + H2: (csubst0 ?1 ?3 ?4 ?5); H3: (drop ?2 (0) ?4 ?6) |- ? ] -> + LApply (csubst0_drop_ge ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x H3; Intros | XAuto ] + | [H2: (csubst0 ?1 ?3 ?4 ?5); H3: (drop ?1 (0) ?4 ?6) |- ? ] -> + LApply (csubst0_drop_ge ?1 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x H2; Intros H2 | XAuto ]; + LApply (H2 ?6); [ Clear H2 H3; Intros | XAuto ] + | [H2: (csubst0 ?1 ?3 ?4 ?5); H3: (drop ?1 (0) ?5 ?6) |- ? ] -> + LApply (csubst0_drop_ge_back ?1 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x H3; Intros | XAuto ] + | [H2: (csubst0 ?1 ?3 ?4 ?5); H3: (drop ?2 (0) ?5 ?6) |- ? ] -> + LApply (csubst0_drop_ge_back ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x H3; Intros | XAuto ]. + diff --git a/helm/coq-contribs/LAMBDA-TYPES/csubst1_defs.v b/helm/coq-contribs/LAMBDA-TYPES/csubst1_defs.v new file mode 100644 index 000000000..8d1e570b5 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/csubst1_defs.v @@ -0,0 +1,101 @@ +(*#* #stop file *) + +Require Export subst1_defs. +Require Export csubst0_defs. + + Inductive csubst1 [i:nat; v:T; c1:C] : C -> Prop := + | csubst1_refl : (csubst1 i v c1 c1) + | csubst1_single : (c2:?) (csubst0 i v c1 c2) -> (csubst1 i v c1 c2). + + Hint csubst1 : ltlc := Constructors csubst1. + + Section csubst1_props. (**************************************************) + + Theorem csubst1_tail: (k:?; i:?; v,u1,u2:?) (subst1 (r k i) v u1 u2) -> + (c1,c2:?) (csubst1 (r k i) v c1 c2) -> + (csubst1 (S i) v (CTail c1 k u1) (CTail c2 k u2)). + Intros until 1; XElim H; Clear u2. +(* case 1: csubst1_refl *) + Intros until 1; XElim H; Clear c2; XAuto. +(* case 2: csubst1_single *) + Intros until 2; XElim H0; Clear c2; XAuto. + Qed. + + End csubst1_props. + + Hints Resolve csubst1_tail : ltlc. + + Section csubst1_gen_base. (***********************************************) + + Theorem csubst1_gen_tail: (k:?; c1,x:?; u1,v:?; i:?) + (csubst1 (S i) v (CTail c1 k u1) x) -> + (EX u2 c2 | x = (CTail c2 k u2) & + (subst1 (r k i) v u1 u2) & + (csubst1 (r k i) v c1 c2) + ). + Intros; InsertEq H '(CTail c1 k u1); InsertEq H '(S i); + XElim H; Clear x; Intros. +(* case 1: csubst1_refl *) + Rewrite H0; XEAuto. +(* case 2: csubst1_single *) + Rewrite H0 in H; Rewrite H1 in H; Clear H0 H1 y y0. + CSubst0GenBase; Rewrite H; XEAuto. + Qed. + + End csubst1_gen_base. + + Tactic Definition CSubst1GenBase := + Match Context With + | [ H: (csubst1 (S ?1) ?2 (CTail ?3 ?4 ?5) ?6) |- ? ] -> + LApply (csubst1_gen_tail ?4 ?3 ?6 ?5 ?2 ?1); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + + Section csubst1_drop. (***************************************************) + + Theorem csubst1_drop_ge : (i,n:?) (le i n) -> + (c1,c2:?; v:?) (csubst1 i v c1 c2) -> + (e:?) (drop n (0) c1 e) -> + (drop n (0) c2 e). + Intros until 2; XElim H0; Intros; + Try CSubst0Drop; XAuto. + Qed. + + Theorem csubst1_drop_lt : (i,n:?) (lt n i) -> + (c1,c2:?; v:?) (csubst1 i v c1 c2) -> + (e1:?) (drop n (0) c1 e1) -> + (EX e2 | (csubst1 (minus i n) v e1 e2) & + (drop n (0) c2 e2) + ). + Intros until 2; XElim H0; Intros; + Try ( + CSubst0Drop; Try Rewrite H1; Try Rewrite minus_x_Sy; + Try Rewrite r_minus in H3; Try Rewrite r_minus in H4 + ); XEAuto. + Qed. + + Theorem csubst1_drop_ge_back : (i,n:?) (le i n) -> + (c1,c2:?; v:?) (csubst1 i v c1 c2) -> + (e:?) (drop n (0) c2 e) -> + (drop n (0) c1 e). + Intros until 2; XElim H0; Intros; + Try CSubst0Drop; XAuto. + Qed. + + End csubst1_drop. + + Tactic Definition CSubst1Drop := + Match Context With + | [ H1: (lt ?2 ?1); + H2: (csubst1 ?1 ?3 ?4 ?5); H3: (drop ?2 (0) ?4 ?6) |- ? ] -> + LApply (csubst1_drop_lt ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x H3; Intros H3 | XAuto ]; + XElim H3; Intros + | [H2: (csubst1 ?1 ?3 ?4 ?5); H3: (drop ?1 (0) ?4 ?6) |- ? ] -> + LApply (csubst1_drop_ge ?1 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x H2; Intros H2 | XAuto ]; + LApply (H2 ?6); [ Clear H2 H3; Intros | XAuto ] + | [ H2: (csubst1 ?1 ?3 ?4 ?5); H3: (drop ?2 (0) ?4 ?6) |- ? ] -> + LApply (csubst1_drop_ge ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x H3; Intros | XAuto ]. diff --git a/helm/coq-contribs/LAMBDA-TYPES/description b/helm/coq-contribs/LAMBDA-TYPES/description new file mode 100644 index 000000000..06f662322 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/description @@ -0,0 +1,13 @@ +Name: lambda-delta +Title: A formalization of a lambda-typed lambda-calculus with abbreviations +Author: Ferruccio Guidi +Email: fguidi@cs.unibo.it +Homepage: http://www.cs.unibo.it/~fguidi +Institution: Department of Computer Science, University of Bologna +Address: Mura Anteo Zamboni 7, 40127 Bologna, ITALY +Date: March 31, 2005 +Description: +Url: +Keywords: lambda-types, lambda-calculus, abbreviations +Version: 7.3.1 +Require: diff --git a/helm/coq-contribs/LAMBDA-TYPES/drop_defs.v b/helm/coq-contribs/LAMBDA-TYPES/drop_defs.v new file mode 100644 index 000000000..e1576c504 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/drop_defs.v @@ -0,0 +1,125 @@ +(*#* #stop file *) + +Require Export contexts_defs. +Require Export lift_defs. + + Inductive drop : nat -> nat -> C -> C -> Prop := + | drop_sort : (h,d,n:?) (drop h d (CSort n) (CSort n)) + | drop_tail : (c,e:?) (drop (0) (0) c e) -> + (k:?; u:?) (drop (0) (0) (CTail c k u) (CTail e k u)) + | drop_drop : (k:?; h:?; c,e:?) (drop (r k h) (0) c e) -> + (u:?) (drop (S h) (0) (CTail c k u) e) + | drop_skip : (k:?; h,d:?; c,e:?) (drop h (r k d) c e) -> (u:?) + (drop h (S d) (CTail c k (lift h (r k d) u)) (CTail e k u)). + + Hint drop : ltlc := Constructors drop. + + Hint discr : ltlc := Extern 4 (drop ? ? ? ?) Simpl. + + Section drop_gen_base. (**************************************************) + + Theorem drop_gen_sort : (n,h,d:?; x:?) + (drop h d (CSort n) x) -> x = (CSort n). + Intros until 1; InsertEq H '(CSort n); XElim H; Intros; + Try Inversion H1; XAuto. + Qed. + + Theorem drop_gen_refl : (x,e:?) (drop (0) (0) x e) -> x = e. + Intros until 1; Repeat InsertEq H '(0); XElim H; Intros. +(* case 1 : drop_sort *) + XAuto. +(* case 2 : drop_tail *) + Rewrite H0; XAuto. +(* case 3 : drop_drop *) + Inversion H2. +(* case 4 : drop_skip *) + Inversion H1. + Qed. + + Theorem drop_gen_drop : (k:?; c,x:?; u:?; h:?) + (drop (S h) (0) (CTail c k u) x) -> + (drop (r k h) (0) c x). + Intros until 1; + InsertEq H '(CTail c k u); InsertEq H '(0); InsertEq H '(S h); + XElim H; Intros. +(* case 1 : drop_sort *) + Inversion H1. +(* case 2 : drop_tail *) + Inversion H1. +(* case 3 : drop_drop *) + Inversion H1; Inversion H3. + Rewrite <- H5; Rewrite <- H6; Rewrite <- H7; XAuto. +(* case 4 : drop_skip *) + Inversion H2. + Qed. + + Theorem drop_gen_skip_r : (c,x:?; u:?; h,d:?; k:?) + (drop h (S d) x (CTail c k u)) -> + (EX e | x = (CTail e k (lift h (r k d) u)) & (drop h (r k d) e c)). + Intros; Inversion_clear H; XEAuto. + Qed. + + Theorem drop_gen_skip_l : (c,x:?; u:?; h,d:?; k:?) + (drop h (S d) (CTail c k u) x) -> + (EX e v | x = (CTail e k v) & + u = (lift h (r k d) v) & + (drop h (r k d) c e) + ). + Intros; Inversion_clear H; XEAuto. + Qed. + + End drop_gen_base. + + Hints Resolve drop_gen_refl : ltlc. + + Tactic Definition DropGenBase := + Match Context With + | [ H: (drop (0) (0) ?0 ?1) |- ? ] -> + LApply (drop_gen_refl ?0 ?1); [ Clear H; Intros | XAuto ] + | [ H: (drop ?0 ?1 (CSort ?2) ?3) |- ? ] -> + LApply (drop_gen_sort ?2 ?0 ?1 ?3); [ Clear H; Intros | XAuto ] + | [ H: (drop (S ?0) (0) (CTail ?1 ?2 ?3) ?4) |- ? ] -> + LApply (drop_gen_drop ?2 ?1 ?4 ?3 ?0); [ Clear H; Intros | XAuto ] + | [ H: (drop ?1 (S ?2) ?3 (CTail ?4 ?5 ?6)) |- ? ] -> + LApply (drop_gen_skip_r ?4 ?3 ?6 ?1 ?2 ?5); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (drop ?1 (S ?2) (CTail ?4 ?5 ?6) ?3) |- ? ] -> + LApply (drop_gen_skip_l ?4 ?3 ?6 ?1 ?2 ?5); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + + Section drop_props. (*****************************************************) + + Theorem drop_skip_bind: (h,d:?; c,e:?) (drop h d c e) -> (b:?; u:?) + (drop h (S d) (CTail c (Bind b) (lift h d u)) (CTail e (Bind b) u)). + Intros; Pattern 2 d; Replace d with (r (Bind b) d); XAuto. + Qed. + + Theorem drop_refl: (c:?) (drop (0) (0) c c). + XElim c; XAuto. + Qed. + + Hints Resolve drop_refl : ltlc. + + Theorem drop_S : (b:?; c,e:?; u:?; h:?) + (drop h (0) c (CTail e (Bind b) u)) -> + (drop (S h) (0) c e). + XElim c. +(* case 1: CSort *) + Intros; DropGenBase; Inversion H. +(* case 2: CTail *) + XElim h; Intros; DropGenBase. +(* case 2.1: h = 0 *) + Inversion H0; XAuto. +(* case 2.1: h > 0 *) + Apply drop_drop; RRw; XEAuto. (**) (* explicit constructor *) + Qed. + + End drop_props. + + Hints Resolve drop_skip_bind drop_refl drop_S : ltlc. + + Tactic Definition DropS := + Match Context With + [ _: (drop ?1 (0) ?2 (CTail ?3 (Bind ?4) ?5)) |- ? ] -> + LApply (drop_S ?4 ?2 ?3 ?5 ?1); [ Intros | XAuto ]. + diff --git a/helm/coq-contribs/LAMBDA-TYPES/drop_props.v b/helm/coq-contribs/LAMBDA-TYPES/drop_props.v new file mode 100644 index 000000000..c9d3ef294 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/drop_props.v @@ -0,0 +1,259 @@ +Require lift_gen. +Require drop_defs. + +(*#* #caption "main properties of drop" #clauses *) + + Section confluence. (*****************************************************) + +(*#* #stop macro *) + + Tactic Definition IH := + Match Context With + [ H1: (drop ?1 ?2 c ?3); H2: (drop ?1 ?2 c ?4) |- ? ] -> + LApply (H ?4 ?2 ?1); [ Clear H H2; Intros H | XAuto ]; + LApply (H ?3); [ Clear H H1; Intros | XAuto ]. + +(*#* #start macro *) + +(*#* #caption "confluence, first case" *) +(*#* #cap #alpha c in C, x1 in C1, x2 in C2, d in i *) + + Theorem drop_mono : (c,x1:?; d,h:?) (drop h d c x1) -> + (x2:?) (drop h d c x2) -> x1 = x2. + +(*#* #stop proof *) + + XElim c. +(* case 1: CSort *) + Intros; Repeat DropGenBase; Rewrite H0; XAuto. +(* case 2: CTail k *) + XElim d. +(* case 2.1: d = 0 *) + XElim h; Intros; Repeat DropGenBase; Try Rewrite <- H0; XEAuto. +(* case 2.2: d > 0 *) + Intros; Repeat DropGenBase; Rewrite H1; Rewrite H2; Rewrite H5 in H3; + LiftGen; IH; XAuto. + Qed. + +(*#* #start proof *) + +(*#* #caption "confluence, second case" *) +(*#* #cap #alpha c in C1, c0 in E1, e in C2, e0 in E2, u in V1, v in V2, i in k, d in i *) + + Theorem drop_conf_lt: (b:?; i:?; u:?; c0,c:?) + (drop i (0) c (CTail c0 (Bind b) u)) -> + (e:?; h,d:?) (drop h (S (plus i d)) c e) -> + (EX v e0 | u = (lift h d v) & + (drop i (0) e (CTail e0 (Bind b) v)) & + (drop h d c0 e0) + ). + +(*#* #stop proof *) + + XElim i. +(* case 1 : i = 0 *) + Intros until 1. + DropGenBase. + Rewrite H in H0; Clear H. + Inversion H0; XEAuto. +(* case 2 : i > 0 *) + Intros i; XElim c. +(* case 2.1 : CSort *) + Intros; Inversion H0. +(* case 2.2 : CTail k *) + XElim k; Intros; Repeat DropGenBase; Rewrite H2; Clear H2 H3 e t. +(* case 2.2.1 : Bind *) + LApply (H u c0 c); [ Clear H H0 H1; Intros H | XAuto ]. + LApply (H x0 h d); [ Clear H H9; Intros H | XAuto ]. + XElim H; XEAuto. +(* case 2.2.2 : Flat *) + LApply H0; [ Clear H H0 H1; Intros H | XAuto ]. + LApply (H x0 h d); [ Clear H H9; Intros H | XAuto ]. + XElim H; XEAuto. + Qed. + +(*#* #start proof *) + +(*#* #caption "confluence, third case" *) +(*#* #cap #alpha c in C, a in C1, e in C2, i in k, d in i *) + + Theorem drop_conf_ge: (i:?; a,c:?) (drop i (0) c a) -> + (e:?; h,d:?) (drop h d c e) -> (le (plus d h) i) -> + (drop (minus i h) (0) e a). + +(*#* #stop proof *) + + XElim i. +(* case 1 : i = 0 *) + Intros until 1. + DropGenBase; Rewrite H in H0; Clear H c. + Inversion H1; Rewrite H2; Simpl; Clear H1. + PlusO; Rewrite H in H0; Rewrite H1 in H0; Clear H H1 d h. + DropGenBase; Rewrite <- H; XAuto. +(* case 2 : i > 0 *) + Intros i; XElim c. +(* case 2.1 : CSort *) + Intros; Repeat DropGenBase; Rewrite H1; Rewrite H0; XAuto. +(* case 2.2 : CTail k *) + XElim k; Intros; DropGenBase; + ( NewInduction d; + [ NewInduction h; DropGenBase; + [ Rewrite <- H2; Simpl; XAuto | Clear IHh ] + | DropGenBase; Rewrite H2; Clear IHd H2 H4 e t ] ). +(* case 2.2.1 : Bind, d = 0, h > 0 *) + LApply (H a c); [ Clear H H0 H1; Intros H | XAuto ]. + LApply (H e h (0)); XAuto. +(* case 2.2.2 : Bind, d > 0 *) + LApply (H a c); [ Clear H H0 H1; Intros H | XAuto ]. + LApply (H x0 h d); [ Clear H H4; Intros H | XAuto ]. + LApply H; [ Clear H; Simpl in H3; Intros H | XAuto ]. + Rewrite <- minus_Sn_m; XEAuto. +(* case 2.2.3 : Flat, d = 0, h > 0 *) + LApply H0; [ Clear H H0 H1; Intros H | XAuto ]. + LApply (H e (S h) (0)); XAuto. +(* case 2.2.4 : Flat, d > 0 *) + LApply H0; [ Clear H H0 H1; Intros H | XAuto ]. + LApply (H x0 h (S d)); [ Clear H H4; Intros H | XAuto ]. + LApply H; [ Clear H; Simpl in H3; Intros H | XAuto ]. + Rewrite <- minus_Sn_m in H; [ Idtac | XEAuto ]. + Rewrite <- minus_Sn_m; XEAuto. + Qed. + +(*#* #start proof *) + + End confluence. + + Section transitivity. (***************************************************) + +(*#* #caption "transitivity, first case" *) +(*#* #cap #alpha c1 in C1, c2 in C2, e1 in D1, e2 in D2, d in i, i in k *) + + Theorem drop_trans_le : (i,d:?) (le i d) -> + (c1,c2:?; h:?) (drop h d c1 c2) -> + (e2:?) (drop i (0) c2 e2) -> + (EX e1 | (drop i (0) c1 e1) & (drop h (minus d i) e1 e2)). + +(*#* #stop proof *) + + XElim i. +(* case 1 : i = 0 *) + Intros. + DropGenBase; Rewrite H1 in H0. + Rewrite <- minus_n_O; XEAuto. +(* case 2 : i > 0 *) + Intros i IHi; XElim d. +(* case 2.1 : d = 0 *) + Intros; Inversion H. +(* case 2.2 : d > 0 *) + Intros d IHd; XElim c1. +(* case 2.2.1 : CSort *) + Intros. + DropGenBase; Rewrite H0 in H1. + DropGenBase; Rewrite H1; XEAuto. +(* case 2.2.2 : CTail k *) + Intros c1 IHc; XElim k; Intros; + DropGenBase; Rewrite H0 in H1; Rewrite H2; Clear IHd H0 H2 c2 t; + DropGenBase. +(* case 2.2.2.1 : Bind *) + LApply (IHi d); [ Clear IHi; Intros IHi | XAuto ]. + LApply (IHi c1 x0 h); [ Clear IHi H8; Intros IHi | XAuto ]. + LApply (IHi e2); [ Clear IHi H0; Intros IHi | XAuto ]. + XElim IHi; XEAuto. +(* case 2.2.2.2 : Flat *) + LApply (IHc x0 h); [ Clear IHc H8; Intros IHc | XAuto ]. + LApply (IHc e2); [ Clear IHc H0; Intros IHc | XAuto ]. + XElim IHc; XEAuto. + Qed. + +(*#* #start proof *) + +(*#* #caption "transitivity, second case" *) +(*#* #cap #alpha c1 in C1, c2 in C, e2 in C2, d in i, i in k *) + + Theorem drop_trans_ge : (i:?; c1,c2:?; d,h:?) (drop h d c1 c2) -> + (e2:?) (drop i (0) c2 e2) -> (le d i) -> + (drop (plus i h) (0) c1 e2). + +(*#* #stop proof *) + + XElim i. +(* case 1: i = 0 *) + Intros. + DropGenBase; Rewrite <- H0. + Inversion H1; Rewrite H2 in H; XAuto. +(* case 2 : i > 0 *) + Intros i IHi; XElim c1; Simpl. +(* case 2.1: CSort *) + Intros. + DropGenBase; Rewrite H in H0. + DropGenBase; Rewrite H0; XAuto. +(* case 2.2: CTail *) + Intros c1 IHc; XElim d. +(* case 2.2.1: d = 0 *) + XElim h; Intros. +(* case 2.2.1.1: h = 0 *) + DropGenBase; Rewrite <- H in H0; + DropGenBase; Rewrite <- plus_n_O; XAuto. +(* case 2.2.1.2: h > 0 *) + DropGenBase; Rewrite <- plus_n_Sm. + Apply drop_drop; RRw; XEAuto. (**) (* explicit constructor *) +(* case 2.2.2: d > 0 *) + Intros d IHd; Intros. + DropGenBase; Rewrite H in IHd; Rewrite H in H0; Rewrite H2 in IHd; Rewrite H2; Clear IHd H H2 c2 t; + DropGenBase; Apply drop_drop; NewInduction k; Simpl; XEAuto. (**) (* explicit constructor *) + Qed. + +(*#* #start proof *) + + End transitivity. + +(*#* #stop macro *) + + Tactic Definition DropDis := + Match Context With + [ H1: (drop ?1 ?2 ?3 ?4); H2: (drop ?1 ?2 ?3 ?5) |- ? ] -> + LApply (drop_mono ?3 ?5 ?2 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?4); [ Clear H_x H1; Intros H1; Rewrite H1 in H2 | XAuto ] + | [ H1: (drop ?0 (0) ?1 (CTail ?2 (Bind ?3) ?4)); + H2: (drop ?5 (S (plus ?0 ?6)) ?1 ?7) |- ? ] -> + LApply (drop_conf_lt ?3 ?0 ?4 ?2 ?1); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?7 ?5 ?6); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | [ _: (drop ?0 (0) ?1 ?2); _: (drop ?5 (0) ?1 ?7); + _: (lt ?5 ?0) |- ? ] -> + LApply (drop_conf_ge ?0 ?2 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?7 ?5 (0)); [ Clear H_x; Intros H_x | XAuto ]; + Simpl in H_x; LApply H_x; [ Clear H_x; Intros | XAuto ] + | [ _: (drop ?1 (0) ?2 (CTail ?3 (Bind ?) ?)); + _: (drop (1) ?1 ?2 ?4) |- ? ] -> + LApply (drop_conf_ge (S ?1) ?3 ?2); [ Intros H_x | XEAuto ]; + LApply (H_x ?4 (1) ?1); [ Clear H_x; Intros H_x | XAuto ]; + LApply H_x; [ Clear H_x; Intros | Rewrite plus_sym; XAuto ]; ( + Match Context With + [ H: (drop (minus (S ?1) (1)) (0) ?4 ?3) |- ? ] -> + Simpl in H; Rewrite <- minus_n_O in H ) + | [ H0: (drop ?0 (0) ?1 ?2); H2: (lt ?6 ?0); + H1: (drop (1) ?6 ?1 ?7) |- ? ] -> + LApply (drop_conf_ge ?0 ?2 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?7 (1) ?6); [ Clear H_x; Intros H_x | XAuto ]; + LApply H_x; [ Clear H_x; Intros | Rewrite plus_sym; XAuto ] + | [ H0: (drop ?0 (0) ?1 ?2); + H1: (drop ?5 ?6 ?1 ?7) |- ? ] -> + LApply (drop_conf_ge ?0 ?2 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?7 ?5 ?6); [ Clear H_x; Intros H_x | XAuto ]; + LApply H_x; [ Clear H_x; Intros | XAuto ] + | [ H0: (lt ?1 ?2); + H1: (drop ?3 ?2 ?4 ?5); H2: (drop ?1 (0) ?5 ?6) |- ? ] -> + LApply (drop_trans_le ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5 ?3); [ Clear H_x H1; Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x H2; Intros H_x | XAuto ]; + XElim H_x; Intros + | [ H0: (le ?1 ?2); + H1: (drop ?3 ?1 ?4 ?5); H2: (drop ?2 (0) ?5 ?6) |- ? ] -> + LApply (drop_trans_ge ?2 ?4 ?5 ?1 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?6); [ Clear H1 H2; Intros H1 | XAuto ]; + LApply H1; [ Clear H1; Intros | XAuto ]. + +(*#* #start macro *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/lift_defs.v b/helm/coq-contribs/LAMBDA-TYPES/lift_defs.v new file mode 100644 index 000000000..3185aad6f --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/lift_defs.v @@ -0,0 +1,236 @@ +(*#* #stop file *) + +Require Export terms_defs. + + Fixpoint bref_map [g:nat->nat; d:nat; t:T] : T := Cases t of + | (TSort n) => (TSort n) + | (TBRef n) => + if (blt n d) then (TBRef n) else (TBRef (g n)) + | (TTail k u t) => + (TTail k (bref_map g d u) (bref_map g (s k d) t)) + end. + + Definition lift : nat -> nat -> T -> T := + [h](bref_map [x](plus x h)). + + Section lift_rw. (********************************************************) + + Theorem lift_sort: (n:?; h,d:?) (lift h d (TSort n)) = (TSort n). + XAuto. + Qed. + + Theorem lift_bref_lt: (n:?; h,d:?) (lt n d) -> + (lift h d (TBRef n)) = (TBRef n). + Intros; Unfold lift; Simpl. + Replace (blt n d) with true; XAuto. + Qed. + + Theorem lift_bref_ge: (n:?; h,d:?) (le d n) -> + (lift h d (TBRef n)) = (TBRef (plus n h)). + + Intros; Unfold lift; Simpl. + Replace (blt n d) with false; XAuto. + Qed. + + Theorem lift_tail: (k:?; u,t:?; h,d:?) + (lift h d (TTail k u t)) = + (TTail k (lift h d u) (lift h (s k d) t)). + XAuto. + Qed. + + Theorem lift_bind: (b:?; u,t:?; h,d:?) + (lift h d (TTail (Bind b) u t)) = + (TTail (Bind b) (lift h d u) (lift h (S d) t)). + XAuto. + Qed. + + Theorem lift_flat: (f:?; u,t:?; h,d:?) + (lift h d (TTail (Flat f) u t)) = + (TTail (Flat f) (lift h d u) (lift h d t)). + XAuto. + Qed. + + End lift_rw. + + Hints Resolve lift_bref_lt lift_bind lift_flat : ltlc. + + Tactic Definition LiftTailRw := + Repeat (Rewrite lift_tail Orelse Rewrite lift_bind Orelse Rewrite lift_flat). + + Tactic Definition LiftTailRwBack := + Repeat (Rewrite <- lift_tail Orelse Rewrite <- lift_bind Orelse Rewrite <- lift_flat). + + Section lift_gen. (*******************************************************) + + Theorem lift_gen_sort: (h,d,n:?; t:?) (TSort n) = (lift h d t) -> + t = (TSort n). + XElim t; Intros. +(* case 1 : TSort *) + XAuto. +(* case 2 : TBRef n0 *) + Apply (lt_le_e n0 d); Intros. +(* case 2.1 : n0 < d *) + Rewrite lift_bref_lt in H; [ Inversion H | XAuto ]. +(* case 2.2 : n0 >= d *) + Rewrite lift_bref_ge in H; [ Inversion H | XAuto ]. +(* case 3 : TTail k *) + Rewrite lift_tail in H1; Inversion H1. + Qed. + + Theorem lift_gen_bref_lt: (h,d,n:?) (lt n d) -> + (t:?) (TBRef n) = (lift h d t) -> + t = (TBRef n). + XElim t; Intros. +(* case 1 : TSort *) + XAuto. +(* case 2 : TBRef n0 *) + Apply (lt_le_e n0 d); Intros. +(* case 2.1 : n0 < d *) + Rewrite lift_bref_lt in H0; XAuto. +(* case 2.2 : n0 >= d *) + Rewrite lift_bref_ge in H0; [ Inversion H0; Clear H0 | XAuto ]. + Rewrite H3 in H; Clear H3 n. + EApply le_false; [ Apply H1 | XEAuto ]. +(* case 3 : TTail k *) + Rewrite lift_tail in H2; Inversion H2. + Qed. + + Theorem lift_gen_bref_false: (h,d,n:?) (le d n) -> (lt n (plus d h)) -> + (t:?) (TBRef n) = (lift h d t) -> + (P:Prop) P. + XElim t; Intros. +(* case 1 : TSort *) + Inversion H1. +(* case 2 : TBRef n0 *) + Apply (lt_le_e n0 d); Intros. +(* case 2.1 : n0 < d *) + Rewrite lift_bref_lt in H1; [ Inversion H1; Clear H1 | XAuto ]. + Rewrite <- H4 in H2; Clear H4 n0. + EApply le_false; [ Apply H | XEAuto ]. +(* case 2.2 : n0 >= d *) + Rewrite lift_bref_ge in H1; [ Inversion H1; Clear H1 | XAuto ]. + Rewrite H4 in H0; Clear H4. + EApply le_false; [ Apply H2 | XEAuto ]. +(* case 3 : TTail k *) + Rewrite lift_tail in H3; Inversion H3. + Qed. + + Theorem lift_gen_bref_ge: (h,d,n:?) (le d n) -> + (t:?) (TBRef (plus n h)) = (lift h d t) -> + t = (TBRef n). + XElim t; Intros. +(* case 1 : TSort *) + Inversion H0. +(* case 2 : TBRef n0 *) + Apply (lt_le_e n0 d); Intros. +(* case 2.1 : n0 < d *) + Rewrite lift_bref_lt in H0; [ Inversion H0; Clear H0 | XAuto ]. + Rewrite <- H3 in H1; Clear H3 n0. + EApply le_false; [ Apply H | XEAuto ]. +(* case 2.2 : n0 >= d *) + Rewrite lift_bref_ge in H0; [ Inversion H0; XEAuto | XAuto ]. +(* case 3 : TTail k *) + Rewrite lift_tail in H2; Inversion H2. + Qed. + +(* NOTE: lift_gen_tail should be used instead of these two *) (**) + Theorem lift_gen_bind: (b:?; u,t,x:?; h,d:?) + (TTail (Bind b) u t) = (lift h d x) -> + (EX y z | x = (TTail (Bind b) y z) & + u = (lift h d y) & + t = (lift h (S d) z) + ). + XElim x; Intros. +(* case 1 : TSort *) + Inversion H. +(* case 2 : TBRef n *) + Apply (lt_le_e n d); Intros. +(* case 2.1 : n < d *) + Rewrite lift_bref_lt in H; [ Inversion H | XAuto ]. +(* case 2.2 : n >= d *) + Rewrite lift_bref_ge in H; [ Inversion H | XAuto ]. +(* case 3 : TTail k *) + Rewrite lift_tail in H1; Inversion H1. + XEAuto. + Qed. + + Theorem lift_gen_flat: (f:?; u,t,x:?; h,d:?) + (TTail (Flat f) u t) = (lift h d x) -> + (EX y z | x = (TTail (Flat f) y z) & + u = (lift h d y) & + t = (lift h d z) + ). + XElim x; Intros. +(* case 1 : TSort *) + Inversion H. +(* case 2 : TBRef n *) + Apply (lt_le_e n d); Intros. +(* case 2.1 : n < d *) + Rewrite lift_bref_lt in H; [ Inversion H | XAuto ]. +(* case 2.2 : n >= d *) + Rewrite lift_bref_ge in H; [ Inversion H | XAuto ]. +(* case 3 : TTail k *) + Rewrite lift_tail in H1; Inversion H1. + XEAuto. + Qed. + + End lift_gen. + + Tactic Definition LiftGenBase := + Match Context With + | [ H: (TSort ?0) = (lift ?1 ?2 ?3) |- ? ] -> + LApply (lift_gen_sort ?1 ?2 ?0 ?3); [ Clear H; Intros | XAuto ] + | [ H1: (le ?1 ?2); H2: (lt ?2 (plus ?1 ?3)); + H3: (TBRef ?2) = (lift ?3 ?1 ?4) |- ? ] -> + Apply (lift_gen_bref_false ?3 ?1 ?2 H1 H2 ?4 H3); XAuto + | [ H: (TBRef ?1) = (lift (1) ?1 ?2) |- ? ] -> + LApply (lift_gen_bref_false (1) ?1 ?1); [ Intros H_x | XAuto ]; + LApply H_x; [ Clear H_x; Intros H_x | Arith7' ?1; XAuto ]; + LApply (H_x ?2); [ Clear H_x; Intros H_x | XAuto ]; + Apply H_x + | [ H: (TBRef (plus ?0 ?1)) = (lift ?1 ?2 ?3) |- ? ] -> + LApply (lift_gen_bref_ge ?1 ?2 ?0); [ Intros H_x | XAuto ]; + LApply (H_x ?3); [ Clear H_x H; Intros | XAuto ] + | [ H1: (TBRef ?0) = (lift ?1 ?2 ?3); H2: (lt ?0 ?4) |- ? ] -> + LApply (lift_gen_bref_lt ?1 ?2 ?0); + [ Intros H_x | Apply lt_le_trans with m:=?4; XEAuto ]; + LApply (H_x ?3); [ Clear H_x H1; Intros | XAuto ] + | [ H: (TBRef ?0) = (lift ?1 ?2 ?3) |- ? ] -> + LApply (lift_gen_bref_lt ?1 ?2 ?0); [ Intros H_x | XEAuto ]; + LApply (H_x ?3); [ Clear H_x H; Intros | XAuto ] + | [ H: (TTail (Bind ?0) ?1 ?2) = (lift ?3 ?4 ?5) |- ? ] -> + LApply (lift_gen_bind ?0 ?1 ?2 ?5 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (TTail (Flat ?0) ?1 ?2) = (lift ?3 ?4 ?5) |- ? ] -> + LApply (lift_gen_flat ?0 ?1 ?2 ?5 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + + Section lift_props. (*****************************************************) + + Theorem lift_r: (t:?; d:?) (lift (0) d t) = t. + XElim t; Intros. +(* case 1: TSort *) + XAuto. +(* case 2: TBRef n *) + Apply (lt_le_e n d); Intros. +(* case 2.1: n < d *) + Rewrite lift_bref_lt; XAuto. +(* case 2.2: n >= d *) + Rewrite lift_bref_ge; XAuto. +(* case 3: TTail *) + LiftTailRw; XAuto. + Qed. + + Theorem lift_bref_gt : (d,n:?) (lt d n) -> + (lift (1) d (TBRef (pred n))) = (TBRef n). + Intros. + Rewrite lift_bref_ge. +(* case 1: first branch *) + Rewrite <- plus_sym; Simpl; Rewrite <- (S_pred n d); XAuto. +(* case 2: second branch *) + Apply le_S_n; Rewrite <- (S_pred n d); XAuto. + Qed. + + End lift_props. + + Hints Resolve lift_r lift_bref_gt : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/lift_gen.v b/helm/coq-contribs/LAMBDA-TYPES/lift_gen.v new file mode 100644 index 000000000..14914d4cb --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/lift_gen.v @@ -0,0 +1,126 @@ +(*#* #stop file *) + +Require lift_defs. + + Section lift_ini. (*******************************************************) + + Tactic Definition IH := + Match Context With + | [ H1: (lift ?1 ?2 t) = (lift ?1 ?2 ?3) |- ? ] -> + LApply (H ?3 ?1 ?2); [ Clear H H1; Intros | XAuto ] + | [ H1: (lift ?1 ?2 t0) = (lift ?1 ?2 ?3) |- ? ] -> + LApply (H0 ?3 ?1 ?2); [ Clear H0 H1; Intros | XAuto ]. + +(*#* #start file *) + +(*#* #caption "main properties of lift" #clauses lift_props *) + +(*#* #caption "injectivity" *) +(*#* #cap #alpha x in T1, t in T2, d in i *) + + Theorem lift_inj : (x,t:?; h,d:?) (lift h d x) = (lift h d t) -> x = t. + +(*#* #stop file *) + + XElim x. +(* case 1 : TSort *) + Intros; Rewrite lift_sort in H; LiftGenBase; XAuto. +(* case 2 : TBRef n *) + Intros; Apply (lt_le_e n d); Intros. +(* case 2.1 : n < d *) + Rewrite lift_bref_lt in H; [ LiftGenBase; XAuto | XAuto ]. +(* case 2.2 : n >= d *) + Rewrite lift_bref_ge in H; [ LiftGenBase; XAuto | XAuto ]. +(* case 3 : TTail k *) + XElim k; Intros; [ Rewrite lift_bind in H1 | Rewrite lift_flat in H1 ]; + LiftGenBase; Rewrite H1; IH; IH; XAuto. + Qed. + + End lift_ini. + + Section lift_gen_lift. (**************************************************) + + Tactic Definition IH := + Match Context With + | [ H_x: (lift ?0 ?1 t) = (lift ?2 (plus ?3 ?0) ?4) |- ? ] -> + LApply (H ?4 ?0 ?2 ?1 ?3); [ Clear H; Intros H | XAuto ]; + LApply H; [ Clear H H_x; Intros H | XAuto ]; + XElim H; Intros + | [ H_x: (lift ?0 ?1 t0) = (lift ?2 (plus ?3 ?0) ?4) |- ? ] -> + LApply (H0 ?4 ?0 ?2 ?1 ?3); [ Clear H0; Intros H0 | XAuto ]; + LApply H0; [ Clear H0 H_x; Intros H0 | XAuto ]; + XElim H0; Intros. + +(*#* #start file *) + +(*#* #caption "generation lemma for lift" *) +(*#* #cap #cap t1 #alpha t2 in T, x in T2, d1 in i1, d2 in i2 *) + + Theorem lift_gen_lift : (t1,x:?; h1,h2,d1,d2:?) (le d1 d2) -> + (lift h1 d1 t1) = (lift h2 (plus d2 h1) x) -> + (EX t2 | x = (lift h1 d1 t2) & + t1 = (lift h2 d2 t2) + ). + +(*#* #stop file *) + + XElim t1; Intros. +(* case 1 : TSort *) + Rewrite lift_sort in H0. + LiftGenBase; Rewrite H0; Clear H0 x. + EApply ex2_intro; Rewrite lift_sort; XAuto. +(* case 2 : TBRef n *) + Apply (lt_le_e n d1); Intros. +(* case 2.1 : n < d1 *) + Rewrite lift_bref_lt in H0; [ Idtac | XAuto ]. + LiftGenBase; Rewrite H0; Clear H0 x. + EApply ex2_intro; Rewrite lift_bref_lt; XEAuto. +(* case 2.2 : n >= d1 *) + Rewrite lift_bref_ge in H0; [ Idtac | XAuto ]. + Apply (lt_le_e n d2); Intros. +(* case 2.2.1 : n < d2 *) + LiftGenBase; Rewrite H0; Clear H0 x. + EApply ex2_intro; [ Rewrite lift_bref_ge | Rewrite lift_bref_lt ]; XEAuto. +(* case 2.2.2 : n >= d2 *) + Apply (lt_le_e n (plus d2 h2)); Intros. +(* case 2.2.2.1 : n < d2 + h2 *) + EApply lift_gen_bref_false; [ Idtac | Idtac | Apply H0 ]; + [ XAuto | Rewrite plus_permute_2_in_3; XAuto ]. +(* case 2.2.2.2 : n >= d2 + h2 *) + Rewrite (le_plus_minus_sym h2 (plus n h1)) in H0; [ Idtac | XEAuto ]. + LiftGenBase; Rewrite H0; Clear H0 x. + EApply ex2_intro; + [ Rewrite le_minus_plus; [ Idtac | XEAuto ] + | Rewrite (le_plus_minus_sym h2 n); [ Idtac | XEAuto ] ]; + Rewrite lift_bref_ge; XEAuto. +(* case 3 : TTail k *) + NewInduction k. +(* case 3.1 : Bind *) + Rewrite lift_bind in H2. + LiftGenBase; Rewrite H2; Clear H2 x. + IH; Rewrite H; Rewrite H2; Clear H H2 x0. + Arith4In H4 d2 h1; IH; Rewrite H; Rewrite H0; Clear H H0 x1 t t0. + EApply ex2_intro; Rewrite lift_bind; XAuto. +(* case 3.2 : Flat *) + Rewrite lift_flat in H2. + LiftGenBase; Rewrite H2; Clear H2 x. + IH; Rewrite H; Rewrite H2; Clear H H2 x0. + IH; Rewrite H; Rewrite H0; Clear H H0 x1 t t0. + EApply ex2_intro; Rewrite lift_flat; XAuto. + Qed. + + End lift_gen_lift. + + Tactic Definition LiftGen := + Match Context With + | [ H: (lift ?1 ?2 ?3) = (lift ?1 ?2 ?4) |- ? ] -> + LApply (lift_inj ?3 ?4 ?1 ?2); [ Clear H; Intros | XAuto ] + | [ H: (lift ?0 ?1 ?2) = (lift ?3 (plus ?4 ?0) ?5) |- ? ] -> + LApply (lift_gen_lift ?2 ?5 ?0 ?3 ?1 ?4); [ Intros H_x | XAuto ]; + LApply H_x; [ Clear H H_x; Intros H | XAuto ]; + XElim H; Intros + | [ H: (lift (1) (0) ?1) = (lift (1) (S ?2) ?3) |- ? ] -> + LApply (lift_gen_lift ?1 ?3 (1) (1) (0) ?2); [ Intros H_x | XAuto ]; + LApply H_x; [ Clear H_x H; Intros H | Arith7' ?2; XAuto ]; + XElim H; Intros + | _ -> LiftGenBase. diff --git a/helm/coq-contribs/LAMBDA-TYPES/lift_props.v b/helm/coq-contribs/LAMBDA-TYPES/lift_props.v new file mode 100644 index 000000000..5d5d7d0a9 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/lift_props.v @@ -0,0 +1,43 @@ +(*#* #stop file *) + +Require lift_defs. + + Section lift_props. (*****************************************************) + + Theorem lift_free: (t:?; h,k,d,e:?) (le e (plus d h)) -> (le d e) -> + (lift k e (lift h d t)) = (lift (plus k h) d t). + XElim t; Intros. +(* case 1: TSort *) + Repeat Rewrite lift_sort; XAuto. +(* case 2: TBRef n *) + Apply (lt_le_e n d); Intros. +(* case 2.1: n < d *) + Repeat Rewrite lift_bref_lt; XEAuto. +(* case 2.2: n >= d *) + Repeat Rewrite lift_bref_ge; XEAuto. +(* case 3: TTail k *) + LiftTailRw; XAuto. + Qed. + + Theorem lift_d : (t:?; h,k,d,e:?) (le e d) -> + (lift h (plus k d) (lift k e t)) = (lift k e (lift h d t)). + XElim t; Intros. +(* case 1: TSort *) + Repeat Rewrite lift_sort; XAuto. +(* case 2: TBRef n *) + Apply (lt_le_e n e); Intros. +(* case 2.1: n < e *) + Cut (lt n d); Intros; Repeat Rewrite lift_bref_lt; XEAuto. +(* case 2.2: n >= e *) + Rewrite lift_bref_ge; [ Idtac | XAuto ]. + Rewrite plus_sym; Apply (lt_le_e n d); Intros. +(* case 2.2.1: n < d *) + Do 2 (Rewrite lift_bref_lt; [ Idtac | XAuto ]). + Rewrite lift_bref_ge; XAuto. +(* case 2.2.2: n >= d *) + Repeat Rewrite lift_bref_ge; XAuto. +(* case 3: TTail k *) + LiftTailRw; SRw; XAuto. + Qed. + + End lift_props. diff --git a/helm/coq-contribs/LAMBDA-TYPES/lift_tlt.v b/helm/coq-contribs/LAMBDA-TYPES/lift_tlt.v new file mode 100644 index 000000000..3a9cb3fce --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/lift_tlt.v @@ -0,0 +1,89 @@ +(*#* #stop file *) + +Require tlt_defs. +Require lift_defs. + + Hint discr : ltlc := Extern 4 (lt (weight_map (wadd ? ?) (lift (S ?) ? ?)) (wadd ? ? ?)) + Simpl; Rewrite <- lift_weight_add_O. + + Hint discr : ltlc := Extern 4 (lt (weight_map ? (lift (0) (0) ?)) ?) + Rewrite lift_r. + + Section lift_tlt_props. (*************************************************) + + Theorem lift_weight_map: (t:?; h,d:?; f:?) + ((m:?) (le d m) -> (f m)=(0)) -> + (weight_map f (lift h d t)) = (weight_map f t). + XElim t; Intros. +(* case 1: TSort *) + XAuto. +(* case 2: TBRef n *) + Apply (lt_le_e n d); Intros. +(* case 2.1: n < d *) + Rewrite lift_bref_lt; XAuto. +(* case 2.2: n >= d *) + Rewrite lift_bref_ge; [ Simpl | XAuto ]. + Rewrite (H n); XAuto. +(* case 3: TTail k *) + XElim k; Intros; LiftTailRw; Simpl. +(* case 3.1: Bind *) + XElim b; [ Rewrite H; [ Idtac | XAuto ] | Idtac | Idtac ]; + Rewrite H0; Intros; Try (LeLtGen; Rewrite H2; Simpl); XAuto. +(* case 3.2: Flat *) + XAuto. + Qed. + + Hints Resolve lift_weight_map : ltlc. + + Theorem lift_weight : (t:?; h,d:?) (weight (lift h d t)) = (weight t). + Unfold weight; XAuto. + Qed. + + Theorem lift_weight_add : (w:?; t:?; h,d:?; f,g:?) + ((m:?) (lt m d) -> (g m) = (f m)) -> + (g d) = w -> + ((m:?) (le d m) -> (g (S m)) = (f m)) -> + (weight_map f (lift h d t)) = + (weight_map g (lift (S h) d t)). + XElim t; Intros. +(* case 1: TSort *) + XAuto. +(* case 2: TBRef *) + Apply (lt_le_e n d); Intros. +(* case 2.1: n < d *) + Repeat Rewrite lift_bref_lt; Simpl; XAuto. +(* case 2.2: n >= d *) + Repeat Rewrite lift_bref_ge; Simpl; Try Rewrite <- plus_n_Sm; XAuto. +(* case 3: TTail k *) + XElim k; Intros; LiftTailRw; Simpl. +(* case 1 : bind b *) + XElim b; Simpl; + Apply (f_equal nat); + (Apply (f_equal2 nat nat); [ XAuto | Idtac ]); + ( Apply H0; Simpl; Intros; Try (LeLtGen; Rewrite H4; Simpl); XAuto). +(* case 2 : Flat *) + XAuto. + Qed. + + Theorem lift_weight_add_O: (w:?; t:?; h:?; f:?) + (weight_map f (lift h (0) t)) = + (weight_map (wadd f w) (lift (S h) (0) t)). + Intros. + EApply lift_weight_add; XAuto. + Intros; Inversion H. + Qed. + + Theorem lift_tlt_dx: (k:?; u,t:?; h,d:?) + (tlt t (TTail k u (lift h d t))). + Unfold tlt; Intros. + Rewrite <- (lift_weight t h d). + Fold (tlt (lift h d t) (TTail k u (lift h d t))); XAuto. + Qed. + + End lift_tlt_props. + + Hints Resolve lift_tlt_dx : ltlc. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/pc1_defs.v b/helm/coq-contribs/LAMBDA-TYPES/pc1_defs.v new file mode 100644 index 000000000..0dcc0b8c7 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pc1_defs.v @@ -0,0 +1,79 @@ +(*#* #stop file *) + +Require Export pr0_defs. + + Inductive pc0 [t1,t2:T] : Prop := + | pc0_r : (pr0 t1 t2) -> (pc0 t1 t2) + | pc0_x : (pr0 t2 t1) -> (pc0 t1 t2). + + Hint pc0 : ltlc := Constructors pc0. + + Inductive pc1 : T -> T -> Prop := + | pc1_r : (t:?) (pc1 t t) + | pc1_u : (t2,t1:?) (pc0 t1 t2) -> (t3:?) (pc1 t2 t3) -> (pc1 t1 t3). + + Hint pc1 : ltlc := Constructors pc1. + + Section pc0_props. (******************************************************) + + Theorem pc0_s : (t2,t1:?) (pc0 t1 t2) -> (pc0 t2 t1). + Intros. + Inversion H; XAuto. + Qed. + + End pc0_props. + + Hints Resolve pc0_s : ltlc. + + Section pc1_props. (******************************************************) + + Theorem pc1_pr0_r : (t1,t2:?) (pr0 t1 t2) -> (pc1 t1 t2). + XEAuto. + Qed. + + Theorem pc1_pr0_x : (t1,t2:?) (pr0 t2 t1) -> (pc1 t1 t2). + XEAuto. + Qed. + + Theorem pc1_pc0 : (t1,t2:?) (pc0 t1 t2) -> (pc1 t1 t2). + XEAuto. + Qed. + + Theorem pc1_t : (t2,t1:?) (pc1 t1 t2) -> + (t3:?) (pc1 t2 t3) -> (pc1 t1 t3). + Intros t2 t1 H; XElim H; XEAuto. + Qed. + + Hints Resolve pc1_t : ltlc. + + Theorem pc1_s : (t2,t1:?) (pc1 t1 t2) -> (pc1 t2 t1). + Intros; XElim H; XEAuto. + Qed. + + Theorem pc1_tail_1: (u1,u2:?) (pc1 u1 u2) -> + (t:?; k:?) (pc1 (TTail k u1 t) (TTail k u2 t)). + Intros; XElim H; Intros. +(* case 1: pc1_r *) + XAuto. +(* case 2: pc1_u *) + XElim H; Intros; XEAuto. + Qed. + + Theorem pc1_tail_2: (t1,t2:?) (pc1 t1 t2) -> + (u:?; k:?) (pc1 (TTail k u t1) (TTail k u t2)). + Intros; XElim H; Intros. +(* case 1: pc1_r *) + XAuto. +(* case 2: pc1_u *) + XElim H; Intros; XEAuto. + Qed. + + Theorem pc1_tail: (u1,u2:?) (pc1 u1 u2) -> (t1,t2:?) (pc1 t1 t2) -> + (k:?) (pc1 (TTail k u1 t1) (TTail k u2 t2)). + Intros; EApply pc1_t; [ EApply pc1_tail_1 | EApply pc1_tail_2 ]; XAuto. + Qed. + + End pc1_props. + + Hints Resolve pc1_pr0_r pc1_pr0_x pc1_pc0 pc1_t pc1_s + pc1_tail_1 pc1_tail_2 pc1_tail : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pc3_defs.v b/helm/coq-contribs/LAMBDA-TYPES/pc3_defs.v new file mode 100644 index 000000000..b2b530d59 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pc3_defs.v @@ -0,0 +1,160 @@ +(*#* #stop file *) + +Require Export pr2_defs. +Require Export pr3_defs. +Require Export pc1_defs. + + Inductive pc2 [c:C; t1,t2:T] : Prop := + | pc2_r : (pr2 c t1 t2) -> (pc2 c t1 t2) + | pc2_x : (pr2 c t2 t1) -> (pc2 c t1 t2). + + Hint pc2 : ltlc := Constructors pc2. + + Inductive pc3 [c:C] : T -> T -> Prop := + | pc3_r : (t:?) (pc3 c t t) + | pc3_u : (t2,t1:?) (pc2 c t1 t2) -> + (t3:?) (pc3 c t2 t3) -> (pc3 c t1 t3). + + Hint pc3 : ltlc := Constructors pc3. + + Section pc2_props. (******************************************************) + + Theorem pc2_s : (c,t2,t1:?) (pc2 c t1 t2) -> (pc2 c t2 t1). + Intros. + Inversion H; XAuto. + Qed. + + Theorem pc2_shift : (h:?; c,e:?) (drop h (0) c e) -> + (t1,t2:?) (pc2 c t1 t2) -> + (pc2 e (app c h t1) (app c h t2)). + Intros until 2; XElim H0; Intros. +(* case 1 : pc2_r *) + XAuto. +(* case 2 : pc2_x *) + XEAuto. + Qed. + + End pc2_props. + + Hints Resolve pc2_s pc2_shift : ltlc. + + Section pc3_props. (******************************************************) + + Theorem pc3_pr2_r : (c,t1,t2:?) (pr2 c t1 t2) -> (pc3 c t1 t2). + XEAuto. + Qed. + + Theorem pc3_pr2_x : (c,t1,t2:?) (pr2 c t2 t1) -> (pc3 c t1 t2). + XEAuto. + Qed. + + Theorem pc3_pc2 : (c,t1,t2:?) (pc2 c t1 t2) -> (pc3 c t1 t2). + XEAuto. + Qed. + + Theorem pc3_t : (t2,c,t1:?) (pc3 c t1 t2) -> + (t3:?) (pc3 c t2 t3) -> (pc3 c t1 t3). + Intros t2 c t1 H; XElim H; XEAuto. + Qed. + + Hints Resolve pc3_t : ltlc. + + Theorem pc3_s : (c,t2,t1:?) (pc3 c t1 t2) -> (pc3 c t2 t1). + Intros; XElim H; [ XAuto | XEAuto ]. + Qed. + + Hints Resolve pc3_s : ltlc. + + Theorem pc3_pr3_r : (c:?; t1,t2) (pr3 c t1 t2) -> (pc3 c t1 t2). + Intros; XElim H; XEAuto. + Qed. + + Theorem pc3_pr3_x : (c:?; t1,t2) (pr3 c t2 t1) -> (pc3 c t1 t2). + Intros; XElim H; XEAuto. + Qed. + + Hints Resolve pc3_pr3_r pc3_pr3_x : ltlc. + + Theorem pc3_pr3_t : (c:?; t1,t0:?) (pr3 c t1 t0) -> + (t2:?) (pr3 c t2 t0) -> (pc3 c t1 t2). + Intros; Apply (pc3_t t0); XAuto. + Qed. + + Theorem pc3_thin_dx : (c:? ;t1,t2:?) (pc3 c t1 t2) -> + (u:?; f:?) (pc3 c (TTail (Flat f) u t1) + (TTail (Flat f) u t2)). + Intros; XElim H; [XAuto | Intros ]. + EApply pc3_u; [ Inversion H | Apply H1 ]; XAuto. + Qed. + + Theorem pc3_tail_1 : (c:?; u1,u2:?) (pc3 c u1 u2) -> + (k:?; t:?) (pc3 c (TTail k u1 t) (TTail k u2 t)). + Intros until 1; XElim H; Intros. +(* case 1 : pc3_r *) + XAuto. +(* case 2 : pc3_u *) + EApply pc3_u; [ Inversion H | Apply H1 ]; XAuto. + Qed. + + Theorem pc3_tail_2 : (c:?; u,t1,t2:?; k:?) (pc3 (CTail c k u) t1 t2) -> + (pc3 c (TTail k u t1) (TTail k u t2)). + Intros. + XElim H; [ Idtac | Intros; Inversion H ]; XEAuto. + Qed. + + Theorem pc3_tail_12 : (c:?; u1,u2:?) (pc3 c u1 u2) -> + (k:?; t1,t2:?) (pc3 (CTail c k u2) t1 t2) -> + (pc3 c (TTail k u1 t1) (TTail k u2 t2)). + Intros. + EApply pc3_t; [ Apply pc3_tail_1 | Apply pc3_tail_2 ]; XAuto. + Qed. + + Theorem pc3_tail_21 : (c:?; u1,u2:?) (pc3 c u1 u2) -> + (k:?; t1,t2:?) (pc3 (CTail c k u1) t1 t2) -> + (pc3 c (TTail k u1 t1) (TTail k u2 t2)). + Intros. + EApply pc3_t; [ Apply pc3_tail_2 | Apply pc3_tail_1 ]; XAuto. + Qed. + + Theorem pc3_pr3_u : (c:?; t2,t1:?) (pr2 c t1 t2) -> + (t3:?) (pc3 c t2 t3) -> (pc3 c t1 t3). + XEAuto. + Qed. + + Theorem pc3_pr3_u2 : (c:?; t0,t1:?) (pr2 c t0 t1) -> + (t2:?) (pc3 c t0 t2) -> (pc3 c t1 t2). + Intros; Apply (pc3_t t0); XAuto. + Qed. + + Theorem pc3_shift : (h:?; c,e:?) (drop h (0) c e) -> + (t1,t2:?) (pc3 c t1 t2) -> + (pc3 e (app c h t1) (app c h t2)). + Intros until 2; XElim H0; Clear t1 t2; Intros. +(* case 1 : pc3_r *) + XAuto. +(* case 2 : pc3_u *) + XEAuto. + Qed. + + Theorem pc3_pc1: (t1,t2:?) (pc1 t1 t2) -> (c:?) (pc3 c t1 t2). + Intros; XElim H; Intros. +(* case 1: pc1_r *) + XAuto. +(* case 2 : pc1_u *) + XElim H; XEAuto. + Qed. + + End pc3_props. + + Hints Resolve pc3_pr2_r pc3_pr2_x pc3_pc2 pc3_pr3_r pc3_pr3_x + pc3_t pc3_s pc3_pr3_t pc3_thin_dx pc3_tail_1 pc3_tail_2 + pc3_tail_12 pc3_tail_21 pc3_pr3_u pc3_shift pc3_pc1 : ltlc. + + Tactic Definition Pc3T := + Match Context With + | [ _: (pr3 ?1 ?2 (TTail ?3 ?4 ?5)); _: (pc3 ?1 ?6 ?4) |- ? ] -> + LApply (pc3_t (TTail ?3 ?4 ?5) ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x (TTail ?3 ?6 ?5)); [ Clear H_x; Intros | Apply pc3_s; XAuto ] + | [ _: (pc3 ?1 ?2 ?3); _: (pr3 ?1 ?3 ?4) |- ? ] -> + LApply (pc3_t ?3 ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?4); [ Clear H_x; Intros | XAuto ]. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pc3_gen.v b/helm/coq-contribs/LAMBDA-TYPES/pc3_gen.v new file mode 100644 index 000000000..4e5dabaaa --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pc3_gen.v @@ -0,0 +1,80 @@ +(*#* #stop file *) + +Require lift_gen. +Require pr3_props. +Require pr3_gen. +Require pc3_defs. +Require pc3_props. + + Section pc3_gen. (********************************************************) + + Theorem pc3_gen_abst : (c:?; u1,u2,t1,t2:?) + (pc3 c (TTail (Bind Abst) u1 t1) + (TTail (Bind Abst) u2 t2) + ) -> + (pc3 c u1 u2) /\ + (b:?; u:?) (pc3 (CTail c (Bind b) u) t1 t2). + Intros. + Pc3Confluence; Pr3Gen; Pr3Gen; Rewrite H0 in H; Clear H0 x. + Inversion H; Rewrite H5 in H1; Rewrite H6 in H2. + Split; XEAuto. + Qed. + + Theorem pc3_gen_lift: (c:?; t1,t2:?; h,d:?) + (pc3 c (lift h d t1) (lift h d t2)) -> + (e:?) (drop h d c e) -> + (pc3 e t1 t2). + Intros. + Pc3Confluence; Pr3Gen; Pr3Gen; Rewrite H1 in H; Clear H1 x. + LiftGen; Rewrite H in H2; XEAuto. + Qed. + + Theorem pc3_gen_not_abst : (b:?) ~b=Abst -> (c:?; t1,t2,u1,u2:?) + (pc3 c (TTail (Bind b) u1 t1) + (TTail (Bind Abst) u2 t2) + ) -> + (pc3 (CTail c (Bind b) u1) t1 + (lift (1) (0) (TTail (Bind Abst) u2 t2)) + ) + . + Intros b; XElim b; Intros; + Try EqFalse; Pc3Confluence; Pr3Gen; Pr3Gen; + Try (Rewrite H1 in H0; Inversion H0); + Rewrite H1 in H4; Pr3Context; + EApply pc3_pr3_t; XEAuto. + Qed. + + Theorem pc3_gen_lift_abst : (c:?; t,t2,u2:?; h,d:?) + (pc3 c (lift h d t) + (TTail (Bind Abst) u2 t2) + ) -> + (e:?) (drop h d c e) -> + (EX u1 t1 | (pr3 e t (TTail (Bind Abst) u1 t1)) & + (pr3 c u2 (lift h d u1)) & + (b:B; u:T)(pr3 (CTail c (Bind b) u) t2 (lift h (S d) t1)) + ). + Intros. + Pc3Confluence; Pr3Gen; Pr3Gen; Rewrite H1 in H; Clear H1 x. + LiftGenBase; Rewrite H in H4; Rewrite H1 in H2; Rewrite H5 in H3; XEAuto. + Qed. + + End pc3_gen. + + Tactic Definition Pc3Gen := + Match Context With + | [ _: (pc3 ?1 (lift ?2 ?3 ?4) (lift ?2 ?3 ?5)); + _: (drop ?2 ?3 ?1 ?6) |- ? ] -> + LApply (pc3_gen_lift ?1 ?4 ?5 ?2 ?3); [ Intros H_x | XAuto ]; + LApply (H_x ?6); [ Clear H_x; Intros | XAuto ] + | [ H: (pc3 ?1 (TTail (Bind Abst) ?2 ?3) (TTail (Bind Abst) ?4 ?5)) |- ? ] -> + LApply (pc3_gen_abst ?1 ?2 ?4 ?3 ?5);[ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (pc3 ?1 (TTail (Bind ?2) ?3 ?4) (TTail (Bind Abst) ?5 ?6)); + _: ~ ?2 = Abst |- ? ] -> + LApply (pc3_gen_not_abst ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?1 ?4 ?6 ?3 ?5); [ Clear H H_x; Intros | XAuto ] + | [ _: (pc3 ?1 (lift ?2 ?3 ?4) (TTail (Bind Abst) ?5 ?6)); + _: (drop ?2 ?3 ?1 ?7) |- ? ] -> + LApply (pc3_gen_lift_abst ?1 ?4 ?6 ?5 ?2 ?3); [ Intros H_x | XAuto ]; + LApply (H_x ?7); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pc3_gen_context.v b/helm/coq-contribs/LAMBDA-TYPES/pc3_gen_context.v new file mode 100644 index 000000000..4e26ce7ea --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pc3_gen_context.v @@ -0,0 +1,22 @@ +(*#* #stop file *) + +Require subst1_confluence. +Require csubst1_defs. +Require pr3_gen_context. +Require pc3_defs. +Require pc3_props. + + Section pc3_gen_context. (************************************************) + + Theorem pc3_gen_cabbr: (c:?; t1,t2:?) (pc3 c t1 t2) -> (e:?; u:?; d:?) + (drop d (0) c (CTail e (Bind Abbr) u)) -> + (a0:?) (csubst1 d u c a0) -> + (a:?) (drop (1) d a0 a) -> + (x1:?) (subst1 d u t1 (lift (1) d x1)) -> + (x2:?) (subst1 d u t2 (lift (1) d x2)) -> + (pc3 a x1 x2). + Intros; Pc3Confluence; Repeat Pr3GenContext. + Subst1Confluence; Rewrite H in H3; Clear H x3; XEAuto. + Qed. + + End pc3_gen_context. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pc3_props.v b/helm/coq-contribs/LAMBDA-TYPES/pc3_props.v new file mode 100644 index 000000000..49d9bc4ec --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pc3_props.v @@ -0,0 +1,163 @@ +(*#* #stop file *) + +Require subst0_subst0. +Require pr0_subst0. +Require pr3_defs. +Require pr3_props. +Require pr3_confluence. +Require cpr0_defs. +Require cpr0_props. +Require pc3_defs. + + Section pc3_confluence. (*************************************************) + + Theorem pc3_confluence : (c:?; t1,t2:?) (pc3 c t1 t2) -> + (EX t0 | (pr3 c t1 t0) & (pr3 c t2 t0)). + Intros; XElim H; Intros. +(* case 1 : pc3_r *) + XEAuto. +(* case 2 : pc3_u *) + Clear H0; XElim H1; Intros. + Inversion_clear H; [ XEAuto | Pr3Confluence; XEAuto ]. + Qed. + + End pc3_confluence. + + Tactic Definition Pc3Confluence := + Match Context With + [ H: (pc3 ?1 ?2 ?3) |- ? ] -> + LApply (pc3_confluence ?1 ?2 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + + Section pc3_context. (****************************************************) + + Theorem pc3_pr0_pr2_t : (u1,u2:?) (pr0 u2 u1) -> + (c:?; t1,t2:?; k:?) (pr2 (CTail c k u2) t1 t2) -> + (pc3 (CTail c k u1) t1 t2). + Intros. + Inversion H0; Clear H0; [ XAuto | NewInduction i ]. +(* case 1 : pr2_delta i = 0 *) + DropGenBase; Inversion H0; Clear H0 H3 H4 c k. + Rewrite H5 in H; Clear H5 u2. + Pr0Subst0; XEAuto. +(* case 2 : pr2_delta i > 0 *) + NewInduction k; DropGenBase; XEAuto. + Qed. + + Theorem pc3_pr2_pr2_t : (c:?; u1,u2:?) (pr2 c u2 u1) -> + (t1,t2:?; k:?) (pr2 (CTail c k u2) t1 t2) -> + (pc3 (CTail c k u1) t1 t2). + Intros until 1; Inversion H; Clear H; Intros. +(* case 1 : pr2_pr0 *) + EApply pc3_pr0_pr2_t; [ Apply H0 | XAuto ]. +(* case 2 : pr2_delta *) + Inversion H; [ XAuto | NewInduction i0 ]. +(* case 2.1 : i0 = 0 *) + DropGenBase; Inversion H2; Clear H2. + Rewrite <- H5; Rewrite H6 in H; Rewrite <- H7 in H3; Clear H5 H6 H7 d0 k u0. + Subst0Subst0; Arith9'In H4 i. + EApply pc3_pr3_u. + EApply pr2_delta; XEAuto. + Apply pc3_pr2_x; EApply pr2_delta; [ Idtac | XEAuto ]; XEAuto. +(* case 2.2 : i0 > 0 *) + Clear IHi0; NewInduction k; DropGenBase; XEAuto. + Qed. + + Theorem pc3_pr2_pr3_t : (c:?; u2,t1,t2:?; k:?) + (pr3 (CTail c k u2) t1 t2) -> + (u1:?) (pr2 c u2 u1) -> + (pc3 (CTail c k u1) t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + EApply pc3_t. + EApply pc3_pr2_pr2_t; [ Apply H2 | Apply H ]. + XAuto. + Qed. + + Theorem pc3_pr3_pc3_t : (c:?; u1,u2:?) (pr3 c u2 u1) -> + (t1,t2:?; k:?) (pc3 (CTail c k u2) t1 t2) -> + (pc3 (CTail c k u1) t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + Apply H1; Pc3Confluence. + EApply pc3_t; [ Idtac | Apply pc3_s ]; EApply pc3_pr2_pr3_t; XEAuto. + Qed. + + End pc3_context. + + Tactic Definition Pc3Context := + Match Context With + | [ H1: (pr0 ?3 ?2); H2: (pr2 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pc3_pr0_pr2_t ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?1 ?5 ?6 ?4); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr0 ?3 ?2); H2: (pr3 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pc3_pr2_pr3_t ?1 ?3 ?5 ?6 ?4); [ Clear H2; Intros H2 | XAuto ]; + LApply (H2 ?2); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr2 ?1 ?3 ?2); H2: (pr2 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pc3_pr2_pr2_t ?1 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?5 ?6 ?4); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr2 ?1 ?3 ?2); H2: (pr3 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pc3_pr2_pr3_t ?1 ?3 ?5 ?6 ?4); [ Clear H2; Intros H2 | XAuto ]; + LApply (H2 ?2); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr3 ?1 ?3 ?2); H2: (pc3 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pc3_pr3_pc3_t ?1 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?5 ?6 ?4); [ Clear H1 H2; Intros | XAuto ] + | _ -> Pr3Context. + + Section pc3_lift. (*******************************************************) + + Theorem pc3_lift : (c,e:?; h,d:?) (drop h d c e) -> + (t1,t2:?) (pc3 e t1 t2) -> + (pc3 c (lift h d t1) (lift h d t2)). + + Intros. + Pc3Confluence. + EApply pc3_pr3_t; (EApply pr3_lift; [ XEAuto | Apply H0 Orelse Apply H1 ]). + Qed. + + End pc3_lift. + + Hints Resolve pc3_lift : ltlc. + + Section pc3_cpr0. (*******************************************************) + + Remark pc3_cpr0_t_aux : (c1,c2:?) (cpr0 c1 c2) -> + (k:?; u,t1,t2:?) (pr3 (CTail c1 k u) t1 t2) -> + (pc3 (CTail c2 k u) t1 t2). + Intros; XElim H0; Intros. +(* case 1.1 : pr3_r *) + XAuto. +(* case 1.2 : pr3_u *) + EApply pc3_t; [ Idtac | XEAuto ]. Clear H2 t1 t2. + Inversion_clear H0. +(* case 1.2.1 : pr2_pr0 *) + XAuto. +(* case 1.2.2 : pr2_delta *) + Cpr0Drop; Pr0Subst0. + EApply pc3_pr3_u; [ EApply pr2_delta; XEAuto | XAuto ]. + Qed. + + Theorem pc3_cpr0_t : (c1,c2:?) (cpr0 c1 c2) -> + (t1,t2:?) (pr3 c1 t1 t2) -> + (pc3 c2 t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : cpr0_refl *) + XAuto. +(* case 2 : cpr0_cont *) + Pc3Context; Pc3Confluence. + EApply pc3_t; [ Idtac | Apply pc3_s ]; EApply pc3_cpr0_t_aux; XEAuto. + Qed. + + Theorem pc3_cpr0 : (c1,c2:?) (cpr0 c1 c2) -> (t1,t2:?) (pc3 c1 t1 t2) -> + (pc3 c2 t1 t2). + Intros; Pc3Confluence. + EApply pc3_t; [ Idtac | Apply pc3_s ]; EApply pc3_cpr0_t; XEAuto. + Qed. + + End pc3_cpr0. + + Hints Resolve pc3_cpr0 : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pc3_subst0.v b/helm/coq-contribs/LAMBDA-TYPES/pc3_subst0.v new file mode 100644 index 000000000..52505544b --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pc3_subst0.v @@ -0,0 +1,141 @@ +(*#* #stop file *) + +Require subst0_subst0. +Require csubst0_defs. +Require pr0_subst0. +Require pc3_defs. + + Section pc3_fsubst0. (****************************************************) + + Theorem pc3_pr2_fsubst0: (c1:?; t1,t:?) (pr2 c1 t1 t) -> + (i:?; u,c2,t2:?) (fsubst0 i u c1 t1 c2 t2) -> + (e:?) (drop i (0) c1 (CTail e (Bind Abbr) u)) -> + (pc3 c2 t2 t). + Intros until 1; XElim H. +(* case 1: pr2_pr0 *) + Intros until 2; XElim H0; Intros. +(* case 1.1: fsubst0_t *) + Pr0Subst0; [ XAuto | Apply (pc3_pr3_u c1 x); XEAuto ]. +(* case 1.2: fsubst0_c *) + XAuto. +(* case 1.3: fsubst0_b *) + Pr0Subst0; CSubst0Drop; [ XAuto | Apply (pc3_pr3_u c0 x); XEAuto ]. +(* case 2 : pr2_delta *) + Intros until 3; XElim H1; Intros. +(* case 2.1: fsubst0_t. *) + Apply (pc3_t t1); [ Apply pc3_s; XEAuto | XEAuto ]. +(* case 2.2: fsubst0_c. *) + Apply (lt_le_e i i0); Intros; CSubst0Drop. +(* case 2.2.1: i < i0, none *) + XEAuto. +(* case 2.2.2: i < i0, csubst0_fst *) + Inversion H; Rewrite <- H7 in H4; Rewrite <- H8 in H4; Rewrite <- H8 in H5; Rewrite <- H9 in H5; Clear H H7 H8 H9 c2 t2 x0 x1 x2. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H6; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u c0 x); XEAuto. +(* case 2.2.3: i < i0, csubst0_snd *) + Inversion H; Rewrite <- H7 in H5; Rewrite <- H8 in H4; Rewrite <- H8 in H5; Rewrite <- H9 in H4; Clear H H7 H8 H9 c2 t2 x0 x1 x3. + Apply pc3_pr2_r; XEAuto. +(* case 2.2.4: i < i0, csubst0_both *) + Inversion H; Rewrite <- H8 in H6; Rewrite <- H9 in H4; Rewrite <- H9 in H5; Rewrite <- H9 in H6; Rewrite <- H10 in H5; Clear H H8 H9 H10 c2 t2 x0 x1 x3. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H7; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u c0 x); XEAuto. +(* case 2.2.5: i >= i0 *) + XEAuto. +(* case 2.3: fsubst0_b *) + Apply (lt_le_e i i0); Intros; CSubst0Drop. +(* case 2.3.1 : i < i0, none *) + CSubst0Drop; Apply pc3_pr3_u2 with t0 := t1; XEAuto. +(* case 2.3.2 : i < i0, csubst0_fst *) + Inversion H; Rewrite <- H8 in H5; Rewrite <- H9 in H5; Rewrite <- H9 in H6; Rewrite <- H10 in H6; Clear H H8 H9 H10 c2 t2 x0 x1 x2. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H7; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u2 c0 t1); [ Idtac | Apply (pc3_pr3_u c0 x) ]; XEAuto. +(* case 2.3.3: i < i0, csubst0_snd *) + Inversion H; Rewrite <- H8 in H6; Rewrite <- H9 in H5; Rewrite <- H9 in H6; Rewrite <- H10 in H5; Clear H H8 H9 H10 c2 t2 x0 x1 x3. + CSubst0Drop; Apply (pc3_pr3_u2 c0 t1); [ Idtac | Apply pc3_pr2_r ]; XEAuto. +(* case 2.3.4: i < i0, csubst0_both *) + Inversion H; Rewrite <- H9 in H7; Rewrite <- H10 in H5; Rewrite <- H10 in H6; Rewrite <- H10 in H7; Rewrite <- H11 in H6; Clear H H9 H10 H11 c2 t2 x0 x1 x3. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H8; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u2 c0 t1); [ Idtac | Apply (pc3_pr3_u c0 x) ]; XEAuto. +(* case 2.3.5: i >= i0 *) + CSubst0Drop; Apply (pc3_pr3_u2 c0 t1); XEAuto. + Qed. + + Theorem pc3_pr2_fsubst0_back: (c1:?; t,t1:?) (pr2 c1 t t1) -> + (i:?; u,c2,t2:?) (fsubst0 i u c1 t1 c2 t2) -> + (e:?) (drop i (0) c1 (CTail e (Bind Abbr) u)) -> + (pc3 c2 t t2). + Intros until 1; XElim H. +(* case 1: pr2_pr0 *) + Intros until 2; XElim H0; Intros. +(* case 1.1: fsubst0_t. *) + Apply (pc3_pr3_u c1 t1); XEAuto. +(* case 1.2: fsubst0_c. *) + XAuto. +(* case 1.3: fsubst0_c. *) + CSubst0Drop; Apply (pc3_pr3_u c0 t1); XEAuto. +(* case 2: pr2_delta *) + Intros until 3; XElim H1; Intros. +(* case 2.1: fsubst0_t. *) + Apply (pc3_t t1); XEAuto. +(* case 2.2: fsubst0_c. *) + Apply (lt_le_e i i0); Intros; CSubst0Drop. +(* case 2.2.1: i < i0, none *) + XEAuto. +(* case 2.2.2: i < i0, csubst0_bind *) + Inversion H; Rewrite <- H7 in H4; Rewrite <- H8 in H4; Rewrite <- H8 in H5; Rewrite <- H9 in H5; Clear H H7 H8 H9 c2 t2 x0 x1 x2. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H6; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u c0 x); XEAuto. +(* case 2.2.3: i < i0, csubst0_snd *) + Inversion H; Rewrite <- H7 in H5; Rewrite <- H8 in H4; Rewrite <- H8 in H5; Rewrite <- H9 in H4; Clear H H7 H8 H9 c2 t2 x0 x1 x3. + Apply pc3_pr2_r; XEAuto. +(* case 2.2.4: i < i0, csubst0_both *) + Inversion H; Rewrite <- H8 in H6; Rewrite <- H9 in H4; Rewrite <- H9 in H5; Rewrite <- H9 in H6; Rewrite <- H10 in H5; Clear H H8 H9 H10 c2 t2 x0 x1 x3. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H7; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u c0 x); XEAuto. +(* case 2.2.5: i >= i0 *) + XEAuto. +(* case 2.3: fsubst0_b *) + Apply (lt_le_e i i0); Intros; CSubst0Drop. +(* case 2.3.1 : i < i0, none *) + CSubst0Drop; Apply pc3_pr3_u with t2 := t1; XEAuto. +(* case 2.3.2 : i < i0, csubst0_fst *) + Inversion H; Rewrite <- H8 in H5; Rewrite <- H9 in H5; Rewrite <- H9 in H6; Rewrite <- H10 in H6; Clear H H8 H9 H10 c2 t2 x0 x1 x2. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H7; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u c0 x); [ Idtac | Apply (pc3_pr3_u2 c0 t1) ]; XEAuto. +(* case 2.3.3: i < i0, csubst0_snd *) + Inversion H; Rewrite <- H8 in H6; Rewrite <- H9 in H5; Rewrite <- H9 in H6; Rewrite <- H10 in H5; Clear H H8 H9 H10 c2 t2 x0 x1 x3. + CSubst0Drop; Apply (pc3_pr3_u c0 t1); [ Idtac | Apply pc3_pr2_r ]; XEAuto. +(* case 2.3.4: i < i0, csubst0_both *) + Inversion H; Rewrite <- H9 in H7; Rewrite <- H10 in H5; Rewrite <- H10 in H6; Rewrite <- H10 in H7; Rewrite <- H11 in H6; Clear H H9 H10 H11 c2 t2 x0 x1 x3. + Subst0Subst0; Rewrite <- lt_plus_minus_r in H8; [ CSubst0Drop | XAuto ]. + Apply (pc3_pr3_u c0 x); [ Idtac | Apply (pc3_pr3_u2 c0 t1) ]; XEAuto. +(* case 2.3.5: i >= i0 *) + CSubst0Drop; Apply (pc3_pr3_u c0 t1); XEAuto. + Qed. + + Theorem pc3_pc2_fsubst0: (c1:?; t1,t:?) (pc2 c1 t1 t) -> + (i:?; u,c2,t2:?) (fsubst0 i u c1 t1 c2 t2) -> + (e:?) (drop i (0) c1 (CTail e (Bind Abbr) u)) -> + (pc3 c2 t2 t). + Intros until 1; XElim H; Intros. +(* case 1: pc2_r *) + EApply pc3_pr2_fsubst0; XEAuto. +(* case 2: pc2_x *) + Apply pc3_s; EApply pc3_pr2_fsubst0_back; XEAuto. + Qed. + + Theorem pc3_fsubst0: (c1:?; t1,t:?) (pc3 c1 t1 t) -> + (i:?; u,c2,t2:?) (fsubst0 i u c1 t1 c2 t2) -> + (e:?) (drop i (0) c1 (CTail e (Bind Abbr) u)) -> + (pc3 c2 t2 t). + Intros until 1; XElim H. +(* case 1: pc3_r *) + Intros until 1; XElim H; Intros; Try CSubst0Drop; XEAuto. +(* case 2: pc3_u *) + Intros until 4; XElim H2; Intros; + (Apply (pc3_t t2); [ EApply pc3_pc2_fsubst0; XEAuto | XEAuto ]). + Qed. + + End pc3_fsubst0. + + Hints Resolve pc3_fsubst0. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr0_confluence.v b/helm/coq-contribs/LAMBDA-TYPES/pr0_confluence.v new file mode 100644 index 000000000..b107ac2a9 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr0_confluence.v @@ -0,0 +1,176 @@ +(*#* #stop file *) + +Require tlt_defs. +Require lift_gen. +Require lift_tlt. +Require subst0_gen. +Require subst0_confluence. +Require pr0_defs. +Require pr0_lift. +Require pr0_gen. +Require pr0_subst0. + + Section pr0_confluence. (*************************************************) + + Tactic Definition SSubstInv := + Match Context With + | [ H0: (TTail ? ? ?) = (TTail ? ? ?) |- ? ] -> + Inversion H0; Clear H0 + | [ H0: (pr0 (TTail (Bind ?) ? ?) ?) |- ? ] -> + Inversion H0; Clear H0 + | _ -> EqFalse Orelse LiftGen Orelse Pr0Gen. + + Tactic Definition SSubstBack := + Match Context With + | [ H0: Abst = ?1; H1:? |- ? ] -> + Rewrite <- H0 in H1 Orelse Rewrite <- H0 Orelse Clear H0 ?1 + | [ H0: Abbr = ?1; H1:? |- ? ] -> + Rewrite <- H0 in H1 Orelse Rewrite <- H0 Orelse Clear H0 ?1 + | [ H0: (? ?) = ?1; H1:? |- ? ] -> + Rewrite <- H0 in H1 Orelse Rewrite <- H0 Orelse Clear H0 ?1 + | [ H0: (? ? ? ?) = ?1; H1:? |- ? ] -> + Rewrite <- H0 in H1 Orelse Rewrite <- H0 Orelse Clear H0 ?1. + + Tactic Definition SSubst := + Match Context With + [ H0: ?1 = ?; H1:? |- ? ] -> + Rewrite H0 in H1 Orelse Rewrite H0 Orelse Clear H0 ?1. + + Tactic Definition XSubst := + Repeat (SSubstInv Orelse SSubstBack Orelse SSubst). + + Tactic Definition IH := + Match Context With + | [ H0: (pr0 ?1 ?2); H1: (pr0 ?1 ?3) |- ? ] -> + LApply (H ?1); [ Intros H_x | XEAuto ]; + LApply (H_x ?2); [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x ?3); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Clear H0 H1; Intros. + +(* case pr0_cong pr0_gamma pr0_refl *****************************************) + + Remark pr0_cong_gamma_refl: (b:?) ~ b = Abst -> + (u0,u3:?) (pr0 u0 u3) -> + (t4,t5:?) (pr0 t4 t5) -> + (u2,v2,x:?) (pr0 u2 x) -> (pr0 v2 x) -> + (EX t:T | (pr0 (TTail (Flat Appl) u2 (TTail (Bind b) u0 t4)) t) & + (pr0 (TTail (Bind b) u3 (TTail (Flat Appl) (lift (1) (0) v2) t5)) t)). + Intros. + Apply ex2_intro with x:=(TTail (Bind b) u3 (TTail (Flat Appl) (lift (1) (0) x) t5)); XAuto. + Qed. + +(* case pr0_cong pr0_gamma pr0_cong *****************************************) + + Remark pr0_cong_gamma_cong: (b:?) ~ b = Abst -> + (u2,v2,x:?) (pr0 u2 x) -> (pr0 v2 x) -> + (t2,t5,x0:?) (pr0 t2 x0) -> (pr0 t5 x0) -> + (u5,u3,x1:?) (pr0 u5 x1) -> (pr0 u3 x1) -> + (EX t:T | (pr0 (TTail (Flat Appl) u2 (TTail (Bind b) u5 t2)) t) & + (pr0 (TTail (Bind b) u3 (TTail (Flat Appl) (lift (1) (0) v2) t5)) t)). + Intros. + Apply ex2_intro with x:=(TTail (Bind b) x1 (TTail (Flat Appl) (lift (1) (0) x) x0)); XAuto. + Qed. + +(* case pr0_cong pr0_gamma pr0_delta *****************************************) + + Remark pr0_cong_gamma_delta: ~ Abbr = Abst -> + (u5,t2,w:?) (subst0 (0) u5 t2 w) -> + (u2,v2,x:?) (pr0 u2 x) -> (pr0 v2 x) -> + (t5,x0:?) (pr0 t2 x0) -> (pr0 t5 x0) -> + (u3,x1:?) (pr0 u5 x1) -> (pr0 u3 x1) -> + (EX t:T | (pr0 (TTail (Flat Appl) u2 (TTail (Bind Abbr) u5 w)) t) & + (pr0 (TTail (Bind Abbr) u3 (TTail (Flat Appl) (lift (1) (0) v2) t5)) t)). + Intros; Pr0Subst0. +(* case 1: x0 is a lift *) + Apply ex2_intro with x:=(TTail (Bind Abbr) x1 (TTail (Flat Appl) (lift (1) (0) x) x0)); XAuto. +(* case 2: x0 is not a lift *) + Apply ex2_intro with x:=(TTail (Bind Abbr) x1 (TTail (Flat Appl) (lift (1) (0) x) x2)); XEAuto. + Qed. + +(* case pr0_cong pr0_gamma pr0_zeta *****************************************) + + Remark pr0_cong_gamma_zeta: (b:?) ~ b = Abst -> + (u0,u3:?) (pr0 u0 u3) -> + (u2,v2,x0:?) (pr0 u2 x0) -> (pr0 v2 x0) -> + (x,t3,x1:?) (pr0 x x1) -> (pr0 t3 x1) -> + (EX t:T | (pr0 (TTail (Flat Appl) u2 t3) t) & + (pr0 (TTail (Bind b) u3 (TTail (Flat Appl) (lift (1) (0) v2) (lift (1) (0) x))) t)). + Intros; LiftTailRwBack; XEAuto. + Qed. + +(* case pr0_cong pr0_delta **************************************************) + + Remark pr0_cong_delta: (u3,t5,w:?) (subst0 (0) u3 t5 w) -> + (u2,x:?) (pr0 u2 x) -> (pr0 u3 x) -> + (t3,x0:?) (pr0 t3 x0) -> (pr0 t5 x0) -> + (EX t:T | (pr0 (TTail (Bind Abbr) u2 t3) t) & + (pr0 (TTail (Bind Abbr) u3 w) t)). + Intros; Pr0Subst0; XEAuto. + Qed. + +(* case pr0_gamma pr0_gamma *************************************************) + + Remark pr0_gamma_gamma: (b:?) ~ b = Abst -> + (v1,v2,x0:?) (pr0 v1 x0) -> (pr0 v2 x0) -> + (u1,u2,x1:?) (pr0 u1 x1) -> (pr0 u2 x1) -> + (t1,t2,x2:?) (pr0 t1 x2) -> (pr0 t2 x2) -> + (EX t:T | (pr0 (TTail (Bind b) u1 (TTail (Flat Appl) (lift (1) (0) v1) t1)) t) & + (pr0 (TTail (Bind b) u2 (TTail (Flat Appl) (lift (1) (0) v2) t2)) t)). + Intros. + Apply ex2_intro with x:=(TTail (Bind b) x1 (TTail (Flat Appl) (lift (1) (0) x0) x2)); XAuto. + Qed. + +(* case pr0_delta pr0_delta *************************************************) + + Remark pr0_delta_delta: (u2,t3,w:?) (subst0 (0) u2 t3 w) -> + (u3,t5,w0:?) (subst0 (0) u3 t5 w0) -> + (x:?) (pr0 u2 x) -> (pr0 u3 x) -> + (x0:?) (pr0 t3 x0) -> (pr0 t5 x0) -> + (EX t:T | (pr0 (TTail (Bind Abbr) u2 w) t) & + (pr0 (TTail (Bind Abbr) u3 w0) t)). + Intros; Pr0Subst0; Pr0Subst0; Try Subst0Confluence; XSubst; XEAuto. + Qed. + +(* case pr0_delta pr0_epsilon ***********************************************) + + Remark pr0_delta_epsilon: (u2,t3,w:?) (subst0 (0) u2 t3 w) -> + (t4:?) (pr0 (lift (1) (0) t4) t3) -> + (t2:?) (EX t:T | (pr0 (TTail (Bind Abbr) u2 w) t) & (pr0 t2 t)). + Intros; Pr0Gen; XSubst; Subst0Gen. + Qed. + +(* main *********************************************************************) + + Hints Resolve pr0_cong_gamma_refl pr0_cong_gamma_cong : ltlc. + Hints Resolve pr0_cong_gamma_delta pr0_cong_gamma_zeta : ltlc. + Hints Resolve pr0_cong_delta : ltlc. + Hints Resolve pr0_gamma_gamma : ltlc. + Hints Resolve pr0_delta_delta pr0_delta_epsilon : ltlc. + +(*#* #start proof *) + +(*#* #caption "confluence with itself: Church-Rosser property" *) +(*#* #cap #cap t0, t1, t2, t *) + + Theorem pr0_confluence : (t0,t1:?) (pr0 t0 t1) -> (t2:?) (pr0 t0 t2) -> + (EX t | (pr0 t1 t) & (pr0 t2 t)). + +(*#* #stop file *) + + XElimUsing tlt_wf_ind t0; Intros. + Inversion H0; Inversion H1; Clear H0 H1; + XSubst; Repeat IH; XEAuto. + Qed. + + End pr0_confluence. + + Tactic Definition Pr0Confluence := + Match Context With + [ H1: (pr0 ?1 ?2); H2: (pr0 ?1 ?3) |-? ] -> + LApply (pr0_confluence ?1 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?3); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr0_defs.v b/helm/coq-contribs/LAMBDA-TYPES/pr0_defs.v new file mode 100644 index 000000000..3c7a96bbe --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr0_defs.v @@ -0,0 +1,91 @@ +(*#* #stop file *) + +Require Export subst0_defs. + + Inductive pr0 : T -> T -> Prop := +(* structural rules *) + | pr0_refl : (t:?) (pr0 t t) + | pr0_thin : (u1,u2:?) (pr0 u1 u2) -> (t1,t2:?) (pr0 t1 t2) -> + (k:?) (pr0 (TTail k u1 t1) (TTail k u2 t2)) +(* axiom rules *) + | pr0_beta : (k,v1,v2:?) (pr0 v1 v2) -> (t1,t2:?) (pr0 t1 t2) -> + (pr0 (TTail (Flat Appl) v1 (TTail (Bind Abst) k t1)) + (TTail (Bind Abbr) v2 t2)) + | pr0_gamma : (b:?) ~b=Abst -> (v1,v2:?) (pr0 v1 v2) -> + (u1,u2:?) (pr0 u1 u2) -> (t1,t2:?) (pr0 t1 t2) -> + (pr0 (TTail (Flat Appl) v1 (TTail (Bind b) u1 t1)) + (TTail (Bind b) u2 (TTail (Flat Appl) (lift (1) (0) v2) t2))) + | pr0_delta : (u1,u2:?) (pr0 u1 u2) -> (t1,t2:?) (pr0 t1 t2) -> + (w:?) (subst0 (0) u2 t2 w) -> + (pr0 (TTail (Bind Abbr) u1 t1) (TTail (Bind Abbr) u2 w)) + | pr0_zeta : (b:?) ~b=Abst -> (t1,t2:?) (pr0 t1 t2) -> + (u:?) (pr0 (TTail (Bind b) u (lift (1) (0) t1)) t2) + | pr0_eps : (t1,t2:?) (pr0 t1 t2) -> + (u:?) (pr0 (TTail (Flat Cast) u t1) t2). + + Hint pr0 : ltlc := Constructors pr0. + + Section pr0_gen. (********************************************************) + + Theorem pr0_gen_sort : (x:?; n:?) (pr0 (TSort n) x) -> x = (TSort n). + Intros; Inversion H; XAuto. + Qed. + + Theorem pr0_gen_bref : (x:?; n:?) (pr0 (TBRef n) x) -> x = (TBRef n). + Intros; Inversion H; XAuto. + Qed. + + Theorem pr0_gen_abst : (u1,t1,x:?) (pr0 (TTail (Bind Abst) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Abst) u2 t2) & + (pr0 u1 u2) & (pr0 t1 t2) + ). + + Intros; Inversion H; Clear H. +(* case 1 : pr0_refl *) + XEAuto. +(* case 2 : pr0_cont *) + XEAuto. +(* case 3 : pr0_zeta *) + XElim H4; XAuto. + Qed. + + Theorem pr0_gen_appl : (u1,t1,x:?) (pr0 (TTail (Flat Appl) u1 t1) x) -> (OR + (EX u2 t2 | x = (TTail (Flat Appl) u2 t2) & + (pr0 u1 u2) & (pr0 t1 t2) + ) | + (EX y1 z1 u2 t2 | t1 = (TTail (Bind Abst) y1 z1) & + x = (TTail (Bind Abbr) u2 t2) & + (pr0 u1 u2) & (pr0 z1 t2) + ) | + (EX b y1 z1 u2 v2 t2 | + ~b=Abst & + t1 = (TTail (Bind b) y1 z1) & + x = (TTail (Bind b) v2 (TTail (Flat Appl) (lift (1) (0) u2) t2)) & + (pr0 u1 u2) & (pr0 y1 v2) & (pr0 z1 t2)) + ). + Intros; Inversion H; XEAuto. + Qed. + + Theorem pr0_gen_cast : (u1,t1,x:?) (pr0 (TTail (Flat Cast) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Flat Cast) u2 t2) & + (pr0 u1 u2) & (pr0 t1 t2) + ) \/ + (pr0 t1 x). + Intros; Inversion H; XEAuto. + Qed. + + End pr0_gen. + + Hints Resolve pr0_gen_sort pr0_gen_bref : ltlc. + + Tactic Definition Pr0GenBase := + Match Context With + | [ H: (pr0 (TTail (Bind Abst) ?1 ?2) ?3) |- ? ] -> + LApply (pr0_gen_abst ?1 ?2 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (pr0 (TTail (Flat Appl) ?1 ?2) ?3) |- ? ] -> + LApply (pr0_gen_appl ?1 ?2 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; Intros H; XElim H; Intros + | [ H: (pr0 (TTail (Flat Cast) ?1 ?2) ?3) |- ? ] -> + LApply (pr0_gen_cast ?1 ?2 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; [ Intros H; XElim H; Intros | Intros ]. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr0_gen.v b/helm/coq-contribs/LAMBDA-TYPES/pr0_gen.v new file mode 100644 index 000000000..0b634e59c --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr0_gen.v @@ -0,0 +1,104 @@ +(*#* #stop file *) + +Require lift_gen. +Require lift_props. +Require subst0_gen. +Require pr0_defs. +Require pr0_lift. + + Section pr0_gen_abbr. (***************************************************) + + Theorem pr0_gen_abbr : (u1,t1,x:?) (pr0 (TTail (Bind Abbr) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Abbr) u2 t2) & + (pr0 u1 u2) & + (pr0 t1 t2) \/ + (EX y | (pr0 t1 y) & (subst0 (0) u2 y t2)) + ) \/ + (pr0 t1 (lift (1) (0) x)). + Intros. + Inversion H; Clear H; XDEAuto 6. + Qed. + + End pr0_gen_abbr. + + Section pr0_gen_void. (***************************************************) + + Theorem pr0_gen_void : (u1,t1,x:?) (pr0 (TTail (Bind Void) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Void) u2 t2) & + (pr0 u1 u2) & (pr0 t1 t2) + ) \/ + (pr0 t1 (lift (1) (0) x)). + Intros. + Inversion H; Clear H; XEAuto. + Qed. + + End pr0_gen_void. + + Section pr0_gen_lift. (***************************************************) + + Tactic Definition IH := + Match Context With + | [ H: (_:?; _:?) ?0 = (lift ? ? ?) -> ?; + H0: ?0 = (lift ? ?2 ?3) |- ? ] -> + LApply (H ?3 ?2); [ Clear H H0; Intros H_x | XAuto ]; + XElim H_x; Intro; Intros H_x; Intro; + Try Rewrite H_x; Try Rewrite H_x in H3; Clear H_x. + +(*#* #start file *) + +(*#* #caption "generation lemma for lift" *) +(*#* #cap #alpha t1 in U1, t2 in U2, x in T, d in i *) + + Theorem pr0_gen_lift : (t1,x:?; h,d:?) (pr0 (lift h d t1) x) -> + (EX t2 | x = (lift h d t2) & (pr0 t1 t2)). + +(*#* #stop file *) + + Intros until 1; InsertEq H '(lift h d t1); + UnIntro H d; UnIntro H t1; XElim H; Clear y x; Intros; + Rename x into t3; Rename x0 into d. +(* case 1 : pr0_r *) + XEAuto. +(* case 2 : pr0_c *) + NewInduction k; LiftGen; Rewrite H3; Clear H3 t0; + IH; IH; XEAuto. +(* case 3 : pr0_beta *) + LiftGen; Rewrite H3; Clear H3 t0. + LiftGen; Rewrite H3; Clear H3 H5 x1 k. + IH; IH; XEAuto. +(* case 4 : pr0_gamma *) + LiftGen; Rewrite H6; Clear H6 t0. + LiftGen; Rewrite H6; Clear H6 x1. + IH; IH; IH. + Rewrite <- lift_d; [ Simpl | XAuto ]. + Rewrite <- lift_flat; XEAuto. +(* case 5 : pr0_delta *) + LiftGen; Rewrite H4; Clear H4 t0. + IH; IH; Arith3In H3 d; Subst0Gen. + Rewrite H3; XEAuto. +(* case 6 : pr0_zeta *) + LiftGen; Rewrite H2; Clear H2 t0. + Arith7In H4 d; LiftGen; Rewrite H2; Clear H2 x1. + IH; XEAuto. +(* case 7 : pr0_zeta *) + LiftGen; Rewrite H1; Clear H1 t0. + IH; XEAuto. + Qed. + + End pr0_gen_lift. + + Tactic Definition Pr0Gen := + Match Context With + | [ H: (pr0 (TTail (Bind Abbr) ?1 ?2) ?3) |- ? ] -> + LApply (pr0_gen_abbr ?1 ?2 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; + [ Intros H; XElim H; Do 4 Intro; Intros H_x; + XElim H_x; [ Intros | Intros H_x; XElim H_x; Intros ] + | Intros ] + | [ H: (pr0 (TTail (Bind Void) ?1 ?2) ?3) |- ? ] -> + LApply (pr0_gen_void ?1 ?2 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; [ Intros H; XElim H; Intros | Intros ] + | [ H: (pr0 (lift ?0 ?1 ?2) ?3) |- ? ] -> + LApply (pr0_gen_lift ?2 ?3 ?0 ?1); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | _ -> Pr0GenBase. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr0_lift.v b/helm/coq-contribs/LAMBDA-TYPES/pr0_lift.v new file mode 100644 index 000000000..f3dc1c518 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr0_lift.v @@ -0,0 +1,39 @@ +Require lift_props. +Require subst0_lift. +Require pr0_defs. + +(*#* #caption "main properties of predicate \\texttt{pr0}" *) +(*#* #clauses pr0_props *) + + Section pr0_lift. (*******************************************************) + +(*#* #caption "conguence with lift" *) +(*#* #cap #cap t1,t2 #alpha d in i *) + + Theorem pr0_lift: (t1,t2:?) (pr0 t1 t2) -> + (h,d:?) (pr0 (lift h d t1) (lift h d t2)). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1: pr0_refl *) + XAuto. +(* case 2: pr0_cong *) + LiftTailRw; XAuto. +(* case 3 : pr0_beta *) + LiftTailRw; XAuto. +(* case 4: pr0_gamma *) + LiftTailRw; Simpl; Arith0 d; Rewrite lift_d; XAuto. +(* case 5: pr0_delta *) + LiftTailRw; Simpl. + EApply pr0_delta; [ XAuto | Apply H2 | Idtac ]. + LetTac d' := (S d); Arith10 d; Unfold d'; XAuto. +(* case 6: pr0_zeta *) + LiftTailRw; Simpl; Arith0 d; Rewrite lift_d; XAuto. +(* case 7: pr0_epsilon *) + LiftTailRw; XAuto. + Qed. + + End pr0_lift. + + Hints Resolve pr0_lift : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr0_subst0.v b/helm/coq-contribs/LAMBDA-TYPES/pr0_subst0.v new file mode 100644 index 000000000..ace613d6e --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr0_subst0.v @@ -0,0 +1,105 @@ +Require subst0_gen. +Require subst0_lift. +Require subst0_subst0. +Require subst0_confluence. +Require pr0_defs. +Require pr0_lift. + +(*#* #stop file *) + + Section pr0_subst0. (*****************************************************) + + Tactic Definition IH := + Match Context With + | [ H1: (u1:?) (pr0 u1 ?1) -> ?; H2: (pr0 ?2 ?1) |- ? ] -> + LApply (H1 ?2); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (u1:?) (pr0 ?1 u1) -> ?; H2: (pr0 ?1 ?2) |- ? ] -> + LApply (H1 ?2); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (v1,w1:?; i:?) (subst0 i v1 ?1 w1) -> (v2:T) (pr0 v1 v2) -> ?; + H2: (subst0 ?2 ?3 ?1 ?4); H3: (pr0 ?3 ?5) |- ? ] -> + LApply (H1 ?3 ?4 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?5); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; [ Intros | Intros H1; XElim H1; Intros ]. + + Theorem pr0_subst0_back: (u2,t1,t2:?; i:?) (subst0 i u2 t1 t2) -> + (u1:?) (pr0 u1 u2) -> + (EX t | (subst0 i u1 t1 t) & (pr0 t t2)). + Intros until 1; XElim H; Intros; + Repeat IH; XEAuto. + Qed. + + Theorem pr0_subst0_fwd: (u2,t1,t2:?; i:?) (subst0 i u2 t1 t2) -> + (u1:?) (pr0 u2 u1) -> + (EX t | (subst0 i u1 t1 t) & (pr0 t2 t)). + Intros until 1; XElim H; Intros; + Repeat IH; XEAuto. + Qed. + + Hints Resolve pr0_subst0_fwd : ltlc. + +(*#* #start file *) + +(*#* #caption "confluence with substitution" *) +(*#* #cap #cap t1,t2,v1,v2 #alpha w1 in U1, w2 in U2 *) + + Theorem pr0_subst0: (t1,t2:?) (pr0 t1 t2) -> + (v1,w1:?; i:?) (subst0 i v1 t1 w1) -> + (v2:?) (pr0 v1 v2) -> + (pr0 w1 t2) \/ + (EX w2 | (pr0 w1 w2) & (subst0 i v2 t2 w2)). + +(*#* #stop file *) + + Intros until 1; XElim H; Clear t1 t2; Intros. +(* case 1: pr0_refl *) + XEAuto. +(* case 2: pr0_cong *) + Subst0Gen; Rewrite H3; Repeat IH; XEAuto. +(* case 3: pr0_beta *) + Repeat Subst0Gen; Rewrite H3; Try Rewrite H5; Try Rewrite H6; + Repeat IH; XEAuto. +(* case 4: pr0_gamma *) + Repeat Subst0Gen; Rewrite H6; Try Rewrite H8; Try Rewrite H9; + Repeat IH; XDEAuto 7. +(* case 5: pr0_delta *) + Subst0Gen; Rewrite H4; Repeat IH; + [ XEAuto | Idtac | XEAuto | Idtac | XEAuto | Idtac | Idtac | Idtac ]. + Subst0Subst0; Arith9'In H9 i; XEAuto. + Subst0Confluence; XEAuto. + Subst0Subst0; Arith9'In H10 i; XEAuto. + Subst0Confluence; XEAuto. + Subst0Subst0; Arith9'In H11 i; Subst0Confluence; XDEAuto 6. +(* case 6: pr0_zeta *) + Repeat Subst0Gen; Rewrite H2; Try Rewrite H4; Try Rewrite H5; + Try (Simpl in H5; Rewrite <- minus_n_O in H5); + Try (Simpl in H6; Rewrite <- minus_n_O in H6); + Try IH; XEAuto. +(* case 7: pr0_epsilon *) + Subst0Gen; Rewrite H1; Try IH; XEAuto. + Qed. + + End pr0_subst0. + + Tactic Definition Pr0Subst0 := + Match Context With + | [ H1: (pr0 ?1 ?2); H2: (subst0 ?3 ?4 ?1 ?5); + H3: (pr0 ?4 ?6) |- ? ] -> + LApply (pr0_subst0 ?1 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4 ?5 ?3); [ Clear H1 H2; Intros H1 | XAuto ]; + LApply (H1 ?6); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; [ Intros | Intros H1; XElim H1; Intros ] + | [ H1: (pr0 ?1 ?2); H2: (subst0 ?3 ?4 ?1 ?5) |- ? ] -> + LApply (pr0_subst0 ?1 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4 ?5 ?3); [ Clear H1 H2; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; [ Intros | Intros H1; XElim H1; Intros ] + | [ H1: (subst0 ?0 ?1 ?2 ?3); H2: (pr0 ?4 ?1) |- ? ] -> + LApply (pr0_subst0_back ?1 ?2 ?3 ?0); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (subst0 ?0 ?1 ?2 ?3); H2: (pr0 ?1 ?4) |- ? ] -> + LApply (pr0_subst0_fwd ?1 ?2 ?3 ?0); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr0_subst1.v b/helm/coq-contribs/LAMBDA-TYPES/pr0_subst1.v new file mode 100644 index 000000000..fbf8e8b38 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr0_subst1.v @@ -0,0 +1,63 @@ +(*#* #stop file *) + +Require subst1_defs. +Require pr0_defs. +Require pr0_subst0. + + Section pr0_subst1_props. (***********************************************) + + Theorem pr0_delta1: (u1,u2:?) (pr0 u1 u2) -> (t1,t2:?) (pr0 t1 t2) -> + (w:?) (subst1 (0) u2 t2 w) -> + (pr0 (TTail (Bind Abbr) u1 t1) (TTail (Bind Abbr) u2 w)). + Intros until 3; XElim H1; Clear w; XEAuto. + Qed. + + Theorem pr0_subst1_back: (u2,t1,t2:?; i:?) (subst1 i u2 t1 t2) -> + (u1:?) (pr0 u1 u2) -> + (EX t | (subst1 i u1 t1 t) & (pr0 t t2)). + Intros until 1; XElim H; Intros; + Try Pr0Subst0; XEAuto. + Qed. + + Theorem pr0_subst1_fwd: (u2,t1,t2:?; i:?) (subst1 i u2 t1 t2) -> + (u1:?) (pr0 u2 u1) -> + (EX t | (subst1 i u1 t1 t) & (pr0 t2 t)). + Intros until 1; XElim H; Intros; + Try Pr0Subst0; XEAuto. + Qed. + + Theorem pr0_subst1: (t1,t2:?) (pr0 t1 t2) -> + (v1,w1:?; i:?) (subst1 i v1 t1 w1) -> + (v2:?) (pr0 v1 v2) -> + (EX w2 | (pr0 w1 w2) & (subst1 i v2 t2 w2)). + Intros until 2; XElim H0; Intros; + Try Pr0Subst0; XEAuto. + Qed. + + End pr0_subst1_props. + + Hints Resolve pr0_delta1 : ltlc. + + Tactic Definition Pr0Subst1 := + Match Context With + | [ H1: (pr0 ?1 ?2); H2: (subst1 ?3 ?4 ?1 ?5); + H3: (pr0 ?4 ?6) |- ? ] -> + LApply (pr0_subst1 ?1 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4 ?5 ?3); [ Clear H1 H2; Intros H1 | XAuto ]; + LApply (H1 ?6); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (pr0 ?1 ?2); H2: (subst1 ?3 ?4 ?1 ?5) |- ? ] -> + LApply (pr0_subst1 ?1 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4 ?5 ?3); [ Clear H1 H2; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (subst1 ?0 ?1 ?2 ?3); H2: (pr0 ?4 ?1) |- ? ] -> + LApply (pr0_subst1_back ?1 ?2 ?3 ?0); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (subst1 ?0 ?1 ?2 ?3); H2: (pr0 ?1 ?4) |- ? ] -> + LApply (pr0_subst1_fwd ?1 ?2 ?3 ?0); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | _ -> Pr0Subst0. + diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr1_confluence.v b/helm/coq-contribs/LAMBDA-TYPES/pr1_confluence.v new file mode 100644 index 000000000..222a08cea --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr1_confluence.v @@ -0,0 +1,64 @@ +Require pr0_confluence. +Require pr1_defs. + +(*#* #caption "main properties of predicate \\texttt{pr1}" *) +(*#* #clauses pr1_props *) + + Section pr1_confluence. (*************************************************) + +(*#* #caption "confluence with single step reduction: strip lemma" *) +(*#* #cap #cap t0, t1, t2, t *) + + Theorem pr1_strip : (t0,t1:?) (pr1 t0 t1) -> (t2:?) (pr0 t0 t2) -> + (EX t | (pr1 t1 t) & (pr1 t2 t)). + +(*#* #stop proof *) + + Intros until 1; XElim H; Intros. +(* case 1 : pr1_r *) + XEAuto. +(* case 2 : pr1_u *) + Pr0Confluence. + LApply (H1 x); [ Clear H1 H2; Intros H1 | XAuto ]. + XElim H1; Intros; XEAuto. + Qed. + +(*#* #start proof *) + +(*#* #caption "confluence with itself: Church-Rosser property" *) +(*#* #cap #cap t0, t1, t2, t *) + + Theorem pr1_confluence : (t0,t1:?) (pr1 t0 t1) -> (t2:?) (pr1 t0 t2) -> + (EX t | (pr1 t1 t) & (pr1 t2 t)). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1 : pr1_r *) + XEAuto. +(* case 2 : pr1_u *) + LApply (pr1_strip t3 t5); [ Clear H2; Intros H2 | XAuto ]. + LApply (H2 t2); [ Clear H H2; Intros H | XAuto ]. + XElim H; Intros. + LApply (H1 x); [ Clear H1 H2; Intros H1 | XAuto ]. + XElim H1; Intros; XEAuto. + Qed. + + End pr1_confluence. + + Tactic Definition Pr1Confluence := + Match Context With + | [ H1: (pr1 ?1 ?2); H2: (pr0 ?1 ?3) |-? ] -> + LApply (pr1_strip ?1 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?3); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (pr1 ?1 ?2); H2: (pr1 ?1 ?3) |-? ] -> + LApply (pr1_confluence ?1 ?2); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?3); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | _ -> Pr0Confluence. + +(*#* #start file *) + +(*#* #single *) + diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr1_defs.v b/helm/coq-contribs/LAMBDA-TYPES/pr1_defs.v new file mode 100644 index 000000000..986b59489 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr1_defs.v @@ -0,0 +1,24 @@ +(*#* #stop file *) + +Require Export pr0_defs. + + Inductive pr1 : T -> T -> Prop := + | pr1_r : (t:?) (pr1 t t) + | pr1_u : (t2,t1:?) (pr0 t1 t2) -> (t3:?) (pr1 t2 t3) -> (pr1 t1 t3). + + Hint pr1 : ltlc := Constructors pr1. + + Section pr1_props. (******************************************************) + + Theorem pr1_pr0 : (t1,t2:?) (pr0 t1 t2) -> (pr1 t1 t2). + XEAuto. + Qed. + + Theorem pr1_t : (t2,t1:?) (pr1 t1 t2) -> + (t3:?) (pr1 t2 t3) -> (pr1 t1 t3). + Intros t2 t1 H; XElim H; XEAuto. + Qed. + + End pr1_props. + + Hints Resolve pr1_pr0 pr1_t : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr2_confluence.v b/helm/coq-contribs/LAMBDA-TYPES/pr2_confluence.v new file mode 100644 index 000000000..afdab3d52 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr2_confluence.v @@ -0,0 +1,77 @@ +(*#* #stop file *) + +Require subst0_confluence. +Require drop_props. +Require pr0_subst0. +Require pr0_confluence. +Require pr2_defs. + + Section pr2_confluence. (*************************************************) + +(* case 1.1 : pr2_pr0 pr2_pr0 ***********************************************) + + Remark pr2_pr0_pr0: (c:?; t0,t1,t2:?) + (pr0 t0 t1) -> (pr0 t0 t2) -> + (EX t:T | (pr2 c t1 t) & (pr2 c t2 t)). + Intros; Pr0Confluence; XEAuto. + Qed. + +(* case 1.2 : pr2_pr0 pr2_delta *********************************************) + + Remark pr2_pr0_delta: (c,d:?; t0,t1,t2,u:?; i:?) + (pr0 t0 t1) -> + (drop i (0) c (CTail d (Bind Abbr) u)) -> + (subst0 i u t0 t2) -> + (EX t | (pr2 c t1 t) & (pr2 c t2 t)). + Intros; Pr0Subst0; XEAuto. + Qed. + +(* case 2.2 : pr2_delta pr2_delta *******************************************) + + Remark pr2_delta_delta: (c,d,d0:?; t0,t1,t2,u,u0:?; i,i0:?) + (drop i (0) c (CTail d (Bind Abbr) u)) -> + (subst0 i u t0 t1) -> + (drop i0 (0) c (CTail d0 (Bind Abbr) u0)) -> + (subst0 i0 u0 t0 t2) -> + (EX t:T | (pr2 c t1 t) & (pr2 c t2 t)). + Intros. + Apply (neq_eq_e i i0); Intros. +(* case 1 : i != i0 *) + Subst0Confluence; XEAuto. +(* case 2 : i = i0 *) + Rewrite H3 in H; Rewrite H3 in H0; Clear H3 i. + DropDis; Inversion H1; Rewrite H5 in H0; Clear H1 H4 H5 d u. + Subst0Confluence; [ Rewrite H1; XEAuto | XEAuto | XEAuto | XEAuto ]. + Qed. + +(* main *********************************************************************) + + Hints Resolve pr2_pr0_pr0 pr2_pr0_delta pr2_delta_delta : ltlc. + +(*#* #start file *) + +(*#* #caption "confluence with itself: Church-Rosser property" *) +(*#* #cap #cap c, t0, t1, t2, t *) + + Theorem pr2_confluence : (c,t0,t1:?) (pr2 c t0 t1) -> + (t2:?) (pr2 c t0 t2) -> + (EX t | (pr2 c t1 t) & (pr2 c t2 t)). + +(*#* #stop file *) + + Intros; Inversion H; Inversion H0; XEAuto. + Qed. + + End pr2_confluence. + + Tactic Definition Pr2Confluence := + Match Context With + | [ H1: (pr2 ?1 ?2 ?3); H2: (pr2 ?1 ?2 ?4) |-? ] -> + LApply (pr2_confluence ?1 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | _ -> Pr0Confluence. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr2_defs.v b/helm/coq-contribs/LAMBDA-TYPES/pr2_defs.v new file mode 100644 index 000000000..a650dd26f --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr2_defs.v @@ -0,0 +1,120 @@ +(*#* #stop file *) + +Require Export drop_defs. +Require Export pr0_defs. + + Inductive pr2 [c:C; t1,t2:T] : Prop := +(* structural rules *) + | pr2_pr0 : (pr0 t1 t2) -> (pr2 c t1 t2) +(* axiom rules *) + | pr2_delta : (d:?; u:?; i:?) + (drop i (0) c (CTail d (Bind Abbr) u)) -> + (subst0 i u t1 t2) -> (pr2 c t1 t2). + + Hint pr2 : ltlc := Constructors pr2. + + Section pr2_gen_base. (***************************************************) + + Theorem pr2_gen_sort : (c:?; x:?; n:?) (pr2 c (TSort n) x) -> + x = (TSort n). + Intros; Inversion H; + Try Subst0GenBase; XEAuto. + Qed. + + Theorem pr2_gen_bref : (c:?; x:?; n:?) (pr2 c (TBRef n) x) -> + x = (TBRef n) \/ + (EX d u | (drop n (0) c (CTail d (Bind Abbr) u)) & + x = (lift (S n) (0) u) + ). + Intros; Inversion H; + Try Subst0GenBase; Try Rewrite <- H1 in H0; XEAuto. + Qed. + + Theorem pr2_gen_abst : (c:?; u1,t1,x:?) + (pr2 c (TTail (Bind Abst) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Abst) u2 t2) & + (pr2 c u1 u2) & (b:?; u:?) + (pr2 (CTail c (Bind b) u) t1 t2) + ). + Intros; Inversion H; + Try Pr0GenBase; Try Subst0GenBase; XDEAuto 6. + Qed. + + Theorem pr2_gen_appl : (c:?; u1,t1,x:?) + (pr2 c (TTail (Flat Appl) u1 t1) x) -> (OR + (EX u2 t2 | x = (TTail (Flat Appl) u2 t2) & + (pr2 c u1 u2) & (pr2 c t1 t2) + ) | + (EX y1 z1 u2 t2 | t1 = (TTail (Bind Abst) y1 z1) & + x = (TTail (Bind Abbr) u2 t2) & + (pr0 u1 u2) & (pr0 z1 t2) + ) | + (EX b y1 z1 u2 v2 t2 | + ~b=Abst & + t1 = (TTail (Bind b) y1 z1) & + x = (TTail (Bind b) v2 (TTail (Flat Appl) (lift (1) (0) u2) t2)) & + (pr0 u1 u2) & (pr0 y1 v2) & (pr0 z1 t2)) + ). + Intros; Inversion H; + Try Pr0GenBase; Try Subst0GenBase; XEAuto. + Qed. + + Theorem pr2_gen_cast : (c:?; u1,t1,x:?) + (pr2 c (TTail (Flat Cast) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Flat Cast) u2 t2) & + (pr2 c u1 u2) & (pr2 c t1 t2) + ) \/ + (pr0 t1 x). + Intros; Inversion H; + Try Pr0GenBase; Try Subst0GenBase; XEAuto. + Qed. + + End pr2_gen_base. + + Tactic Definition Pr2GenBase := + Match Context With + | [ H: (pr2 ?1 (TTail (Bind Abst) ?2 ?3) ?4) |- ? ] -> + LApply (pr2_gen_abst ?1 ?2 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + + Section pr2_props. (******************************************************) + + Theorem pr2_thin_dx : (c:?; t1,t2:?) (pr2 c t1 t2) -> + (u:?; f:?) (pr2 c (TTail (Flat f) u t1) + (TTail (Flat f) u t2)). + Intros; Inversion H; XEAuto. + Qed. + + Theorem pr2_tail_1 : (c:?; u1,u2:?) (pr2 c u1 u2) -> + (k:?; t:?) (pr2 c (TTail k u1 t) (TTail k u2 t)). + Intros; Inversion H; XEAuto. + Qed. + + Theorem pr2_tail_2 : (c:?; u,t1,t2:?; k:?) (pr2 (CTail c k u) t1 t2) -> + (pr2 c (TTail k u t1) (TTail k u t2)). + XElim k; Intros; + (Inversion H; [ XAuto | Clear H ]; + (NewInduction i; DropGenBase; [ Inversion H; XEAuto | XEAuto ])). + Qed. + + Hints Resolve pr2_tail_2 : ltlc. + + Theorem pr2_shift : (i:?; c,e:?) (drop i (0) c e) -> + (t1,t2:?) (pr2 c t1 t2) -> + (pr2 e (app c i t1) (app c i t2)). + XElim i. +(* case 1 : i = 0 *) + Intros. + DropGenBase; Rewrite H in H0. + Repeat Rewrite app_O; XAuto. +(* case 2 : i > 0 *) + XElim c. +(* case 2.1 : CSort *) + Intros; DropGenBase; Rewrite H0; XAuto. +(* case 2.2 : CTail *) + XElim k; Intros; Simpl; DropGenBase; XAuto. + Qed. + + End pr2_props. + + Hints Resolve pr2_thin_dx pr2_tail_1 pr2_tail_2 pr2_shift : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr2_gen.v b/helm/coq-contribs/LAMBDA-TYPES/pr2_gen.v new file mode 100644 index 000000000..6fcb00c30 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr2_gen.v @@ -0,0 +1,81 @@ +(*#* #stop file *) + +Require subst0_gen. +Require drop_props. +Require pr0_gen. +Require pr2_defs. + + Section pr2_gen. (********************************************************) + + Theorem pr2_gen_abbr : (c:?; u1,t1,x:?) + (pr2 c (TTail (Bind Abbr) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Abbr) u2 t2) & + (pr2 c u1 u2) & + ((b:?; u:?) (pr2 (CTail c (Bind b) u) t1 t2)) \/ + (EX y | (pr0 t1 y) & (subst0 (0) u2 y t2)) + ) \/ + (pr0 t1 (lift (1) (0) x)). + Intros; Inversion H; + Try Pr0Gen; Try Subst0Gen; XDEAuto 8. + Qed. + + Theorem pr2_gen_void : (c:?; u1,t1,x:?) + (pr2 c (TTail (Bind Void) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Void) u2 t2) & + (pr2 c u1 u2) & (b:?; u:?) + (pr2 (CTail c (Bind b) u) t1 t2) + ) \/ + (pr0 t1 (lift (1) (0) x)). + Intros; Inversion H; + Try Pr0Gen; Try Subst0Gen; XDEAuto 7. + Qed. + +(*#* #start file *) + +(*#* #caption "generation lemma for lift" *) +(*#* #cap #cap c #alpha e in D, t1 in U1, t2 in U2, x in T, d in i *) + + Theorem pr2_gen_lift : (c:?; t1,x:?; h,d:?) (pr2 c (lift h d t1) x) -> + (e:?) (drop h d c e) -> + (EX t2 | x = (lift h d t2) & (pr2 e t1 t2)). + +(*#* #stop file *) + + Intros. + Inversion H; Clear H. +(* case 1 : pr2_pr0 *) + Pr0Gen; XEAuto. +(* case 2 : pr2_delta *) + Apply (lt_le_e i d); Intros. +(* case 2.1 : i < d *) + Rewrite (lt_plus_minus i d) in H0; [ Idtac | XAuto ]. + Rewrite (lt_plus_minus i d) in H2; [ Idtac | XAuto ]. + DropDis; Rewrite H0 in H2; Clear H0 u. + Subst0Gen; Rewrite <- lt_plus_minus in H0; XEAuto. +(* case 2.2 : i >= d *) + Apply (lt_le_e i (plus d h)); Intros. +(* case 2.2.1 : i < d + h *) + EApply subst0_gen_lift_false; [ Apply H | Apply H3 | XEAuto ]. +(* case 2.2.2 : i >= d + h *) + DropDis; Subst0Gen; XEAuto. + Qed. + + End pr2_gen. + + Tactic Definition Pr2Gen := + Match Context With + | [ H: (pr2 ?1 (TTail (Bind Abbr) ?2 ?3) ?4) |- ? ] -> + LApply (pr2_gen_abbr ?1 ?2 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; + [ Intros H; XElim H; Do 4 Intro; Intros H_x; XElim H_x; + [ Intros | Intros H_x; XElim H_x; Intros ] + | Intros ] + | [ H: (pr2 ?1 (TTail (Bind Void) ?2 ?3) ?4) |- ? ] -> + LApply (pr2_gen_void ?1 ?2 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; [ Intros H; XElim H; Intros | Intros ] + | [ H0: (pr2 ?1 (lift ?2 ?3 ?4) ?5); + H1: (drop ?2 ?3 ?1 ?6) |- ? ] -> + LApply (pr2_gen_lift ?1 ?4 ?5 ?2 ?3); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?6); [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros + | _ -> Pr2GenBase. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr2_gen_context.v b/helm/coq-contribs/LAMBDA-TYPES/pr2_gen_context.v new file mode 100644 index 000000000..b2cfaead1 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr2_gen_context.v @@ -0,0 +1,59 @@ +(*#* #stop file *) + +Require drop_props. +Require subst1_gen. +Require subst1_subst1. +Require subst1_confluence. +Require csubst1_defs. +Require pr0_gen. +Require pr0_subst1. +Require pr2_defs. +Require pr2_subst1. + + Section pr2_gen_context. (************************************************) + + Theorem pr2_gen_cabbr: (c:?; t1,t2:?) (pr2 c t1 t2) -> (e:?; u:?; d:?) + (drop d (0) c (CTail e (Bind Abbr) u)) -> + (a0:?) (csubst1 d u c a0) -> + (a:?) (drop (1) d a0 a) -> + (x1:?) (subst1 d u t1 (lift (1) d x1)) -> + (EX x2 | (subst1 d u t2 (lift (1) d x2)) & + (pr2 a x1 x2) + ). + Intros until 1; XElim H; Intros. +(* case 1: pr2_pr0 *) + Pr0Subst1; Pr0Gen; Rewrite H in H3; Clear H x; XEAuto. +(* case 2: pr2_delta *) + Apply (lt_eq_gt_e i d0); Intros. +(* case 2.1: i < d0 *) + Subst1Confluence; CSubst1Drop. + Rewrite minus_x_Sy in H; [ Idtac | XAuto ]. + CSubst1GenBase; Rewrite H in H6; Clear H x0. + Rewrite (lt_plus_minus i d0) in H3; [ Idtac | XAuto ]. + DropDis; Rewrite H in H7; Clear H x2. + Subst1Subst1; Pattern 2 d0 in H; Rewrite (lt_plus_minus i d0) in H; [ Idtac | XAuto ]. + Subst1Gen; Rewrite H in H9; Simpl in H9; Clear H x2. + Rewrite <- lt_plus_minus in H9; [ Idtac | XAuto ]. + Rewrite <- lt_plus_minus_r in H9; XEAuto. +(* case 2.2: i = d0 *) + Rewrite H5 in H; Rewrite H5 in H0; Clear H5 i. + DropDis; Inversion H; Rewrite <- H7 in H0; Rewrite <- H7 in H1; Rewrite <- H7; Clear H H6 H7 e u. + Subst1Confluence; Subst1Gen; Rewrite H0 in H; Clear H0 x; XEAuto. +(* case 2.3: i > d0 *) + Subst1Confluence; Subst1Gen; Rewrite H4 in H0; Clear H1 H4 x. + CSubst1Drop; DropDis; XEAuto. + Qed. + + End pr2_gen_context. + + Tactic Definition Pr2GenContext := + Match Context With + | [ H0: (pr2 ?1 ?2 ?3); H1: (drop ?4 (0) ?1 (CTail ?5 (Bind Abbr) ?6)); + H2: (csubst1 ?4 ?6 ?1 ?7); H3: (drop (1) ?4 ?7 ?8); + H4: (subst1 ?4 ?6 ?2 (lift (1) ?4 ?9)) |- ? ] -> + LApply (pr2_gen_cabbr ?1 ?2 ?3); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?5 ?6 ?4); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?7); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?8); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?9); [ Clear H0 H4; Intros H0 | XAuto ]; + XElim H0; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr2_lift.v b/helm/coq-contribs/LAMBDA-TYPES/pr2_lift.v new file mode 100644 index 000000000..9f828bfa8 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr2_lift.v @@ -0,0 +1,34 @@ +Require subst0_lift. +Require drop_props. +Require pr0_lift. +Require pr2_defs. + +(*#* #caption "main properties of predicate \\texttt{pr2}" *) +(*#* #clauses pr2_props *) + + Section pr2_lift. (*******************************************************) + +(*#* #caption "conguence with lift" *) +(*#* #cap #cap c, t1, t2 #alpha e in D, d in i *) + + Theorem pr2_lift : (c,e:?; h,d:?) (drop h d c e) -> + (t1,t2:?) (pr2 e t1 t2) -> + (pr2 c (lift h d t1) (lift h d t2)). + +(*#* #stop file *) + + Intros until 2; XElim H0; Intros. +(* case 1 : pr2_pr0 *) + XAuto. +(* case 2 : pr2_delta *) + Apply (lt_le_e i d); Intros; DropDis. +(* case 2.1 : i < d *) + Rewrite minus_x_Sy in H0; [ Idtac | XAuto ]. + DropGenBase; Rewrite H0 in H; Simpl in H; XEAuto. +(* case 2.2 : i >= d *) + XEAuto. + Qed. + + End pr2_lift. + + Hints Resolve pr2_lift : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr2_subst1.v b/helm/coq-contribs/LAMBDA-TYPES/pr2_subst1.v new file mode 100644 index 000000000..988237fc1 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr2_subst1.v @@ -0,0 +1,46 @@ +(*#* #stop file *) + +Require subst1_defs. +Require subst1_confluence. +Require drop_props. +Require pr0_subst1. +Require pr2_defs. + + Section pr2_subst1_props. (***********************************************) + + Theorem pr2_delta1: (c,d:?; u:?; i:?) (drop i (0) c (CTail d (Bind Abbr) u)) -> + (t1,t2:?) (subst1 i u t1 t2) -> (pr2 c t1 t2). + Intros; XElim H0; Clear t2; XEAuto. + Qed. + + Hints Resolve pr2_delta1 : ltlc. + + Theorem pr2_subst1: (c,e:?; v:?; i:?) (drop i (0) c (CTail e (Bind Abbr) v)) -> + (t1,t2:?) (pr2 c t1 t2) -> + (w1:?) (subst1 i v t1 w1) -> + (EX w2 | (pr2 c w1 w2) & (subst1 i v t2 w2)). + Intros until 2; XElim H0; Intros. +(* case 1: pr2_pr0 *) + Pr0Subst1; XEAuto. +(* case 2: pr2_delta *) + Apply (neq_eq_e i i0); Intros. +(* case 2.1: i <> i0 *) + Subst1Confluence; XEAuto. +(* case 2.2: i = i0 *) + Rewrite <- H3 in H0; Rewrite <- H3 in H1; Clear H3 i0. + DropDis; Inversion H0; Rewrite H5 in H2; Clear H0 H4 H5 e v. + Subst1Confluence; XEAuto. + Qed. + + End pr2_subst1_props. + + Hints Resolve pr2_delta1 : ltlc. + + Tactic Definition Pr2Subst1 := + Match Context With + | [ H0: (drop ?1 (0) ?2 (CTail ?3 (Bind Abbr) ?4)); + H1: (pr2 ?2 ?5 ?6); H3: (subst1 ?1 ?4 ?5 ?7) |- ? ] -> + LApply (pr2_subst1 ?2 ?3 ?4 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?5 ?6); [ Clear H_x H1; Intros H1 | XAuto ]; + LApply (H1 ?7); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr3_confluence.v b/helm/coq-contribs/LAMBDA-TYPES/pr3_confluence.v new file mode 100644 index 000000000..2267e88ae --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr3_confluence.v @@ -0,0 +1,60 @@ +Require pr2_confluence. +Require pr3_defs. + + Section pr3_confluence. (*************************************************) + +(*#* #caption "confluence with single step reduction: strip lemma" *) +(*#* #cap #cap c, t0, t1, t2, t *) + + Theorem pr3_strip : (c:?; t0,t1:?) (pr3 c t0 t1) -> (t2:?) (pr2 c t0 t2) -> + (EX t | (pr3 c t1 t) & (pr3 c t2 t)). + +(*#* #stop proof *) + + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XEAuto. +(* case 2 : pr3_u *) + Pr2Confluence. + LApply (H1 x); [ Clear H1 H2; Intros H1 | XAuto ]. + XElim H1; Intros; XEAuto. + Qed. + +(*#* #start proof *) + +(*#* #caption "confluence with itself: Church-Rosser property" *) +(*#* #cap #cap c, t0, t1, t2, t *) + + Theorem pr3_confluence : (c:?; t0,t1:?) (pr3 c t0 t1) -> (t2:?) (pr3 c t0 t2) -> + (EX t | (pr3 c t1 t) & (pr3 c t2 t)). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XEAuto. +(* case 2 : pr3_u *) + LApply (pr3_strip c t3 t5); [ Clear H2; Intros H2 | XAuto ]. + LApply (H2 t2); [ Clear H H2; Intros H | XAuto ]. + XElim H; Intros. + LApply (H1 x); [ Clear H1 H2; Intros H1 | XAuto ]. + XElim H1; Intros; XEAuto. + Qed. + + End pr3_confluence. + + Tactic Definition Pr3Confluence := + Match Context With + | [ H1: (pr3 ?1 ?2 ?3); H2: (pr2 ?1 ?2 ?4) |-? ] -> + LApply (pr3_strip ?1 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (pr3 ?1 ?2 ?3); H2: (pr3 ?1 ?2 ?4) |-? ] -> + LApply (pr3_confluence ?1 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?4); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros + | _ -> Pr2Confluence. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr3_defs.v b/helm/coq-contribs/LAMBDA-TYPES/pr3_defs.v new file mode 100644 index 000000000..1d67abfb1 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr3_defs.v @@ -0,0 +1,75 @@ +(*#* #stop file *) + +Require Export pr1_defs. +Require Export pr2_defs. + + Inductive pr3 [c:C] : T -> T -> Prop := + | pr3_r : (t:?) (pr3 c t t) + | pr3_u : (t2,t1:?) (pr2 c t1 t2) -> + (t3:?) (pr3 c t2 t3) -> (pr3 c t1 t3). + + Hint pr3: ltlc := Constructors pr3. + + Section pr3_props. (******************************************************) + + Theorem pr3_pr2 : (c,t1,t2:?) (pr2 c t1 t2) -> (pr3 c t1 t2). + XEAuto. + Qed. + + Theorem pr3_t : (t2,t1,c:?) (pr3 c t1 t2) -> + (t3:?) (pr3 c t2 t3) -> (pr3 c t1 t3). + Intros until 1; XElim H; XEAuto. + Qed. + + Theorem pr3_tail_1 : (c:?; u1,u2:?) (pr3 c u1 u2) -> + (k:?; t:?) (pr3 c (TTail k u1 t) (TTail k u2 t)). + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + EApply pr3_u; [ Apply pr2_tail_1; Apply H | XAuto ]. + Qed. + + Theorem pr3_tail_2 : (c:?; u,t1,t2:?; k:?) (pr3 (CTail c k u) t1 t2) -> + (pr3 c (TTail k u t1) (TTail k u t2)). + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + EApply pr3_u; [ Apply pr2_tail_2; Apply H | XAuto ]. + Qed. + + Hints Resolve pr3_tail_1 pr3_tail_2 : ltlc. + + Theorem pr3_tail_21 : (c:?; u1,u2:?) (pr3 c u1 u2) -> + (k:?; t1,t2:?) (pr3 (CTail c k u1) t1 t2) -> + (pr3 c (TTail k u1 t1) (TTail k u2 t2)). + Intros. + EApply pr3_t; [ Apply pr3_tail_2 | Apply pr3_tail_1 ]; XAuto. + Qed. + + Theorem pr3_tail_12 : (c:?; u1,u2:?) (pr3 c u1 u2) -> + (k:?; t1,t2:?) (pr3 (CTail c k u2) t1 t2) -> + (pr3 c (TTail k u1 t1) (TTail k u2 t2)). + Intros. + EApply pr3_t; [ Apply pr3_tail_1 | Apply pr3_tail_2 ]; XAuto. + Qed. + + Theorem pr3_shift : (h:?; c,e:?) (drop h (0) c e) -> + (t1,t2:?) (pr3 c t1 t2) -> + (pr3 e (app c h t1) (app c h t2)). + Intros until 2; XElim H0; Clear t1 t2; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + XEAuto. + Qed. + + Theorem pr3_pr1: (t1,t2:?) (pr1 t1 t2) -> (c:?) (pr3 c t1 t2). + Intros until 1; XElim H; XEAuto. + Qed. + + End pr3_props. + + Hints Resolve pr3_pr2 pr3_t pr3_pr1 + pr3_tail_12 pr3_tail_21 pr3_shift : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr3_gen.v b/helm/coq-contribs/LAMBDA-TYPES/pr3_gen.v new file mode 100644 index 000000000..855c4deab --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr3_gen.v @@ -0,0 +1,184 @@ +(*#* #stop file *) + +Require pr2_gen. +Require pr3_defs. +Require pr3_props. + + Section pr3_gen_void. (***************************************************) + + Tactic Definition IH := + Match Context With + [ H: (u,t:T) (TTail (Bind Void) ?1 ?2) = (TTail (Bind Void) u t) -> ? |- ? ] -> + LApply (H ?1 ?2); [ Clear H; Intros H | XAuto ]; + XElim H1; Intros H1; XElim H1; Intros. + + Theorem pr3_gen_void : (c:?; u1,t1,x:?) (pr3 c (TTail (Bind Void) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Void) u2 t2) & + (pr3 c u1 u2) & (b:?; u:?) + (pr3 (CTail c (Bind b) u) t1 t2) + ) \/ + (EX u | (pr3 c u1 u) & + (pr3 (CTail c (Bind Void) u) t1 (lift (1) (0) x)) + ). + Intros until 1; InsertEq H '(TTail (Bind Void) u1 t1); + UnIntro t1 H; UnIntro u1 H; XElim H; Intros. +(* case 1 : pr3_r *) + Rewrite H; XEAuto. +(* case 2 : pr3_u *) + Rewrite H2 in H; Clear H2 t0; Pr2Gen. +(* case 2.1 : short step: compatibility *) + Rewrite H in H0; Rewrite H in H1; Clear H t2; IH. +(* case 2.1.1 : long step: compatibility *) + Rewrite H; Rewrite H in H0; XEAuto. +(* case 2.1.2 : long step: zeta *) + XEAuto. +(* case 2.2 : short step: zeta *) + Clear H1; Right. + EApply ex2_intro; [ XAuto | Idtac ]. + EApply pr3_u; [ Idtac | EApply pr3_lift ]. + XEAuto. XAuto. XAuto. + Qed. + + End pr3_gen_void. + + Section pr3_gen_abbr. (***************************************************) + + Tactic Definition IH := + LApply (H1 x0 x1); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; + [ Intros H1; XElim H1; + Do 4 Intro; Intros H_x; XElim H_x; + [ Intros | Intros H_x; XElim H_x; Intros ] + | Intros H1; XElim H1; Intros ]. + + Theorem pr3_gen_abbr : (c:?; u1,t1,x:?) (pr3 c (TTail (Bind Abbr) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Abbr) u2 t2) & + (pr3 c u1 u2) & + ((b:?; u:?) (pr3 (CTail c (Bind b) u) t1 t2)) \/ + (EX u3 t3 y | (pr3 c (TTail (Bind Abbr) u3 t3) x) & + (pr3 c u1 u3) & + (b:?; u:?) (pr3 (CTail c (Bind b) u) t1 y) & + (subst0 (0) u3 y t3) + ) + ) \/ + (EX u | (pr3 c u1 u) & + (pr3 (CTail c (Bind Abbr) u) t1 (lift (1) (0) x)) + ). + Intros until 1; InsertEq H '(TTail (Bind Abbr) u1 t1); + UnIntro H t1; UnIntro H u1; XElim H; Clear y x; Intros; + Rename x into u1; Rename x0 into t4. +(* case 1 : pr3_r *) + Rewrite H; XEAuto. +(* case 2 : pr3_u *) + Rewrite H2 in H; Clear H2 t1; Pr2Gen. +(* case 2.1 : short step: compatibility *) + Rewrite H in H0; Rewrite H in H1; Clear H t2; IH. +(* case 2.1.1 : long step: compatibility *) + Rewrite H; Rewrite H in H0; Clear H t3. + Left; EApply ex3_2_intro; XEAuto. +(* case 2.1.2 : long step: delta *) + Rewrite H; Rewrite H in H0; Rewrite H in H4; Clear H t3. + Left; EApply ex3_2_intro; + [ XEAuto | XEAuto + | Right; EApply ex4_3_intro; + [ EApply pr3_t; [ XAuto | Apply H4 ] | XEAuto | Idtac | Apply H7 ] ]. + XEAuto. +(* case 2.1.3 : long step: zeta *) + XEAuto. +(* case 2.2 : short step: delta *) + Rewrite H in H0; Rewrite H in H1; Clear H t2; IH. +(* case 2.2.1 : long step: compatibility *) + Left; EApply ex3_2_intro; + [ XEAuto | XEAuto + | Right; EApply ex4_3_intro; [ Rewrite H | Idtac | Idtac | Apply H4 ] ]. + XAuto. XAuto. XAuto. +(* case 2.2.2 : long step: delta *) + Left; EApply ex3_2_intro; + [ XEAuto | XEAuto + | Right; EApply ex4_3_intro; + [ EApply pr3_t; [ Apply pr3_tail_12 | Apply H5 ] + | Idtac | Idtac | Apply H4 ] ]. + XAuto. EApply pr3_t; [ Apply H7 | XEAuto ]. XAuto. XAuto. +(* case 2.2.3 : long step: zeta *) + Right; Apply ex2_intro with x := x0; [ XAuto | Idtac ]. + Apply pr3_u with t2 := x; [ XAuto | Idtac ]. + Apply pr3_u with t2 := x1; [ XEAuto | Idtac ]. + Pr3Context; XAuto. +(* case 2.3 : short step: zeta *) + Clear H1; Right. + EApply ex2_intro; [ XAuto | Idtac ]. + EApply pr3_u; [ Idtac | EApply pr3_lift ]. + XEAuto. XAuto. XAuto. + Qed. + + End pr3_gen_abbr. + + Section pr3_gen_abst. (***************************************************) + + Theorem pr3_gen_abst : (c:?; u1,t1,x:?) + (pr3 c (TTail (Bind Abst) u1 t1) x) -> + (EX u2 t2 | x = (TTail (Bind Abst) u2 t2) & + (pr3 c u1 u2) & (b:?; u:?) + (pr3 (CTail c (Bind b) u) t1 t2) + ). + Intros until 1; InsertEq H '(TTail (Bind Abst) u1 t1); + UnIntro H t1; UnIntro H u1; XElim H; Clear y x; Intros; + Rename x into u1; Rename x0 into t4. +(* case 1 : pr3_r *) + Rewrite H; XEAuto. +(* case 2 : pr3_u *) + Rewrite H2 in H; Clear H2 t1. + Pr2GenBase. + LApply (H1 x0 x1); [ Clear H H1; Intros | XAuto ]. + XElim H; XEAuto. + Qed. + + End pr3_gen_abst. + + Section pr3_gen_lift. (***************************************************) + +(*#* #start file *) + +(*#* #caption "generation lemma for lift" *) +(*#* #cap #cap c #alpha e in D, t1 in U1, t2 in U2, x in T, d in i *) + + Theorem pr3_gen_lift : (c:?; t1,x:?; h,d:?) (pr3 c (lift h d t1) x) -> + (e:?) (drop h d c e) -> + (EX t2 | x = (lift h d t2) & (pr3 e t1 t2)). + +(*#* #stop file *) + + Intros until 1; InsertEq H '(lift h d t1); + UnIntro H t1; XElim H; Clear y x; Intros; Rename x into t4. +(* case 1 : pr3_r *) + XEAuto. +(* case 2 : pr3_u *) + Rewrite H2 in H; Pr2Gen. + LApply (H1 x); [ Clear H1; Intros H1 | XAuto ]. + LApply (H1 e); [ Clear H1; Intros H1 | XAuto ]. + XElim H1; XEAuto. + Qed. + + End pr3_gen_lift. + + Tactic Definition Pr3Gen := + Match Context With + | [ H: (pr3 ?1 (TTail (Bind Abst) ?2 ?3) ?4) |- ? ] -> + LApply (pr3_gen_abst ?1 ?2 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (pr3 ?1 (TTail (Bind Abbr) ?2 ?3) ?4) |- ? ] -> + LApply (pr3_gen_abbr ?1 ?2 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; + [ Intros H; XElim H; + Do 4 Intro; Intros H_x; XElim H_x; + [ Intros | Intros H_x; XElim H_x; Intros ] + | Intros H; XElim H; Intros ] + | [ H: (pr3 ?1 (TTail (Bind Void) ?2 ?3) ?4) |- ? ] -> + LApply (pr3_gen_void ?1 ?2 ?3 ?4); [ Clear H; Intros H | XAuto ]; + XElim H; Intros H; XElim H; Intros + | [ H0: (pr3 ?1 (lift ?2 ?3 ?4) ?5); + H1: (drop ?2 ?3 ?1 ?6) |- ? ] -> + LApply (pr3_gen_lift ?1 ?4 ?5 ?2 ?3); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?6); [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros + | _ -> Pr2Gen. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr3_gen_context.v b/helm/coq-contribs/LAMBDA-TYPES/pr3_gen_context.v new file mode 100644 index 000000000..f0662babe --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr3_gen_context.v @@ -0,0 +1,42 @@ +(*#* #stop file *) + +Require csubst1_defs. +Require pr2_gen_context. +Require pr3_defs. + + Section pr3_gen_context. (************************************************) + + Theorem pr3_gen_cabbr: (c:?; t1,t2:?) (pr3 c t1 t2) -> (e:?; u:?; d:?) + (drop d (0) c (CTail e (Bind Abbr) u)) -> + (a0:?) (csubst1 d u c a0) -> + (a:?) (drop (1) d a0 a) -> + (x1:?) (subst1 d u t1 (lift (1) d x1)) -> + (EX x2 | (subst1 d u t2 (lift (1) d x2)) & + (pr3 a x1 x2) + ). + Intros until 1; XElim H; Intros. +(* case 1: pr3_r *) + XEAuto. +(* case 1: pr3_r *) + Pr2GenContext. + LApply (H1 e u d); [ Clear H1; Intros H1 | XAuto ]. + LApply (H1 a0); [ Clear H1; Intros H1 | XAuto ]. + LApply (H1 a); [ Clear H1; Intros H1 | XAuto ]. + LApply (H1 x); [ Clear H1; Intros H1 | XAuto ]. + XElim H1; XEAuto. + Qed. + + End pr3_gen_context. + + Tactic Definition Pr3GenContext := + Match Context With + | [ H0: (pr3 ?1 ?2 ?3); H1: (drop ?4 (0) ?1 (CTail ?5 (Bind Abbr) ?6)); + H2: (csubst1 ?4 ?6 ?1 ?7); H3: (drop (1) ?4 ?7 ?8); + H4: (subst1 ?4 ?6 ?2 (lift (1) ?4 ?9)) |- ? ] -> + LApply (pr3_gen_cabbr ?1 ?2 ?3); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?5 ?6 ?4); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?7); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?8); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?9); [ Clear H0 H4; Intros H0 | XAuto ]; + XElim H0; Intros + | _ -> Pr2GenContext. diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr3_props.v b/helm/coq-contribs/LAMBDA-TYPES/pr3_props.v new file mode 100644 index 000000000..dfdc49c50 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr3_props.v @@ -0,0 +1,113 @@ +Require subst0_subst0. +Require pr0_subst0. +Require pr2_lift. +Require pr3_defs. + +(*#* #caption "main properties of predicate \\texttt{pr3}" *) +(*#* #clauses *) + +(*#* #stop file *) + + Section pr3_context. (****************************************************) + + Theorem pr3_pr0_pr2_t : (u1,u2:?) (pr0 u1 u2) -> + (c:?; t1,t2:?; k:?) (pr2 (CTail c k u2) t1 t2) -> + (pr3 (CTail c k u1) t1 t2). + Intros. + Inversion H0; Clear H0; XAuto. + NewInduction i. +(* case 1 : pr2_delta i = 0 *) + DropGenBase; Inversion H0; Clear H0 H3 H4 c k. + Rewrite H5 in H; Clear H5 u2. + Pr0Subst0; XEAuto. +(* case 2 : pr2_delta i > 0 *) + NewInduction k; DropGenBase; XEAuto. + Qed. + + Theorem pr3_pr2_pr2_t : (c:?; u1,u2:?) (pr2 c u1 u2) -> + (t1,t2:?; k:?) (pr2 (CTail c k u2) t1 t2) -> + (pr3 (CTail c k u1) t1 t2). + Intros until 1; Inversion H; Clear H; Intros. +(* case 1 : pr2_pr0 *) + EApply pr3_pr0_pr2_t; [ Apply H0 | XAuto ]. +(* case 2 : pr2_delta *) + Inversion H; [ XAuto | NewInduction i0 ]. +(* case 2.1 : i0 = 0 *) + DropGenBase; Inversion H2; Clear H2. + Rewrite <- H5; Rewrite H6 in H; Rewrite <- H7 in H3; Clear H5 H6 H7 d0 k u0. + Subst0Subst0; Arith9'In H4 i; XDEAuto 7. +(* case 2.2 : i0 > 0 *) + Clear IHi0; NewInduction k; DropGenBase; XEAuto. + Qed. + + Theorem pr3_pr2_pr3_t : (c:?; u2,t1,t2:?; k:?) + (pr3 (CTail c k u2) t1 t2) -> + (u1:?) (pr2 c u1 u2) -> + (pr3 (CTail c k u1) t1 t2). + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + EApply pr3_t. + EApply pr3_pr2_pr2_t; [ Apply H2 | Apply H ]. + XAuto. + Qed. + +(*#* #start file *) + +(*#* #caption "reduction inside context items" *) +(*#* #cap #cap t1, t2 #alpha c in E, u1 in V1, u2 in V2, k in z *) + + Theorem pr3_pr3_pr3_t : (c:?; u1,u2:?) (pr3 c u1 u2) -> + (t1,t2:?; k:?) (pr3 (CTail c k u2) t1 t2) -> + (pr3 (CTail c k u1) t1 t2). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + EApply pr3_pr2_pr3_t; [ Apply H1; XAuto | XAuto ]. + Qed. + + End pr3_context. + + Tactic Definition Pr3Context := + Match Context With + | [ H1: (pr0 ?2 ?3); H2: (pr2 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pr3_pr0_pr2_t ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?1 ?5 ?6 ?4); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr0 ?2 ?3); H2: (pr3 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pr3_pr2_pr3_t ?1 ?3 ?5 ?6 ?4); [ Clear H2; Intros H2 | XAuto ]; + LApply (H2 ?2); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr2 ?1 ?2 ?3); H2: (pr2 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pr3_pr2_pr2_t ?1 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?5 ?6 ?4); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr2 ?1 ?2 ?3); H2: (pr3 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pr3_pr2_pr3_t ?1 ?3 ?5 ?6 ?4); [ Clear H2; Intros H2 | XAuto ]; + LApply (H2 ?2); [ Clear H1 H2; Intros | XAuto ] + | [ H1: (pr3 ?1 ?2 ?3); H2: (pr3 (CTail ?1 ?4 ?3) ?5 ?6) |- ? ] -> + LApply (pr3_pr3_pr3_t ?1 ?2 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply (H1 ?5 ?6 ?4); [ Clear H1 H2; Intros | XAuto ]. + + Section pr3_lift. (*******************************************************) + +(*#* #start file *) + +(*#* #caption "conguence with lift" *) +(*#* #cap #cap c, t1, t2 #alpha e in D, d in i *) + + Theorem pr3_lift : (c,e:?; h,d:?) (drop h d c e) -> + (t1,t2:?) (pr3 e t1 t2) -> + (pr3 c (lift h d t1) (lift h d t2)). + +(*#* #stop file *) + + Intros until 2; XElim H0; Intros; XEAuto. + Qed. + + End pr3_lift. + + Hints Resolve pr3_lift : ltlc. + diff --git a/helm/coq-contribs/LAMBDA-TYPES/pr3_subst1.v b/helm/coq-contribs/LAMBDA-TYPES/pr3_subst1.v new file mode 100644 index 000000000..78c9834d5 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/pr3_subst1.v @@ -0,0 +1,33 @@ +(*#* #stop file *) + +Require subst1_defs. +Require pr2_subst1. +Require pr3_defs. + + Section pr3_subst1_props. (***********************************************) + + Theorem pr3_subst1: (c,e:?; v:?; i:?) (drop i (0) c (CTail e (Bind Abbr) v)) -> + (t1,t2:?) (pr3 c t1 t2) -> + (w1:?) (subst1 i v t1 w1) -> + (EX w2 | (pr3 c w1 w2) & (subst1 i v t2 w2)). + Intros until 2; XElim H0; Clear t1 t2; Intros. +(* case 1: pr3_refl *) + XEAuto. +(* case 2: pr3_single *) + Pr2Subst1. + LApply (H2 x); [ Clear H2; Intros H2 | XAuto ]. + XElim H2; XEAuto. + Qed. + + End pr3_subst1_props. + + Tactic Definition Pr3Subst1 := + Match Context With + | [ H0: (drop ?1 (0) ?2 (CTail ?3 (Bind Abbr) ?4)); + H1: (pr3 ?2 ?5 ?6); H3: (subst1 ?1 ?4 ?5 ?7) |- ? ] -> + LApply (pr3_subst1 ?2 ?3 ?4 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?5 ?6); [ Clear H_x H1; Intros H1 | XAuto ]; + LApply (H1 ?7); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros + | _ -> Pr2Subst1. + diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst0_confluence.v b/helm/coq-contribs/LAMBDA-TYPES/subst0_confluence.v new file mode 100644 index 000000000..bbbfdc469 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst0_confluence.v @@ -0,0 +1,80 @@ +(*#* #stop file *) + +Require lift_gen. +Require subst0_gen. +Require subst0_defs. + + Section subst0_confluence. (**********************************************) + + Tactic Definition IH := + Match Context With + | [ H1: (t2,u2:?; i2:?) (subst0 i2 u2 ?1 t2) -> ~?2=i2 -> ?; + H2: (subst0 ?3 ?4 ?1 ?5); H3: ~?2=?3 |- ? ] -> + LApply (H1 ?5 ?4 ?3); [ Clear H1; Intros H1 | XAuto ]; + LApply H1; [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (t2,u2:?; i2:?) (subst0 i2 u2 ?1 t2) -> ~(s k ?2)=i2 -> ?; + H2: (subst0 (s k ?3) ?4 ?1 ?5); H3: ~?2=?3 |- ? ] -> + LApply (H1 ?5 ?4 (s k ?3)); [ Clear H1; Intros H1 | XAuto ]; + LApply H1; [ Clear H1; Intros H1 | Unfold not in H3; Unfold not; XEAuto ]; + XElim H1; Intros + | [ H1: (t2:T) (subst0 ?1 ?2 ?3 t2) -> ?; H2: (subst0 ?1 ?2 ?3 ?4) |- ? ] -> + LApply (H1 ?4); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros H1; [ Try Rewrite H1 | XElim H1; Intros | Idtac | Idtac ]. + + Theorem subst0_confluence_neq : (t0,t1,u1:?; i1:?) (subst0 i1 u1 t0 t1) -> + (t2,u2:?; i2:?) (subst0 i2 u2 t0 t2) -> + ~i1=i2 -> + (EX t | (subst0 i2 u2 t1 t) & + (subst0 i1 u1 t2 t)). + + Intros until 1; XElim H; Intros; + Subst0GenBase; Try Rewrite H in H0; Try Rewrite H1; Try Rewrite H3; + Try EqFalse; Repeat IH; XEAuto. + Qed. + + Theorem subst0_confluence_eq : (t0,t1,u:?; i:?) (subst0 i u t0 t1) -> + (t2:?) (subst0 i u t0 t2) -> (OR + t1 = t2 | + (EX t | (subst0 i u t1 t) & (subst0 i u t2 t)) | + (subst0 i u t1 t2) | + (subst0 i u t2 t1)). + Intros until 1; XElim H; Intros; + Subst0GenBase; Try Rewrite H1; Try Rewrite H3; + Repeat IH; XEAuto. + Qed. + + End subst0_confluence. + + Tactic Definition Subst0Confluence := + Match Context With + | [ H0: (subst0 ?1 ?2 ?3 ?4); + H1: (subst0 ?1 ?2 ?3 ?5) |- ? ] -> + LApply (subst0_confluence_eq ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?5); [ Clear H0; Intros H0 | XAuto ]; + XElim H0; [ Intros | Intros H0; XElim H0; Intros | Intros | Intros ] + | [ H0: (subst0 ?1 ?2 ?3 ?4); + H1: (subst0 ?5 ?6 ?3 ?7) |- ? ] -> + LApply (subst0_confluence_neq ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?7 ?6 ?5); [ Clear H0 H1; Intros H0 | XAuto ]; + LApply H0; [ Clear H0; Intros H0 | Simpl; XAuto ]; + XElim H0; Intros. + + Section subst0_confluence_lift. (*****************************************) + + Theorem subst0_confluence_lift: (t0,t1,u:?; i:?) (subst0 i u t0 (lift (1) i t1)) -> + (t2:?) (subst0 i u t0 (lift (1) i t2)) -> + t1 = t2. + Intros; Subst0Confluence; + Try Subst0Gen; SymEqual; LiftGen; XEAuto. + Qed. + + End subst0_confluence_lift. + + Tactic Definition Subst0ConfluenceLift := + Match Context With + | [ H0: (subst0 ?1 ?2 ?3 (lift (1) ?1 ?4)); + H1: (subst0 ?1 ?2 ?3 (lift (1) ?1 ?5)) |- ? ] -> + LApply (subst0_confluence_lift ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?5); [ Clear H0; Intros | XAuto ] + | _ -> Subst0Confluence. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst0_defs.v b/helm/coq-contribs/LAMBDA-TYPES/subst0_defs.v new file mode 100644 index 000000000..5c9c2e5c8 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst0_defs.v @@ -0,0 +1,55 @@ +(*#* #stop file *) + +Require Export lift_defs. + + Inductive subst0 : nat -> T -> T -> T -> Prop := + | subst0_bref : (v:?; i:?) (subst0 i v (TBRef i) (lift (S i) (0) v)) + | subst0_fst : (v,w,u:?; i:?) (subst0 i v u w) -> + (t:?; k:?) (subst0 i v (TTail k u t) (TTail k w t)) + | subst0_snd : (k:?; v,w,t:?; i:?) (subst0 (s k i) v t w) -> (u:?) + (subst0 i v (TTail k u t) (TTail k u w)) + | subst0_both : (v,u1,u2:?; i:?) (subst0 i v u1 u2) -> + (k:?; t1,t2:?) (subst0 (s k i) v t1 t2) -> + (subst0 i v (TTail k u1 t1) (TTail k u2 t2)). + + Hint subst0 : ltlc := Constructors subst0. + + Section subst0_gen_base. (************************************************) + + Theorem subst0_gen_sort : (v,x:?; i,n:?) (subst0 i v (TSort n) x) -> + (P:Prop) P. + Intros; Inversion H. + Qed. + + Theorem subst0_gen_bref : (v,x:?; i,n:?) (subst0 i v (TBRef n) x) -> + n = i /\ x = (lift (S n) (0) v). + Intros; Inversion H; XAuto. + Qed. + + Theorem subst0_gen_tail : (k:?; v,u1,t1,x:?; i:?) + (subst0 i v (TTail k u1 t1) x) -> (OR + (EX u2 | x = (TTail k u2 t1) & + (subst0 i v u1 u2)) | + (EX t2 | x = (TTail k u1 t2) & + (subst0 (s k i) v t1 t2)) | + (EX u2 t2 | x = (TTail k u2 t2) & + (subst0 i v u1 u2) & + (subst0 (s k i) v t1 t2)) + ). + + Intros; Inversion H; XEAuto. + Qed. + + End subst0_gen_base. + + Tactic Definition Subst0GenBase := + Match Context With + | [ H: (subst0 ?1 ?2 (TSort ?3) ?4) |- ? ] -> + Apply (subst0_gen_sort ?2 ?4 ?1 ?3); Apply H + | [ H: (subst0 ?1 ?2 (TBRef ?3) ?4) |- ? ] -> + LApply (subst0_gen_bref ?2 ?4 ?1 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (subst0 ?1 ?2 (TTail ?3 ?4 ?5) ?6) |- ? ] -> + LApply (subst0_gen_tail ?3 ?2 ?4 ?5 ?6 ?1); [ Clear H; Intros H | XAuto ]; + XElim H; Intros H; XElim H; Intros. + diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst0_gen.v b/helm/coq-contribs/LAMBDA-TYPES/subst0_gen.v new file mode 100644 index 000000000..7a0acfeb6 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst0_gen.v @@ -0,0 +1,130 @@ +(*#* #stop file *) + +Require lift_props. +Require subst0_defs. + + Section subst0_gen_lift_lt. (*********************************************) + + Tactic Definition IH := + Match Context With + [ H1: (x:T; i,h,d:nat) (subst0 i (lift h d ?1) (lift h (S (plus i d)) ?2) x) -> ?; + H2: (subst0 ?3 (lift ?4 ?5 ?1) (lift ?4 (S (plus ?3 ?5)) ?2) ?6) |- ? ] -> + LApply (H1 ?6 ?3 ?4 ?5); [ Clear H1 H2; Intros H1 | XAuto ]; + XElim H1; Intros. + + Theorem subst0_gen_lift_lt : (u,t1,x:?; i,h,d:?) (subst0 i (lift h d u) (lift h (S (plus i d)) t1) x) -> + (EX t2 | x = (lift h (S (plus i d)) t2) & (subst0 i u t1 t2)). + XElim t1; Intros. +(* case 1: TSort *) + Rewrite lift_sort in H; Subst0GenBase. +(* case 2: TBRef n *) + Apply (lt_le_e n (S (plus i d))); Intros. +(* case 2.1: n < 1 + i + d *) + Rewrite lift_bref_lt in H; [ Idtac | XAuto ]. + Subst0GenBase; Rewrite H1; Rewrite H. + Rewrite <- lift_d; Simpl; XEAuto. +(* case 2.2: n >= 1 + i + d *) + Rewrite lift_bref_ge in H; [ Idtac | XAuto ]. + Subst0GenBase; Rewrite <- H in H0. + EApply le_false; [ Idtac | Apply H0 ]; XAuto. +(* case 3: TTail k *) + Rewrite lift_tail in H1; Subst0GenBase; Rewrite H1; Clear H1 x. +(* case 3.1: subst0_fst *) + IH; Rewrite H; Rewrite <- lift_tail; XEAuto. +(* case 3.2: subst0_snd *) + SRwIn H2; IH; Rewrite H0; SRwBack; Rewrite <- lift_tail; XEAuto. +(* case 3.2: subst0_snd *) + SRwIn H3; Repeat IH; Rewrite H; Rewrite H0; SRwBack; + Rewrite <- lift_tail; XEAuto. + Qed. + + End subst0_gen_lift_lt. + + Section subst0_gen_lift_false. (******************************************) + + Theorem subst0_gen_lift_false : (t,u,x:?; h,d,i:?) + (le d i) -> (lt i (plus d h)) -> + (subst0 i u (lift h d t) x) -> + (P:Prop) P. + XElim t; Intros. +(* case 1: TSort *) + Rewrite lift_sort in H1; Subst0GenBase. +(* case 2: TBRef n *) + Apply (lt_le_e n d); Intros. +(* case 2.1: n < d *) + Rewrite lift_bref_lt in H1; [ Idtac | XAuto ]. + Subst0GenBase; Rewrite H1 in H2. + EApply le_false; [ Apply H | XAuto ]. +(* case 2.2: n >= d *) + Rewrite lift_bref_ge in H1; [ Idtac | XAuto ]. + Subst0GenBase; Rewrite <- H1 in H0. + EApply le_false; [ Apply H2 | XEAuto ]. +(* case 3: TTail k *) + Rewrite lift_tail in H3; Subst0GenBase. +(* case 3.1: subst0_fst *) + EApply H; XEAuto. +(* case 3.2: subst0_snd *) + EApply H0; [ Idtac | Idtac | XEAuto ]; [ Idtac | SRwBack ]; XAuto. +(* case 3.3: subst0_both *) + EApply H; XEAuto. + Qed. + + End subst0_gen_lift_false. + + Section subst0_gen_lift_ge. (*********************************************) + + Tactic Definition IH := + Match Context With + [ H1: (x:?; i,h,d:?) (subst0 i ?1 (lift h d ?2) x) -> ?; + H2: (subst0 ?3 ?1 (lift ?4 ?5 ?2) ?6) |- ? ] -> + LApply (H1 ?6 ?3 ?4 ?5); [ Clear H1 H2; Intros H1 | XAuto ]; + LApply H1; [ Clear H1; Intros H1 | SRwBack; XAuto ]; + XElim H1; Intros. + + Theorem subst0_gen_lift_ge : (u,t1,x:?; i,h,d:?) (subst0 i u (lift h d t1) x) -> + (le (plus d h) i) -> + (EX t2 | x = (lift h d t2) & (subst0 (minus i h) u t1 t2)). + XElim t1; Intros. +(* case 1: TSort *) + Rewrite lift_sort in H; Subst0GenBase. +(* case 2: TBRef n *) + Apply (lt_le_e n d); Intros. +(* case 2.1: n < d *) + Rewrite lift_bref_lt in H; [ Idtac | XAuto ]. + Subst0GenBase; Rewrite H in H1. + EApply le_false; [ Apply H0 | XAuto ]. +(* case 2.2: n >= d *) + Rewrite lift_bref_ge in H; [ Idtac | XAuto ]. + Subst0GenBase; Rewrite <- H; Rewrite H2. + Rewrite minus_plus_r. + EApply ex2_intro; [ Idtac | XAuto ]. + Rewrite lift_free; [ Idtac | XEAuto (**) | XAuto ]. + Rewrite plus_sym; Rewrite plus_n_Sm; XAuto. +(* case 3: TTail k *) + Rewrite lift_tail in H1; Subst0GenBase; Rewrite H1; Clear H1 x; + Repeat IH; Try Rewrite H; Try Rewrite H0; + Rewrite <- lift_tail; Try Rewrite <- s_minus in H1; XEAuto. + Qed. + + End subst0_gen_lift_ge. + + Tactic Definition Subst0Gen := + Match Context With + | [ H: (subst0 ?0 (lift ?1 ?2 ?3) (lift ?1 (S (plus ?0 ?2)) ?4) ?5) |- ? ] -> + LApply (subst0_gen_lift_lt ?3 ?4 ?5 ?0 ?1 ?2); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (subst0 ?0 ?1 (lift (1) ?0 ?2) ?3) |- ? ] -> + LApply (subst0_gen_lift_false ?2 ?1 ?3 (1) ?0 ?0); [ Intros H_x | XAuto ]; + LApply H_x; [ Clear H_x; Intros H_x | Rewrite plus_sym; XAuto ]; + LApply H_x; [ Clear H H_x; Intros H | XAuto ]; + Apply H + | [ _: (le ?1 ?2); _: (lt ?2 (plus ?1 ?3)); + _: (subst0 ?2 ?4 (lift ?3 ?1 ?5) ?6) |- ? ] -> + Apply (subst0_gen_lift_false ?5 ?4 ?6 ?3 ?1 ?2); XAuto + | [ _: (subst0 ?1 ?2 (lift (S ?1) (0) ?3) ?4) |- ? ] -> + Apply (subst0_gen_lift_false ?3 ?2 ?4 (S ?1) (0) ?1); XAuto + | [ H: (subst0 ?0 ?1 (lift ?2 ?3 ?4) ?5) |- ? ] -> + LApply (subst0_gen_lift_ge ?1 ?4 ?5 ?0 ?2 ?3); [ Clear H; Intros H | XAuto ]; + LApply H; [ Clear H; Intros H | Simpl; XAuto ]; + XElim H; Intros + | _ -> Subst0GenBase. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst0_lift.v b/helm/coq-contribs/LAMBDA-TYPES/subst0_lift.v new file mode 100644 index 000000000..d4ce7412f --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst0_lift.v @@ -0,0 +1,49 @@ +(*#* #stop file *) + +Require lift_props. +Require subst0_defs. + + Section subst0_lift. (****************************************************) + + Theorem subst0_lift_lt : (t1,t2,u:?; i:?) (subst0 i u t1 t2) -> + (d:?) (lt i d) -> (h:?) + (subst0 i (lift h (minus d (S i)) u) (lift h d t1) (lift h d t2)). + Intros until 1; XElim H; Intros. +(* case 1: subst0_bref *) + Rewrite lift_bref_lt; [ Idtac | XAuto ]. + LetTac w := (minus d (S i0)). + Arith8 d '(S i0); Rewrite lift_d; XAuto. +(* case 2: subst0_fst *) + LiftTailRw; XAuto. +(* case 3: subst0_snd *) + SRwBackIn H0; LiftTailRw; Rewrite <- (minus_s_s k); XAuto. +(* case 4: subst0_both *) + SRwBackIn H2; LiftTailRw. + Apply subst0_both; [ Idtac | Rewrite <- (minus_s_s k) ]; XAuto. + Qed. + + Theorem subst0_lift_ge : (t1,t2,u:?; i,h:?) (subst0 i u t1 t2) -> + (d:?) (le d i) -> + (subst0 (plus i h) u (lift h d t1) (lift h d t2)). + Intros until 1; XElim H; Intros. +(* case 1: subst0_bref *) + Rewrite lift_bref_ge; [ Idtac | XAuto ]. + Rewrite lift_free; [ Idtac | Simpl; XAuto | XAuto ]. + Arith5'c h i0; XAuto. +(* case 2: subst0_fst *) + LiftTailRw; XAuto. +(* case 3: subst0_snd *) + SRwBackIn H0; LiftTailRw; XAuto. +(* case 4: subst0_snd *) + SRwBackIn H2; LiftTailRw; XAuto. + Qed. + + Theorem subst0_lift_ge_S : (t1,t2,u:?; i:?) (subst0 i u t1 t2) -> + (d:?) (le d i) -> (b:?) + (subst0 (s (Bind b) i) u (lift (1) d t1) (lift (1) d t2)). + Intros; Simpl; Arith7 i; Apply subst0_lift_ge; XAuto. + Qed. + + End subst0_lift. + + Hints Resolve subst0_lift_lt subst0_lift_ge subst0_lift_ge_S : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst0_subst0.v b/helm/coq-contribs/LAMBDA-TYPES/subst0_subst0.v new file mode 100644 index 000000000..e092e23e7 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst0_subst0.v @@ -0,0 +1,68 @@ +(*#* #stop file *) + +Require subst0_defs. +Require subst0_gen. +Require subst0_lift. + + Section subst0_subst0. (**************************************************) + + Tactic Definition IH := + Match Context With + | [ H1: (u1,u:?; i:?) (subst0 i u u1 ?1) -> ?; + H2: (subst0 ?2 ?3 ?4 ?1) |- ? ] -> + LApply (H1 ?4 ?3 ?2); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros + | [ H1: (u1,u:?; i:?) (subst0 i u ?1 u1) -> ?; + H2: (subst0 ?2 ?3 ?1 ?4) |- ? ] -> + LApply (H1 ?4 ?3 ?2); [ Clear H1; Intros H1 | XAuto ]; + XElim H1; Intros. + + Theorem subst0_subst0: (t1,t2,u2:?; j:?) (subst0 j u2 t1 t2) -> + (u1,u:?; i:?) (subst0 i u u1 u2) -> + (EX t | (subst0 j u1 t1 t) & (subst0 (S (plus i j)) u t t2)). + Intros until 1; XElim H; Intros. +(* case 1 : subst0_bref *) + Arith5 i0 i; XEAuto. +(* case 2 : subst0_fst *) + IH; XEAuto. +(* case 3 : subst0_snd *) + IH; SRwBackIn H2; XEAuto. +(* case 4 : subst0_both *) + Repeat IH; SRwBackIn H4; XEAuto. + Qed. + + Theorem subst0_subst0_back: (t1,t2,u2:?; j:?) (subst0 j u2 t1 t2) -> + (u1,u:?; i:?) (subst0 i u u2 u1) -> + (EX t | (subst0 j u1 t1 t) & (subst0 (S (plus i j)) u t2 t)). + Intros until 1; XElim H; Intros. +(* case 1 : subst0_bref *) + Arith5 i0 i; XEAuto. +(* case 2 : subst0_fst *) + IH; XEAuto. +(* case 3 : subst0_snd *) + IH; SRwBackIn H2; XEAuto. +(* case 4 : subst0_both *) + Repeat IH; SRwBackIn H4; XEAuto. + Qed. + + Theorem subst0_trans: (t2,t1,v:?; i:?) (subst0 i v t1 t2) -> + (t3:?) (subst0 i v t2 t3) -> + (subst0 i v t1 t3). + Intros until 1; XElim H; Intros; + Subst0Gen; Try Rewrite H1; Try Rewrite H3; XAuto. + Qed. + + End subst0_subst0. + + Hints Resolve subst0_trans : ltlc. + + Tactic Definition Subst0Subst0 := + Match Context With + | [ H1: (subst0 ?0 ?1 ?2 ?3); H2: (subst0 ?4 ?5 ?6 ?1) |- ? ] -> + LApply (subst0_subst0 ?2 ?3 ?1 ?0); [ Intros H_x | XAuto ]; + LApply (H_x ?6 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros + | [ H1: (subst0 ?0 ?1 ?2 ?3); H2: (subst0 ?4 ?5 ?1 ?6) |- ? ] -> + LApply (subst0_subst0_back ?2 ?3 ?1 ?0); [ Intros H_x | XAuto ]; + LApply (H_x ?6 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst0_tlt.v b/helm/coq-contribs/LAMBDA-TYPES/subst0_tlt.v new file mode 100644 index 000000000..87bf9c8c0 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst0_tlt.v @@ -0,0 +1,62 @@ +(*#* #stop file *) + +Require tlt_defs. +Require lift_tlt. +Require subst0_defs. + + Section subst0_tlt_props. (***********************************************) + + Theorem subst0_weight_le : (u,t,z:?; d:?) (subst0 d u t z) -> + (f,g:?) ((m:?) (le (f m) (g m))) -> + (lt (weight_map f (lift (S d) (0) u)) (g d)) -> + (le (weight_map f z) (weight_map g t)). + Intros until 1; XElim H. +(* case 1: subst0_bref *) + Intros; XAuto. +(* case 2: subst0_fst *) + XElim k; [ XElim b | Idtac ]; Simpl; [ Auto 7 with ltlc (**) | XAuto | XAuto | XAuto ]. +(* case 3: subst0_snd *) + XElim k; [ XElim b | Idtac ]; Simpl; [ Auto 7 with ltlc (**) | XAuto | XAuto | XAuto ]. +(* case 4: subst0_both *) + XElim k; [ XElim b | Idtac ]; Simpl; [ Auto 7 with ltlc (**) | XAuto | XAuto | XAuto ]. + Qed. + + Theorem subst0_weight_lt : (u,t,z:?; d:?) (subst0 d u t z) -> (f,g:?) + ((m:?) (le (f m) (g m))) -> + (lt (weight_map f (lift (S d) (0) u)) (g d)) -> + (lt (weight_map f z) (weight_map g t)). + Intros until 1; XElim H. +(* case 1: subst0_bref *) + Intros; XAuto. +(* case 2: subst0_fst *) + XElim k; [ XElim b | Idtac ]; Simpl; Intros; + Apply lt_n_S; (Apply lt_le_plus_plus; [ XAuto | Idtac ]); (**) + [ Auto 6 with ltlc (**) | XAuto | XAuto | XAuto ]. +(* case 3: subst0_snd *) + XElim k; [ XElim b | Idtac ]; Simpl; + [ Auto 8 with ltlc | Auto 6 with ltlc | Auto 6 with ltlc | XAuto ]. (**) +(* case 3: subst0_both *) + XElim k; [ XElim b | Idtac ]; Simpl; + Intros; Apply lt_n_S; [ Apply lt_le_plus_plus | Apply lt_plus_plus | Apply lt_plus_plus | Apply lt_plus_plus ]; XAuto. + EApply subst0_weight_le; [ XEAuto | XAuto | XAuto ]. + Qed. + + Theorem subst0_tlt_tail: (u,t,z:?) (subst0 (0) u t z) -> + (tlt (TTail (Bind Abbr) u z) + (TTail (Bind Abbr) u t) + ). + Unfold tlt weight; Intros; Simpl. + Apply lt_n_S; Apply le_lt_plus_plus; [ XAuto | Idtac ]. + EApply subst0_weight_lt; [ XEAuto | XAuto | XAuto ]. + Qed. + + Theorem subst0_tlt: (u,t,z:?) (subst0 (0) u t z) -> + (tlt z (TTail (Bind Abbr) u t)). + Intros. + EApply tlt_trans; [ Idtac | Apply subst0_tlt_tail; XEAuto]. + XAuto. + Qed. + + End subst0_tlt_props. + + Hints Resolve subst0_tlt : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst1_confluence.v b/helm/coq-contribs/LAMBDA-TYPES/subst1_confluence.v new file mode 100644 index 000000000..0c473e9ef --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst1_confluence.v @@ -0,0 +1,82 @@ +(*#* #stop file *) + +Require lift_gen. +Require subst0_gen. +Require subst0_confluence. +Require subst1_defs. +Require subst1_gen. + + Section subst1_confluence. (**********************************************) + + Theorem subst1_confluence_neq: (t0,t1,u1:?; i1:?) (subst1 i1 u1 t0 t1) -> + (t2,u2:?; i2:?) (subst1 i2 u2 t0 t2) -> + ~i1=i2 -> + (EX t | (subst1 i2 u2 t1 t) & + (subst1 i1 u1 t2 t) + ). + Intros until 1; XElim H; Clear t1; Intros. +(* case 1; subst1_refl *) + XEAuto. +(* case 2; subst1_single *) + XElim H0; Intros; Try Subst0Confluence; XEAuto. + Qed. + + Theorem subst1_confluence_eq : (t0,t1,u:?; i:?) (subst1 i u t0 t1) -> + (t2:?) (subst1 i u t0 t2) -> + (EX t | (subst1 i u t1 t) & + (subst1 i u t2 t) + ). + Intros until 1; XElim H; Intros. +(* case 1; subst1_refl *) + XEAuto. +(* case 2; subst1_single *) + XElim H0; Intros; + Try Subst0Confluence; Try Rewrite H0; XEAuto. + Qed. + + Theorem subst1_confluence_lift: (t0,t1,u:?; i:?) (subst1 i u t0 (lift (1) i t1)) -> + (t2:?) (subst1 i u t0 (lift (1) i t2)) -> + t1 = t2. + Intros until 1; InsertEq H '(lift (1) i t1); XElim H; Clear y; Intros. +(* case 1: subst1_refl *) + Rewrite H in H0; Clear H t0. + Subst1Gen; SymEqual; LiftGen; XEAuto. +(* case 2: subst1_single *) + Rewrite H0 in H; Clear H0 t2. + InsertEq H1 '(lift (1) i t3); XElim H0; Clear y; Intros. +(* case 2.1: subst1_refl *) + Rewrite H0 in H; Clear H0 t0; Subst0Gen. +(* case 2.2: subst1_single *) + Rewrite H1 in H0; Clear H1 t2; Subst0ConfluenceLift; XAuto. + Qed. + + End subst1_confluence. + + Tactic Definition Subst1Confluence := + Match Context With + | [ H0: (subst1 ?1 ?2 ?3 (lift (1) ?1 ?4)); + H1: (subst1 ?1 ?2 ?3 (lift (1) ?1 ?5)) |- ? ] -> + LApply (subst1_confluence_lift ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?5); [ Clear H0; Intros | XAuto ] + | [ H0: (subst1 ?1 ?2 ?3 ?4); + H1: (subst1 ?1 ?2 ?3 ?5) |- ? ] -> + LApply (subst1_confluence_eq ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?5); [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros + | [ H0: (subst0 ?1 ?2 ?3 ?4); + H1: (subst1 ?1 ?2 ?3 ?5) |- ? ] -> + LApply (subst1_confluence_eq ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?5); [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros + | [ H0: (subst1 ?1 ?2 ?3 ?4); + H1: (subst1 ?5 ?6 ?3 ?7) |- ? ] -> + LApply (subst1_confluence_neq ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?7 ?6 ?5); [ Clear H0 H1; Intros H0 | XAuto ]; + LApply H0; [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros + | [ H0: (subst0 ?1 ?2 ?3 ?4); + H1: (subst1 ?5 ?6 ?3 ?7) |- ? ] -> + LApply (subst1_confluence_neq ?3 ?4 ?2 ?1); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?7 ?6 ?5); [ Clear H0 H1; Intros H0 | XAuto ]; + LApply H0; [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst1_defs.v b/helm/coq-contribs/LAMBDA-TYPES/subst1_defs.v new file mode 100644 index 000000000..d1e091348 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst1_defs.v @@ -0,0 +1,58 @@ +(*#* #stop file *) + +Require Export subst0_defs. + + Inductive subst1 [i:nat; v:T; t1:T] : T -> Prop := + | subst1_refl : (subst1 i v t1 t1) + | subst1_single : (t2:?) (subst0 i v t1 t2) -> (subst1 i v t1 t2). + + Hint subst1 : ltlc := Constructors subst1. + + Section subst1_props. (***************************************************) + + Theorem subst1_tail: (v,u1,u2:?; i:?) (subst1 i v u1 u2) -> + (k:?; t1,t2:?) (subst1 (s k i) v t1 t2) -> + (subst1 i v (TTail k u1 t1) (TTail k u2 t2)). + Intros until 1; XElim H; Clear u2. +(* case 1: csubst1_refl *) + Intros until 1; XElim H; Clear t2; XAuto. +(* case 2: csubst1_single *) + Intros until 2; XElim H0; Clear t3; XAuto. + Qed. + + End subst1_props. + + Hints Resolve subst1_tail : ltlc. + + Section subst1_gen_base. (************************************************) + + Theorem subst1_gen_sort : (v,x:?; i,n:?) (subst1 i v (TSort n) x) -> + x = (TSort n). + Intros; XElim H; Clear x; Intros; + Try Subst0GenBase; XAuto. + Qed. + + Theorem subst1_gen_bref : (v,x:?; i,n:?) (subst1 i v (TBRef n) x) -> + x = (TBRef n) \/ + n = i /\ x = (lift (S n) (0) v). + Intros; XElim H; Clear x; Intros; + Try Subst0GenBase; XAuto. + Qed. + + Theorem subst1_gen_tail : (k:?; v,u1,t1,x:?; i:?) + (subst1 i v (TTail k u1 t1) x) -> + (EX u2 t2 | x = (TTail k u2 t2) & + (subst1 i v u1 u2) & + (subst1 (s k i) v t1 t2) + ). + Intros; XElim H; Clear x; Intros; + Try Subst0GenBase; XEAuto. + Qed. + + End subst1_gen_base. + + Tactic Definition Subst1GenBase := + Match Context With + | [ H: (subst1 ?1 ?2 (TTail ?3 ?4 ?5) ?6) |- ? ] -> + LApply (subst1_gen_tail ?3 ?2 ?4 ?5 ?6 ?1); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst1_gen.v b/helm/coq-contribs/LAMBDA-TYPES/subst1_gen.v new file mode 100644 index 000000000..0b2d4a170 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst1_gen.v @@ -0,0 +1,44 @@ +(*#* #stop file *) + +Require subst0_gen. +Require subst1_defs. + + Section subst1_gen_lift. (************************************************) + + Theorem subst1_gen_lift_lt : (u,t1,x:?; i,h,d:?) (subst1 i (lift h d u) (lift h (S (plus i d)) t1) x) -> + (EX t2 | x = (lift h (S (plus i d)) t2) & (subst1 i u t1 t2)). + Intros; XElim H; Clear x; Intros; + Try Subst0Gen; XEAuto. + Qed. + + Theorem subst1_gen_lift_eq : (t,u,x:?; h,d,i:?) + (le d i) -> (lt i (plus d h)) -> + (subst1 i u (lift h d t) x) -> + x = (lift h d t). + Intros; XElim H1; Clear x; Intros; + Try Subst0Gen; XAuto. + Qed. + + Theorem subst1_gen_lift_ge : (u,t1,x:?; i,h,d:?) (subst1 i u (lift h d t1) x) -> + (le (plus d h) i) -> + (EX t2 | x = (lift h d t2) & (subst1 (minus i h) u t1 t2)). + Intros; XElim H; Clear x; Intros; + Try Subst0Gen; XEAuto. + Qed. + + End subst1_gen_lift. + + Tactic Definition Subst1Gen := + Match Context With + | [ H: (subst1 ?0 (lift ?1 ?2 ?3) (lift ?1 (S (plus ?0 ?2)) ?4) ?5) |- ? ] -> + LApply (subst1_gen_lift_lt ?3 ?4 ?5 ?0 ?1 ?2); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (subst1 ?0 ?1 (lift (1) ?0 ?2) ?3) |- ? ] -> + LApply (subst1_gen_lift_eq ?2 ?1 ?3 (1) ?0 ?0); [ Intros H_x | XAuto ]; + LApply H_x; [ Clear H_x; Intros H_x | Rewrite plus_sym; XAuto ]; + LApply H_x; [ Clear H H_x; Intros | XAuto ] + | [ H0: (subst1 ?0 ?1 (lift (1) ?4 ?2) ?3); H1: (lt ?4 ?0) |- ? ] -> + LApply (subst1_gen_lift_ge ?1 ?2 ?3 ?0 (1) ?4); [ Clear H0; Intros H0 | XAuto ]; + LApply H0; [ Clear H0; Intros H0 | Rewrite plus_sym; XAuto ]; + XElim H0; Intros + | _ -> Subst1GenBase. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst1_lift.v b/helm/coq-contribs/LAMBDA-TYPES/subst1_lift.v new file mode 100644 index 000000000..396757179 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst1_lift.v @@ -0,0 +1,23 @@ +(*#* #stop file *) + +Require lift_props. +Require subst0_lift. +Require subst1_defs. + + Section subst1_lift. (****************************************************) + + Theorem subst1_lift_lt : (t1,t2,u:?; i:?) (subst1 i u t1 t2) -> + (d:?) (lt i d) -> (h:?) + (subst1 i (lift h (minus d (S i)) u) (lift h d t1) (lift h d t2)). + Intros until 1; XElim H; Clear t2; XAuto. + Qed. + + Theorem subst1_lift_ge : (t1,t2,u:?; i,h:?) (subst1 i u t1 t2) -> + (d:?) (le d i) -> + (subst1 (plus i h) u (lift h d t1) (lift h d t2)). + Intros until 1; XElim H; Clear t2; XAuto. + Qed. + + End subst1_lift. + + Hints Resolve subst1_lift_lt subst1_lift_ge : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/subst1_subst1.v b/helm/coq-contribs/LAMBDA-TYPES/subst1_subst1.v new file mode 100644 index 000000000..0f437ed9a --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/subst1_subst1.v @@ -0,0 +1,60 @@ +(*#* #stop file *) + +Require subst0_subst0. +Require subst1_defs. + + Section subst1_subst1. (**************************************************) + + Theorem subst1_subst1: (t1,t2,u2:?; j:?) (subst1 j u2 t1 t2) -> + (u1,u:?; i:?) (subst1 i u u1 u2) -> + (EX t | (subst1 j u1 t1 t) & (subst1 (S (plus i j)) u t t2)). + Intros until 1; XElim H; Clear t2. +(* case 1: subst1_refl on first premise *) + XEAuto. +(* case 2: subst1_single on first premise *) + Intros until 2; InsertEq H0 u2; XElim H0; Clear y; Intros. +(* case 2.1: subst1_refl on second premise *) + Rewrite H0; Clear H0 u1; XEAuto. +(* case 2.2: subst1_single on second premise *) + Rewrite H1 in H0; Clear H1 t0; Subst0Subst0; XEAuto. + Qed. + + Theorem subst1_subst1_back: (t1,t2,u2:?; j:?) (subst1 j u2 t1 t2) -> + (u1,u:?; i:?) (subst1 i u u2 u1) -> + (EX t | (subst1 j u1 t1 t) & (subst1 (S (plus i j)) u t2 t)). + Intros until 1; XElim H; Clear t2. +(* case 1: subst1_refl on first premise *) + XEAuto. +(* case 2: subst1_single on first premise *) + Intros until 2; XElim H0; Clear u1; Intros; + Try Subst0Subst0; XEAuto. + Qed. + + Theorem subst1_trans: (t2,t1,v:?; i:?) (subst1 i v t1 t2) -> + (t3:?) (subst1 i v t2 t3) -> + (subst1 i v t1 t3). + Intros until 1; XElim H; Clear t2. +(* case 1: subst1_refl on first premise *) + XEAuto. +(* case 2: subst1_single on first premise *) + Intros until 2; XElim H0; Clear t3; XEAuto. + Qed. + + End subst1_subst1. + + Hints Resolve subst1_trans : ltlc. + + Tactic Definition Subst1Subst1 := + Match Context With + | [ H1: (subst1 ?0 ?1 ?2 ?3); H2: (subst1 ?4 ?5 ?6 ?1) |- ? ] -> + LApply (subst1_subst1 ?2 ?3 ?1 ?0); [ Intros H_x | XAuto ]; + LApply (H_x ?6 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros + | [ H1: (subst1 ?0 ?1 ?2 ?3); H2: (subst0 ?4 ?5 ?6 ?1) |- ? ] -> + LApply (subst1_subst1 ?2 ?3 ?1 ?0); [ Intros H_x | XAuto ]; + LApply (H_x ?6 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros + | [ H1: (subst1 ?0 ?1 ?2 ?3); H2: (subst1 ?4 ?5 ?1 ?6) |- ? ] -> + LApply (subst1_subst1_back ?2 ?3 ?1 ?0); [ Intros H_x | XAuto ]; + LApply (H_x ?6 ?5 ?4); [ Clear H_x; Intros H_x | XAuto ]; + XElim H_x; Intros. diff --git a/helm/coq-contribs/LAMBDA-TYPES/terms_defs.v b/helm/coq-contribs/LAMBDA-TYPES/terms_defs.v new file mode 100644 index 000000000..157cb7456 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/terms_defs.v @@ -0,0 +1,78 @@ +(*#* #stop file *) + +Require Export Base. + + Inductive Set B := Abbr : B + | Abst : B + | Void : B. + + Inductive Set F := Appl : F + | Cast : F. + + Inductive Set K := Bind : B -> K + | Flat : F -> K. + + Inductive Set T := TSort : nat -> T + | TBRef : nat -> T + | TTail : K -> T -> T -> T. + + Hint f3KTT : ltlc := Resolve (f_equal3 K T T). + + Definition s: K -> nat -> nat := [k;i] Cases k of + | (Bind _) => (S i) + | (Flat _) => i + end. + + Section s_props. (********************************************************) + + Theorem s_S: (k:?; i:?) (s k (S i)) = (S (s k i)). + XElim k; XAuto. + Qed. + + Theorem s_plus: (k:?; i,j:?) (s k (plus i j)) = (plus (s k i) j). + XElim k; XAuto. + Qed. + + Theorem s_plus_sym: (k:?; i,j:?) (s k (plus i j)) = (plus i (s k j)). + XElim k; [ Intros; Simpl; Rewrite plus_n_Sm | Idtac ]; XAuto. + Qed. + + Theorem s_minus: (k:?; i,j:?) (le j i) -> + (s k (minus i j)) = (minus (s k i) j). + XElim k; [ Intros; Unfold s; Cbv Iota | XAuto ]. + Rewrite minus_Sn_m; XAuto. + Qed. + + Theorem minus_s_s: (k:?; i,j:?) (minus (s k i) (s k j)) = (minus i j). + XElim k; XAuto. + Qed. + + Theorem s_le: (k:?; i,j:?) (le i j) -> (le (s k i) (s k j)). + XElim k; Simpl; XAuto. + Qed. + + Theorem s_lt: (k:?; i,j:?) (lt i j) -> (lt (s k i) (s k j)). + XElim k; Simpl; XAuto. + Qed. + + Theorem s_inj: (k:?; i,j:?) (s k i) = (s k j) -> i = j. + XElim k; XEAuto. + Qed. + + End s_props. + + Hints Resolve s_le s_lt s_inj. + + Tactic Definition SRw := + Repeat (Rewrite s_S Orelse Rewrite s_plus_sym). + + Tactic Definition SRwIn H := + Repeat (Rewrite s_S in H Orelse Rewrite s_plus in H). + + Tactic Definition SRwBack := + Repeat (Rewrite <- s_S Orelse Rewrite <- s_plus Orelse Rewrite <- s_plus_sym). + + Tactic Definition SRwBackIn H := + Repeat (Rewrite <- s_S in H Orelse Rewrite <- s_plus in H Orelse Rewrite <- s_plus_sym in H). + + Hint discr : ltlc := Extern 4 (le ? (plus (s ? ?) ?)) SRwBack. diff --git a/helm/coq-contribs/LAMBDA-TYPES/tlt_defs.v b/helm/coq-contribs/LAMBDA-TYPES/tlt_defs.v new file mode 100644 index 000000000..689477a39 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/tlt_defs.v @@ -0,0 +1,115 @@ +(*#* #stop file *) + +Require Export terms_defs. + + Definition wadd : (nat -> nat) -> nat -> (nat -> nat) := + [f;w;n] Cases n of (0) => w | (S m) => (f m) end. + + Fixpoint weight_map [f:nat->nat; t:T] : nat := Cases t of + | (TSort n) => (0) + | (TBRef n) => (f n) + | (TTail (Bind Abbr) u t) => + (S (plus (weight_map f u) (weight_map (wadd f (S (weight_map f u))) t))) + | (TTail (Bind _) u t) => + (S (plus (weight_map f u) (weight_map (wadd f (0)) t))) + | (TTail _ u t) => (S (plus (weight_map f u) (weight_map f t))) + end. + + Definition weight : T -> nat := (weight_map [_](0)). + + Definition tlt : T -> T -> Prop := [t1,t2](lt (weight t1) (weight t2)). + + Section wadd_props. (*****************************************************) + + Theorem wadd_le: (f,g:?) ((n:?) (le (f n) (g n))) -> (v,w:?) (le v w) -> + (n:?) (le (wadd f v n) (wadd g w n)). + XElim n; Simpl; XAuto. + Qed. + + Theorem wadd_lt: (f,g:?) ((n:?) (le (f n) (g n))) -> (v,w:?) (lt v w) -> + (n:?) (le (wadd f v n) (wadd g w n)). + XElim n; Simpl; XAuto. + Qed. + + Theorem wadd_O: (n:?) (wadd [_](0) (0) n) = (0). + XElim n; XAuto. + Qed. + + End wadd_props. + + Hints Resolve wadd_le wadd_lt wadd_O : ltlc. + + Section weight_props. (***************************************************) + + Theorem weight_le : (t:?; f,g:?) ((n:?) (le (f n) (g n))) -> + (le (weight_map f t) (weight_map g t)). + XElim t; [ XAuto | Simpl; XAuto | Idtac ]. + XElim k; Simpl; [ Idtac | XAuto ]. + XElim b; Auto 7 with ltlc. (**) + Qed. + + Theorem weight_eq : (t:?; f,g:?) ((n:?) (f n) = (g n)) -> + (weight_map f t) = (weight_map g t). + Intros; Apply le_antisym; Apply weight_le; + Intros; Rewrite (H n); XAuto. + Qed. + + Hints Resolve weight_le weight_eq : ltlc. + + Theorem weight_add_O : (t:?) (weight_map (wadd [_](0) (0)) t) = (weight_map [_](0) t). + XAuto. + Qed. + + Theorem weight_add_S : (t:?; m:?) (le (weight_map (wadd [_](0) (0)) t) (weight_map (wadd [_](0) (S m)) t)). + XAuto. + Qed. + + End weight_props. + + Hints Resolve weight_le weight_add_S : ltlc. + + Section tlt_props. (******************************************************) + + Theorem tlt_trans: (v,u,t:?) (tlt u v) -> (tlt v t) -> (tlt u t). + Unfold tlt; XEAuto. + Qed. + + Theorem tlt_tail_sx: (k:?; u,t:?) (tlt u (TTail k u t)). + Unfold tlt weight. + XElim k; Simpl; [ XElim b | Idtac ]; XAuto. + Qed. + + Theorem tlt_tail_dx: (k:?; u,t:?) (tlt t (TTail k u t)). + Unfold tlt weight. + XElim k; Simpl; [ Idtac | XAuto ]. + XElim b; Intros; Try Rewrite weight_add_O; [ Idtac | XAuto | XAuto ]. + EApply lt_le_trans; [ Apply lt_n_Sn | Apply le_n_S ]. + EApply le_trans; [ Rewrite <- (weight_add_O t); Apply weight_add_S | XAuto ]. + Qed. + + End tlt_props. + + Hints Resolve tlt_tail_sx tlt_tail_dx tlt_trans : ltlc. + + Section tlt_wf. (*********************************************************) + + Local Q: (T -> Prop) -> nat -> Prop := + [P;n] (t:?) (weight t) = n -> (P t). + + Remark q_ind: (P:T->Prop)((n:?) (Q P n)) -> (t:?) (P t). + Unfold Q; Intros. + Apply (H (weight t) t); XAuto. + Qed. + + Theorem tlt_wf_ind: (P:T->Prop) + ((t:?)((v:?)(tlt v t) -> (P v)) -> (P t)) -> + (t:?)(P t). + Unfold tlt; Intros. + XElimUsing q_ind t; Intros. + Apply lt_wf_ind; Clear n; Intros. + Unfold Q in H0; Unfold Q; Intros. + Rewrite <- H1 in H0; Clear H1. + Apply H; XEAuto. + Qed. + + End tlt_wf. diff --git a/helm/coq-contribs/LAMBDA-TYPES/ty0_defs.v b/helm/coq-contribs/LAMBDA-TYPES/ty0_defs.v new file mode 100644 index 000000000..d9b302aca --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/ty0_defs.v @@ -0,0 +1,302 @@ +Require Export pc3_defs. + +(*#* #stop record *) + + Record G : Set := { + f : nat -> nat; + f_inc : (n:?) (lt n (f n)) + }. + +(*#* #start record *) + +(*#* #caption "typing", + "well formed context sort", "well formed context binder", + "conversion rule", "typed sort", "typed reference to abbreviation", + "typed reference to abstraction", "typed binder", "typed application", + "typed cast" +*) + Inductive wf0 [g:G] : C -> Prop := + | wf0_sort : (m:?) (wf0 g (CSort m)) + | wf0_bind : (c:?; u,t:?) (ty0 g c u t) -> + (b:?) (wf0 g (CTail c (Bind b) u)) + with ty0 [g:G] : C -> T -> T -> Prop := +(* structural rules *) + | ty0_conv : (c:?; t2,t:?) (ty0 g c t2 t) -> + (u,t1:?) (ty0 g c u t1) -> (pc3 c t1 t2) -> + (ty0 g c u t2) +(* axiom rules *) + | ty0_sort : (c:?) (wf0 g c) -> + (m:?) (ty0 g c (TSort m) (TSort (f g m))) + | ty0_abbr : (c:?) (wf0 g c) -> + (n:?; d:?; u:?) (drop n (0) c (CTail d (Bind Abbr) u)) -> + (t:?) (ty0 g d u t) -> + (ty0 g c (TBRef n) (lift (S n) (0) t)) + | ty0_abst : (c:?) (wf0 g c) -> + (n:?; d:?; u:?) (drop n (0) c (CTail d (Bind Abst) u)) -> + (t:?) (ty0 g d u t) -> + (ty0 g c (TBRef n) (lift (S n) (0) u)) + | ty0_bind : (c:?; u,t:?) (ty0 g c u t) -> + (b:?; t1,t2:?) (ty0 g (CTail c (Bind b) u) t1 t2) -> + (t0:?) (ty0 g (CTail c (Bind b) u) t2 t0) -> + (ty0 g c (TTail (Bind b) u t1) (TTail (Bind b) u t2)) + | ty0_appl : (c:?; w,u:?) (ty0 g c w u) -> + (v,t:?) (ty0 g c v (TTail (Bind Abst) u t)) -> + (ty0 g c (TTail (Flat Appl) w v) + (TTail (Flat Appl) w (TTail (Bind Abst) u t)) + ) + | ty0_cast : (c:?; t1,t2:?) (ty0 g c t1 t2) -> + (t0:?) (ty0 g c t2 t0) -> + (ty0 g c (TTail (Flat Cast) t2 t1) t2). + + Hint wf0 : ltlc := Constructors wf0. + + Hint ty0 : ltlc := Constructors ty0. + +(*#* #caption "generation lemma of typing" #clauses ty0_gen_base *) + + Section ty0_gen_base. (***************************************************) + +(*#* #caption "generation lemma for sort" *) +(*#* #cap #cap c #alpha x in T, n in h *) + + Theorem ty0_gen_sort: (g:?; c:?; x:?; n:?) + (ty0 g c (TSort n) x) -> + (pc3 c (TSort (f g n)) x). + +(*#* #stop proof *) + + Intros until 1; InsertEq H '(TSort n); XElim H; Intros. +(* case 1 : ty0_conv *) + XEAuto. +(* case 2 : ty0_sort *) + Inversion H0; XAuto. +(* case 3 : ty0_abbr *) + Inversion H3. +(* case 4 : ty0_abst *) + Inversion H3. +(* case 5 : ty0_bind *) + Inversion H5. +(* case 6 : ty0_appl *) + Inversion H3. +(* case 7 : ty0_cast *) + Inversion H3. + Qed. + +(*#* #start proof *) + +(*#* #caption "generation lemma for bound reference" *) +(*#* #cap #cap c, e #alpha x in T, t in U, u in V, n in i *) + + Theorem ty0_gen_bref: (g:?; c:?; x:?; n:?) (ty0 g c (TBRef n) x) -> + (EX e u t | (pc3 c (lift (S n) (0) t) x) & + (drop n (0) c (CTail e (Bind Abbr) u)) & + (ty0 g e u t) + ) \/ + (EX e u t | (pc3 c (lift (S n) (0) u) x) & + (drop n (0) c (CTail e (Bind Abst) u)) & + (ty0 g e u t) + ). + +(*#* #stop proof *) + + Intros until 1; InsertEq H '(TBRef n); XElim H; Intros. +(* case 1 : ty0_conv *) + LApply H2; [ Clear H2; Intros H2 | XAuto ]. + XElim H2; Intros; XElim H2; XEAuto. +(* case 2 : ty0_sort *) + Inversion H0. +(* case 3 : ty0_abbr *) + Inversion H3 ; Rewrite H5 in H0; XEAuto. +(* case 4 : ty0_abst *) + Inversion H3; Rewrite H5 in H0; XEAuto. +(* case 5 : ty0_bind *) + Inversion H5. +(* case 6 : ty0_appl *) + Inversion H3. +(* case 7 : ty0_cast *) + Inversion H3. + Qed. + +(*#* #start proof *) + +(*#* #caption "generation lemma for binder" *) +(*#* #cap #cap c #alpha x in T, t1 in U1, t2 in U2, u in V, t in U, t0 in U3 *) + + Theorem ty0_gen_bind: (g:?; b:?; c:?; u,t1,x:?) (ty0 g c (TTail (Bind b) u t1) x) -> + (EX t2 t t0 | (pc3 c (TTail (Bind b) u t2) x) & + (ty0 g c u t) & + (ty0 g (CTail c (Bind b) u) t1 t2) & + (ty0 g (CTail c (Bind b) u) t2 t0) + ). + +(*#* #stop proof *) + + Intros until 1; InsertEq H '(TTail (Bind b) u t1); XElim H; Intros. +(* case 1 : ty0_conv *) + LApply H2; [ Clear H2; Intros H2 | XAuto ]. + XElim H2; XEAuto. +(* case 2 : ty0_sort *) + Inversion H0. +(* case 3 : ty0_abbr *) + Inversion H3. +(* case 4 : ty0_abst *) + Inversion H3. +(* case 5 : ty0_bind *) + Inversion H5. + Rewrite H7 in H1; Rewrite H7 in H3. + Rewrite H8 in H; Rewrite H8 in H1; Rewrite H8 in H3. + Rewrite H9 in H1; XEAuto. +(* case 6 : ty0_appl *) + Inversion H3. +(* case 7 : ty0_cast *) + Inversion H3. + Qed. + +(*#* #start proof *) + +(*#* #caption "generation lemma for application" *) +(*#* #cap #cap c #alpha x in T, v in U1, w in V1, u in V2, t in U2 *) + + Theorem ty0_gen_appl: (g:?; c:?; w,v,x:?) (ty0 g c (TTail (Flat Appl) w v) x) -> + (EX u t | (pc3 c (TTail (Flat Appl) w (TTail (Bind Abst) u t)) x) & + (ty0 g c v (TTail (Bind Abst) u t)) & + (ty0 g c w u) + ). + +(*#* #stop proof *) + + Intros until 1; InsertEq H '(TTail (Flat Appl) w v); XElim H; Intros. +(* case 1 : ty0_conv *) + LApply H2; [ Clear H2; Intros H2 | XAuto ]. + XElim H2; XEAuto. +(* case 2 : ty0_sort *) + Inversion H0. +(* case 3 : ty0_abbr *) + Inversion H3. +(* case 4 : ty0_abst *) + Inversion H3. +(* case 5 : ty0_bind *) + Inversion H5. +(* case 6 : ty0_appl *) + Inversion H3; Rewrite H5 in H; Rewrite H6 in H1; XEAuto. +(* case 7 : ty0_cast *) + Inversion H3. + Qed. + +(*#* #start proof *) + +(*#* #caption "generation lemma for cast" *) +(*#* #cap #cap c #alpha x in T, t2 in V, t1 in U *) + + Theorem ty0_gen_cast: (g:?; c:?; t1,t2,x:?) + (ty0 g c (TTail (Flat Cast) t2 t1) x) -> + (pc3 c t2 x) /\ (ty0 g c t1 t2). + +(*#* #stop proof *) + + Intros until 1; InsertEq H '(TTail (Flat Cast) t2 t1); XElim H; Intros. +(* case 1 : ty0_conv *) + LApply H2; [ Clear H2; Intros H2 | XAuto ]. + XElim H2; XEAuto. +(* case 2 : ty0_sort *) + Inversion H0. +(* case 3 : ty0_abbr *) + Inversion H3. +(* case 4 : ty0_abst *) + Inversion H3. +(* case 5 : ty0_bind *) + Inversion H5. +(* case 6 : ty0_appl *) + Inversion H3. +(* case 7 : ty0_cast *) + Inversion H3; Rewrite H5 in H; Rewrite H5 in H1; Rewrite H6 in H; XAuto. + Qed. + + End ty0_gen_base. + + Tactic Definition Ty0GenBase := + Match Context With + | [ H: (ty0 ?1 ?2 (TSort ?3) ?4) |- ? ] -> + LApply (ty0_gen_sort ?1 ?2 ?4 ?3); [ Clear H; Intros | XAuto ] + | [ H: (ty0 ?1 ?2 (TBRef ?3) ?4) |- ? ] -> + LApply (ty0_gen_bref ?1 ?2 ?4 ?3); [ Clear H; Intros H | XAuto ]; + XElim H; Intros H; XElim H; Intros + | [ H: (ty0 ?1 ?2 (TTail (Bind ?3) ?4 ?5) ?6) |- ? ] -> + LApply (ty0_gen_bind ?1 ?3 ?2 ?4 ?5 ?6); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (ty0 ?1 ?2 (TTail (Flat Appl) ?3 ?4) ?5) |- ? ] -> + LApply (ty0_gen_appl ?1 ?2 ?3 ?4 ?5); [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (ty0 ?1 ?2 (TTail (Flat Cast) ?3 ?4) ?5) |- ? ] -> + LApply (ty0_gen_cast ?1 ?2 ?4 ?3 ?5); [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + + Section wf0_props. (******************************************************) + + Theorem wf0_ty0 : (g:?; c:?; u,t:?) (ty0 g c u t) -> (wf0 g c). + Intros; XElim H; XAuto. + Qed. + + Hints Resolve wf0_ty0 : ltlc. + + Theorem wf0_drop_O : (c,e:?; h:?) (drop h (0) c e) -> + (g:?) (wf0 g c) -> (wf0 g e). + XElim c. +(* case 1 : CSort *) + Intros; DropGenBase; Rewrite H; XAuto. +(* case 2 : CTail k *) + Intros c IHc; XElim k; ( + XElim h; Intros; DropGenBase; + [ Rewrite H in H0; XAuto | Inversion H1; XEAuto ] ). + Qed. + + End wf0_props. + + Hints Resolve wf0_ty0 wf0_drop_O : ltlc. + + Tactic Definition Wf0Ty0 := + Match Context With + [ _: (ty0 ?1 ?2 ?3 ?4) |- ? ] -> + LApply (wf0_ty0 ?1 ?2 ?3 ?4); [ Intros H_x | XAuto ]; + Inversion_clear H_x. + + Tactic Definition Wf0DropO := + Match Context With + | [ _: (drop ?1 (0) ?2 ?3); _: (wf0 ?4 ?2) |- ? ] -> + LApply (wf0_drop_O ?2 ?3 ?1); [ Intros H_x | XAuto ]; + LApply (H_x ?4); [ Clear H_x; Intros | XAuto ]. + + Section wf0_facilities. (*************************************************) + + Theorem wf0_drop_wf0 : (g:?; c:?) (wf0 g c) -> + (b:?; e:?; u:?; h:?) + (drop h (0) c (CTail e (Bind b) u)) -> (wf0 g e). + Intros. + Wf0DropO; Inversion H1; XEAuto. + Qed. + + Theorem ty0_drop_wf0 : (g:?; c:?; t1,t2:?) (ty0 g c t1 t2) -> + (b:?; e:?; u:?; h:?) + (drop h (0) c (CTail e (Bind b) u)) -> (wf0 g e). + Intros. + EApply wf0_drop_wf0; [ Idtac | EApply H0 ]; XEAuto. + Qed. + + End wf0_facilities. + + Hints Resolve wf0_drop_wf0 ty0_drop_wf0 : ltlc. + + Tactic Definition DropWf0 := + Match Context With + | [ _: (ty0 ?1 ?2 ?3 ?4); + _: (drop ?5 (0) ?2 (CTail ?6 (Bind ?7) ?8)) |- ? ] -> + LApply (ty0_drop_wf0 ?1 ?2 ?3 ?4); [ Intros H_x | XAuto ]; + LApply (H_x ?7 ?6 ?8 ?5); [ Clear H_x; Intros | XAuto ] + | [ _: (wf0 ?1 ?2); + _: (drop ?5 (0) ?2 (CTail ?6 (Bind ?7) ?8)) |- ? ] -> + LApply (wf0_drop_wf0 ?1 ?2); [ Intros H_x | XAuto ]; + LApply (H_x ?7 ?6 ?8 ?5); [ Clear H_x; Intros | XAuto ]. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/ty0_gen_context.v b/helm/coq-contribs/LAMBDA-TYPES/ty0_gen_context.v new file mode 100644 index 000000000..bf9217602 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/ty0_gen_context.v @@ -0,0 +1,227 @@ +(*#* #stop file *) + +Require lift_gen. +Require lift_props. +Require subst1_defs. +Require subst1_lift. +Require subst1_confluence. +Require drop_props. +Require csubst1_defs. +Require pc3_gen. +Require pc3_gen_context. +Require ty0_defs. +Require ty0_lift. + +(* NOTE: these break the recursion between ty0_sred_cpr0_pr0 and ty0_gen_lift *) + + Section ty0_gen_cabbr. (**************************************************) + + Tactic Definition IH d a0 a := + Match Context With + [ H: (e:?; u:?; d:?) ? -> (a0:?) ? -> (a:?) ? -> ? -> ? |- ? ] -> + LApply (H e u0 d); [ Clear H; Intros H | XAuto ]; + LApply (H a0); [ Clear H; Intros H | XAuto ]; + LApply (H a); [ Clear H; Intros H | XEAuto ]; + LApply H; [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + +(* NOTE: This can be generalized removing the last three premises *) + Theorem ty0_gen_cabbr: (g:?; c:?; t1,t2:?) (ty0 g c t1 t2) -> + (e:?; u:?; d:?) (drop d (0) c (CTail e (Bind Abbr) u)) -> + (a0:?) (csubst1 d u c a0) -> + (a:?) (wf0 g a) -> (drop (1) d a0 a) -> + (EX y1 y2 | (subst1 d u t1 (lift (1) d y1)) & + (subst1 d u t2 (lift (1) d y2)) & + (ty0 g a y1 y2) + ). + Intros until 1; XElim H; Intros. +(* case 1 : ty0_conv *) + Repeat IH d a0 a; EApply ex3_2_intro; + [ XEAuto | XEAuto | EApply ty0_conv; Try EApply pc3_gen_cabbr; XEAuto ]. +(* case 2 : ty0_sort *) + EApply ex3_2_intro; Try Rewrite lift_sort; XAuto. +(* case 3 : ty0_abbr *) + Apply (lt_eq_gt_e n d0); Intros; Clear c t1 t2. +(* case 3.1 : n < d0 *) + Clear H1; DropDis; Rewrite minus_x_Sy in H1; [ DropGenBase | XAuto ]. + CSubst1Drop; Rewrite minus_x_Sy in H0; [ Idtac | XAuto ]. + CSubst1GenBase; Rewrite H0 in H8; Clear H0 x; Simpl in H9. + Rewrite (lt_plus_minus n d0) in H6; [ Idtac | XAuto ]. + DropDis; Rewrite H0 in H9; Clear H0 x0. + IH '(minus d0 (S n)) x1 x3. + Subst1Confluence; Rewrite H0 in H11; Clear H0 x0. + Pattern 3 d0; Rewrite (le_plus_minus_sym (S n) d0); [ Idtac | XAuto ]. + Pattern 4 d0; Rewrite (le_plus_minus (S n) d0); [ Idtac | XAuto ]. + EApply ex3_2_intro; + [ Rewrite lift_bref_lt | Rewrite lift_d | EApply ty0_abbr ]; XEAuto. +(* case 3.2 : n = d0 *) + Rewrite H7; Rewrite H7 in H0; Clear H2 H7 n. + DropDis; Inversion H0; Rewrite H8 in H4; Clear H0 H7 H8 e u0. + CSubst1Drop; DropDis. + EApply ex3_2_intro; + [ EApply subst1_single; Rewrite lift_free; Simpl; XEAuto + | Rewrite lift_free; Simpl; XEAuto + | XEAuto ]. +(* case 3.3 : n > d0 *) + Clear H2 H3 e; CSubst1Drop; DropDis. + Pattern 1 n; Rewrite (lt_plus_minus (0) n); [ Idtac | XEAuto ]. + Arith4c '(0) '(minus n (1)). + EApply ex3_2_intro; + [ Rewrite lift_bref_ge + | Rewrite lift_free; Simpl + | Pattern 2 n; Rewrite (minus_x_SO n) + ]; XEAuto. +(* case 4 : ty0_abst *) + Apply (lt_eq_gt_e n d0); Intros; Clear c t1 t2. +(* case 4.1 : n < d0 *) + Clear H1; DropDis; Rewrite minus_x_Sy in H1; [ DropGenBase | XAuto ]. + CSubst1Drop; Rewrite minus_x_Sy in H0; [ Idtac | XAuto ]. + CSubst1GenBase; Rewrite H0 in H8; Clear H0 x; Simpl in H9. + Rewrite (lt_plus_minus n d0) in H6; [ Idtac | XAuto ]. + DropDis; Rewrite H0 in H9; Clear H0 x0. + IH '(minus d0 (S n)) x1 x3. + Subst1Confluence; Rewrite H0 in H11; Clear H0 x0. + Pattern 3 d0; Rewrite (le_plus_minus_sym (S n) d0); [ Idtac | XAuto ]. + Pattern 4 d0; Rewrite (le_plus_minus (S n) d0); [ Idtac | XAuto ]. + EApply ex3_2_intro; + [ Rewrite lift_bref_lt | Rewrite lift_d | EApply ty0_abst ]; XEAuto. +(* case 4.2 : n = d0 *) + Rewrite H7; Rewrite H7 in H0; DropDis; Inversion H0. +(* case 4.3 : n > d0 *) + Clear H2 H3 e; CSubst1Drop; DropDis. + Pattern 1 n; Rewrite (lt_plus_minus (0) n); [ Idtac | XEAuto ]. + Arith4c '(0) '(minus n (1)). + EApply ex3_2_intro; + [ Rewrite lift_bref_ge + | Rewrite lift_free; Simpl + | Pattern 2 n; Rewrite (minus_x_SO n) + ]; XEAuto. +(* case 5 : ty0_bind *) + IH d a0 a; Clear H H1 H3 c t1 t2. + IH '(S d) '(CTail a0 (Bind b) (lift (1) d x0)) '(CTail a (Bind b) x0). + IH '(S d) '(CTail a0 (Bind b) (lift (1) d x0)) '(CTail a (Bind b) x0). + Subst1Confluence; Rewrite H4 in H11; Clear H4 x5. + EApply ex3_2_intro; Try Rewrite lift_bind; XEAuto. +(* case 6 : ty0_appl *) + Repeat IH d a0 a; Clear H H1 c t1 t2. + Subst1GenBase; SymEqual; LiftGenBase; Rewrite H in H8; Rewrite H11 in H1; Rewrite H12 in H7; Clear H H11 H12 x1 x4 x5. + Subst1Confluence; Rewrite H in H8; Clear H x6. + EApply ex3_2_intro; Try Rewrite lift_flat; + [ Idtac | EApply subst1_tail; [ Idtac | Rewrite lift_bind ] | Idtac ]; XEAuto. +(* case 7 : ty0_cast *) + Rename u into u0; Repeat IH d a0 a; Clear H H1 c t1 t2. + Subst1Confluence; Rewrite H in H10; Clear H x3. + EApply ex3_2_intro; [ Rewrite lift_flat | Idtac | Idtac ]; XEAuto. + Qed. + + End ty0_gen_cabbr. + + Section ty0_gen_cvoid. (**************************************************) + + Tactic Definition IH d a := + Match Context With + [ H: (e:?; u:?; d:?) ? -> (a:?) ? -> ? -> ? |- ? ] -> + LApply (H e u0 d); [ Clear H; Intros H | XAuto ]; + LApply (H a); [ Clear H; Intros H | XEAuto ]; + LApply H; [ Clear H; Intros H | XAuto ]; + XElim H; Intros. + +(* NOTE: This can be generalized removing the last two premises *) + Theorem ty0_gen_cvoid: (g:?; c:?; t1,t2:?) (ty0 g c t1 t2) -> + (e:?; u:?; d:?) (drop d (0) c (CTail e (Bind Void) u)) -> + (a:?) (wf0 g a) -> (drop (1) d c a) -> + (EX y1 y2 | t1 = (lift (1) d y1) & + t2 = (lift (1) d y2) & + (ty0 g a y1 y2) + ). + Intros until 1; XElim H; Intros. +(* case 1 : ty0_conv *) + Repeat IH d a; Rewrite H0 in H3; Rewrite H7 in H3; Pc3Gen; XEAuto. +(* case 2 : ty0_sort *) + EApply ex3_2_intro; Try Rewrite lift_sort; XEAuto. +(* case 3 : ty0_abbr *) + Apply (lt_eq_gt_e n d0); Intros. +(* case 3.1 : n < d0 *) + DropDis; Rewrite minus_x_Sy in H7; [ DropGenBase | XAuto ]. + Rewrite (lt_plus_minus n d0) in H5; [ Idtac | XAuto ]. + DropDis; Rewrite H0 in H2; Clear H0 H1 u. + IH '(minus d0 (S n)) x1; Rewrite H1; Clear H1 t. + LiftGen; Rewrite <- H0 in H2; Clear H0 x2. + Rewrite <- lift_d; [ Idtac | XAuto ]. + Rewrite <- le_plus_minus; [ Idtac | XAuto ]. + EApply ex3_2_intro; [ Rewrite lift_bref_lt | Idtac | EApply ty0_abbr ]; XEAuto. +(* case 3.2 : n = d0 *) + Rewrite H6 in H0; DropDis; Inversion H0. +(* case 3.3 : n > d0 *) + Clear H2 H3 c e t1 t2 u0; DropDis. + Pattern 1 n; Rewrite (lt_plus_minus (0) n); [ Idtac | XEAuto ]. + Arith4c '(0) '(minus n (1)). + EApply ex3_2_intro; + [ Rewrite lift_bref_ge + | Rewrite lift_free; Simpl + | Pattern 2 n; Rewrite (minus_x_SO n) + ]; XEAuto. +(* case 4 : ty0_abst *) + Apply (lt_eq_gt_e n d0); Intros. +(* case 4.1 : n < d0 *) + DropDis; Rewrite minus_x_Sy in H7; [ DropGenBase | XAuto ]. + Rewrite (lt_plus_minus n d0) in H5; [ Idtac | XAuto ]. + DropDis; Rewrite H0; Rewrite H0 in H2; Clear H0 H1 u. + IH '(minus d0 (S n)) x1; Clear H1 t. + LiftGen; Rewrite <- H0 in H2; Clear H0 x2. + Rewrite <- lift_d; [ Idtac | XAuto ]. + Rewrite <- le_plus_minus; [ Idtac | XAuto ]. + EApply ex3_2_intro; [ Rewrite lift_bref_lt | Idtac | EApply ty0_abst ]; XEAuto. +(* case 4.2 : n = d0 *) + Rewrite H6 in H0; DropDis; Inversion H0. +(* case 4.3 : n > d0 *) + Clear H2 H3 c e t1 t2 u0; DropDis. + Pattern 1 n; Rewrite (lt_plus_minus (0) n); [ Idtac | XEAuto ]. + Arith4c '(0) '(minus n (1)). + EApply ex3_2_intro; + [ Rewrite lift_bref_ge + | Rewrite lift_free; [ Simpl | Simpl | Idtac ] + | Pattern 2 n; Rewrite (minus_x_SO n) + ]; XEAuto. +(* case 5 : ty0_bind *) + IH d a; Rewrite H0; Rewrite H0 in H2; Rewrite H0 in H4; Clear H H0 H1 H3 H8 u t. + IH '(S d) '(CTail a (Bind b) x0); Rewrite H; Rewrite H in H2; Clear H H0 t3 t4. + IH '(S d) '(CTail a (Bind b) x0); Rewrite H; Clear H t0. + LiftGen; Rewrite <- H in H2; Clear H x5. + LiftTailRwBack; XEAuto. +(* case 6 : ty0_appl *) + IH d a; Rewrite H2; Clear H H1 H2 v. + LiftGenBase; Rewrite H in H7; Rewrite H1; Rewrite H1 in H0; Rewrite H2; Clear H H1 H2 u t x1. + IH d a; Rewrite H; Clear H w. + LiftGen; Rewrite <- H in H1; Clear H x4. + LiftTailRwBack; XEAuto. +(* case 7 : ty0_cast *) + Rename u into u0. + IH d a; Rewrite H2 in H0; Rewrite H2; Clear H H1 H2 H6 t3 t4. + IH d a; Rewrite H; Clear H t0. + LiftGen; Rewrite <- H in H1; Clear H x3. + LiftTailRwBack; XEAuto. + Qed. + + End ty0_gen_cvoid. + + Tactic Definition Ty0GenContext := + Match Context With + | [ H: (ty0 ?1 (CTail ?2 (Bind Abbr) ?3) ?4 ?5) |- ? ] -> + LApply (ty0_gen_cabbr ?1 (CTail ?2 (Bind Abbr) ?3) ?4 ?5); [ Clear H; Intros H | XAuto ]; + LApply (H ?2 ?3 (0)); [ Clear H; Intros H | XAuto ]; + LApply (H (CTail ?2 (Bind Abbr) ?3)); [ Clear H; Intros H | XAuto ]; + LApply (H ?2); [ Clear H; Intros H | XAuto ]; + LApply H; [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | [ H: (ty0 ?1 (CTail ?2 (Bind Void) ?3) ?4 ?5) |- ? ] -> + LApply (ty0_gen_cvoid ?1 (CTail ?2 (Bind Void) ?3) ?4 ?5); [ Clear H; Intros H | XAuto ]; + LApply (H ?2 ?3 (0)); [ Clear H; Intros H | XAuto ]; + LApply (H ?2); [ Clear H; Intros H | XAuto ]; + LApply H; [ Clear H; Intros H | XAuto ]; + XElim H; Intros + | _ -> Ty0GenBase. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/ty0_lift.v b/helm/coq-contribs/LAMBDA-TYPES/ty0_lift.v new file mode 100644 index 000000000..107a4ca89 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/ty0_lift.v @@ -0,0 +1,65 @@ +Require lift_props. +Require drop_props. +Require pc3_props. +Require ty0_defs. + +(*#* #caption "main properties of typing" #clauses ty0_props *) + + Section ty0_lift. (*******************************************************) + +(*#* #caption "lift preserves types" *) +(*#* #cap #cap t1, t2 #alpha c in C1, e in C2, d in i *) + + Theorem ty0_lift : (g:?; e:?; t1,t2:?) (ty0 g e t1 t2) -> + (c:?) (wf0 g c) -> (d,h:?) (drop h d c e) -> + (ty0 g c (lift h d t1) (lift h d t2)). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1 : ty0_conv *) + XEAuto. +(* case 2 : ty0_sort *) + Repeat Rewrite lift_sort; XAuto. +(* case 3 : ty0_abbr *) + Apply (lt_le_e n d0); Intros; DropDis. +(* case 3.1 : n < d0 *) + Rewrite minus_x_Sy in H4; [ Idtac | XAuto ]. + DropGenBase; Rewrite H4 in H0; Clear H4 x. + Rewrite lift_bref_lt; [ Idtac | XAuto ]. + Arith8 d0 '(S n); Rewrite lift_d; [ Arith8' d0 '(S n) | XAuto ]. + EApply ty0_abbr; XEAuto. +(* case 3.2 : n >= d0 *) + Rewrite lift_bref_ge; [ Idtac | XAuto ]. + Arith7' n; Rewrite lift_free; [ Idtac | Simpl; XAuto | XAuto ]. + Rewrite (plus_sym h (S n)); Simpl; XEAuto. +(* case 4: ty0_abst *) + Apply (lt_le_e n d0); Intros; DropDis. +(* case 4.1 : n < d0 *) + Rewrite minus_x_Sy in H4; [ Idtac | XAuto ]. + DropGenBase; Rewrite H4 in H0; Clear H4 x. + Rewrite lift_bref_lt; [ Idtac | XAuto ]. + Arith8 d0 '(S n); Rewrite lift_d; [ Arith8' d0 '(S n) | XAuto ]. + EApply ty0_abst; XEAuto. +(* case 4.2 : n >= d0 *) + Rewrite lift_bref_ge; [ Idtac | XAuto ]. + Arith7' n; Rewrite lift_free; [ Idtac | Simpl; XAuto | XAuto ]. + Rewrite (plus_sym h (S n)); Simpl; XEAuto. +(* case 5: ty0_bind *) + LiftTailRw; Simpl; EApply ty0_bind; XEAuto. +(* case 6: ty0_appl *) + LiftTailRw; Simpl; EApply ty0_appl; [ Idtac | Rewrite <- lift_bind ]; XEAuto. +(* case 7: ty0_cast *) + LiftTailRw; XEAuto. + Qed. + + End ty0_lift. + + Hints Resolve ty0_lift : ltlc. + + Tactic Definition Ty0Lift b u := + Match Context With + [ H: (ty0 ?1 ?2 ?3 ?4) |- ? ] -> + LApply (ty0_lift ?1 ?2 ?3 ?4); [ Intros H_x | XAuto ]; + LApply (H_x (CTail ?2 (Bind b) u)); [ Clear H_x; Intros H_x | XEAuto ]; + LApply (H_x (0) (1)); [ Clear H_x; Intros | XAuto ]. diff --git a/helm/coq-contribs/LAMBDA-TYPES/ty0_props.v b/helm/coq-contribs/LAMBDA-TYPES/ty0_props.v new file mode 100644 index 000000000..d51266a54 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/ty0_props.v @@ -0,0 +1,107 @@ +Require drop_props. +Require pc3_props. +Require ty0_defs. +Require ty0_lift. + + Section ty0_correct. (****************************************************) + +(*#* #caption "correctness of types" *) +(*#* #cap #cap c, t1, t2 #alpha t in T3 *) + + Theorem ty0_correct : (g:?; c:?; t1,t2:?) + (ty0 g c t1 t2) -> (EX t | (ty0 g c t2 t)). + +(*#* #stop file *) + + Intros; XElim H; Intros. +(* case 1 : ty0_conv *) + XEAuto. +(* case 2 : ty0_sort *) + XEAuto. +(* case 3 : ty0_abbr *) + XElim H2; XEAuto. +(* case 4 : ty0_abst *) + XEAuto. +(* case 5 : ty0_bind *) + XElim H4; XEAuto. +(* case 6 : ty0_appl *) + XElim H0; XElim H2; Intros. + Ty0GenBase; XEAuto. +(* case 7 : ty0_cast *) + XAuto. + Qed. + + End ty0_correct. + + Tactic Definition Ty0Correct := + Match Context With + [ _: (ty0 ?1 ?2 ?3 ?4) |- ? ] -> + LApply (ty0_correct ?1 ?2 ?3 ?4); [ Intros H_x | XAuto ]; + XElim H_x; Intros. + +(*#* #start file *) + + Section ty0_shift. (******************************************************) + +(*#* #caption "shift lemma for types" *) +(*#* #cap #cap t1, t2 #alpha c in C1, e in C2 *) + + Theorem ty0_shift : (h:?; c,e:?) (drop h (0) c e) -> + (g:?; t1,t2:?) (ty0 g c t1 t2) -> (wf0 g e) -> + (ty0 g e (app c h t1) (app c h t2)). + +(*#* #stop file *) + + XElim h. +(* case 1 : h = 0 *) + Intros; DropGenBase; Rewrite <- H. + Repeat Rewrite app_O; XAuto. +(* case 2 : h > 0 *) + Intros h IHh; XElim c. +(* case 2.1 : CSort *) + Intros; DropGenBase; Rewrite H. + Simpl; XAuto. +(* case 2.2 : CTail k *) + Intros c IHc; Clear IHc; XElim k; Intros; Wf0Ty0. + DropGenBase; Move H0 after H2; Ty0Correct. + Simpl; Apply IHh; [ Idtac | EApply ty0_bind | Idtac ]; XEAuto. + Qed. + + End ty0_shift. + + Hints Resolve ty0_shift : ltlc. + +(*#* #start file *) + + Section ty0_unique. (*****************************************************) + +(*#* #caption "uniqueness of types" *) +(*#* #cap #cap c, t1, t2 #alpha u in T *) + + Theorem ty0_unique : (g:?; c:?; u,t1:?) (ty0 g c u t1) -> + (t2:?) (ty0 g c u t2) -> (pc3 c t1 t2). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1 : ty0_conv *) + XEAuto. +(* case 2 : ty0_sort *) + Ty0GenBase; XAuto. +(* case 3 : ty0_abbr *) + Ty0GenBase; DropDis; Inversion H4. + Rewrite H7 in H2; Rewrite H8 in H2; XEAuto. +(* case 4 : ty0_abst *) + Ty0GenBase; DropDis; Inversion H4. + Rewrite H7 in H2; Rewrite H8 in H2; XEAuto. +(* case 5 : ty0_bind *) + Ty0GenBase; XEAuto. +(* case 6 : ty0_appl *) + Ty0GenBase; EApply pc3_t; [ Idtac | EApply H3 ]; XEAuto. +(* case 7 : ty0_cast *) + Ty0GenBase; XEAuto. + Qed. + + End ty0_unique. + + Hints Resolve ty0_unique : ltlc. diff --git a/helm/coq-contribs/LAMBDA-TYPES/ty0_sred.v b/helm/coq-contribs/LAMBDA-TYPES/ty0_sred.v new file mode 100644 index 000000000..dc185a95a --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/ty0_sred.v @@ -0,0 +1,250 @@ +Require lift_gen. +Require subst1_gen. +Require csubst1_defs. +Require pr0_lift. +Require pr0_subst1. +Require cpr0_defs. +Require cpr0_props. +Require pc3_props. +Require pc3_gen. +Require ty0_defs. +Require ty0_lift. +Require ty0_props. +Require ty0_subst0. +Require ty0_gen_context. +Require csub0_defs. + +(*#* #caption "subject reduction" #clauses *) + +(*#* #stop file *) + + Section ty0_sred_cpr0_pr0. (**********************************************) + + Tactic Definition IH H c2 t2 := + LApply (H c2); [ Intros H_x | XEAuto ]; + LApply H_x; [ Clear H_x; Intros H_x | XAuto ]; + LApply (H_x t2); [ Clear H_x; Intros | XEAuto ]. + + Tactic Definition IH0 := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 ?2 c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (ty0 ?1 ?2 ?3 ?4) |- ? ] -> + IH H1 ?5 ?3. + + Tactic Definition IH0c := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 ?2 c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (ty0 ?1 ?2 ?3 ?4) |- ? ] -> + IH H1 ?5 ?3; Clear H1. + + Tactic Definition IH0B := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 (CTail ?2 (Bind ?6) ?7) c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (ty0 ?1 (CTail ?2 (Bind ?6) ?7) ?3 ?4) |- ? ] -> + IH H1 '(CTail ?5 (Bind ?6) ?7) ?3. + + Tactic Definition IH0Bc := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 (CTail ?2 (Bind ?6) ?7) c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (ty0 ?1 (CTail ?2 (Bind ?6) ?7) ?3 ?4) |- ? ] -> + IH H1 '(CTail ?5 (Bind ?6) ?7) ?3; Clear H1. + + Tactic Definition IH1 := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 ?2 c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (pr0 ?3 ?6) |- ? ] -> + IH H1 ?5 ?6. + + Tactic Definition IH1c := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 ?2 c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (pr0 ?3 ?6) |- ? ] -> + IH H1 ?5 ?6; Clear H1. + + Tactic Definition IH1Bc := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 (CTail ?2 (Bind ?7) ?8) c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (pr0 ?3 ?6) |- ? ] -> + IH H1 '(CTail ?5 (Bind ?7) ?8) ?6; Clear H1. + + Tactic Definition IH1BLc := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 (CTail ?2 (Bind ?7) ?8) c2)->(t2:T)(pr0 (lift ?10 ?11 ?3) t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (pr0 ?3 ?6) |- ? ] -> + IH H1 '(CTail ?5 (Bind ?7) ?8) '(lift ?10 ?11 ?6); Clear H1. + + Tactic Definition IH1T := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 ?2 c2)->(t2:T)(pr0 (TTail ?7 ?8 ?3) t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (pr0 ?3 ?6) |- ? ] -> + IH H1 ?5 '(TTail ?7 ?8 ?6). + + Tactic Definition IH1T2c := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 ?2 c2)->(t2:T)(pr0 (TTail ?7 ?8 ?3) t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (pr0 ?3 ?6); H4: (pr0 ?8 ?9) |- ? ] -> + IH H1 ?5 '(TTail ?7 ?9 ?6); Clear H1. + + Tactic Definition IH3B := + Match Context With + [ H1: (c2:C) (wf0 ?1 c2)->(cpr0 (CTail ?2 (Bind ?7) ?8) c2)->(t2:T)(pr0 ?3 t2)->(ty0 ?1 c2 t2 ?4); + H2: (cpr0 ?2 ?5); H3: (pr0 ?3 ?6); H4: (pr0 ?8 ?9) |- ? ] -> + IH H1 '(CTail ?5 (Bind ?7) ?9) ?6. + +(*#* #start file *) + +(*#* #caption "base case" *) +(*#* #cap #cap c1, c2 #alpha t1 in T, t2 in T1, t in T2 *) + + Theorem ty0_sred_cpr0_pr0 : (g:?; c1:?; t1,t:?) (ty0 g c1 t1 t) -> + (c2:?) (wf0 g c2) -> (cpr0 c1 c2) -> + (t2:?) (pr0 t1 t2) -> (ty0 g c2 t2 t). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1 : ty0_conv *) + IH1c; IH0c; EApply ty0_conv; XEAuto. +(* case 2 : ty0_sort *) + Inversion H2; XAuto. +(* case 3 : ty0_abbr *) + Inversion H5; Cpr0Drop; IH1c; XEAuto. +(* case 4 : ty0_abst *) + Intros; Inversion H5; Cpr0Drop; IH0; IH1. + EApply ty0_conv; + [ EApply ty0_lift; [ Idtac | XAuto | XEAuto ] + | EApply ty0_abst + | EApply pc3_lift ]; XEAuto. +(* case 5 : ty0_bind *) + Intros; Inversion H7; Clear H7. +(* case 5.1 : pr0_refl *) + IH0c; IH0Bc; IH0Bc. + EApply ty0_bind; XEAuto. +(* case 5.2 : pr0_cont *) + IH0; IH0B; Ty0Correct; IH3B; Ty0Correct. + EApply ty0_conv; [ EApply ty0_bind | EApply ty0_bind | Idtac ]; XEAuto. +(* case 5.3 : pr0_delta *) + Rewrite <- H8 in H1; Rewrite <- H8 in H2; + Rewrite <- H8 in H3; Rewrite <- H8 in H4; Clear H8 b. + IH0; IH0B; Ty0Correct; IH3B; Ty0Correct. + EApply ty0_conv; [ EApply ty0_bind | EApply ty0_bind | Idtac ]; XEAuto. +(* case 5.4 : pr0_zeta *) + Rewrite <- H11 in H1; Rewrite <- H11 in H2; Clear H8 H9 H10 H11 b0 t2 t7 u0. + IH0; IH1BLc; Move H3 after H8; IH0Bc; Ty0Correct; Move H8 after H4; Clear H H0 H1 H3 H6 c c1 t t1; + NewInduction b. +(* case 5.4.1 : Abbr *) + Ty0GenContext; Subst1Gen; LiftGen; Rewrite H in H1; Clear H x0. + EApply ty0_conv; + [ EApply ty0_bind; XEAuto | XEAuto + | EApply pc3_pr3_x; + EApply (pr3_t (TTail (Bind Abbr) u (lift (1) (0) x1))); XEAuto ]. +(* case 5.4.2 : Abst *) + EqFalse. +(* case 5.4.3 : Void *) + Ty0GenContext; Rewrite H0; Rewrite H0 in H2; Clear H0 t3. + LiftGen; Rewrite <- H in H1; Clear H x0. + EApply ty0_conv; [ EApply ty0_bind; XEAuto | XEAuto | XAuto ]. +(* case 6 : ty0_appl *) + Intros; Inversion H5; Clear H5. +(* case 6.1 : pr0_refl *) + IH0c; IH0c; EApply ty0_appl; XEAuto. +(* case 6.2 : pr0_cont *) + Clear H6 H7 H8 H9 c1 k t t1 t2 t3 u1. + IH0; Ty0Correct; Ty0GenBase; IH1c; IH0; IH1c. + EApply ty0_conv; + [ EApply ty0_appl; [ XEAuto | EApply ty0_bind; XEAuto ] + | EApply ty0_appl; XEAuto + | XEAuto ]. +(* case 6.3 : pr0_beta *) + Rewrite <- H7 in H1; Rewrite <- H7 in H2; Clear H6 H7 H9 c1 t t1 t2 v v1. + IH1T; IH0c; Ty0Correct; Ty0GenBase; IH0; IH1c. + Move H5 after H13; Ty0GenBase; Pc3Gen; Repeat CSub0Ty0. + EApply ty0_conv; + [ Apply ty0_appl; [ Idtac | EApply ty0_bind ] + | EApply ty0_bind + | Apply (pc3_t (TTail (Bind Abbr) v2 t0)) + ]; XEAuto. +(* case 6.4 : pr0_delta *) + Rewrite <- H7 in H1; Rewrite <- H7 in H2; Clear H6 H7 H11 c1 t t1 t2 v v1. + IH1T2c; Clear H1; Ty0Correct; NonLinear; Ty0GenBase; IH1; IH0c. + Move H5 after H1; Ty0GenBase; Pc3Gen; Rewrite lift_bind in H0. + Move H1 after H0; Ty0Lift b u2; Rewrite lift_bind in H17. + Ty0GenBase. + EApply ty0_conv; + [ Apply ty0_appl; [ Idtac | EApply ty0_bind ]; XEAuto + | EApply ty0_bind; + [ Idtac + | EApply ty0_appl; [ EApply ty0_lift | EApply ty0_conv ] + | EApply ty0_appl; [ EApply ty0_lift | EApply ty0_bind ] + ]; XEAuto + | Idtac ]. + Rewrite <- lift_bind; Apply pc3_pc1; + Apply (pc1_u (TTail (Flat Appl) v2 (TTail (Bind b) u2 (lift (1) (0) (TTail (Bind Abst) u t0))))); XAuto. +(* case 7 : ty0_cast *) + Intros; Inversion H5; Clear H5. +(* case 7.1 : pr0_refl *) + IH0c; IH0c; EApply ty0_cast; XEAuto. +(* case 7.2 : pr0_cont *) + Clear H6 H7 H8 H9 c1 k u1 t t1 t4 t5. + IH0; IH1c; IH1c. + EApply ty0_conv; + [ XEAuto + | EApply ty0_cast; [ EApply ty0_conv; XEAuto | XEAuto ] + | XAuto ]. +(* case 7.3 : pr0_eps *) + XAuto. + Qed. + + End ty0_sred_cpr0_pr0. + + Section ty0_sred_pr3. (**********************************************) + + Theorem ty0_sred_pr1 : (c:?; t1,t2:?) (pr1 t1 t2) -> + (g:?; t:?) (ty0 g c t1 t) -> + (ty0 g c t2 t). + Intros until 1; XElim H; Intros. +(* case 1 : pr1_r *) + XAuto. +(* case 2 : pr1_u *) + EApply H1; EApply ty0_sred_cpr0_pr0; XEAuto. + Qed. + + Theorem ty0_sred_pr2 : (c:?; t1,t2:?) (pr2 c t1 t2) -> + (g:?; t:?) (ty0 g c t1 t) -> + (ty0 g c t2 t). + Intros until 1; XElim H; Intros. +(* case 1 : pr2_pr0 *) + EApply ty0_sred_cpr0_pr0; XEAuto. +(* case 2 : pr2_u *) + XEAuto. + Qed. + +(*#* #start file *) + +(*#* #caption "general case" *) +(*#* #cap #cap c #alpha t1 in T, t2 in T1, t in T2 *) + + Theorem ty0_sred_pr3 : (c:?; t1,t2:?) (pr3 c t1 t2) -> + (g:?; t:?) (ty0 g c t1 t) -> + (ty0 g c t2 t). + +(*#* #stop file *) + + Intros until 1; XElim H; Intros. +(* case 1 : pr3_r *) + XAuto. +(* case 2 : pr3_u *) + EApply H1; EApply ty0_sred_pr2; XEAuto. + Qed. + + End ty0_sred_pr3. + + Tactic Definition Ty0SRed := + Match Context With + | [ H1: (pr3 ?1 ?2 ?3); H2: (ty0 ?4 ?1 ?2 ?5) |- ? ] -> + LApply (ty0_sred_pr3 ?1 ?2 ?3); [ Intros H_x | XAuto ]; + LApply (H_x ?4 ?5); [ Clear H2 H_x; Intros | XAuto ]. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/ty0_sred_props.v b/helm/coq-contribs/LAMBDA-TYPES/ty0_sred_props.v new file mode 100644 index 000000000..6fb7f17e1 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/ty0_sred_props.v @@ -0,0 +1,175 @@ +Require lift_props. +Require drop_props. +Require pc3_props. +Require pc3_gen. +Require ty0_defs. +Require ty0_props. +Require ty0_sred. + +(*#* #caption "corollaries of subject reduction" #clauses *) + +(*#* #stop file *) + + Section ty0_gen. (********************************************************) + + Tactic Definition IH e := + Match Context With + [ H0: (t:?; d:?) ?1 = (lift ?2 d t) -> ?; H1: ?1 = (lift ?2 ?3 ?4) |- ? ] -> + LApply (H0 ?4 ?3); [ Clear H0 H1; Intros H0 | XAuto ]; + LApply (H0 e); [ Clear H0; Intros H0 | XEAuto ]; + LApply H0; [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros. + +(*#* #start file *) + +(*#* #caption "generation lemma for lift" *) +(*#* #cap #cap t2 #alpha c in C1, e in C2, t1 in T, x in T1, d in i *) + + Theorem ty0_gen_lift : (g:?; c:?; t1,x:?; h,d:?) + (ty0 g c (lift h d t1) x) -> + (e:?) (wf0 g e) -> (drop h d c e) -> + (EX t2 | (pc3 c (lift h d t2) x) & (ty0 g e t1 t2)). + +(*#* #stop file *) + + Intros until 1; InsertEq H '(lift h d t1); + UnIntro H d; UnIntro H t1; XElim H; Intros; + Rename x0 into t3; Rename x1 into d0. +(* case 1 : ty0_conv *) + IH e; XEAuto. +(* case 2 : ty0_sort *) + LiftGenBase; Rewrite H0; Clear H0 t. + EApply ex2_intro; [ Rewrite lift_sort; XAuto | XAuto ]. +(* case 3 : ty0_abbr *) + Apply (lt_le_e n d0); Intros. +(* case 3.1 : n < d0 *) + LiftGenBase; DropS; Rewrite H3; Clear H3 t3. + Rewrite (le_plus_minus (S n) d0); [ Idtac | XAuto ]. + Rewrite (lt_plus_minus n d0) in H5; [ DropDis; IH x1 | XAuto ]. + EApply ex2_intro; + [ Rewrite lift_d; [ EApply pc3_lift; XEAuto | XEAuto ] + | EApply ty0_abbr; XEAuto ]. +(* case 3.2 : n >= d0 *) + Apply (lt_le_e n (plus d0 h)); Intros. +(* case 3.2.1 : n < d0 + h *) + LiftGenBase. +(* case 3.2.2 : n >= d0 + h *) + Rewrite (le_plus_minus_sym h n) in H3; [ Idtac | XEAuto ]. + LiftGenBase; DropDis; Rewrite H3; Clear H3 t3. + EApply ex2_intro; [ Idtac | EApply ty0_abbr; XEAuto ]. + Rewrite lift_free; [ Idtac | XEAuto | XAuto ]. + Rewrite <- plus_n_Sm; Rewrite <- le_plus_minus; XEAuto. +(* case 4 : ty0_abst *) + Apply (lt_le_e n d0); Intros. +(* case 4.1 : n < d0 *) + LiftGenBase; Rewrite H3; Clear H3 t3. + Rewrite (le_plus_minus (S n) d0); [ Idtac | XAuto ]. + Rewrite (lt_plus_minus n d0) in H5; [ DropDis; Rewrite H0; IH x1 | XAuto ]. + EApply ex2_intro; [ Rewrite lift_d | EApply ty0_abst ]; XEAuto. +(* case 4.2 : n >= d0 *) + Apply (lt_le_e n (plus d0 h)); Intros. +(* case 4.2.1 : n < d0 + h *) + LiftGenBase. +(* case 4.2.2 : n >= d0 + h *) + Rewrite (le_plus_minus_sym h n) in H3; [ Idtac | XEAuto ]. + LiftGenBase; DropDis; Rewrite H3; Clear H3 t3. + EApply ex2_intro; [ Idtac | EApply ty0_abst; XEAuto ]. + Rewrite lift_free; [ Idtac | XEAuto | XAuto ]. + Rewrite <- plus_n_Sm; Rewrite <- le_plus_minus; XEAuto. +(* case 5 : ty0_bind *) + LiftGenBase; Rewrite H5; Rewrite H8; Rewrite H8 in H2; Clear H5 t3. + Move H0 after H2; IH e; IH '(CTail e (Bind b) x0); Ty0Correct. + EApply ex2_intro; [ Rewrite lift_bind; XEAuto | XEAuto ]. +(* case 6 : ty0_appl *) + LiftGenBase; Rewrite H3; Rewrite H6; Clear H3 c t3 x y. + IH e; IH e; Pc3Gen; Pc3T; Pc3Gen; Pc3T. + Move H3 after H12; Ty0Correct; Ty0SRed; Ty0GenBase; Wf0Ty0. + EApply ex2_intro; + [ Rewrite lift_flat; Apply pc3_thin_dx; + Rewrite lift_bind; Apply pc3_tail_21; [ EApply pc3_pr3_x | Idtac ] + | EApply ty0_appl; + [ EApply ty0_conv + | EApply ty0_conv; [ EApply ty0_bind | Idtac | Idtac ] ] + ]; XEAuto. +(* case 7 : ty0_cast *) + LiftGenBase; Rewrite H3; Rewrite H6; Rewrite H6 in H0. + IH e; IH e; Pc3Gen; XEAuto. + Qed. + + End ty0_gen. + + Tactic Definition Ty0Gen := + Match Context With + | [ H0: (ty0 ?1 ?2 (lift ?3 ?4 ?5) ?6); + H1: (drop ?3 ?4 ?2 ?7) |- ? ] -> + LApply (ty0_gen_lift ?1 ?2 ?5 ?6 ?3 ?4); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?7); [ Clear H0; Intros H0 | XEAuto ]; + LApply H0; [ Clear H0 H1; Intros H0 | XAuto ]; + XElim H0; Intros + | [ H0: (ty0 ?1 ?2 (lift ?3 ?4 ?5) ?6); + _ : (wf0 ?1 ?7) |- ? ] -> + LApply (ty0_gen_lift ?1 ?2 ?5 ?6 ?3 ?4); [ Clear H0; Intros H0 | XAuto ]; + LApply (H0 ?7); [ Clear H0; Intros H0 | XAuto ]; + LApply H0; [ Clear H0; Intros H0 | XAuto ]; + XElim H0; Intros + | _ -> Ty0GenContext. + + Section ty0_sred_props. (*************************************************) + +(*#* #start file *) + +(*#* #caption "drop preserves well-formedness" *) +(*#* #cap #alpha c in C1, e in C2, d in i *) + + Theorem wf0_drop : (c,e:?; d,h:?) (drop h d c e) -> + (g:?) (wf0 g c) -> (wf0 g e). + +(*#* #stop proof *) + + XElim c. +(* case 1 : CSort *) + Intros; DropGenBase; Rewrite H; XAuto. +(* case 2 : CTail k *) + Intros c IHc; XElim k; ( + XElim d; + [ XEAuto + | Intros d IHd; Intros; + DropGenBase; Rewrite H; Rewrite H1 in H0; Clear IHd H H1 e t; + Inversion H0; Clear H3 H4 b0 u ]). +(* case 2.1 : Bind, d > 0 *) + Ty0Gen; XEAuto. + Qed. + +(*#* #start proof *) + +(*#* #caption "type reduction" *) +(*#* #cap #cap c, t1, t2 #alpha u in T *) + + Theorem ty0_tred : (g:?; c:?; u,t1:?) (ty0 g c u t1) -> + (t2:?) (pr3 c t1 t2) -> (ty0 g c u t2). + +(*#* #stop proof *) + + Intros; Ty0Correct; Ty0SRed; EApply ty0_conv; XEAuto. + Qed. + +(*#* #start proof *) + +(*#* #caption "subject conversion" *) +(*#* #cap #cap c, u1, u2, t1, t2 *) + + Theorem ty0_sconv : (g:?; c:?; u1,t1:?) (ty0 g c u1 t1) -> + (u2,t2:?) (ty0 g c u2 t2) -> + (pc3 c u1 u2) -> (pc3 c t1 t2). + +(*#* #stop file *) + + Intros; Pc3Confluence; Repeat Ty0SRed; XEAuto. + Qed. + + + End ty0_sred_props. + +(*#* #start file *) + +(*#* #single *) diff --git a/helm/coq-contribs/LAMBDA-TYPES/ty0_subst0.v b/helm/coq-contribs/LAMBDA-TYPES/ty0_subst0.v new file mode 100644 index 000000000..3e4703200 --- /dev/null +++ b/helm/coq-contribs/LAMBDA-TYPES/ty0_subst0.v @@ -0,0 +1,333 @@ +Require drop_props. +Require csubst0_defs. +Require pc3_props. +Require pc3_subst0. +Require ty0_defs. +Require ty0_lift. +Require ty0_props. + + Section ty0_fsubst0. (****************************************************) + +(*#* #stop macro *) + + Tactic Definition IH H0 v1 v2 v3 v4 v5 := + LApply (H0 v1 v2 v3 v4); [ Intros H_x | XEAuto ]; + LApply H_x; [ Clear H_x; Intros H_x | XEAuto ]; + LApply (H_x v5); [ Clear H_x; Intros | XEAuto ]. + + Tactic Definition IHT := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 ?1 ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) ?1 (CTail e (Bind Abbr) u0)) -> ?; + _: (subst0 ?4 ?5 ?2 ?6); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H ?4 ?5 ?1 ?6 ?9. + + Tactic Definition IHTb1 := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 (CTail ?1 (Bind ?11) ?10) ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) (CTail ?1 (Bind ?11) ?10) (CTail e (Bind Abbr) u0)) -> ?; + _: (subst0 ?4 ?5 ?10 ?6); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H '(S ?4) ?5 '(CTail ?1 (Bind ?11) ?6) ?2 ?9. + + Tactic Definition IHTb2 := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 (CTail ?1 (Bind ?11) ?10) ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) (CTail ?1 (Bind ?11) ?10) (CTail e (Bind Abbr) u0)) -> ?; + _: (subst0 (s (Bind ?11) ?4) ?5 ?2 ?6); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H '(S ?4) ?5 '(CTail ?1 (Bind ?11) ?10) ?6 ?9. + + Tactic Definition IHC := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 ?1 ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) ?1 (CTail e (Bind Abbr) u0)) -> ?; + _: (csubst0 ?4 ?5 ?1 ?6); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H ?4 ?5 ?6 ?2 ?9. + + Tactic Definition IHCb := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 (CTail ?1 (Bind ?11) ?10) ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) (CTail ?1 (Bind ?11) ?10) (CTail e (Bind Abbr) u0)) -> ?; + _: (csubst0 ?4 ?5 ?1 ?6); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H '(S ?4) ?5 '(CTail ?6 (Bind ?11) ?10) ?2 ?9. + + Tactic Definition IHTTb := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 (CTail ?1 (Bind ?11) ?10) ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) (CTail ?1 (Bind ?11) ?10) (CTail e (Bind Abbr) u0)) -> ?; + _: (subst0 ?4 ?5 ?10 ?6); + _: (subst0 (s (Bind ?11) ?4) ?5 ?2 ?7); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H '(S ?4) ?5 '(CTail ?1 (Bind ?11) ?6) ?7 ?9. + + Tactic Definition IHCT := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 ?1 ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) ?1 (CTail e (Bind Abbr) u0)) -> ?; + _: (csubst0 ?4 ?5 ?1 ?6); + _: (subst0 ?4 ?5 ?2 ?7); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H ?4 ?5 ?6 ?7 ?9. + + Tactic Definition IHCTb1 := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 (CTail ?1 (Bind ?11) ?10) ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) (CTail ?1 (Bind ?11) ?10) (CTail e (Bind Abbr) u0)) -> ?; + _: (csubst0 ?4 ?5 ?1 ?6); + _: (subst0 ?4 ?5 ?10 ?7); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H '(S ?4) ?5 '(CTail ?6 (Bind ?11) ?7) ?2 ?9. + + Tactic Definition IHCTb2 := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 (CTail ?1 (Bind ?11) ?10) ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) (CTail ?1 (Bind ?11) ?10) (CTail e (Bind Abbr) u0)) -> ?; + _: (csubst0 ?4 ?5 ?1 ?6); + _: (subst0 (s (Bind ?11) ?4) ?5 ?2 ?7); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H '(S ?4) ?5 '(CTail ?6 (Bind ?11) ?10) ?7 ?9. + + Tactic Definition IHCTTb := + Match Context With + [ H: (i:nat; u0:T; c2:C; t2:T) (fsubst0 i u0 (CTail ?1 (Bind ?11) ?10) ?2 c2 t2) -> + (wf0 ?3 c2) -> + (e:C) (drop i (0) (CTail ?1 (Bind ?11) ?10) (CTail e (Bind Abbr) u0)) -> ?; + _: (csubst0 ?4 ?5 ?1 ?6); + _: (subst0 ?4 ?5 ?10 ?7); + _: (subst0 (s (Bind ?11) ?4) ?5 ?2 ?8); + _: (drop ?4 (0) ?1 (CTail ?9 (Bind Abbr) ?5)) |- ? ] -> + IH H '(S ?4) ?5 '(CTail ?6 (Bind ?11) ?7) ?8 ?9. + +(*#* #start macro *) + +(*#* #caption "substitution preserves types" *) +(*#* #cap #cap c1, c2, e, t1, t2, t #alpha u in V *) + +(* NOTE: This breaks the mutual recursion between ty0_subst0 and ty0_csubst0 *) + Theorem ty0_fsubst0: (g:?; c1:?; t1,t:?) (ty0 g c1 t1 t) -> + (i:?; u,c2,t2:?) (fsubst0 i u c1 t1 c2 t2) -> + (wf0 g c2) -> + (e:?) (drop i (0) c1 (CTail e (Bind Abbr) u)) -> + (ty0 g c2 t2 t). + +(*#* #stop file *) + + Intros until 1; XElim H. +(* case 1: ty0_conv *) + Intros until 6; XElim H4; Intros. +(* case 1.1: fsubst0_t *) + IHT; EApply ty0_conv; XEAuto. +(* case 1.2: fsubst0_c *) + IHC; EApply ty0_conv; Try EApply pc3_fsubst0; XEAuto. +(* case 1.3: fsubst0_b *) + IHCT; IHCT; EApply ty0_conv; Try EApply pc3_fsubst0; XEAuto. +(* case 2: ty0_sort *) + Intros until 2; XElim H0; Intros. +(* case 2.1: fsubst0_t *) + Subst0GenBase. +(* case 2.2: fsubst0_c *) + XAuto. +(* case 2.3: fsubst0_b *) + Subst0GenBase. +(* case 3: ty0_abbr *) + Intros until 5; XElim H3; Intros; Clear c1 c2 t t1 t2. +(* case 3.1: fsubst0_t *) + Subst0GenBase; Rewrite H6; Rewrite <- H3 in H5; Clear H3 H6 i t3. + DropDis; Inversion H5; Rewrite <- H6 in H0; Rewrite H7 in H1; XEAuto. +(* case 3.2: fsubst0_c *) + Apply (lt_le_e n i); Intros; CSubst0Drop. +(* case 3.2.1: n < i, none *) + EApply ty0_abbr; XEAuto. +(* case 3.2.2: n < i, csubst0_fst *) + Inversion H0; CSubst0Drop. + Rewrite <- H10 in H7; Rewrite <- H11 in H7; Rewrite <- H11 in H8; Rewrite <- H12 in H8; + Clear H0 H10 H11 H12 x0 x1 x2. + DropDis; Rewrite minus_x_Sy in H0; [ DropGenBase | XAuto ]. + IHT; EApply ty0_abbr; XEAuto. +(* case 3.2.3: n < i, csubst0_snd *) + Inversion H0; CSubst0Drop. + Rewrite <- H10 in H8; Rewrite <- H11 in H7; Rewrite <- H11 in H8; Rewrite <- H12 in H7; + Clear H0 H10 H11 H12 x0 x1 x3. + DropDis; Rewrite minus_x_Sy in H0; [ DropGenBase; CSubst0Drop | XAuto ]. + IHC; EApply ty0_abbr; XEAuto. +(* case 3.2.4: n < i, csubst0_both *) + Inversion H0; CSubst0Drop. + Rewrite <- H11 in H9; Rewrite <- H12 in H7; Rewrite <- H12 in H8; Rewrite <- H12 in H9; Rewrite <- H13 in H8; + Clear H0 H11 H12 H13 x0 x1 x3. + DropDis; Rewrite minus_x_Sy in H0; [ DropGenBase; CSubst0Drop | XAuto ]. + IHCT; EApply ty0_abbr; XEAuto. +(* case 3.2.5: n >= i *) + EApply ty0_abbr; XEAuto. +(* case 3.3: fsubst0_b *) + Subst0GenBase; Rewrite H7; Rewrite <- H3 in H4; Rewrite <- H3 in H6; Clear H3 H7 i t3. + DropDis; Inversion H6; Rewrite <- H7 in H0; Rewrite H8 in H1. + CSubst0Drop; XEAuto. +(* case 4: ty0_abst *) + Intros until 5; XElim H3; Intros; Clear c1 c2 t t1 t2. +(* case 4.1: fsubst0_t *) + Subst0GenBase; Rewrite H3 in H0; DropDis; Inversion H0. +(* case 4.2: fsubst0_c *) + Apply (lt_le_e n i); Intros; CSubst0Drop. +(* case 4.2.1: n < i, none *) + EApply ty0_abst; XEAuto. +(* case 4.2.2: n < i, csubst0_fst *) + Inversion H0; CSubst0Drop. + Rewrite <- H10 in H7; Rewrite <- H11 in H7; Rewrite <- H11 in H8; Rewrite <- H12 in H8; Rewrite <- H12; + Clear H0 H10 H11 H12 x0 x1 x2. + DropDis; Rewrite minus_x_Sy in H0; [ DropGenBase | XAuto ]. + IHT; EApply ty0_conv; + [ EApply ty0_lift | EApply ty0_abst | EApply pc3_lift ]; XEAuto. +(* case 4.2.3: n < i, csubst0_snd *) + Inversion H0; CSubst0Drop. + Rewrite <- H10 in H8; Rewrite <- H11 in H7; Rewrite <- H11 in H8; Rewrite <- H12 in H7; Rewrite <- H12; + Clear H0 H10 H11 H12 x0 x1 x3. + DropDis; Rewrite minus_x_Sy in H0; [ DropGenBase; CSubst0Drop | XAuto ]. + IHC; EApply ty0_abst; XEAuto. +(* case 4.2.4: n < i, csubst0_both *) + Inversion H0; CSubst0Drop. + Rewrite <- H11 in H9; Rewrite <- H12 in H7; Rewrite <- H12 in H8; Rewrite <- H12 in H9; Rewrite <- H13 in H8; Rewrite <- H13; + Clear H0 H11 H12 H13 x0 x1 x3. + DropDis; Rewrite minus_x_Sy in H0; [ DropGenBase; CSubst0Drop | XAuto ]. + IHCT; IHC; EApply ty0_conv; + [ EApply ty0_lift | EApply ty0_abst + | EApply pc3_lift; Try EApply pc3_fsubst0; Try Apply H0 + ]; XEAuto. +(* case 4.2.4: n >= i *) + EApply ty0_abst; XEAuto. +(* case 4.3: fsubst0_b *) + Subst0GenBase; Rewrite H3 in H0; DropDis; Inversion H0. +(* case 5: ty0_bind *) + Intros until 7; XElim H5; Intros; Clear H4. +(* case 5.1: fsubst0_t *) + Subst0GenBase; Rewrite H4; Clear H4 t6. +(* case 5.1.1: subst0 on left argument *) + Ty0Correct; IHT; IHTb1; Ty0Correct. + EApply ty0_conv; + [ EApply ty0_bind | EApply ty0_bind | EApply pc3_fsubst0 ]; XEAuto. +(* case 5.1.2: subst0 on right argument *) + IHTb2; Ty0Correct; EApply ty0_bind; XEAuto. +(* case 5.1.3: subst0 on both arguments *) + Ty0Correct; IHT; IHTb1; IHTTb; Ty0Correct. + EApply ty0_conv; + [ EApply ty0_bind | EApply ty0_bind | EApply pc3_fsubst0 ]; XEAuto. +(* case 5.2: fsubst0_c *) + IHC; IHCb; Ty0Correct; EApply ty0_bind; XEAuto. +(* case 5.3: fsubst0_b *) + Subst0GenBase; Rewrite H4; Clear H4 t6. +(* case 5.3.1: subst0 on left argument *) + IHC; IHCb; Ty0Correct; Ty0Correct; IHCT; IHCTb1; Ty0Correct. + EApply ty0_conv; + [ EApply ty0_bind | EApply ty0_bind + | EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ]; XEAuto. +(* case 5.3.2: subst0 on right argument *) + IHC; IHCTb2; Ty0Correct; EApply ty0_bind; XEAuto. +(* case 5.3.3: subst0 on both arguments *) + IHC; IHCb; Ty0Correct; Ty0Correct; IHCT; IHCTTb; Ty0Correct. + EApply ty0_conv; + [ EApply ty0_bind | EApply ty0_bind + | EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ]; XEAuto. +(* case 6: ty0_appl *) + Intros until 5; XElim H3; Intros. +(* case 6.1: fsubst0_t *) + Subst0GenBase; Rewrite H3; Clear H3 c1 c2 t t1 t2 t3. +(* case 6.1.1: subst0 on left argument *) + Ty0Correct; Ty0GenBase; IHT; Ty0Correct. + EApply ty0_conv; + [ EApply ty0_appl | EApply ty0_appl | EApply pc3_fsubst0 ]; XEAuto. +(* case 6.1.2: subst0 on right argument *) + IHT; EApply ty0_appl; XEAuto. +(* case 6.1.3: subst0 on both arguments *) + Ty0Correct; Ty0GenBase; Move H after H10; Ty0Correct; IHT; Clear H2; IHT. + EApply ty0_conv; + [ EApply ty0_appl | EApply ty0_appl | EApply pc3_fsubst0 ]; XEAuto. +(* case 6.2: fsubst0_c *) + IHC; Clear H2; IHC; EApply ty0_appl; XEAuto. +(* case 6.3: fsubst0_b *) + Subst0GenBase; Rewrite H3; Clear H3 c1 c2 t t1 t2 t3. +(* case 6.3.1: subst0 on left argument *) + IHC; Ty0Correct; Ty0GenBase; Clear H2; IHC; IHCT. + EApply ty0_conv; + [ EApply ty0_appl | EApply ty0_appl + | EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ]; XEAuto. +(* case 6.3.2: subst0 on right argument *) + IHCT; Clear H2; IHC; EApply ty0_appl; XEAuto. +(* case 6.3.3: subst0 on both arguments *) + IHC; Ty0Correct; Ty0GenBase; IHCT; Clear H2; IHC; Ty0Correct; IHCT. + EApply ty0_conv; + [ EApply ty0_appl | EApply ty0_appl + | EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ]; XEAuto. +(* case 7: ty0_cast *) + Clear c1 t t1; Intros until 5; XElim H3; Intros; Clear c2 t3. +(* case 7.1: fsubst0_t *) + Subst0GenBase; Rewrite H3; Clear H3 t4. +(* case 7.1.1: subst0 on left argument *) + IHT; EApply ty0_conv; + [ Idtac + | EApply ty0_cast; + [ EApply ty0_conv; [ Idtac | Idtac | Apply pc3_s; EApply pc3_fsubst0 ] + | Idtac ] + | EApply pc3_fsubst0 ]; XEAuto. +(* case 7.1.2: subst0 on right argument *) + IHT; EApply ty0_cast; XEAuto. +(* case 7.1.3: subst0 on both arguments *) + IHT; Clear H2; IHT. + EApply ty0_conv; + [ Idtac + | EApply ty0_cast; + [ EApply ty0_conv; [ Idtac | Idtac | Apply pc3_s; EApply pc3_fsubst0 ] + | Idtac ] + | EApply pc3_fsubst0 ]; XEAuto. +(* case 7.2: fsubst0_c *) + IHC; Clear H2; IHC; EApply ty0_cast; XEAuto. +(* case 6.3: fsubst0_b *) + Subst0GenBase; Rewrite H3; Clear H3 t4. +(* case 7.3.1: subst0 on left argument *) + IHC; IHCT; Clear H2; IHC. + EApply ty0_conv; + [ Idtac + | EApply ty0_cast; + [ EApply ty0_conv; [ Idtac | Idtac | Apply pc3_s; EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ] + | Idtac ] + | EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ]; XEAuto. +(* case 7.3.2: subst0 on right argument *) + IHCT; IHC; EApply ty0_cast; XEAuto. +(* case 7.3.3: subst0 on both arguments *) + IHC; IHCT; Clear H2; IHCT. + EApply ty0_conv; + [ Idtac + | EApply ty0_cast; + [ EApply ty0_conv; [ Idtac | Idtac | Apply pc3_s; EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ] + | Idtac ] + | EApply pc3_fsubst0; [ Idtac | Idtac | XEAuto ] ]; XEAuto. + Qed. + + Theorem ty0_csubst0: (g:?; c1:?; t1,t2:?) (ty0 g c1 t1 t2) -> + (e:?; u:?; i:?) (drop i (0) c1 (CTail e (Bind Abbr) u)) -> + (c2:?) (wf0 g c2) -> (csubst0 i u c1 c2) -> + (ty0 g c2 t1 t2). + Intros; EApply ty0_fsubst0; XEAuto. + Qed. + + Theorem ty0_subst0: (g:?; c:?; t1,t:?) (ty0 g c t1 t) -> + (e:?; u:?; i:?) (drop i (0) c (CTail e (Bind Abbr) u)) -> + (t2:?) (subst0 i u t1 t2) -> (ty0 g c t2 t). + Intros; EApply ty0_fsubst0; XEAuto. + Qed. + + End ty0_fsubst0. + + Hints Resolve ty0_subst0 : ltlc. + diff --git a/helm/coq-contribs/SUBSETS.tgz b/helm/coq-contribs/SUBSETS.tgz deleted file mode 100644 index ad647f41706dd61116ab560acff54d566de9ea13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20442 zcmV(zK<2+6iwFSGxqCtY1MPi#cN;g7@BBOb6u2{)E7C_+B-xJdQtM=8M~XG;$Qn_S zXRo5eZIVs7*JP7!wkSEfv!DH<3a`SeyGhH=omufDGT9HH>Q{wAp#T(m=P!E)XT5KK z_XR)O+fR3&KYPai-QIcrY@7b8KEK=9-hJ}j^CwTA@9z9=duQhv|A#&Ml0>P`&7w>S z#(p=xzR5;e{JFaOf2W_Gl>h0${*ON&e3?47ceb~`d-^mce=hi4NB+A{o*Y;089^O4bEsxEn+#@mKrQ<@Dflyw-^|7v3s!!br;>=SBtib%Y8~b5q?ir2 zfV#6=Uh=2MW2paAniLDT$oX58#mx|@A|-9M-rn(=M(lj+WQ(%iad6XxEaYXfNCl?4kpJKY2}^RG z{}GjaE|k@V4hKLl8uIIdH$MZf|H0co`{(!RWJ*=ydjxBkiv4yt`}kNgzfe|dtGxcT^;=uq z|Gz$}{~sCky7xM2`v2|kw!d@w|0mDCd-~A-e~r&^GUdI7?A2OlSvlc9_anV&?sccU zxrRGb*)RDW(gAcB!T#d)Y|4A5>$JARfc_#Yg-KhpN82BbigdB)vY&5?gzafudxbhiKI-&&%B6`kLcolWcjnQfQPi%GZjuj!{--e)hA8?e~a z_+AJ*+GWqTo^0*3PQkuIm-5@mU$y^U$z_=oqpjur*HPF0cb>Zb|C6Urw;$U7*Z4>k zWCwTiSy8e@*&lG9WUJ+0=WQVyhHm6Z8M>SlS^1tjsJ}Ib51*=!YX4ebU%mZ5`R>W? z6Sw_8+kF`Sf0a+9Ik$S;K?je2AC#hhc$4GL#TE`+)Xn#4GU{{3f6`Cp^E4lA$zct< z;JTCyCMoN6dnqrj{fPIIV?Lf1uZ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