src/ZF/AC/WO6_WO1.ML
author paulson
Tue, 08 Jan 2002 16:09:09 +0100
changeset 12667 7e6eaaa125f2
parent 11380 e76366922751
permissions -rw-r--r--
Added some simprules proofs. Converted theories CardinalArith and OrdQuant to Isar style
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
     1
(*  Title:      ZF/AC/WO6_WO1.ML
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
     3
    Author:     Krzysztof Grabczewski
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     4
11380
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
     5
  Proofs needed to state that formulations WO1,...,WO6 are all equivalent.
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
     6
  The only hard one is WO6 ==> WO1.
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
     7
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
     8
  Every proof (except WO6 ==> WO1 and WO1 ==> WO2) are described as "clear"
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
     9
  by Rubin & Rubin (page 2). 
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    10
  They refer reader to a book by Gödel to see the proof WO1 ==> WO2.
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    11
  Fortunately order types made this proof also very easy.
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    12
*)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    13
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    14
(* ********************************************************************** *)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    15
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    16
Goalw WO_defs "WO2 ==> WO3";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    17
by (Fast_tac 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    18
qed "WO2_WO3";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    19
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    20
(* ********************************************************************** *)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    21
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    22
Goalw (eqpoll_def::WO_defs) "WO3 ==> WO1";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    23
by (fast_tac (claset() addSEs [bij_is_inj RS well_ord_rvimage, 
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    24
			      well_ord_Memrel RS well_ord_subset]) 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    25
qed "WO3_WO1";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    26
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    27
(* ********************************************************************** *)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    28
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    29
Goalw (eqpoll_def::WO_defs) "WO1 ==> WO2";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    30
by (fast_tac (claset() addSIs [Ord_ordertype, ordermap_bij]) 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    31
qed "WO1_WO2";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    32
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    33
(* ********************************************************************** *)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    34
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    35
Goal "f \\<in> A->B ==> (\\<lambda>x \\<in> A. {f`x}): A -> {{b}. b \\<in> B}";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    36
by (fast_tac (claset() addSIs [lam_type, apply_type]) 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    37
qed "lam_sets";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    38
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    39
Goalw [surj_def] "f \\<in> surj(A,B) ==> (\\<Union>a \\<in> A. {f`a}) = B";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    40
by (fast_tac (claset() addSEs [apply_type]) 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    41
qed "surj_imp_eq_";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    42
11380
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    43
Goal "[| f \\<in> surj(A,B); Ord(A) |] ==> (\\<Union>a<A. {f`a}) = B";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    44
by (fast_tac (claset() addSDs [surj_imp_eq_]
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    45
                addSIs [ltI] addSEs [ltE]) 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    46
qed "surj_imp_eq";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    47
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    48
Goalw WO_defs "WO1 ==> WO4(1)";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    49
by (rtac allI 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    50
by (eres_inst_tac [("x","A")] allE 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    51
by (etac exE 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    52
by (REPEAT (resolve_tac [exI, conjI] 1));
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    53
by (etac Ord_ordertype 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    54
by (rtac conjI 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    55
by (eresolve_tac [ordermap_bij RS bij_converse_bij RS bij_is_fun RS
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    56
                lam_sets RS domain_of_fun] 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    57
by (asm_simp_tac (simpset() addsimps [singleton_eqpoll_1 RS eqpoll_imp_lepoll,
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    58
                  Ord_ordertype RSN (2, ordermap_bij RS bij_converse_bij RS
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    59
                        bij_is_surj RS surj_imp_eq)]) 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    60
qed "WO1_WO4";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    61
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    62
(* ********************************************************************** *)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    63
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    64
Goalw WO_defs "[| m le n; WO4(m) |] ==> WO4(n)";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    65
by (blast_tac (claset() addSDs [spec] 
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    66
                        addIs [le_imp_lepoll RSN (2, lepoll_trans)]) 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    67
qed "WO4_mono";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    68
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    69
(* ********************************************************************** *)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    70
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    71
Goalw WO_defs "[| m \\<in> nat; 1 le m; WO4(m) |] ==> WO5";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    72
by (Blast_tac 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    73
qed "WO4_WO5";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    74
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    75
(* ********************************************************************** *)
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    76
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    77
Goalw WO_defs "WO5 ==> WO6";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    78
by (Blast_tac 1);
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    79
qed "WO5_WO6";
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    80
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    81
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    82
(* ********************************************************************** 
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    83
    The proof of "WO6 ==> WO1".  Simplified by L C Paulson.
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    84
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    85
    From the book "Equivalents of the Axiom of Choice" by Rubin & Rubin,
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    86
    pages 2-5
e76366922751 tidying and consolidating files
paulson
parents: 11317
diff changeset
    87
************************************************************************* *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    88
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    89
goal OrderType.thy 
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    90
      "!!i j k. [| k < i++j;  Ord(i);  Ord(j) |] ==>  \
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    91
\                  k < i  |  (~ k<i & k = i ++ (k--i) & (k--i)<j)";
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    92
by (res_inst_tac [("i","k"),("j","i")] Ord_linear2 1);
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    93
by (dtac odiff_lt_mono2 4 THEN assume_tac 4);
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    94
by (asm_full_simp_tac
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    95
    (simpset() addsimps [oadd_odiff_inverse, odiff_oadd_inverse]) 4);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    96
by (safe_tac (claset() addSEs [lt_Ord]));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
    97
qed "lt_oadd_odiff_disj";
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    98
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
    99
(*The corresponding elimination rule*)
4152
451104c223e2 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   100
val lt_oadd_odiff_cases = rule_by_tactic Safe_tac
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   101
                                         (lt_oadd_odiff_disj RS disjE);
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   102
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   103
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   104
(* The most complicated part of the proof - lemma ii - p. 2-4             *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   105
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   106
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   107
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   108
(* some properties of relation uu(beta, gamma, delta) - p. 2              *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   109
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   110
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   111
Goalw [uu_def] "domain(uu(f,b,g,d)) \\<subseteq> f`b";
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   112
by (Blast_tac 1);
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   113
qed "domain_uu_subset";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   114
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   115
Goal "\\<forall>b<a. f`b lepoll m ==> \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   116
\               \\<forall>b<a. \\<forall>g<a. \\<forall>d<a. domain(uu(f,b,g,d)) lepoll m";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   117
by (fast_tac (claset() addSEs
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   118
        [domain_uu_subset RS subset_imp_lepoll RS lepoll_trans]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   119
qed "quant_domain_uu_lepoll_m";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   120
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   121
Goalw [uu_def] "uu(f,b,g,d) \\<subseteq> f`b * f`g";
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   122
by (Blast_tac 1);
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   123
qed "uu_subset1";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   124
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   125
Goalw [uu_def] "uu(f,b,g,d) \\<subseteq> f`d";
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   126
by (Blast_tac 1);
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   127
qed "uu_subset2";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   128
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   129
Goal "[| \\<forall>b<a. f`b lepoll m;  d<a |] ==> uu(f,b,g,d) lepoll m";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   130
by (fast_tac (claset()
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   131
        addSEs [uu_subset2 RS subset_imp_lepoll RS lepoll_trans]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   132
qed "uu_lepoll_m";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   133
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   134
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   135
(* Two cases for lemma ii                                                 *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   136
(* ********************************************************************** *)
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   137
Goalw [lesspoll_def] 
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   138
     "\\<forall>b<a. \\<forall>g<a. \\<forall>d<a. u(f,b,g,d) lepoll m  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   139
\     ==> (\\<forall>b<a. f`b \\<noteq> 0 --> \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   140
\                 (\\<exists>g<a. \\<exists>d<a. u(f,b,g,d) \\<noteq> 0 & u(f,b,g,d) lesspoll m)) \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   141
\       | (\\<exists>b<a. f`b \\<noteq> 0 & (\\<forall>g<a. \\<forall>d<a. u(f,b,g,d) \\<noteq> 0 -->  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   142
\                                       u(f,b,g,d) eqpoll m))";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   143
by (Asm_simp_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   144
by (blast_tac (claset() delrules [equalityI]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   145
qed "cases";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   146
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   147
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   148
(* Lemmas used in both cases                                              *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   149
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   150
Goal "Ord(a) ==> (\\<Union>b<a++a. C(b)) = (\\<Union>b<a. C(b) Un C(a++b))";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   151
by (fast_tac (claset() addSIs [equalityI] addIs [ltI] 
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   152
                    addSDs [lt_oadd_disj]
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   153
                    addSEs [lt_oadd1, oadd_lt_mono2]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   154
qed "UN_oadd";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   155
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   156
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   157
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   158
(* Case 1 \\<in> lemmas                                                        *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   159
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   160
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   161
Goalw [vv1_def] "vv1(f,m,b) \\<subseteq> f`b";
1450
19a256c8086d Renamed letI to LetI (for consistency)
paulson
parents: 1208
diff changeset
   162
by (rtac (LetI RS LetI) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   163
by (simp_tac (simpset() addsimps [domain_uu_subset]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   164
qed "vv1_subset";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   165
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   166
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   167
(* Case 1 \\<in> Union of images is the whole "y"                              *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   168
(* ********************************************************************** *)
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   169
Goalw [gg1_def]
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   170
  "!! a f y. [| Ord(a);  m \\<in> nat |] ==>   \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   171
\            (\\<Union>b<a++a. gg1(f,a,m)`b) = (\\<Union>b<a. f`b)";
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   172
by (asm_simp_tac
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   173
    (simpset() addsimps [UN_oadd, lt_oadd1,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   174
                           oadd_le_self RS le_imp_not_lt, lt_Ord,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   175
                           odiff_oadd_inverse, ltD,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   176
                           vv1_subset RS Diff_partition, ww1_def]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   177
qed "UN_gg1_eq";
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   178
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   179
Goal "domain(gg1(f,a,m)) = a++a";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   180
by (simp_tac (simpset() addsimps [lam_funtype RS domain_of_fun, gg1_def]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   181
qed "domain_gg1";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   182
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   183
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   184
(* every value of defined function is less than or equipollent to m       *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   185
(* ********************************************************************** *)
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   186
Goal "[| P(a, b);  Ord(a);  Ord(b);  \
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   187
\               Least_a = (LEAST a. \\<exists>x. Ord(x) & P(a, x)) |]  \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   188
\               ==> P(Least_a, LEAST b. P(Least_a, b))";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   189
by (etac ssubst 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   190
by (res_inst_tac [("Q","%z. P(z, LEAST b. P(z, b))")] LeastI2 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   191
by (REPEAT (fast_tac (claset() addSEs [LeastI]) 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   192
qed "nested_LeastI";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   193
8551
5c22595bc599 tidied using new "inst" rule
paulson
parents: 8123
diff changeset
   194
bind_thm ("nested_Least_instance",
5c22595bc599 tidied using new "inst" rule
paulson
parents: 8123
diff changeset
   195
	  inst "P" 
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   196
               "%g d. domain(uu(f,b,g,d)) \\<noteq> 0 & domain(uu(f,b,g,d)) lepoll m" 
8551
5c22595bc599 tidied using new "inst" rule
paulson
parents: 8123
diff changeset
   197
	  nested_LeastI);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   198
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   199
Goalw [gg1_def]
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   200
    "!!a. [| Ord(a);  m \\<in> nat;  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   201
\            \\<forall>b<a. f`b \\<noteq>0 -->                                       \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   202
\            (\\<exists>g<a. \\<exists>d<a. domain(uu(f,b,g,d)) \\<noteq> 0  &               \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   203
\                             domain(uu(f,b,g,d)) lepoll m);            \
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   204
\            \\<forall>b<a. f`b lepoll succ(m);  b<a++a                       \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   205
\         |] ==> gg1(f,a,m)`b lepoll m";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   206
by (Asm_simp_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   207
by (safe_tac (claset() addSEs [lt_oadd_odiff_cases]));
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   208
(*Case b<a   \\<in> show vv1(f,m,b) lepoll m *)
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   209
by (asm_simp_tac (simpset() addsimps [vv1_def, Let_def]) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   210
by (fast_tac (claset() addIs [nested_Least_instance RS conjunct2]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   211
                addSEs [lt_Ord]
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   212
                addSIs [empty_lepollI]) 1);
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   213
(*Case a le b \\<in> show ww1(f,m,b--a) lepoll m *)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   214
by (asm_simp_tac (simpset() addsimps [ww1_def]) 1);
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   215
by (excluded_middle_tac "f`(b--a) = 0" 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   216
by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 2);
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   217
by (rtac Diff_lepoll 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   218
by (Blast_tac 1);
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   219
by (rtac vv1_subset 1);
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   220
by (dtac (ospec RS mp) 1);
6153
bff90585cce5 new typechecking solver for the simplifier
paulson
parents: 6070
diff changeset
   221
by (REPEAT (eresolve_tac [asm_rl, oexE, conjE] 1));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   222
by (asm_simp_tac (simpset()
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   223
        addsimps [vv1_def, Let_def, lt_Ord, 
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   224
                  nested_Least_instance RS conjunct1]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   225
qed "gg1_lepoll_m";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   226
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   227
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   228
(* Case 2 \\<in> lemmas                                                        *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   229
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   230
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   231
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   232
(* Case 2 \\<in> vv2_subset                                                    *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   233
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   234
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   235
Goalw [uu_def] "[| b<a;  g<a;  f`b\\<noteq>0;  f`g\\<noteq>0;        \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   236
\                  y*y \\<subseteq> y;  (\\<Union>b<a. f`b)=y          \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   237
\               |] ==> \\<exists>d<a. uu(f,b,g,d) \\<noteq> 0";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   238
by (fast_tac (claset() addSIs [not_emptyI] 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   239
                    addSDs [SigmaI RSN (2, subsetD)]
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   240
                    addSEs [not_emptyE]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   241
qed "ex_d_uu_not_empty";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   242
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   243
Goal "[| b<a; g<a; f`b\\<noteq>0; f`g\\<noteq>0;  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   244
\        y*y \\<subseteq> y; (\\<Union>b<a. f`b)=y |]  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   245
\     ==> uu(f,b,g,LEAST d. (uu(f,b,g,d) \\<noteq> 0)) \\<noteq> 0";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   246
by (dtac ex_d_uu_not_empty 1 THEN REPEAT (assume_tac 1));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   247
by (fast_tac (claset() addSEs [LeastI, lt_Ord]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   248
qed "uu_not_empty";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   249
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   250
Goal "[| r \\<subseteq> A*B; r\\<noteq>0 |] ==> domain(r)\\<noteq>0";
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5315
diff changeset
   251
by (Blast_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   252
qed "not_empty_rel_imp_domain";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   253
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   254
Goal "[| b<a; g<a; f`b\\<noteq>0; f`g\\<noteq>0;  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   255
\        y*y \\<subseteq> y; (\\<Union>b<a. f`b)=y |]  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   256
\     ==> (LEAST d. uu(f,b,g,d) \\<noteq> 0) < a";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   257
by (eresolve_tac [ex_d_uu_not_empty RS oexE] 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   258
        THEN REPEAT (assume_tac 1));
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   259
by (resolve_tac [Least_le RS lt_trans1] 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   260
        THEN (REPEAT (ares_tac [lt_Ord] 1)));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   261
qed "Least_uu_not_empty_lt_a";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   262
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   263
Goal "[| B \\<subseteq> A; a\\<notin>B |] ==> B \\<subseteq> A-{a}";
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   264
by (Blast_tac 1);
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   265
qed "subset_Diff_sing";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   266
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   267
(*Could this be proved more directly?*)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   268
Goal "[| A lepoll m; m lepoll B; B \\<subseteq> A; m \\<in> nat |] ==> A=B";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   269
by (etac natE 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   270
by (fast_tac (claset() addSDs [lepoll_0_is_0] addSIs [equalityI]) 1);
5325
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5315
diff changeset
   271
by (safe_tac (claset() addSIs [equalityI])); 
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5315
diff changeset
   272
by (rtac ccontr 1);
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5315
diff changeset
   273
by (etac (subset_Diff_sing RS subset_imp_lepoll 
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5315
diff changeset
   274
	  RSN (2, Diff_sing_lepoll RSN (3, lepoll_trans RS lepoll_trans)) RS 
f7a5e06adea1 Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
paulson
parents: 5315
diff changeset
   275
	  succ_lepoll_natE) 1
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   276
        THEN REPEAT (assume_tac 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   277
qed "supset_lepoll_imp_eq";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   278
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   279
Goal "[| \\<forall>g<a. \\<forall>d<a. domain(uu(f, b, g, d))\\<noteq>0 -->               \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   280
\         domain(uu(f, b, g, d)) eqpoll succ(m);                        \
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   281
\         \\<forall>b<a. f`b lepoll succ(m);  y*y \\<subseteq> y;                       \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   282
\         (\\<Union>b<a. f`b)=y;  b<a;  g<a;  d<a;                            \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   283
\         f`b\\<noteq>0;  f`g\\<noteq>0;  m \\<in> nat;  s \\<in> f`b                               \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   284
\      |] ==> uu(f, b, g, LEAST d. uu(f,b,g,d)\\<noteq>0) \\<in> f`b -> f`g";
1071
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
   285
by (dres_inst_tac [("x2","g")] (ospec RS ospec RS mp) 1);
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
   286
by (rtac ([uu_subset1, uu_not_empty] MRS not_empty_rel_imp_domain) 3);
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
   287
by (rtac Least_uu_not_empty_lt_a 2 THEN TRYALL assume_tac);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   288
by (resolve_tac [eqpoll_sym RS eqpoll_imp_lepoll RS 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   289
        (Least_uu_not_empty_lt_a RSN (2, uu_lepoll_m) RSN (2, 
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   290
        uu_subset1 RSN (4, rel_is_fun)))] 1
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   291
        THEN TRYALL assume_tac);
1071
96dfc9977bf5 Simple updates for compatibility with KG
lcp
parents: 1057
diff changeset
   292
by (rtac (eqpoll_sym RS eqpoll_imp_lepoll RSN (2, supset_lepoll_imp_eq)) 1);
12667
7e6eaaa125f2 Added some simprules proofs.
paulson
parents: 11380
diff changeset
   293
by (REPEAT_FIRST assume_tac);
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   294
by (REPEAT (fast_tac (claset() addSIs [domain_uu_subset]) 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   295
qed "uu_Least_is_fun";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   296
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   297
Goalw [vv2_def]
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   298
    "!!a. [| \\<forall>g<a. \\<forall>d<a. domain(uu(f, b, g, d))\\<noteq>0 -->            \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   299
\            domain(uu(f, b, g, d)) eqpoll succ(m);                     \
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   300
\            \\<forall>b<a. f`b lepoll succ(m); y*y \\<subseteq> y;                     \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   301
\            (\\<Union>b<a. f`b)=y;  b<a;  g<a;  m \\<in> nat;  s \\<in> f`b                \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   302
\          |] ==> vv2(f,b,g,s) \\<subseteq> f`g";
5116
8eb343ab5748 Renamed expand_if to split_if and setloop split_tac to addsplits,
paulson
parents: 5068
diff changeset
   303
by (split_tac [split_if] 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   304
by Safe_tac;
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   305
by (etac (uu_Least_is_fun RS apply_type) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   306
by (REPEAT_SOME (fast_tac (claset() addSIs [not_emptyI, singleton_subsetI])));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   307
qed "vv2_subset";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   308
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   309
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   310
(* Case 2 \\<in> Union of images is the whole "y"                              *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   311
(* ********************************************************************** *)
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   312
Goalw [gg2_def]
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   313
    "!!a. [| \\<forall>g<a. \\<forall>d<a. domain(uu(f,b,g,d)) \\<noteq> 0 -->             \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   314
\            domain(uu(f,b,g,d)) eqpoll succ(m);                        \
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   315
\            \\<forall>b<a. f`b lepoll succ(m); y*y \\<subseteq> y;                       \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   316
\            (\\<Union>b<a. f`b)=y;  Ord(a);  m \\<in> nat;  s \\<in> f`b;  b<a              \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   317
\         |] ==> (\\<Union>g<a++a. gg2(f,a,b,s) ` g) = y";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   318
by (dtac sym 1);
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   319
by (asm_simp_tac
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   320
    (simpset() addsimps [UN_oadd, lt_oadd1,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   321
                           oadd_le_self RS le_imp_not_lt, lt_Ord,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   322
                           odiff_oadd_inverse, ww2_def,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   323
                           vv2_subset RS Diff_partition]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   324
qed "UN_gg2_eq";
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   325
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   326
Goal "domain(gg2(f,a,b,s)) = a++a";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   327
by (simp_tac (simpset() addsimps [lam_funtype RS domain_of_fun, gg2_def]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   328
qed "domain_gg2";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   329
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   330
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   331
(* every value of defined function is less than or equipollent to m       *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   332
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   333
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   334
Goalw [vv2_def] "[| m \\<in> nat; m\\<noteq>0 |] ==> vv2(f,b,g,s) lepoll m";
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   335
by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   336
by (fast_tac (claset()
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   337
        addSDs [le_imp_subset RS subset_imp_lepoll RS lepoll_0_is_0]
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   338
        addSIs [singleton_eqpoll_1 RS eqpoll_imp_lepoll RS lepoll_trans,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   339
                not_lt_imp_le RS le_imp_subset RS subset_imp_lepoll,
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   340
                nat_into_Ord, nat_1I]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   341
qed "vv2_lepoll";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   342
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   343
Goalw [ww2_def]
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   344
    "[| \\<forall>b<a. f`b lepoll succ(m);  g<a;  m \\<in> nat;  vv2(f,b,g,d) \\<subseteq> f`g |] \
5315
c9ad6bbf3a34 tidying
paulson
parents: 5268
diff changeset
   345
\    ==> ww2(f,b,g,d) lepoll m";
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   346
by (excluded_middle_tac "f`g = 0" 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   347
by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 2);
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   348
by (dtac ospec 1 THEN (assume_tac 1));
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   349
by (rtac Diff_lepoll 1 THEN (TRYALL assume_tac));
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   350
by (asm_simp_tac (simpset() addsimps [vv2_def, not_emptyI]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   351
qed "ww2_lepoll";
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   352
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4152
diff changeset
   353
Goalw [gg2_def]
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   354
    "!!a. [| \\<forall>g<a. \\<forall>d<a. domain(uu(f,b,g,d)) \\<noteq> 0 -->             \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   355
\            domain(uu(f,b,g,d)) eqpoll succ(m);                        \
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   356
\            \\<forall>b<a. f`b lepoll succ(m);  y*y \\<subseteq> y;                    \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   357
\            (\\<Union>b<a. f`b)=y;  b<a;  s \\<in> f`b;  m \\<in> nat;  m\\<noteq> 0;  g<a++a     \
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   358
\         |] ==> gg2(f,a,b,s) ` g lepoll m";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   359
by (Asm_simp_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   360
by (safe_tac (claset() addSEs [lt_oadd_odiff_cases, lt_Ord2]));
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   361
by (asm_simp_tac (simpset() addsimps [vv2_lepoll]) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   362
by (asm_simp_tac (simpset() addsimps [ww2_lepoll, vv2_subset]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   363
qed "gg2_lepoll_m";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   364
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   365
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   366
(* lemma ii                                                               *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   367
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   368
Goalw [NN_def] "[| succ(m) \\<in> NN(y); y*y \\<subseteq> y; m \\<in> nat; m\\<noteq>0 |] ==> m \\<in> NN(y)";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   369
by (REPEAT (eresolve_tac [CollectE, exE, conjE] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   370
by (resolve_tac [quant_domain_uu_lepoll_m RS cases RS disjE] 1
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   371
    THEN (assume_tac 1));
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   372
(* case 1 *)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   373
by (asm_full_simp_tac (simpset() addsimps [lesspoll_succ_iff]) 1);
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   374
by (res_inst_tac [("x","a++a")] exI 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   375
by (fast_tac (claset() addSIs [Ord_oadd, domain_gg1, UN_gg1_eq, 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   376
                                  gg1_lepoll_m]) 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   377
(* case 2 *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   378
by (REPEAT (eresolve_tac [oexE, conjE] 1));
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   379
by (res_inst_tac [("A","f`?B")] not_emptyE 1 THEN (assume_tac 1));
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   380
by (rtac CollectI 1);
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   381
by (etac succ_natD 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   382
by (res_inst_tac [("x","a++a")] exI 1);
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   383
by (res_inst_tac [("x","gg2(f,a,b,x)")] exI 1);
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   384
(*Calling fast_tac might get rid of the res_inst_tac calls, but it
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   385
  is just too slow.*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   386
by (asm_simp_tac (simpset() addsimps 
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   387
                  [Ord_oadd, domain_gg2, UN_gg2_eq, gg2_lepoll_m]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   388
qed "lemma_ii";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   389
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   390
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   391
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   392
(* lemma iv - p. 4 \\<in>                                                      *)
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   393
(* For every set x there is a set y such that   x Un (y * y) \\<subseteq> y         *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   394
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   395
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   396
(* the quantifier \\<forall>looks inelegant but makes the proofs shorter  *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   397
(* (used only in the following two lemmas)                          *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   398
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   399
Goal "\\<forall>n \\<in> nat. rec(n, x, %k r. r Un r*r) \\<subseteq>  \
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   400
\                    rec(succ(n), x, %k r. r Un r*r)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   401
by (fast_tac (claset() addIs [rec_succ RS ssubst]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   402
qed "z_n_subset_z_succ_n";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   403
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   404
Goal "[| \\<forall>n \\<in> nat. f(n)<=f(succ(n)); n le m; n \\<in> nat; m \\<in> nat |]  \
5315
c9ad6bbf3a34 tidying
paulson
parents: 5268
diff changeset
   405
\     ==> f(n)<=f(m)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   406
by (eres_inst_tac [("P","n le m")] rev_mp 1);
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   407
by (res_inst_tac [("P","%z. n le z --> f(n) \\<subseteq> f(z)")] nat_induct 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   408
by (REPEAT (fast_tac le_cs 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   409
qed "le_subsets";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   410
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   411
Goal "[| n le m; m \\<in> nat |] ==>  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   412
\       rec(n, x, %k r. r Un r*r) \\<subseteq> rec(m, x, %k r. r Un r*r)";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   413
by (resolve_tac [z_n_subset_z_succ_n RS le_subsets] 1 
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   414
    THEN (TRYALL assume_tac));
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   415
by (eresolve_tac [Ord_nat RSN (2, ltI) RSN (2, lt_trans1) RS ltD] 1
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   416
    THEN (assume_tac 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   417
qed "le_imp_rec_subset";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   418
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   419
Goal "\\<exists>y. x Un y*y \\<subseteq> y";
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   420
by (res_inst_tac [("x","\\<Union>n \\<in> nat. rec(n, x, %k r. r Un r*r)")] exI 1);
4152
451104c223e2 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   421
by Safe_tac;
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   422
by (rtac (nat_0I RS UN_I) 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   423
by (Asm_simp_tac 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   424
by (res_inst_tac [("a","succ(n Un na)")] UN_I 1);
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   425
by (eresolve_tac [Un_nat_type RS nat_succI] 1 THEN (assume_tac 1));
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   426
by (fast_tac (ZF_cs addIs [le_imp_rec_subset RS subsetD]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   427
                addSIs [Un_upper1_le, Un_upper2_le, Un_nat_type]
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   428
                addSEs [nat_into_Ord] addss (simpset())) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   429
qed "lemma_iv";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   430
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   431
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   432
(* Rubin & Rubin wrote \\<in>                                                  *)
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   433
(* "It follows from (ii) and mathematical induction that if y*y \\<subseteq> y then *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   434
(* y can be well-ordered"                                                 *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   435
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   436
(* In fact we have to prove \\<in>                                             *)
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   437
(*      * WO6 ==> NN(y) \\<noteq> 0                                              *)
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   438
(*      * reverse induction which lets us infer that 1 \\<in> NN(y)            *)
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   439
(*      * 1 \\<in> NN(y) ==> y can be well-ordered                             *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   440
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   441
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   442
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   443
(*      WO6 ==> NN(y) \\<noteq> 0                                                *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   444
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   445
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   446
Goalw [WO6_def, NN_def] "WO6 ==> NN(y) \\<noteq> 0";
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5241
diff changeset
   447
by (fast_tac ZF_cs 1);  (*SLOW if current claset is used*)
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   448
qed "WO6_imp_NN_not_empty";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   449
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   450
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   451
(*      1 \\<in> NN(y) ==> y can be well-ordered                               *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   452
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   453
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   454
Goal "[| (\\<Union>b<a. f`b)=y; x \\<in> y; \\<forall>b<a. f`b lepoll 1; Ord(a) |]  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   455
\     ==> \\<exists>c<a. f`c = {x}";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   456
by (fast_tac (claset() addSEs [lepoll_1_is_sing]) 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   457
val lemma1 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   458
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   459
Goal "[| (\\<Union>b<a. f`b)=y; x \\<in> y; \\<forall>b<a. f`b lepoll 1; Ord(a) |]  \
5315
c9ad6bbf3a34 tidying
paulson
parents: 5268
diff changeset
   460
\     ==> f` (LEAST i. f`i = {x}) = {x}";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   461
by (dtac lemma1 1 THEN REPEAT (assume_tac 1));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   462
by (fast_tac (claset() addSEs [lt_Ord] addIs [LeastI]) 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   463
val lemma2 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   464
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   465
Goalw [NN_def] "1 \\<in> NN(y) ==> \\<exists>a f. Ord(a) & f \\<in> inj(y, a)";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   466
by (etac CollectE 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   467
by (REPEAT (eresolve_tac [exE, conjE] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   468
by (res_inst_tac [("x","a")] exI 1);
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   469
by (res_inst_tac [("x","\\<lambda>x \\<in> y. LEAST i. f`i = {x}")] exI 1);
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   470
by (rtac conjI 1 THEN (assume_tac 1));
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   471
by (res_inst_tac [("d","%i. THE x. x \\<in> f`i")] lam_injective 1);
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   472
by (dtac lemma1 1 THEN REPEAT (assume_tac 1));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   473
by (fast_tac (claset() addSEs [Least_le RS lt_trans1 RS ltD, lt_Ord]) 1);
1041
6664d0b54d0f Deleted subset_imp_Un_Diff_eq, as it is identical to
lcp
parents: 992
diff changeset
   474
by (resolve_tac [lemma2 RS ssubst] 1 THEN REPEAT (assume_tac 1));
5505
paulson
parents: 5325
diff changeset
   475
by (Blast_tac 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   476
qed "NN_imp_ex_inj";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   477
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   478
Goal "[| y*y \\<subseteq> y; 1 \\<in> NN(y) |] ==> \\<exists>r. well_ord(y, r)";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   479
by (dtac NN_imp_ex_inj 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   480
by (fast_tac (claset() addSEs [well_ord_Memrel RSN (2,  well_ord_rvimage)]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   481
qed "y_well_ord";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   482
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   483
(* ********************************************************************** *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   484
(*      reverse induction which lets us infer that 1 \\<in> NN(y)              *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   485
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   486
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   487
val [prem1, prem2] = goal thy
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   488
        "[| n \\<in> nat; !!m. [| m \\<in> nat; m\\<noteq>0; P(succ(m)) |] ==> P(m) |]  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   489
\       ==> n\\<noteq>0 --> P(n) --> P(1)";
6070
032babd0120b ZF: the natural numbers as a datatype
paulson
parents: 5505
diff changeset
   490
by (rtac (prem1 RS nat_induct) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   491
by (Blast_tac 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   492
by (excluded_middle_tac "x=0" 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   493
by (Blast_tac 2);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   494
by (fast_tac (claset() addSIs [prem2]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   495
qed "rev_induct_lemma";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   496
5315
c9ad6bbf3a34 tidying
paulson
parents: 5268
diff changeset
   497
val prems = 
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   498
Goal    "[| P(n); n \\<in> nat; n\\<noteq>0;  \
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   499
\           !!m. [| m \\<in> nat; m\\<noteq>0; P(succ(m)) |] ==> P(m) |]  \
5315
c9ad6bbf3a34 tidying
paulson
parents: 5268
diff changeset
   500
\        ==> P(1)";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   501
by (resolve_tac [rev_induct_lemma RS impE] 1);
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   502
by (etac impE 4 THEN (assume_tac 5));
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   503
by (REPEAT (ares_tac prems 1));
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   504
qed "rev_induct";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   505
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   506
Goalw [NN_def] "n \\<in> NN(y) ==> n \\<in> nat";
1057
5097aa914449 Renamed diff_sing_lepoll to Diff_sing_lepoll.
lcp
parents: 1041
diff changeset
   507
by (etac CollectD1 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   508
qed "NN_into_nat";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   509
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   510
Goal "[| n \\<in> NN(y); y*y \\<subseteq> y; n\\<noteq>0 |] ==> 1 \\<in> NN(y)";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   511
by (rtac rev_induct 1 THEN REPEAT (ares_tac [NN_into_nat] 1));
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   512
by (rtac lemma_ii 1 THEN REPEAT (assume_tac 1));
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   513
val lemma3 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   514
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   515
(* ********************************************************************** *)
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1450
diff changeset
   516
(* Main theorem "WO6 ==> WO1"                                             *)
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   517
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   518
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   519
(* another helpful lemma *)
11317
7f9e4c389318 X-symbols for set theory
paulson
parents: 8551
diff changeset
   520
Goalw [NN_def] "0 \\<in> NN(y) ==> y=0";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   521
by (fast_tac (claset() addSIs [equalityI] 
5315
c9ad6bbf3a34 tidying
paulson
parents: 5268
diff changeset
   522
                       addSDs [lepoll_0_is_0] addEs [subst]) 1);
3731
71366483323b result() -> qed; Step_tac -> Safe_tac
paulson
parents: 2873
diff changeset
   523
qed "NN_y_0";
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   524
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   525
Goalw [WO1_def] "WO6 ==> WO1";
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   526
by (rtac allI 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   527
by (excluded_middle_tac "A=0" 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   528
by (fast_tac (claset() addSIs [well_ord_Memrel, nat_0I RS nat_into_Ord]) 2);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   529
by (res_inst_tac [("x1","A")] (lemma_iv RS revcut_rl) 1);
1208
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   530
by (etac exE 1);
bc3093616ba4 Ran expandshort and corrected spelling of Grabczewski
paulson
parents: 1071
diff changeset
   531
by (dtac WO6_imp_NN_not_empty 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   532
by (eresolve_tac [Un_subset_iff RS iffD1 RS conjE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   533
by (eres_inst_tac [("A","NN(y)")] not_emptyE 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 6153
diff changeset
   534
by (ftac y_well_ord 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   535
by (fast_tac (claset() addEs [well_ord_subset]) 2);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   536
by (fast_tac (claset() addSIs [lemma3] addSDs [NN_y_0] addSEs [not_emptyE]) 1);
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   537
qed "WO6_imp_WO1";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   538