From b01b8ee0f3472cb728f09463d0620ac8b8066bcb Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Wed, 27 Mar 2019 14:41:16 +0100 Subject: More progress. I think we are reaching the limit of what can be conveniently proved with the current implementation. --- Prod.thy | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'Prod.thy') diff --git a/Prod.thy b/Prod.thy index 75db657..a35138c 100644 --- a/Prod.thy +++ b/Prod.thy @@ -119,8 +119,36 @@ unfolding compose_def by (derive lems: assms cong) abbreviation id :: "t \ t" ("(id _)" [115] 114) where "id A \ \x: A. x" -lemma id_type [intro]: "\A. A: U i \ id A: A \ A" by derive - +lemma id_type: "\A. A: U i \ id A: A \ A" by derive + +lemma id_compl: + assumes [intro]: "A: U i" "B: U i" "f: A \ B" + shows "id B o[A] f \ f" +unfolding compose_def proof - + { + fix x assume [intro]: "x: A" + have "(id B)`(f`x) \ f`x" by derive + } + hence "\x: A. (id B)`(f`x) \ \x: A. f`x" by (derive lems: cong) derive + also have "\x: A. f`x \ f" by derive + finally show "\(x: A). (id B)`(f`x) \ f" by simp +qed + +lemma id_compr: + assumes [intro]: "A: U i" "B: U i" "f: A \ B" + shows "f o[A] id A \ f" +unfolding compose_def proof - + { + fix x assume [intro]: "x: A" + have "f`((id A)`x) \ f`x" by derive + } + hence "\x: A. f`((id A)`x) \ \x: A. f`x" by (derive lems: cong) derive + also have "\x: A. f`x \ f" by derive + finally show "\x: A. f`((id A)`x) \ f" by simp +qed + +declare id_type [intro] +lemmas id_comp [comp] = id_compl id_compr section \Universal quantification\ -- cgit v1.2.3