src/ZF/Finite.thy
changeset 46820 c656222c4dc1
parent 46471 2289a3869c88
child 46821 ff6b0c1087f2
     1.1 --- a/src/ZF/Finite.thy	Sun Mar 04 23:20:43 2012 +0100
     1.2 +++ b/src/ZF/Finite.thy	Tue Mar 06 15:15:49 2012 +0000
     1.3 @@ -2,7 +2,7 @@
     1.4      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     1.5      Copyright   1994  University of Cambridge
     1.6  
     1.7 -prove:  b: Fin(A) ==> inj(b,b) <= surj(b,b)
     1.8 +prove:  b: Fin(A) ==> inj(b,b) \<subseteq> surj(b,b)
     1.9  *)
    1.10  
    1.11  header{*Finite Powerset Operator and Finite Function Space*}
    1.12 @@ -22,41 +22,41 @@
    1.13    FiniteFun :: "[i,i]=>i"         ("(_ -||>/ _)" [61, 60] 60)
    1.14  
    1.15  inductive
    1.16 -  domains   "Fin(A)" <= "Pow(A)"
    1.17 +  domains   "Fin(A)" \<subseteq> "Pow(A)"
    1.18    intros
    1.19 -    emptyI:  "0 : Fin(A)"
    1.20 -    consI:   "[| a: A;  b: Fin(A) |] ==> cons(a,b) : Fin(A)"
    1.21 +    emptyI:  "0 \<in> Fin(A)"
    1.22 +    consI:   "[| a: A;  b: Fin(A) |] ==> cons(a,b) \<in> Fin(A)"
    1.23    type_intros  empty_subsetI cons_subsetI PowI
    1.24    type_elims   PowD [elim_format]
    1.25  
    1.26  inductive
    1.27 -  domains   "FiniteFun(A,B)" <= "Fin(A*B)"
    1.28 +  domains   "FiniteFun(A,B)" \<subseteq> "Fin(A*B)"
    1.29    intros
    1.30 -    emptyI:  "0 : A -||> B"
    1.31 -    consI:   "[| a: A;  b: B;  h: A -||> B;  a ~: domain(h) |]
    1.32 -              ==> cons(<a,b>,h) : A -||> B"
    1.33 +    emptyI:  "0 \<in> A -||> B"
    1.34 +    consI:   "[| a: A;  b: B;  h: A -||> B;  a \<notin> domain(h) |]
    1.35 +              ==> cons(<a,b>,h) \<in> A -||> B"
    1.36    type_intros Fin.intros
    1.37  
    1.38  
    1.39  subsection {* Finite Powerset Operator *}
    1.40  
    1.41 -lemma Fin_mono: "A<=B ==> Fin(A) <= Fin(B)"
    1.42 +lemma Fin_mono: "A<=B ==> Fin(A) \<subseteq> Fin(B)"
    1.43  apply (unfold Fin.defs)
    1.44  apply (rule lfp_mono)
    1.45  apply (rule Fin.bnd_mono)+
    1.46  apply blast
    1.47  done
    1.48  
    1.49 -(* A : Fin(B) ==> A <= B *)
    1.50 +(* @{term"A \<in> Fin(B) ==> A \<subseteq> B"} *)
    1.51  lemmas FinD = Fin.dom_subset [THEN subsetD, THEN PowD]
    1.52  
    1.53  (** Induction on finite sets **)
    1.54  
    1.55 -(*Discharging x~:y entails extra work*)
    1.56 +(*Discharging @{term"x\<notin>y"} entails extra work*)
    1.57  lemma Fin_induct [case_names 0 cons, induct set: Fin]:
    1.58      "[| b: Fin(A);
    1.59          P(0);
    1.60 -        !!x y. [| x: A;  y: Fin(A);  x~:y;  P(y) |] ==> P(cons(x,y))
    1.61 +        !!x y. [| x: A;  y: Fin(A);  x\<notin>y;  P(y) |] ==> P(cons(x,y))
    1.62       |] ==> P(b)"
    1.63  apply (erule Fin.induct, simp)
    1.64  apply (case_tac "a:b")
    1.65 @@ -72,18 +72,18 @@
    1.66  by (blast intro: Fin.emptyI dest: FinD)
    1.67  
    1.68  (*The union of two finite sets is finite.*)
    1.69 -lemma Fin_UnI [simp]: "[| b: Fin(A);  c: Fin(A) |] ==> b Un c : Fin(A)"
    1.70 +lemma Fin_UnI [simp]: "[| b: Fin(A);  c: Fin(A) |] ==> b \<union> c \<in> Fin(A)"
    1.71  apply (erule Fin_induct)
    1.72  apply (simp_all add: Un_cons)
    1.73  done
    1.74  
    1.75  
    1.76  (*The union of a set of finite sets is finite.*)
    1.77 -lemma Fin_UnionI: "C : Fin(Fin(A)) ==> Union(C) : Fin(A)"
    1.78 +lemma Fin_UnionI: "C \<in> Fin(Fin(A)) ==> \<Union>(C) \<in> Fin(A)"
    1.79  by (erule Fin_induct, simp_all)
    1.80  
    1.81  (*Every subset of a finite set is finite.*)
    1.82 -lemma Fin_subset_lemma [rule_format]: "b: Fin(A) ==> \<forall>z. z<=b --> z: Fin(A)"
    1.83 +lemma Fin_subset_lemma [rule_format]: "b: Fin(A) ==> \<forall>z. z<=b \<longrightarrow> z: Fin(A)"
    1.84  apply (erule Fin_induct)
    1.85  apply (simp add: subset_empty_iff)
    1.86  apply (simp add: subset_cons_iff distrib_simps, safe)
    1.87 @@ -93,16 +93,16 @@
    1.88  lemma Fin_subset: "[| c<=b;  b: Fin(A) |] ==> c: Fin(A)"
    1.89  by (blast intro: Fin_subset_lemma)
    1.90  
    1.91 -lemma Fin_IntI1 [intro,simp]: "b: Fin(A) ==> b Int c : Fin(A)"
    1.92 +lemma Fin_IntI1 [intro,simp]: "b: Fin(A) ==> b \<inter> c \<in> Fin(A)"
    1.93  by (blast intro: Fin_subset)
    1.94  
    1.95 -lemma Fin_IntI2 [intro,simp]: "c: Fin(A) ==> b Int c : Fin(A)"
    1.96 +lemma Fin_IntI2 [intro,simp]: "c: Fin(A) ==> b \<inter> c \<in> Fin(A)"
    1.97  by (blast intro: Fin_subset)
    1.98  
    1.99  lemma Fin_0_induct_lemma [rule_format]:
   1.100      "[| c: Fin(A);  b: Fin(A); P(b);
   1.101          !!x y. [| x: A;  y: Fin(A);  x:y;  P(y) |] ==> P(y-{x})
   1.102 -     |] ==> c<=b --> P(b-c)"
   1.103 +     |] ==> c<=b \<longrightarrow> P(b-c)"
   1.104  apply (erule Fin_induct, simp)
   1.105  apply (subst Diff_cons)
   1.106  apply (simp add: cons_subset_iff Diff_subset [THEN Fin_subset])
   1.107 @@ -114,11 +114,11 @@
   1.108          !!x y. [| x: A;  y: Fin(A);  x:y;  P(y) |] ==> P(y-{x})
   1.109       |] ==> P(0)"
   1.110  apply (rule Diff_cancel [THEN subst])
   1.111 -apply (blast intro: Fin_0_induct_lemma) 
   1.112 +apply (blast intro: Fin_0_induct_lemma)
   1.113  done
   1.114  
   1.115  (*Functions from a finite ordinal*)
   1.116 -lemma nat_fun_subset_Fin: "n: nat ==> n->A <= Fin(nat*A)"
   1.117 +lemma nat_fun_subset_Fin: "n: nat ==> n->A \<subseteq> Fin(nat*A)"
   1.118  apply (induct_tac "n")
   1.119  apply (simp add: subset_iff)
   1.120  apply (simp add: succ_def mem_not_refl [THEN cons_fun_eq])
   1.121 @@ -129,14 +129,14 @@
   1.122  subsection{*Finite Function Space*}
   1.123  
   1.124  lemma FiniteFun_mono:
   1.125 -    "[| A<=C;  B<=D |] ==> A -||> B  <=  C -||> D"
   1.126 +    "[| A<=C;  B<=D |] ==> A -||> B  \<subseteq>  C -||> D"
   1.127  apply (unfold FiniteFun.defs)
   1.128  apply (rule lfp_mono)
   1.129  apply (rule FiniteFun.bnd_mono)+
   1.130  apply (intro Fin_mono Sigma_mono basic_monos, assumption+)
   1.131  done
   1.132  
   1.133 -lemma FiniteFun_mono1: "A<=B ==> A -||> A  <=  B -||> B"
   1.134 +lemma FiniteFun_mono1: "A<=B ==> A -||> A  \<subseteq>  B -||> B"
   1.135  by (blast dest: FiniteFun_mono)
   1.136  
   1.137  lemma FiniteFun_is_fun: "h: A -||>B ==> h: domain(h) -> B"
   1.138 @@ -144,14 +144,14 @@
   1.139  apply (simp add: fun_extend3)
   1.140  done
   1.141  
   1.142 -lemma FiniteFun_domain_Fin: "h: A -||>B ==> domain(h) : Fin(A)"
   1.143 +lemma FiniteFun_domain_Fin: "h: A -||>B ==> domain(h) \<in> Fin(A)"
   1.144  by (erule FiniteFun.induct, simp, simp)
   1.145  
   1.146  lemmas FiniteFun_apply_type = FiniteFun_is_fun [THEN apply_type]
   1.147  
   1.148  (*Every subset of a finite function is a finite function.*)
   1.149  lemma FiniteFun_subset_lemma [rule_format]:
   1.150 -     "b: A-||>B ==> ALL z. z<=b --> z: A-||>B"
   1.151 +     "b: A-||>B ==> \<forall>z. z<=b \<longrightarrow> z: A-||>B"
   1.152  apply (erule FiniteFun.induct)
   1.153  apply (simp add: subset_empty_iff FiniteFun.intros)
   1.154  apply (simp add: subset_cons_iff distrib_simps, safe)
   1.155 @@ -165,29 +165,29 @@
   1.156  
   1.157  (** Some further results by Sidi O. Ehmety **)
   1.158  
   1.159 -lemma fun_FiniteFunI [rule_format]: "A:Fin(X) ==> ALL f. f:A->B --> f:A-||>B"
   1.160 +lemma fun_FiniteFunI [rule_format]: "A:Fin(X) ==> \<forall>f. f:A->B \<longrightarrow> f:A-||>B"
   1.161  apply (erule Fin.induct)
   1.162   apply (simp add: FiniteFun.intros, clarify)
   1.163  apply (case_tac "a:b")
   1.164   apply (simp add: cons_absorb)
   1.165 -apply (subgoal_tac "restrict (f,b) : b -||> B")
   1.166 +apply (subgoal_tac "restrict (f,b) \<in> b -||> B")
   1.167   prefer 2 apply (blast intro: restrict_type2)
   1.168  apply (subst fun_cons_restrict_eq, assumption)
   1.169  apply (simp add: restrict_def lam_def)
   1.170 -apply (blast intro: apply_funtype FiniteFun.intros 
   1.171 +apply (blast intro: apply_funtype FiniteFun.intros
   1.172                      FiniteFun_mono [THEN [2] rev_subsetD])
   1.173  done
   1.174  
   1.175 -lemma lam_FiniteFun: "A: Fin(X) ==> (lam x:A. b(x)) : A -||> {b(x). x:A}"
   1.176 +lemma lam_FiniteFun: "A: Fin(X) ==> (\<lambda>x\<in>A. b(x)) \<in> A -||> {b(x). x:A}"
   1.177  by (blast intro: fun_FiniteFunI lam_funtype)
   1.178  
   1.179  lemma FiniteFun_Collect_iff:
   1.180 -     "f : FiniteFun(A, {y:B. P(y)})
   1.181 -      <-> f : FiniteFun(A,B) & (ALL x:domain(f). P(f`x))"
   1.182 +     "f \<in> FiniteFun(A, {y:B. P(y)})
   1.183 +      <-> f \<in> FiniteFun(A,B) & (\<forall>x\<in>domain(f). P(f`x))"
   1.184  apply auto
   1.185  apply (blast intro: FiniteFun_mono [THEN [2] rev_subsetD])
   1.186  apply (blast dest: Pair_mem_PiD FiniteFun_is_fun)
   1.187 -apply (rule_tac A1="domain(f)" in 
   1.188 +apply (rule_tac A1="domain(f)" in
   1.189         subset_refl [THEN [2] FiniteFun_mono, THEN subsetD])
   1.190   apply (fast dest: FiniteFun_domain_Fin Fin.dom_subset [THEN subsetD])
   1.191  apply (rule fun_FiniteFunI)