From 76deb7ae15fa00b5498ab43db020a0364499251e Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Fri, 6 Jul 2018 10:48:41 +0200 Subject: Added attributes to type elimination rules, not sure if these will actually be needed or useful later. Added [comp] attribute to be used by simplification met methods. --- scratch.thy | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'scratch.thy') diff --git a/scratch.thy b/scratch.thy index b90fd59..1c921bd 100644 --- a/scratch.thy +++ b/scratch.thy @@ -3,6 +3,59 @@ theory scratch begin -schematic_goal "\a : A; b : B\ \ ?x : A \ B" by simple +(* Typechecking *) +schematic_goal "\a : A; b : B\ \ (a,b) : ?A" by simple + + +(* Simplification *) + +notepad begin + +assume asm: + "f`a \ g" + "g`b \ \<^bold>\x:A. d" + "c : A" + "d : B" + +have "f`a`b`c \ d" by (simp add: asm | rule comp | derive lems: asm)+ + +end + +lemma "a : A \ indEqual[A] (\x y _. y =\<^sub>A x) (\x. refl(x)) a a refl(a) \ refl(a)" + by verify_simp + +lemma "\a : A; \x. x : A \ b x : X\ \ (\<^bold>\x:A. b x)`a \ b a" + by verify_simp + +lemma + assumes "a : A" and "\x. x : A \ b x : B x" + shows "(\<^bold>\x:A. b x)`a \ b a" + by (verify_simp lems: assms) + +lemma "\a : A; b : B a; B: A \ U\ \ (\<^bold>\x:A. \<^bold>\y:B x. c x y)`a`b \ c a b" +oops + +lemma + assumes + "(\<^bold>\x:A. \<^bold>\y:B x. c x y)`a \ \<^bold>\y:B a. c a y" + "(\<^bold>\y:B a. c a y)`b \ c a b" + shows "(\<^bold>\x:A. \<^bold>\y:B x. c x y)`a`b \ c a b" +apply (simp add: assms) +done + +lemmas lems = + Prod_comp[where ?A = "B a" and ?b = "\b. c a b" and ?a = b] + Prod_comp[where ?A = A and ?b = "\x. \<^bold>\y:B x. c x y" and ?a = a] + +lemma + assumes + "a : A" + "b : B a" + "B: A \ U" + "\x y. \x : A; y : B x\ \ c x y : D x y" + shows "(\<^bold>\x:A. \<^bold>\y:B x. c x y)`a`b \ c a b" +apply (verify_simp lems: assms) + + end \ No newline at end of file -- cgit v1.2.3