lemma function_imp_Pi: "\function(f); relation(f)\ \ f \ domain(f) -> range(f)" by (simp add: Pi_iff relation_def, blast)
lemma functionI: "\\x y y'. \\x,y\:r; :r\ \ y=y'\ \ function(r)" by (simp add: function_def, blast)
(*Functions are relations*) lemma fun_is_rel: "f \ Pi(A,B) \ f \ Sigma(A,B)" by (unfold Pi_def, blast)
lemma Pi_cong: "\A=A'; \x. x \ A' \ B(x)=B'(x)\ \ Pi(A,B) = Pi(A',B')" by (simp add: Pi_def cong add: Sigma_cong)
(*Sigma_cong, Pi_cong NOT given to Addcongs: they cause flex-flex pairs and the "Check your prover" error. Most
Sigmas and Pis are abbreviated as * or -> *)
(*Weakening one function type to another; see also Pi_type*) lemma fun_weaken_type: "\f \ A->B; B<=D\ \ f \ A->D" by (unfold Pi_def, best)
subsection\<open>Function Application\<close>
lemma apply_equality2: "\\a,b\: f; \a,c\: f; f \ Pi(A,B)\ \ b=c" by (unfold Pi_def function_def, blast)
(*Conclusion is flexible -- use rule_tac or else apply_funtype below!*) lemma apply_type [TC]: "\f \ Pi(A,B); a \ A\ \ f`a \ B(a)" by (blast intro: apply_Pair dest: fun_is_rel)
(*This version is acceptable to the simplifier*) lemma apply_funtype: "\f \ A->B; a \ A\ \ f`a \ B" by (blast dest: apply_type)
lemma apply_iff: "f \ Pi(A,B) \ \a,b\: f \ a \ A \ f`a = b" apply (frule fun_is_rel) apply (blast intro!: apply_Pair apply_equality) done
(*Refining one Pi type to another*) lemma Pi_type: "\f \ Pi(A,C); \x. x \ A \ f`x \ B(x)\ \ f \ Pi(A,B)" apply (simp only: Pi_iff) apply (blast dest: function_apply_equality) done
(*Such functions arise in non-standard datatypes, ZF/ex/Ntree for instance*) lemma Pi_Collect_iff: "(f \ Pi(A, \x. {y \ B(x). P(x,y)})) \<longleftrightarrow> f \<in> Pi(A,B) \<and> (\<forall>x\<in>A. P(x, f`x))" by (blast intro: Pi_type dest: apply_type)
lemma Pi_weaken_type: "\f \ Pi(A,B); \x. x \ A \ B(x)<=C(x)\ \ f \ Pi(A,C)" by (blast intro: Pi_type dest: apply_type)
(** Elimination of membership in a function **)
lemma domain_type: "\\a,b\ \ f; f \ Pi(A,B)\ \ a \ A" by (blast dest: fun_is_rel)
lemma range_type: "\\a,b\ \ f; f \ Pi(A,B)\ \ b \ B(a)" by (blast dest: fun_is_rel)
lemma Pair_mem_PiD: "\\a,b\: f; f \ Pi(A,B)\ \ a \ A \ b \ B(a) \ f`a = b" by (blast intro: domain_type range_type apply_equality)
subsection\<open>Lambda Abstraction\<close>
lemma lamI: "a \ A \ \ (\x\A. b(x))" unfolding lam_def apply (erule RepFunI) done
lemma lamE: "\p: (\x\A. b(x)); \x.\x \ A; p=\ \ P \<rbrakk> \<Longrightarrow> P" by (simp add: lam_def, blast)
lemma lamD: "\\a,c\: (\x\A. b(x))\ \ c = b(a)" by (simp add: lam_def)
lemma lam_type [TC]: "\\x. x \ A \ b(x): B(x)\ \ (\x\A. b(x)) \ Pi(A,B)" by (simp add: lam_def Pi_def function_def, blast)
lemma lam_funtype: "(\x\A. b(x)) \ A -> {b(x). x \ A}" by (blast intro: lam_type)
lemma function_lam: "function (\x\A. b(x))" by (simp add: function_def lam_def)
lemma relation_lam: "relation (\x\A. b(x))" by (simp add: relation_def lam_def)
lemma beta_if [simp]: "(\x\A. b(x)) ` a = (if a \ A then b(a) else 0)" by (simp add: apply_def lam_def, blast)
lemma beta: "a \ A \ (\x\A. b(x)) ` a = b(a)" by (simp add: apply_def lam_def, blast)
lemma fun_extension_iff: "\f \ Pi(A,B); g \ Pi(A,C)\ \ (\a\A. f`a = g`a) \ f=g" by (blast intro: fun_extension)
(*thm by Mark Staples, proof by lcp*) lemma fun_subset_eq: "\f \ Pi(A,B); g \ Pi(A,C)\ \ f \ g \ (f = g)" by (blast dest: apply_Pair
intro: fun_extension apply_equality [symmetric])
(*Every element of Pi(A,B) may be expressed as a lambda abstraction!*) lemma Pi_lamE: assumes major: "f \ Pi(A,B)" and minor: "\b. \\x\A. b(x):B(x); f = (\x\A. b(x))\ \ P" shows"P" apply (rule minor) apply (rule_tac [2] eta [symmetric]) apply (blast intro: major apply_type)+ done
subsection\<open>Images of Functions\<close>
lemma image_lam: "C \ A \ (\x\A. b(x)) `` C = {b(x). x \ C}" by (unfold lam_def, blast)
(*For this lemma and the next, the right-hand side could equivalently
be written \<Union>x\<in>C. {f`x} *) lemma image_function: "\function(f); C \ domain(f)\ \ f``C = {f`x. x \ C}" by (simp add: Repfun_function_if)
subsubsection\<open>Replacement in its Various Forms\<close>
(*Not easy to express monotonicity in P, since any "bigger" predicate
would have to be single-valued*) lemma Replace_mono: "A<=B \ Replace(A,P) \ Replace(B,P)" by (blast elim!: ReplaceE)
lemma RepFun_mono: "A<=B \ {f(x). x \ A} \ {f(x). x \ B}" by blast
lemma Pow_mono: "A<=B \ Pow(A) \ Pow(B)" by blast
lemma Union_mono: "A<=B \ \(A) \ \(B)" by blast
lemma UN_mono: "\A<=C; \x. x \ A \ B(x)<=D(x)\ \ (\x\A. B(x)) \ (\x\C. D(x))" by blast
(*Intersection is ANTI-monotonic. There are TWO premises! *) lemma Inter_anti_mono: "\A<=B; A\0\ \ \(B) \ \(A)" by blast
lemma cons_mono: "C<=D \ cons(a,C) \ cons(a,D)" by blast
lemma Un_mono: "\A<=C; B<=D\ \ A \ B \ C \ D" by blast
lemma Int_mono: "\A<=C; B<=D\ \ A \ B \ C \ D" by blast
lemma Diff_mono: "\A<=C; D<=B\ \ A-B \ C-D" by blast
subsubsection\<open>Standard Products, Sums and Function Spaces\<close>
lemma Sigma_mono [rule_format]: "\A<=C; \x. x \ A \ B(x) \ D(x)\ \ Sigma(A,B) \ Sigma(C,D)" by blast
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.