src/ZF/AC/AC_Equiv.ML
author paulson
Fri, 03 Jan 1997 15:01:55 +0100
changeset 2469 b50b8c0eec01
parent 1615 ec04389ddcd3
child 2496 40efb87985b5
permissions -rw-r--r--
Implicit simpsets and clasets for FOL and ZF
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
     1
(*  Title:      ZF/AC/AC_Equiv.ML
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
     3
    Author:     Krzysztof Grabczewski
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     4
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     5
*)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     6
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     7
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     8
open AC_Equiv;
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     9
1071
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
    10
val WO_defs = [WO1_def, WO2_def, WO3_def, WO4_def, WO5_def, WO6_def, WO8_def];
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
    11
 
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
    12
val AC_defs = [AC0_def, AC1_def, AC2_def, AC3_def, AC4_def, AC5_def, 
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
    13
               AC6_def, AC7_def, AC8_def, AC9_def, AC10_def, AC11_def, 
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
    14
               AC12_def, AC13_def, AC14_def, AC15_def, AC16_def, 
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
    15
               AC17_def, AC18_def, AC19_def];
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
    16
 
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    17
val AC_aux_defs = [pairwise_disjoint_def, sets_of_size_between_def];
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
    18
 
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    19
(* ******************************************** *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    20
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    21
(* Theorems analogous to ones presented in "ZF/Ordinal.ML" *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    22
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    23
(* lemma for nat_le_imp_lepoll *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    24
val [prem] = goalw Cardinal.thy [lepoll_def]
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    25
             "m:nat ==> ALL n: nat. m le n --> m lepoll n";
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    26
by (nat_ind_tac "m" [prem] 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    27
by (fast_tac (!claset addSIs [le_imp_subset RS id_subset_inj]) 1);
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    28
by (rtac ballI 1);
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    29
by (eres_inst_tac [("n","n")] natE 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    30
by (asm_simp_tac (!simpset addsimps [inj_def, succI1 RS Pi_empty2]) 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    31
by (fast_tac (!claset addSIs [le_imp_subset RS id_subset_inj]) 1);
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    32
val nat_le_imp_lepoll_lemma = result();
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    33
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    34
(* used in : AC10-AC15.ML WO1-WO6.ML WO6WO1.ML*)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    35
val nat_le_imp_lepoll = nat_le_imp_lepoll_lemma RS bspec RS mp |> standard;
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    36
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    37
(* ********************************************************************** *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    38
(*             lemmas concerning FOL and pure ZF theory                   *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    39
(* ********************************************************************** *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    40
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
    41
goal thy "!!X. (A->X)=0 ==> X=0";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    42
by (fast_tac (!claset addSIs [equals0I] addEs [lam_type RSN (2, equals0D)]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
    43
val fun_space_emptyD = result();
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    44
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    45
(* used only in WO1_DC.ML *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    46
(*Note simpler proof*)
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    47
goal upair.thy "!!A f g. [| ALL x:A. f`x=g`x; f:Df->Cf; g:Dg->Cg;  \
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    48
\         A<=Df; A<=Dg |] ==> f``A=g``A";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    49
by (asm_simp_tac (!simpset addsimps [image_fun]) 1);
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    50
val images_eq = result();
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    51
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    52
(* used in : AC10-AC15.ML AC16WO4.ML WO6WO1.ML *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    53
(*I don't know where to put this one.*)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    54
goal Cardinal.thy
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    55
     "!!m A B. [| A lepoll succ(m); B<=A; B~=0 |] ==> A-B lepoll m";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
    56
by (rtac not_emptyE 1 THEN (assume_tac 1));
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    57
by (forward_tac [singleton_subsetI] 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    58
by (forward_tac [subsetD] 1 THEN (assume_tac 1));
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    59
by (res_inst_tac [("A2","A")] 
1057
5097aa914449 Renamed diff_sing_lepoll to Diff_sing_lepoll.
lcp
parents: 1037
diff changeset
    60
     (Diff_sing_lepoll RSN (2, subset_imp_lepoll RS lepoll_trans)) 1 
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    61
    THEN (REPEAT (assume_tac 2)));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    62
by (Fast_tac 1);
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    63
val Diff_lepoll = result();
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    64
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    65
(* ********************************************************************** *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    66
(*              lemmas concerning lepoll and eqpoll relations             *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    67
(* ********************************************************************** *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    68
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    69
(* ********************************************************************** *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    70
(*                    Theorems concerning ordinals                        *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    71
(* ********************************************************************** *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    72
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    73
(* lemma for ordertype_Int *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    74
goalw Cardinal.thy [rvimage_def] "rvimage(A,id(A),r) = r Int A*A";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
    75
by (rtac equalityI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    76
by (Step_tac 1);
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    77
by (dres_inst_tac [("P","%a. <id(A)`xb,a>:r")] (id_conv RS subst) 1
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    78
    THEN (assume_tac 1));
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    79
by (dres_inst_tac [("P","%a. <a,ya>:r")] (id_conv RS subst) 1
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
    80
    THEN (REPEAT (assume_tac 1)));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    81
by (fast_tac (!claset addIs [id_conv RS ssubst]) 1);
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    82
val rvimage_id = result();
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    83
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    84
(* used only in Hartog.ML *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    85
goal Cardinal.thy
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    86
        "!!A r. well_ord(A,r) ==> ordertype(A, r Int A*A) = ordertype(A,r)";
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    87
by (res_inst_tac [("P","%a. ordertype(A,a)=ordertype(A,r)")] 
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    88
    (rvimage_id RS subst) 1);
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    89
by (eresolve_tac [id_bij RS bij_ordertype_vimage] 1);
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    90
val ordertype_Int = result();
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    91
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    92
(* used only in AC16_lemmas.ML *)
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    93
goalw CardinalArith.thy [InfCard_def]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
    94
        "!!i. [| ~Finite(i); Card(i) |] ==> InfCard(i)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    95
by (asm_simp_tac (!simpset addsimps [Card_is_Ord RS nat_le_infinite_Ord]) 1);
991
547931cbbf08 New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    96
val Inf_Card_is_InfCard = result();
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
    97
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
    98
goal thy "(THE z. {x}={z}) = x";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
    99
by (fast_tac (!claset addSIs [the_equality]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   100
                addSEs [singleton_eq_iff RS iffD1 RS sym]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   101
val the_element = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   102
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   103
goal thy "(lam x:A. {x}) : bij(A, {{x}. x:A})";
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   104
by (res_inst_tac [("d","%z. THE x. z={x}")] lam_bijective 1);
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   105
by (TRYALL (eresolve_tac [RepFunI, RepFunE]));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   106
by (REPEAT (asm_full_simp_tac (!simpset addsimps [the_element]) 1));
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   107
val lam_sing_bij = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   108
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   109
val [major,minor] = goal thy 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   110
        "[| f : Pi(A,B); (!!x. x:A ==> B(x)<=C(x)) |] ==> f : Pi(A,C)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   111
by (fast_tac (!claset addSIs [major RS Pi_type, minor RS subsetD,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   112
                major RS apply_type]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   113
val Pi_weaken_type = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   114
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   115
val [major, minor] = goalw thy [inj_def]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   116
        "[| f:inj(A, B); (!!a. a:A ==> f`a : C) |] ==> f:inj(A,C)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   117
by (fast_tac (!claset addSEs [minor]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   118
        addSIs [major RS CollectD1 RS Pi_type, major RS CollectD2]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   119
val inj_strengthen_type = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   120
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   121
goal thy "A*B=0 <-> A=0 | B=0";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   122
by (fast_tac (!claset addSIs [equals0I] addEs [equals0D]) 1);
1123
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   123
val Sigma_empty_iff = result();
5dfdc1464966 Krzysztof Grabczewski's (nearly) complete AC proofs
lcp
parents: 1071
diff changeset
   124
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   125
goalw thy [Finite_def] "!!n. n:nat ==> Finite(n)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   126
by (fast_tac (!claset addSIs [eqpoll_refl]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   127
val nat_into_Finite = result();
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   128
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   129
goalw thy [Finite_def] "~Finite(nat)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   130
by (fast_tac (!claset addSDs [eqpoll_imp_lepoll]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   131
                addIs [Ord_nat RSN (2, ltI) RS lt_not_lepoll RS notE]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   132
val nat_not_Finite = result();
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   133
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   134
val le_imp_lepoll = le_imp_subset RS subset_imp_lepoll;
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   135
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   136
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   137
(* Another elimination rule for EX!                                       *)
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   138
(* ********************************************************************** *)
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   139
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   140
goal thy "!!x. [| EX! x. P(x); P(x); P(y) |] ==> x=y";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   141
by (etac ex1E 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   142
by (res_inst_tac [("b","xa")] (sym RSN (2, trans)) 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   143
by (Fast_tac 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   144
by (Fast_tac 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   145
val ex1_two_eq = result();
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   146
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   147
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   148
(* image of a surjection                                                  *)
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   149
(* ********************************************************************** *)
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   150
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   151
goalw thy [surj_def] "!!f. f : surj(A, B) ==> f``A = B";
1207
3f460842e919 Ran expandshort and changed spelling of Grabczewski
lcp
parents: 1200
diff changeset
   152
by (etac CollectE 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   153
by (resolve_tac [subset_refl RSN (2, image_fun) RS ssubst] 1 THEN (assume_tac 1));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   154
by (fast_tac (!claset addSEs [RepFunE, apply_type]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1207
diff changeset
   155
                addSIs [RepFunI] addIs [equalityI]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   156
val surj_image_eq = result();
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   157
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   158
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   159
goal thy "!!y. succ(x) lepoll y ==> y ~= 0";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   160
by (fast_tac (!claset addSDs [lepoll_0_is_0]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   161
val succ_lepoll_imp_not_empty = result();
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   162
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   163
goal thy "!!x. x eqpoll succ(n) ==> x ~= 0";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1615
diff changeset
   164
by (fast_tac (!claset addSEs [eqpoll_sym RS eqpoll_0_is_0 RS succ_neq_0]) 1);
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   165
val eqpoll_succ_imp_not_empty = result();
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents: 1123
diff changeset
   166