(* Title: HoTT/ProdProps.thy Author: Josh Chen Date: Aug 2018 Properties of the dependent product. *) theory ProdProps imports HoTT_Methods Prod begin section \Composition\ text " The following rule is admissible, but we cannot derive it only using the rules for the \-type. " lemma compose_comp': "\ A: U(i); \x. x: A \ b(x): B; \x. x: B \ c(x): C(x) \ \ (\<^bold>\x. c(x)) \ (\<^bold>\x. b(x)) \ \<^bold>\x. c(b(x))" oops text "However we can derive a variant with more explicit premises:" lemma compose_comp2: assumes "A: U(i)" "B: U(i)" and "C: B \ U(i)" and "\x. x: A \ b(x): B" and "\x. x: B \ c(x): C(x)" shows "(\<^bold>\x. c(x)) \ (\<^bold>\x. b(x)) \ \<^bold>\x. c(b(x))" proof (subst (0) comp) show "\<^bold>\x. (\<^bold>\u. c(u))`((\<^bold>\v. b(v))`x) \ \<^bold>\x. c(b(x))" proof (subst (0) comp) show "\<^bold>\x. c((\<^bold>\v. b(v))`x) \ \<^bold>\x. c(b(x))" proof - have *: "\x. x: A \ (\<^bold>\v. b(v))`x \ b(x)" by simple (rule assms) show "\<^bold>\x. c((\<^bold>\v. b(v))`x) \ \<^bold>\x. c(b(x))" proof (subst *) text "We can show associativity of composition in general." lemma compose_assoc: "(f \ g) \ h \ f \ (g \ h)" proof end