src/ZF/CardinalArith.thy
author paulson
Fri May 17 16:48:11 2002 +0200 (2002-05-17)
changeset 13161 a40db0418145
parent 13118 336b0bcbd27c
child 13216 6104bd4088a2
permissions -rw-r--r--
unsymbolize
clasohm@1478
     1
(*  Title:      ZF/CardinalArith.thy
lcp@437
     2
    ID:         $Id$
clasohm@1478
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
lcp@437
     4
    Copyright   1994  University of Cambridge
lcp@437
     5
lcp@437
     6
Cardinal Arithmetic
lcp@437
     7
*)
lcp@437
     8
paulson@12667
     9
theory CardinalArith = Cardinal + OrderArith + ArithSimp + Finite:
lcp@467
    10
paulson@12667
    11
constdefs
lcp@437
    12
paulson@12667
    13
  InfCard       :: "i=>o"
paulson@12667
    14
    "InfCard(i) == Card(i) & nat le i"
lcp@437
    15
paulson@12667
    16
  cmult         :: "[i,i]=>i"       (infixl "|*|" 70)
paulson@12667
    17
    "i |*| j == |i*j|"
paulson@12667
    18
  
paulson@12667
    19
  cadd          :: "[i,i]=>i"       (infixl "|+|" 65)
paulson@12667
    20
    "i |+| j == |i+j|"
lcp@437
    21
paulson@12667
    22
  csquare_rel   :: "i=>i"
paulson@12667
    23
    "csquare_rel(K) ==   
paulson@12667
    24
	  rvimage(K*K,   
paulson@12667
    25
		  lam <x,y>:K*K. <x Un y, x, y>, 
paulson@12667
    26
		  rmult(K,Memrel(K), K*K, rmult(K,Memrel(K), K,Memrel(K))))"
lcp@437
    27
lcp@484
    28
  (*This def is more complex than Kunen's but it more easily proved to
lcp@484
    29
    be a cardinal*)
paulson@12667
    30
  jump_cardinal :: "i=>i"
paulson@12667
    31
    "jump_cardinal(K) ==   
clasohm@1155
    32
         UN X:Pow(K). {z. r: Pow(K*K), well_ord(X,r) & z = ordertype(X,r)}"
paulson@12667
    33
  
lcp@484
    34
  (*needed because jump_cardinal(K) might not be the successor of K*)
paulson@12667
    35
  csucc         :: "i=>i"
paulson@12667
    36
    "csucc(K) == LEAST L. Card(L) & K<L"
lcp@484
    37
wenzelm@12114
    38
syntax (xsymbols)
paulson@12667
    39
  "op |+|"     :: "[i,i] => i"          (infixl "\<oplus>" 65)
paulson@12667
    40
  "op |*|"     :: "[i,i] => i"          (infixl "\<otimes>" 70)
paulson@12667
    41
paulson@12667
    42
paulson@13118
    43
(*** The following really belong early in the development ***)
paulson@13118
    44
paulson@13118
    45
lemma relation_converse_converse [simp]:
paulson@13118
    46
     "relation(r) ==> converse(converse(r)) = r"
paulson@13118
    47
by (simp add: relation_def, blast) 
paulson@13118
    48
paulson@13118
    49
lemma relation_restrict [simp]:  "relation(restrict(r,A))"
paulson@13118
    50
by (simp add: restrict_def relation_def, blast) 
paulson@13118
    51
paulson@13118
    52
(*** The following really belong in Order ***)
paulson@13118
    53
paulson@13118
    54
lemma subset_ord_iso_Memrel:
paulson@13161
    55
     "[| f: ord_iso(A,Memrel(B),C,r); A<=B |] ==> f: ord_iso(A,Memrel(A),C,r)"
paulson@13118
    56
apply (frule ord_iso_is_bij [THEN bij_is_fun, THEN fun_is_rel]) 
paulson@13118
    57
apply (frule ord_iso_trans [OF id_ord_iso_Memrel], assumption) 
paulson@13118
    58
apply (simp add: right_comp_id) 
paulson@13118
    59
done
paulson@13118
    60
paulson@13118
    61
lemma restrict_ord_iso:
paulson@13161
    62
     "[| f \<in> ord_iso(i, Memrel(i), Order.pred(A,a,r), r);  a \<in> A; j < i; 
paulson@13161
    63
       trans[A](r) |]
paulson@13161
    64
      ==> restrict(f,j) \<in> ord_iso(j, Memrel(j), Order.pred(A,f`j,r), r)"
paulson@13118
    65
apply (frule ltD) 
paulson@13118
    66
apply (frule ord_iso_is_bij [THEN bij_is_fun, THEN apply_type], assumption) 
paulson@13118
    67
apply (frule ord_iso_restrict_pred, assumption) 
paulson@13118
    68
apply (simp add: pred_iff trans_pred_pred_eq lt_pred_Memrel)
paulson@13118
    69
apply (blast intro!: subset_ord_iso_Memrel le_imp_subset [OF leI]) 
paulson@13118
    70
done
paulson@13118
    71
paulson@13118
    72
lemma restrict_ord_iso2:
paulson@13161
    73
     "[| f \<in> ord_iso(Order.pred(A,a,r), r, i, Memrel(i));  a \<in> A; 
paulson@13161
    74
       j < i; trans[A](r) |]
paulson@13161
    75
      ==> converse(restrict(converse(f), j)) 
paulson@13118
    76
          \<in> ord_iso(Order.pred(A, converse(f)`j, r), r, j, Memrel(j))"
paulson@13118
    77
by (blast intro: restrict_ord_iso ord_iso_sym ltI)
paulson@13118
    78
paulson@12667
    79
(*** The following really belong in OrderType ***)
paulson@12667
    80
paulson@13161
    81
lemma oadd_eq_0_iff: "[| Ord(i); Ord(j) |] ==> (i ++ j) = 0 <-> i=0 & j=0"
paulson@12667
    82
apply (erule trans_induct3 [of j])
paulson@12667
    83
apply (simp_all add: oadd_Limit)
paulson@12820
    84
apply (simp add: Union_empty_iff Limit_def lt_def, blast)
paulson@12667
    85
done
paulson@12667
    86
paulson@13161
    87
lemma oadd_eq_lt_iff: "[| Ord(i); Ord(j) |] ==> 0 < (i ++ j) <-> 0<i | 0<j"
paulson@12667
    88
by (simp add: Ord_0_lt_iff [symmetric] oadd_eq_0_iff)
paulson@12667
    89
paulson@12667
    90
lemma oadd_lt_self: "[| Ord(i);  0<j |] ==> i < i++j"
paulson@12667
    91
apply (rule lt_trans2) 
paulson@12667
    92
apply (erule le_refl) 
paulson@12667
    93
apply (simp only: lt_Ord2  oadd_1 [of i, symmetric]) 
paulson@12667
    94
apply (blast intro: succ_leI oadd_le_mono)
paulson@12667
    95
done
paulson@12667
    96
paulson@13161
    97
lemma oadd_LimitI: "[| Ord(i); Limit(j) |] ==> Limit(i ++ j)"
paulson@12667
    98
apply (simp add: oadd_Limit)
paulson@12667
    99
apply (frule Limit_has_1 [THEN ltD])
paulson@12667
   100
apply (rule increasing_LimitI)
paulson@12667
   101
 apply (rule Ord_0_lt)
paulson@12667
   102
  apply (blast intro: Ord_in_Ord [OF Limit_is_Ord])
paulson@12667
   103
 apply (force simp add: Union_empty_iff oadd_eq_0_iff
paulson@12820
   104
                        Limit_is_Ord [of j, THEN Ord_in_Ord], auto)
paulson@12667
   105
apply (rule_tac x="succ(x)" in bexI)
paulson@12667
   106
 apply (simp add: ltI Limit_is_Ord [of j, THEN Ord_in_Ord])
paulson@12667
   107
apply (simp add: Limit_def lt_def) 
paulson@12667
   108
done
paulson@12667
   109
paulson@12667
   110
(*** The following really belong in Cardinal ***)
paulson@12667
   111
paulson@12667
   112
lemma lesspoll_not_refl: "~ (i lesspoll i)"
paulson@12667
   113
by (simp add: lesspoll_def) 
paulson@12667
   114
paulson@12667
   115
lemma lesspoll_irrefl [elim!]: "i lesspoll i ==> P"
paulson@12667
   116
by (simp add: lesspoll_def) 
paulson@12667
   117
paulson@12667
   118
lemma Card_Union [simp,intro,TC]: "(ALL x:A. Card(x)) ==> Card(Union(A))"
paulson@12667
   119
apply (rule CardI) 
paulson@12667
   120
 apply (simp add: Card_is_Ord) 
paulson@12667
   121
apply (clarify dest!: ltD)
paulson@12667
   122
apply (drule bspec, assumption) 
paulson@12667
   123
apply (frule lt_Card_imp_lesspoll, blast intro: ltI Card_is_Ord) 
paulson@12667
   124
apply (drule eqpoll_sym [THEN eqpoll_imp_lepoll])
paulson@12667
   125
apply (drule lesspoll_trans1, assumption) 
paulson@12667
   126
apply (subgoal_tac "B lepoll \<Union>A")
paulson@12667
   127
 apply (drule lesspoll_trans1, assumption, blast) 
paulson@12667
   128
apply (blast intro: subset_imp_lepoll) 
paulson@12667
   129
done
paulson@12667
   130
paulson@12667
   131
lemma Card_UN:
paulson@12667
   132
     "(!!x. x:A ==> Card(K(x))) ==> Card(UN x:A. K(x))" 
paulson@12667
   133
by (blast intro: Card_Union) 
paulson@12667
   134
paulson@12667
   135
lemma Card_OUN [simp,intro,TC]:
paulson@12667
   136
     "(!!x. x:A ==> Card(K(x))) ==> Card(UN x<A. K(x))"
paulson@12667
   137
by (simp add: OUnion_def Card_0) 
paulson@9654
   138
paulson@12776
   139
lemma n_lesspoll_nat: "n \<in> nat ==> n \<prec> nat"
paulson@12776
   140
apply (unfold lesspoll_def)
paulson@12776
   141
apply (rule conjI)
paulson@12776
   142
apply (erule OrdmemD [THEN subset_imp_lepoll], rule Ord_nat)
paulson@12776
   143
apply (rule notI)
paulson@12776
   144
apply (erule eqpollE)
paulson@12776
   145
apply (rule succ_lepoll_natE)
paulson@12776
   146
apply (blast intro: nat_succI [THEN OrdmemD, THEN subset_imp_lepoll] 
paulson@12820
   147
                    lepoll_trans, assumption) 
paulson@12776
   148
done
paulson@12776
   149
paulson@12776
   150
lemma in_Card_imp_lesspoll: "[| Card(K); b \<in> K |] ==> b \<prec> K"
paulson@12776
   151
apply (unfold lesspoll_def)
paulson@12776
   152
apply (simp add: Card_iff_initial)
paulson@12776
   153
apply (fast intro!: le_imp_lepoll ltI leI)
paulson@12776
   154
done
paulson@12776
   155
paulson@12776
   156
lemma succ_lepoll_imp_not_empty: "succ(x) \<lesssim> y ==> y \<noteq> 0"
paulson@12776
   157
by (fast dest!: lepoll_0_is_0)
paulson@12776
   158
paulson@12776
   159
lemma eqpoll_succ_imp_not_empty: "x \<approx> succ(n) ==> x \<noteq> 0"
paulson@12776
   160
by (fast elim!: eqpoll_sym [THEN eqpoll_0_is_0, THEN succ_neq_0])
paulson@12776
   161
paulson@12776
   162
lemma Finite_Fin_lemma [rule_format]:
paulson@12776
   163
     "n \<in> nat ==> \<forall>A. (A\<approx>n & A \<subseteq> X) --> A \<in> Fin(X)"
paulson@12776
   164
apply (induct_tac "n")
paulson@12776
   165
apply (rule allI)
paulson@12776
   166
apply (fast intro!: Fin.emptyI dest!: eqpoll_imp_lepoll [THEN lepoll_0_is_0])
paulson@12776
   167
apply (rule allI)
paulson@12776
   168
apply (rule impI)
paulson@12776
   169
apply (erule conjE)
paulson@12820
   170
apply (rule eqpoll_succ_imp_not_empty [THEN not_emptyE], assumption)
paulson@12820
   171
apply (frule Diff_sing_eqpoll, assumption)
paulson@12776
   172
apply (erule allE)
paulson@12776
   173
apply (erule impE, fast)
paulson@12820
   174
apply (drule subsetD, assumption)
paulson@12820
   175
apply (drule Fin.consI, assumption)
paulson@12776
   176
apply (simp add: cons_Diff)
paulson@12776
   177
done
paulson@12776
   178
paulson@12776
   179
lemma Finite_Fin: "[| Finite(A); A \<subseteq> X |] ==> A \<in> Fin(X)"
paulson@12776
   180
by (unfold Finite_def, blast intro: Finite_Fin_lemma) 
paulson@12776
   181
paulson@12776
   182
lemma lesspoll_lemma: 
paulson@12776
   183
        "[| ~ A \<prec> B; C \<prec> B |] ==> A - C \<noteq> 0"
paulson@12776
   184
apply (unfold lesspoll_def)
paulson@12776
   185
apply (fast dest!: Diff_eq_0_iff [THEN iffD1, THEN subset_imp_lepoll]
paulson@12776
   186
            intro!: eqpollI elim: notE 
paulson@12776
   187
            elim!: eqpollE lepoll_trans)
paulson@12776
   188
done
paulson@12776
   189
paulson@12776
   190
lemma eqpoll_imp_Finite_iff: "A \<approx> B ==> Finite(A) <-> Finite(B)"
paulson@12776
   191
apply (unfold Finite_def) 
paulson@12776
   192
apply (blast intro: eqpoll_trans eqpoll_sym) 
paulson@12776
   193
done
paulson@12776
   194
lcp@437
   195
end