From 8b767a5aac248892fb1a5ed99aca6699f5f2b317 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Sat, 18 Aug 2018 15:02:43 +0200 Subject: Rename --- tests/Schematic_subgoal.thy | 64 -------------------------------------------- tests/Subgoal.thy | 65 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 64 deletions(-) delete mode 100644 tests/Schematic_subgoal.thy create mode 100644 tests/Subgoal.thy (limited to 'tests') diff --git a/tests/Schematic_subgoal.thy b/tests/Schematic_subgoal.thy deleted file mode 100644 index 5f20eac..0000000 --- a/tests/Schematic_subgoal.thy +++ /dev/null @@ -1,64 +0,0 @@ -theory Schematic_subgoal - imports "../HoTT" -begin - -text " - \subgoal\ converts schematic variables to fixed free variables, making it unsuitable for use in \schematic_goal\ proofs. - - This is a problem for syntheses which need to use induction (elimination rules), as these often have to be applied to fixed variables, while keeping any schematic variables intact. -" - -schematic_goal rpathcomp_synthesis: - assumes "A: U(i)" - shows "?a: \x:A. \y:A. x =\<^sub>A y \ (\z:A. y =\<^sub>A z \ x =\<^sub>A z)" - -text " - Try (and fail) to synthesize the constant for path composition, following the proof of \rpathcomp_type\ below. -" - -apply (rule Prod_intro) -prefer 2 - apply (rule Prod_intro) - prefer 2 - apply (rule Prod_intro) - prefer 2 - subgoal 123 for x y p - apply (rule Equal_elim[where ?x=x and ?y=y and ?A=A]) - oops - - -lemma rpathcomp_type: - assumes "A: U(i)" - shows "rpathcomp: \x:A. \y:A. x =\<^sub>A y \ (\z:A. y =\<^sub>A z \ x =\<^sub>A z)" -unfolding rpathcomp_def -apply standard -prefer 2 - subgoal premises 1 for x \ \\subgoal\ is the proof script version of \fix-assume-show\.\ - apply standard - prefer 2 - subgoal premises 2 for y - apply standard - prefer 2 - subgoal premises 3 for p - apply (rule Equal_elim[where ?x=x and ?y=y and ?A=A]) - \ \specifying \?A=A\ is crucial here to prevent the next \subgoal\ from binding a schematic ?A which should be instantiated to \A\.\ - prefer 2 - apply standard - prefer 2 - apply (rule Prod_intro) - prefer 2 - subgoal premises 4 for u z q - apply (rule Equal_elim[where ?x=u and ?y=z]) - apply (simple lems: assms 4) - done - apply (simple lems: assms 1 2 3) - done - apply (simple lems: assms 1 2) - done - apply fact - done -apply fact -done - - -end \ No newline at end of file diff --git a/tests/Subgoal.thy b/tests/Subgoal.thy new file mode 100644 index 0000000..2226f08 --- /dev/null +++ b/tests/Subgoal.thy @@ -0,0 +1,65 @@ +theory Subgoal + imports "../HoTT" +begin + +text " + \subgoal\ converts schematic variables to fixed free variables, making it unsuitable for use in \schematic_goal\ proofs. + This is the same thing as being unable to start a "sub-schematic goal" inside an ongoing proof. + + This is a problem for syntheses which need to use induction (elimination rules), as these often have to be applied to fixed variables, while keeping any schematic variables intact. +" + +schematic_goal rpathcomp_synthesis: + assumes "A: U(i)" + shows "?a: \x:A. \y:A. x =\<^sub>A y \ (\z:A. y =\<^sub>A z \ x =\<^sub>A z)" + +text " + Try (and fail) to synthesize the constant for path composition, following the proof of \rpathcomp_type\ below. +" + +apply (rule Prod_intro) +prefer 2 + apply (rule Prod_intro) + prefer 2 + apply (rule Prod_intro) + prefer 2 + subgoal 123 for x y p + apply (rule Equal_elim[where ?x=x and ?y=y and ?A=A]) + oops + + +lemma rpathcomp_type: + assumes "A: U(i)" + shows "rpathcomp: \x:A. \y:A. x =\<^sub>A y \ (\z:A. y =\<^sub>A z \ x =\<^sub>A z)" +unfolding rpathcomp_def +apply standard +prefer 2 + subgoal premises 1 for x \ \\subgoal\ is the proof script version of \fix-assume-show\.\ + apply standard + prefer 2 + subgoal premises 2 for y + apply standard + prefer 2 + subgoal premises 3 for p + apply (rule Equal_elim[where ?x=x and ?y=y and ?A=A]) + \ \specifying \?A=A\ is crucial here to prevent the next \subgoal\ from binding a schematic ?A which should be instantiated to \A\.\ + prefer 2 + apply standard + prefer 2 + apply (rule Prod_intro) + prefer 2 + subgoal premises 4 for u z q + apply (rule Equal_elim[where ?x=u and ?y=z]) + apply (simple lems: assms 4) + done + apply (simple lems: assms 1 2 3) + done + apply (simple lems: assms 1 2) + done + apply fact + done +apply fact +done + + +end \ No newline at end of file -- cgit v1.2.3