src/ZF/AC/Cardinal_aux.ML
author paulson
Mon, 29 Sep 1997 11:48:48 +0200
changeset 3731 71366483323b
parent 2873 5f0599e15448
child 3840 e0baea4d485a
permissions -rw-r--r--
result() -> qed; Step_tac -> Safe_tac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
     1
(*  Title:      ZF/AC/Cardinal_aux.ML
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
     3
    Author:     Krzysztof Grabczewski
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     4
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     5
Auxiliary lemmas concerning cardinalities
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     6
*)
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     7
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     8
open Cardinal_aux;
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     9
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    10
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    11
(* Lemmas involving ordinals and cardinalities used in the proofs         *)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    12
(* concerning AC16 and DC                                                 *)
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    13
(* ********************************************************************** *)
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    14
1616
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    15
(* j=|A| *)
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    16
goal Cardinal.thy
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    17
    "!!A. [| A lepoll i; Ord(i) |] ==> EX j. j le i & A eqpoll j";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    18
by (fast_tac (!claset addIs [lepoll_cardinal_le, well_ord_Memrel,
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    19
                            well_ord_cardinal_eqpoll RS eqpoll_sym]
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    20
                    addDs [lepoll_well_ord]) 1);
1616
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    21
qed "lepoll_imp_ex_le_eqpoll";
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    22
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    23
(* j=|A| *)
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    24
goalw Cardinal.thy [lesspoll_def]
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    25
    "!!A a. [| A lesspoll i; Ord(i) |] ==> EX j. j<i & A eqpoll j";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    26
by (fast_tac (!claset addSDs [lepoll_imp_ex_le_eqpoll] addSEs [leE]) 1);
1616
6d7278c3f686 Moved some proofs to Cardinal.ML; simplified others
paulson
parents: 1461
diff changeset
    27
qed "lesspoll_imp_ex_lt_eqpoll";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    28
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    29
goalw thy [InfCard_def] "!!i. [| ~Finite(i); Ord(i) |] ==> InfCard(|i|)";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
    30
by (rtac conjI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
    31
by (rtac Card_cardinal 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    32
by (resolve_tac [Card_nat RS (Card_def RS def_imp_iff RS iffD1 RS ssubst)] 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    33
by (resolve_tac [nat_le_infinite_Ord RS le_imp_lepoll
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    34
        RSN (2, well_ord_Memrel RS well_ord_lepoll_imp_Card_le)] 1 
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    35
    THEN REPEAT (assume_tac 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    36
qed "Inf_Ord_imp_InfCard_cardinal";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    37
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    38
val sum_lepoll_prod = [sum_eq_2_times RS equalityD1 RS subset_imp_lepoll,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    39
        asm_rl, lepoll_refl] MRS (prod_lepoll_mono RSN (2, lepoll_trans))
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    40
        |> standard;
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    41
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    42
goal thy "!!A. [| A lepoll B; 2 lepoll A |] ==> A+B lepoll A*B";
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    43
by (REPEAT (ares_tac [[sum_lepoll_mono, sum_lepoll_prod]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    44
                MRS lepoll_trans, lepoll_refl] 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    45
qed "lepoll_imp_sum_lepoll_prod";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    46
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    47
goal thy "!!A. [| A eqpoll i; B eqpoll i; ~Finite(i); Ord(i) |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    48
\               ==> A Un B eqpoll i";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
    49
by (rtac eqpollI 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    50
by (eresolve_tac [subset_imp_lepoll RSN (2, eqpoll_sym RS eqpoll_imp_lepoll
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    51
        RS  lepoll_trans)] 2);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    52
by (Fast_tac 2);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    53
by (resolve_tac [Un_lepoll_sum RS lepoll_trans] 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    54
by (resolve_tac [lepoll_imp_sum_lepoll_prod RS lepoll_trans] 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    55
by (eresolve_tac [eqpoll_sym RSN (2, eqpoll_trans) RS eqpoll_imp_lepoll] 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    56
        THEN (assume_tac 1));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    57
by (resolve_tac [nat_le_infinite_Ord RS le_imp_lepoll RS 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    58
        (Ord_nat RS (nat_2I RS OrdmemD) RS subset_imp_lepoll RS lepoll_trans)
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    59
        RS (eqpoll_sym RS eqpoll_imp_lepoll RSN (2, lepoll_trans))] 1 
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    60
    THEN (REPEAT (assume_tac 1)));
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    61
by (eresolve_tac [prod_eqpoll_cong RS eqpoll_imp_lepoll RS lepoll_trans] 1 
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    62
    THEN (assume_tac 1));
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    63
by (resolve_tac [Inf_Ord_imp_InfCard_cardinal RSN (2, well_ord_Memrel RS 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    64
        well_ord_InfCard_square_eq) RS eqpoll_imp_lepoll] 1 
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    65
    THEN REPEAT (assume_tac 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    66
qed "Un_eqpoll_Inf_Ord";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    67
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    68
val ss = (!simpset) addsimps [inj_is_fun RS apply_type, left_inverse] 
1710
f50ec5b35937 Simplified KG's proofs
paulson
parents: 1616
diff changeset
    69
               setloop (split_tac [expand_if] ORELSE' etac UnE);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    70
2873
5f0599e15448 Converted back from upair.thy to ZF.thy
paulson
parents: 2496
diff changeset
    71
goal ZF.thy "{x, y} - {y} = {x} - {y}";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
    72
by (Fast_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    73
qed "double_Diff_sing";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    74
2873
5f0599e15448 Converted back from upair.thy to ZF.thy
paulson
parents: 2496
diff changeset
    75
goal ZF.thy "if({y,z}-{z}=0, z, THE w. {y,z}-{z}={w}) = y";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    76
by (split_tac [expand_if] 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    77
by (asm_full_simp_tac (!simpset addsimps [double_Diff_sing, Diff_eq_0_iff]) 1);
2496
40efb87985b5 Removal of needless "addIs [equality]", etc.
paulson
parents: 2493
diff changeset
    78
by (fast_tac (!claset addSIs [the_equality] addEs [equalityE]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    79
qed "paired_bij_lemma";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    80
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    81
goal thy "(lam y:{{y,z}. y:x}. if(y-{z}=0, z, THE w. y-{z}={w}))  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    82
\               : bij({{y,z}. y:x}, x)";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    83
by (res_inst_tac [("d","%a. {a,z}")] lam_bijective 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    84
by (TRYALL (fast_tac (!claset addSEs [RepFunE] addSIs [RepFunI] 
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    85
                addss (!simpset addsimps [paired_bij_lemma]))));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    86
qed "paired_bij";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    87
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    88
goalw thy [eqpoll_def] "{{y,z}. y:x} eqpoll x";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    89
by (fast_tac (!claset addSIs [paired_bij]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    90
qed "paired_eqpoll";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    91
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    92
goal thy "!!A. EX B. B eqpoll A & B Int C = 0";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
    93
by (fast_tac (!claset addSIs [paired_eqpoll, equals0I] addEs [mem_asym]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    94
qed "ex_eqpoll_disjoint";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    95
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    96
goal thy "!!A. [| A lepoll i; B lepoll i; ~Finite(i); Ord(i) |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    97
\               ==> A Un B lepoll i";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    98
by (res_inst_tac [("A1","i"), ("C1","i")] (ex_eqpoll_disjoint RS exE) 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
    99
by (etac conjE 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   100
by (dresolve_tac [eqpoll_sym RS eqpoll_imp_lepoll RSN (2, lepoll_trans)] 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   101
by (assume_tac 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   102
by (resolve_tac [Un_lepoll_Un RS lepoll_trans] 1 THEN (REPEAT (assume_tac 1)));
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   103
by (eresolve_tac [eqpoll_refl RSN (2, Un_eqpoll_Inf_Ord) RS
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   104
        eqpoll_imp_lepoll] 1
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   105
        THEN (REPEAT (assume_tac 1)));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   106
qed "Un_lepoll_Inf_Ord";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   107
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   108
goal thy "!!P. [| P(i); i:j; Ord(j) |] ==> (LEAST i. P(i)) : j";
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   109
by (eresolve_tac [Least_le RS leE] 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   110
by (etac Ord_in_Ord 1 THEN (assume_tac 1));
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   111
by (etac ltE 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   112
by (fast_tac (!claset addDs [OrdmemD]) 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   113
by (etac subst_elem 1 THEN (assume_tac 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   114
qed "Least_in_Ord";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   115
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   116
goal thy "!!x. [| well_ord(x,r); y<=x; y lepoll succ(n); n:nat |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   117
\       ==> y-{THE b. first(b,y,r)} lepoll n";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   118
by (res_inst_tac [("Q","y=0")] (excluded_middle RS disjE) 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   119
by (fast_tac (!claset addSIs [Diff_sing_lepoll, the_first_in]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   120
by (res_inst_tac [("b","y-{THE b. first(b, y, r)}")] subst 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   121
by (rtac empty_lepollI 2);
2496
40efb87985b5 Removal of needless "addIs [equality]", etc.
paulson
parents: 2493
diff changeset
   122
by (Fast_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   123
qed "Diff_first_lepoll";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   124
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   125
goal thy "(UN x:X. P(x)) <= (UN x:X. P(x)-Q(x)) Un (UN x:X. Q(x))";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   126
by (Fast_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   127
qed "UN_subset_split";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   128
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   129
goalw thy [lepoll_def] "!!a. Ord(a) ==> (UN x:a. {P(x)}) lepoll a";
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   130
by (res_inst_tac [("x","lam z:(UN x:a. {P(x)}). (LEAST i. P(i)=z)")] exI 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   131
by (res_inst_tac [("d","%z. P(z)")] lam_injective 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   132
by (fast_tac (!claset addSIs [Least_in_Ord]) 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   133
by (fast_tac (!claset addIs [LeastI] addSEs [Ord_in_Ord]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   134
qed "UN_sing_lepoll";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   135
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   136
goal thy "!!a T. [| well_ord(T, R); ~Finite(a); Ord(a); n:nat |] ==>  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   137
\       ALL f. (ALL b:a. f`b lepoll n & f`b <= T) --> (UN b:a. f`b) lepoll a";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   138
by (etac nat_induct 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   139
by (rtac allI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   140
by (rtac impI 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   141
by (res_inst_tac [("b","UN b:a. f`b")] subst 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   142
by (rtac empty_lepollI 2);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   143
by (resolve_tac [equals0I RS sym] 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   144
by (REPEAT (eresolve_tac [UN_E, allE] 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   145
by (fast_tac (!claset addDs [lepoll_0_is_0 RS subst]) 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   146
by (rtac allI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   147
by (rtac impI 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   148
by (eres_inst_tac [("x","lam x:a. f`x - {THE b. first(b,f`x,R)}")] allE 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   149
by (etac impE 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   150
by (Asm_full_simp_tac 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   151
by (fast_tac (!claset addSIs [Diff_first_lepoll]) 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   152
by (Asm_full_simp_tac 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   153
by (resolve_tac [UN_subset_split RS subset_imp_lepoll RS lepoll_trans] 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   154
by (rtac Un_lepoll_Inf_Ord 1 THEN (REPEAT_FIRST assume_tac));
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   155
by (etac UN_sing_lepoll 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   156
qed "UN_fun_lepoll_lemma";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   157
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   158
goal thy "!!a f. [| ALL b:a. f`b lepoll n & f`b <= T; well_ord(T, R);  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   159
\       ~Finite(a); Ord(a); n:nat |] ==> (UN b:a. f`b) lepoll a";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   160
by (eresolve_tac [UN_fun_lepoll_lemma RS allE] 1 THEN (REPEAT (assume_tac 1)));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   161
by (Fast_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   162
qed "UN_fun_lepoll";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   163
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   164
goal thy "!!a f. [| ALL b:a. F(b) lepoll n & F(b) <= T; well_ord(T, R);  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   165
\       ~Finite(a); Ord(a); n:nat |] ==> (UN b:a. F(b)) lepoll a";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   166
by (rtac impE 1 THEN (assume_tac 3));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   167
by (res_inst_tac [("f","lam b:a. F(b)")] (UN_fun_lepoll) 2 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   168
        THEN (TRYALL assume_tac));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   169
by (Simp_tac 2);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   170
by (Asm_full_simp_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   171
qed "UN_lepoll";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   172
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   173
goal thy "!!a. Ord(a) ==> (UN b:a. F(b)) = (UN b:a. F(b) - (UN c:b. F(c)))";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   174
by (rtac equalityI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   175
by (Fast_tac 2);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   176
by (rtac subsetI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   177
by (etac UN_E 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   178
by (rtac UN_I 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   179
by (res_inst_tac [("P","%z. x:F(z)")] Least_in_Ord 1 THEN (REPEAT (assume_tac 1)));
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   180
by (rtac DiffI 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   181
by (resolve_tac [Ord_in_Ord RSN (2, LeastI)] 1 THEN (REPEAT (assume_tac 1)));
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   182
by (rtac notI 1);
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   183
by (etac UN_E 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   184
by (eres_inst_tac [("P","%z. x:F(z)"),("i","c")] less_LeastE 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   185
by (eresolve_tac [Ord_Least RSN (2, ltI)] 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   186
qed "UN_eq_UN_Diffs";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   187
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   188
goalw thy [eqpoll_def] "!!A B. A Int B = 0 ==> A Un B eqpoll A + B";
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   189
by (res_inst_tac [("x","lam a:A Un B. if(a:A,Inl(a),Inr(a))")] exI 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   190
by (res_inst_tac [("d","%z. case(%x.x, %x.x, z)")] lam_bijective 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   191
by (fast_tac (!claset addSIs [if_type, InlI, InrI]) 1);
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   192
by (TRYALL (etac sumE ));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   193
by (TRYALL (split_tac [expand_if]));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   194
by (TRYALL Asm_simp_tac);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   195
by (fast_tac (!claset addDs [equals0D]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   196
qed "disj_Un_eqpoll_sum";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   197
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   198
goalw thy [lepoll_def, eqpoll_def]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   199
        "!!X a. a lepoll X ==> EX Y. Y<=X & a eqpoll Y";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   200
by (etac exE 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   201
by (forward_tac [subset_refl RSN (2, restrict_bij)] 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   202
by (res_inst_tac [("x","f``a")] exI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   203
by (fast_tac (!claset addSEs [inj_is_fun RS fun_is_rel RS image_subset]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   204
qed "lepoll_imp_eqpoll_subset";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   205
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   206
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   207
(* Diff_lesspoll_eqpoll_Card                                              *)
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   208
(* ********************************************************************** *)
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   209
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   210
goal thy "!!A B. [| A eqpoll a; ~Finite(a); Card(a); B lesspoll a;  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   211
\               A-B lesspoll a |] ==> P";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   212
by (REPEAT (eresolve_tac [lesspoll_imp_ex_lt_eqpoll RS exE,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   213
        Card_is_Ord, conjE] 1));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   214
by (forw_inst_tac [("j","xa")] (lt_Ord RS (lt_Ord RSN (2, Un_upper1_le))) 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   215
        THEN (assume_tac 1));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   216
by (forw_inst_tac [("j","xa")] (lt_Ord RS (lt_Ord RSN (2, Un_upper2_le))) 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   217
        THEN (assume_tac 1));
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   218
by (dtac Un_least_lt 1 THEN (assume_tac 1));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   219
by (dresolve_tac [le_imp_lepoll RSN
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   220
        (2, eqpoll_imp_lepoll RS lepoll_trans)] 1
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   221
        THEN (assume_tac 1));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   222
by (dresolve_tac [le_imp_lepoll RSN
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   223
        (2, eqpoll_imp_lepoll RS lepoll_trans)] 1
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   224
        THEN (assume_tac 1));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   225
by (res_inst_tac [("Q","Finite(x Un xa)")] (excluded_middle RS disjE) 1);
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   226
by (dresolve_tac [[lepoll_Finite, lepoll_Finite] MRS Finite_Un] 2
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   227
        THEN (REPEAT (assume_tac 2)));
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   228
by (dresolve_tac [subset_Un_Diff RS subset_imp_lepoll RS lepoll_Finite] 2);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   229
by (fast_tac (!claset
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   230
        addDs [eqpoll_sym RS eqpoll_imp_lepoll RS lepoll_Finite]) 2);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   231
by (dresolve_tac [ Un_lepoll_Inf_Ord] 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   232
        THEN (REPEAT (assume_tac 1)));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   233
by (fast_tac (!claset addSEs [ltE, Ord_in_Ord]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   234
by (dresolve_tac [subset_Un_Diff RS subset_imp_lepoll RS lepoll_trans RSN
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   235
        (3, lt_Card_imp_lesspoll RS lepoll_lesspoll_lesspoll)] 1
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   236
        THEN (TRYALL assume_tac));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   237
by (fast_tac (!claset addSDs [lesspoll_def RS def_imp_iff RS iffD1]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   238
qed "Diff_lesspoll_eqpoll_Card_lemma";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   239
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   240
goal thy "!!A. [| A eqpoll a; ~Finite(a); Card(a); B lesspoll a |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   241
\       ==> A - B eqpoll a";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   242
by (rtac swap 1 THEN (Fast_tac 1));
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   243
by (rtac Diff_lesspoll_eqpoll_Card_lemma 1 THEN (REPEAT (assume_tac 1)));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1932
diff changeset
   244
by (fast_tac (!claset addSIs [lesspoll_def RS def_imp_iff RS iffD2,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   245
        subset_imp_lepoll RS (eqpoll_imp_lepoll RSN (2, lepoll_trans))]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   246
qed "Diff_lesspoll_eqpoll_Card";
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   247