From f83534561085c224ab30343b945ee74d1ce547f4 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Tue, 14 Aug 2018 15:08:37 +0200 Subject: Equality inverse and composition done. Cleaned up methods and method example theory. --- ex/Methods.thy | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'ex') diff --git a/ex/Methods.thy b/ex/Methods.thy index d174dde..b0c5f92 100644 --- a/ex/Methods.thy +++ b/ex/Methods.thy @@ -1,6 +1,6 @@ (* Title: HoTT/ex/Methods.thy Author: Josh Chen - Date: Jul 2018 + Date: Aug 2018 HoTT method usage examples *) @@ -9,33 +9,40 @@ theory Methods imports "../HoTT" begin + lemma - assumes "A : U" "B: A \ U" "\x. x : A \ C x: B x \ U" - shows "\x:A. \y:B x. \z:C x y. \w:A. x =\<^sub>A w : U" -by (simple lems: assms) + assumes "A : U(i)" "B: A \ U(i)" "\x. x : A \ C x: B x \ U(i)" + shows "\x:A. \y:B x. \z:C x y. \w:A. x =\<^sub>A w : U(i)" +by (simple lem: assms) lemma - assumes "f : \x:A. \y: B x. \z: C x y. D x y z" + assumes "\x:A. \y: B x. \z: C x y. D x y z: U(i)" shows - "A : U" and - "B: A \ U" and - "\x. x : A \ C x: B x \ U" and - "\x y. \x : A; y : B x\ \ D x y: C x y \ U" + "A : U(i)" and + "B: A \ U(i)" and + "\x. x : A \ C x: B x \ U(i)" and + "\x y. \x : A; y : B x\ \ D x y: C x y \ U(i)" proof - - show "A : U" by (wellformed jdgmt: assms) - show "B: A \ U" by (wellformed jdgmt: assms) - show "\x. x : A \ C x: B x \ U" by (wellformed jdgmt: assms) - show "\x y. \x : A; y : B x\ \ D x y: C x y \ U" by (wellformed jdgmt: assms) + show + "A : U(i)" and + "B: A \ U(i)" and + "\x. x : A \ C x: B x \ U(i)" and + "\x y. \x : A; y : B x\ \ D x y: C x y \ U(i)" + by (derive lem: assms) qed -text "Typechecking:" +text "Typechecking and constructing inhabitants:" \ \Correctly determines the type of the pair\ -schematic_goal "\a : A; b : B\ \ (a, b) : ?A" by simple - -\ \Finds element\ -schematic_goal "\a : A; b : B\ \ ?x : A \ B" by simple +schematic_goal "\A: U(i); B: U(i); a : A; b : B\ \ : ?A" +by simple + +\ \Finds pair (too easy).\ +schematic_goal "\A: U(i); B: U(i); a : A; b : B\ \ ?x : A \ B" +apply (rule Sum_intro) +apply assumption+ +done end \ No newline at end of file -- cgit v1.2.3