src/ZF/AC/WO6_WO1.ML
author lcp
Fri, 31 Mar 1995 11:55:29 +0200
changeset 992 4ef4f7ff2aeb
child 1041 6664d0b54d0f
permissions -rw-r--r--
New example of AC Equivalences by Krzysztof Grabczewski
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
992
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     1
(*  Title: 	ZF/AC/WO6_WO1.ML
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     2
    ID:         $Id$
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     3
    Author: 	Krzysztof Gr`abczewski
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     4
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     5
The proof of "WO6 ==> WO1".
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     6
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     7
From the book "Equivalents of the Axiom of Choice" by Rubin & Rubin,
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     8
pages 2-5
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
     9
*)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    10
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    11
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    12
(* The most complicated part of the proof - lemma ii - p. 2-4		  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    13
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    14
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    15
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    16
(* some properties of relation uu(beta, gamma, delta) - p. 2		  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    17
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    18
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    19
goalw thy [uu_def] "domain(uu(f,b,g,d)) <= f`b";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    20
by (fast_tac ZF_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    21
val domain_uu_subset = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    22
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    23
goal thy "!!a. [| ALL b<a. f`b lepoll m; b<a |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    24
\		==> domain(uu(f, b, g, d)) lepoll m";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    25
by (fast_tac (AC_cs addSEs
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    26
	[domain_uu_subset RS subset_imp_lepoll RS lepoll_trans]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    27
val domain_uu_lepoll_m = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    28
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    29
goal thy "!! a. ALL b<a. f`b lepoll m ==> \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    30
\          ALL b<a. ALL g<a. ALL d<a. domain(uu(f,b,g,d)) lepoll m";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    31
by (fast_tac (AC_cs addEs [domain_uu_lepoll_m]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    32
val quant_domain_uu_lepoll_m = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    33
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    34
(* used in case 2 *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    35
goalw thy [uu_def] "uu(f,b,g,d) <= f`b * f`g";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    36
by (fast_tac ZF_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    37
val uu_subset1 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    38
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    39
goalw thy [uu_def] "uu(f,b,g,d) <= f`d";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    40
by (fast_tac ZF_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    41
val uu_subset2 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    42
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    43
goal thy "!! a. [| ALL b<a. f`b lepoll m; d<a |] ==> uu(f,b,g,d) lepoll m";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    44
by (fast_tac (AC_cs
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    45
	addSEs [uu_subset2 RS subset_imp_lepoll RS lepoll_trans]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    46
val uu_lepoll_m = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    47
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    48
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    49
(* Two cases for lemma ii 						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    50
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    51
goalw thy [lesspoll_def] 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    52
  "!! a f u. ALL b<a. ALL g<a. ALL d<a. u(f,b,g,d) lepoll m ==>  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    53
\ (ALL b<a. f`b ~= 0 --> (EX g<a. EX d<a. u(f,b,g,d) ~= 0 &  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    54
\				u(f,b,g,d) lesspoll m)) |  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    55
\ (EX b<a. f`b ~= 0 & (ALL g<a. ALL d<a. u(f,b,g,d) ~= 0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    56
\				u(f,b,g,d) eqpoll m))";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    57
by (fast_tac AC_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    58
val cases = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    59
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    60
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    61
(* Lemmas used in both cases						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    62
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    63
goal thy "!!a f. Ord(a) ==> (UN b<a++a. f`b) = (UN b<a. f`b Un f`(a++b))";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    64
by (resolve_tac [equalityI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    65
by (fast_tac (AC_cs addIs [ltI, OUN_I] addSEs [OUN_E]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    66
		addSDs [lt_oadd_disj]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    67
by (fast_tac (AC_cs addSEs [lt_oadd1, oadd_lt_mono2, OUN_E]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    68
		addSIs [OUN_I]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    69
val UN_oadd = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    70
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    71
val [prem] = goal thy
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    72
	"(!!b. b<a ==> P(b)=Q(b)) ==> (UN b<a. P(b)) = (UN b<a. Q(b))";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    73
by (fast_tac (ZF_cs addSIs [OUN_I, equalityI] 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    74
		addSEs [OUN_E, prem RS equalityD1 RS subsetD, 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    75
			prem RS sym RS equalityD1 RS subsetD]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    76
val UN_eq = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    77
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    78
goal thy "!!a. b<a ==> b = (THE l. l<a & a ++ b = a ++ l)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    79
by (fast_tac (ZF_cs addSIs [the_equality RS sym] 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    80
                    addIs [lt_Ord2, lt_Ord] 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    81
                    addSEs [oadd_inject RS sym]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    82
val the_only_b = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    83
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    84
goal thy "!!A. B <= A ==> B Un (A-B) = A";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    85
by (fast_tac (ZF_cs addSIs [equalityI]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    86
val subset_imp_Un_Diff_eq = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    87
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    88
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    89
(* Case 1 : lemmas							  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    90
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    91
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    92
goalw thy [vv1_def] "vv1(f,b,succ(m)) <= f`b";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    93
by (resolve_tac [expand_if RS iffD2] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    94
by (fast_tac (ZF_cs addSIs [domain_uu_subset]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    95
val vv1_subset = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    96
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    97
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    98
(* Case 1 : Union of images is the whole "y"				  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
    99
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   100
goal thy "!! a f y. [| (UN b<a. f`b) = y; Ord(a); m:nat |] ==>  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   101
\	(UN b<a++a. (lam b:a++a. if(b<a, vv1(f,b,succ(m)),  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   102
\			ww1(f, THE l. l<a & b=a++l, succ(m)))) ` b) = y";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   103
by (resolve_tac [UN_oadd RS ssubst] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   104
by (eresolve_tac [subst] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   105
by (resolve_tac [UN_eq] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   106
by (forw_inst_tac [("i","a")] lt_oadd1 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   107
	THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   108
by (forw_inst_tac [("j","a")] oadd_lt_mono2 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   109
	THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   110
by (asm_simp_tac (ZF_ss addsimps [ltD RS beta,
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   111
	oadd_le_self RS le_imp_not_lt RS if_not_P, lt_Ord]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   112
by (resolve_tac [the_only_b RS subst] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   113
by (asm_simp_tac (ZF_ss 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   114
	addsimps [vv1_subset RS subset_imp_Un_Diff_eq, ltD, ww1_def]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   115
val UN_eq_y = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   116
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   117
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   118
(* every value of defined function is less than or equipollent to m	  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   119
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   120
goal thy "!!a b. [| P(a, b); Ord(a); Ord(b);  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   121
\		Least_a = (LEAST a. EX x. Ord(x) & P(a, x)) |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   122
\		==> P(Least_a, LEAST b. P(Least_a, b))";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   123
by (eresolve_tac [ssubst] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   124
by (res_inst_tac [("Q","%z. P(z, LEAST b. P(z, b))")] LeastI2 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   125
by (REPEAT (fast_tac (ZF_cs addSEs [LeastI]) 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   126
val nested_LeastI = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   127
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   128
val nested_Least_instance = read_instantiate 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   129
	[("P","%g d. domain(uu(f,b,g,d)) ~= 0 &  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   130
\		domain(uu(f,b,g,d)) lesspoll succ(m)")] nested_LeastI;
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   131
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   132
goalw thy [vv1_def] "!!a. [| ALL b<a. f`b ~=0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   133
\		(EX g<a. EX d<a. domain(uu(f,b,g,d))~=0 &  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   134
\		domain(uu(f,b,g,d)) lesspoll succ(m)); m:nat; b<a |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   135
\		==> vv1(f,b,succ(m)) lesspoll succ(m)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   136
by (resolve_tac [expand_if RS iffD2] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   137
by (fast_tac (AC_cs addIs [nested_Least_instance RS conjunct2]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   138
		addSEs [lt_Ord]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   139
		addSIs [empty_lepollI RS lepoll_imp_lesspoll_succ]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   140
val vv1_lesspoll_succ = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   141
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   142
goalw thy [vv1_def] "!!a. [| ALL b<a. f`b ~=0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   143
\	(EX g<a. EX d<a. domain(uu(f,b,g,d))~=0 &  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   144
\	domain(uu(f,b,g,d)) lesspoll succ(m)); m:nat; b<a; f`b ~= 0 |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   145
\	==> vv1(f,b,succ(m)) ~= 0";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   146
by (resolve_tac [expand_if RS iffD2] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   147
by (resolve_tac [conjI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   148
by (fast_tac ZF_cs 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   149
by (resolve_tac [impI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   150
by (eresolve_tac [oallE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   151
by (mp_tac 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   152
by (contr_tac 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   153
by (REPEAT (eresolve_tac [oexE] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   154
by (asm_simp_tac (ZF_ss
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   155
	addsimps [lt_Ord, nested_Least_instance RS conjunct1]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   156
val vv1_not_0 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   157
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   158
goalw thy [ww1_def] "!!a. [| ALL b<a. f`b ~=0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   159
\	(EX g<a. EX d<a. domain(uu(f,b,g,d))~=0 &  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   160
\	domain(uu(f,b,g,d)) lesspoll succ(m));  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   161
\	ALL b<a. f`b lepoll succ(m); m:nat; b<a  |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   162
\	==> ww1(f,b,succ(m)) lesspoll succ(m)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   163
by (excluded_middle_tac "f`b = 0" 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   164
by (asm_full_simp_tac (AC_ss
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   165
	addsimps [empty_lepollI RS lepoll_imp_lesspoll_succ]) 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   166
by (resolve_tac [Diff_lepoll RS lepoll_imp_lesspoll_succ] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   167
by (fast_tac AC_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   168
by (REPEAT (ares_tac [vv1_subset, vv1_not_0] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   169
val ww1_lesspoll_succ = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   170
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   171
goal thy "!!a. [| Ord(a); m:nat;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   172
\	ALL b<a. f`b ~=0 --> (EX g<a. EX d<a. domain(uu(f,b,g,d))~=0 &  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   173
\			domain(uu(f,b,g,d)) lesspoll succ(m));  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   174
\	ALL b<a. f`b lepoll succ(m) |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   175
\	==> ALL b<a++a. (lam b:a++a. if(b<a, vv1(f,b,succ(m)),  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   176
\		ww1(f,THE l. l<a & b = a ++ l,succ(m))))`b lepoll m";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   177
by (resolve_tac [oallI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   178
by (asm_full_simp_tac (ZF_ss addsimps [ltD RS beta]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   179
by (resolve_tac [lesspoll_succ_imp_lepoll] 1 THEN (atac 2));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   180
by (resolve_tac [expand_if RS iffD2] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   181
by (resolve_tac [conjI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   182
by (resolve_tac [impI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   183
by (forward_tac [lt_oadd_disj1] 2 THEN (REPEAT (atac 2)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   184
by (resolve_tac [impI] 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   185
by (eresolve_tac [disjE] 2 THEN (fast_tac (ZF_cs addSEs [ltE]) 2));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   186
by (asm_full_simp_tac (ZF_ss addsimps [vv1_lesspoll_succ]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   187
by (dresolve_tac [theI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   188
by (eresolve_tac [conjE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   189
by (resolve_tac [ww1_lesspoll_succ] 1 THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   190
val all_sum_lepoll_m = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   191
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   192
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   193
(* Case 2 : lemmas							  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   194
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   195
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   196
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   197
(* Case 2 : vv2_subset							  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   198
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   199
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   200
goalw thy [uu_def] "!!f. [| b<a; g<a; f`b~=0; f`g~=0;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   201
\			y*y <= y; (UN b<a. f`b)=y |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   202
\			==> EX d<a. uu(f,b,g,d)~=0";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   203
by (fast_tac (AC_cs addSIs [not_emptyI] 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   204
		addSDs [SigmaI RSN (2, subsetD)]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   205
		addSEs [not_emptyE]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   206
val ex_d_uu_not_empty = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   207
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   208
goal thy "!!f. [| b<a; g<a; f`b~=0; f`g~=0;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   209
\			y*y<=y;	(UN b<a. f`b)=y |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   210
\		==> uu(f,b,g,LEAST d. (uu(f,b,g,d) ~= 0)) ~= 0";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   211
by (dresolve_tac [ex_d_uu_not_empty] 1 THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   212
by (fast_tac (AC_cs addSEs [LeastI, lt_Ord]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   213
val uu_not_empty = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   214
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   215
(* moved from ZF_aux.ML *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   216
goal thy "!!r. [| r<=A*B; r~=0 |] ==> domain(r)~=0";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   217
by (REPEAT (eresolve_tac [asm_rl, not_emptyE, subsetD RS SigmaE, 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   218
		sym RSN (2, subst_elem) RS domainI RS not_emptyI] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   219
val not_empty_rel_imp_domain = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   220
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   221
goal thy "!!f. [| b<a; g<a; f`b~=0; f`g~=0;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   222
\			y*y <= y; (UN b<a. f`b)=y |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   223
\		==> (LEAST d. uu(f,b,g,d) ~= 0) < a";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   224
by (eresolve_tac [ex_d_uu_not_empty RS oexE] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   225
	THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   226
by (resolve_tac [Least_le RS lt_trans1] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   227
	THEN (REPEAT (ares_tac [lt_Ord] 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   228
val Least_uu_not_empty_lt_a = result();
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
goal thy "!!B. [| B<=A; a~:B |] ==> B <= A-{a}";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   231
by (fast_tac ZF_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   232
val subset_Diff_sing = result();
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
goal thy "!!A B. [| A lepoll m; m lepoll B; B <= A; m:nat |] ==> A=B";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   235
by (eresolve_tac [natE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   236
by (fast_tac (AC_cs addSDs [lepoll_0_is_0] addSIs [equalityI]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   237
by (hyp_subst_tac 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   238
by (resolve_tac [equalityI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   239
by (atac 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   240
by (resolve_tac [subsetI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   241
by (excluded_middle_tac "?P" 1 THEN (atac 2));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   242
by (eresolve_tac [subset_Diff_sing RS subset_imp_lepoll RSN (2, 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   243
		diff_sing_lepoll RSN (3, lepoll_trans RS lepoll_trans)) RS 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   244
		succ_lepoll_natE] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   245
	THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   246
val supset_lepoll_imp_eq = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   247
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   248
goalw thy [vv2_def] 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   249
	"!!a. [| ALL g<a. ALL d<a. domain(uu(f, b, g, d))~=0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   250
\	domain(uu(f, b, g, d)) eqpoll succ(m);  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   251
\	ALL b<a. f`b lepoll succ(m); y*y <= y;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   252
\	(UN b<a. f`b)=y; b<a; g<a; d<a; f`b~=0; f`g~=0; m:nat; aa:f`b |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   253
\	 ==> uu(f,b,g,LEAST d. uu(f,b,g,d)~=0) : f`b -> f`g";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   254
by (eres_inst_tac [("x","g")] oallE 1 THEN (contr_tac 2));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   255
by (eres_inst_tac [("P","%z. ?QQ(z) ~= 0 --> ?RR(z)")] oallE 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   256
by (eresolve_tac [impE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   257
by (eresolve_tac [uu_not_empty RS (uu_subset1 RS 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   258
	not_empty_rel_imp_domain)] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   259
	THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   260
by (eresolve_tac [Least_uu_not_empty_lt_a RSN (2, notE)] 2
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   261
	THEN (TRYALL atac));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   262
by (resolve_tac [eqpoll_sym RS eqpoll_imp_lepoll RS 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   263
	(Least_uu_not_empty_lt_a RSN (2, uu_lepoll_m) RSN (2, 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   264
	uu_subset1 RSN (4, rel_is_fun)))] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   265
	THEN (TRYALL atac));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   266
by (resolve_tac [eqpoll_sym RS eqpoll_imp_lepoll RSN (2, 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   267
		supset_lepoll_imp_eq)] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   268
by (REPEAT (fast_tac (AC_cs addSIs [domain_uu_subset, nat_succI]) 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   269
val uu_Least_is_fun = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   270
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   271
goalw thy [vv2_def]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   272
	"!!a. [| ALL g<a. ALL d<a. domain(uu(f, b, g, d))~=0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   273
\		domain(uu(f, b, g, d)) eqpoll succ(m);  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   274
\		ALL b<a. f`b lepoll succ(m); y*y <= y;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   275
\		(UN b<a. f`b)=y; b<a; g<a; m:nat; aa:f`b |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   276
\		==> vv2(f,b,g,aa) <= f`g";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   277
by (fast_tac (FOL_cs addIs [expand_if RS iffD2]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   278
	addSEs [uu_Least_is_fun]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   279
	addSIs [empty_subsetI, not_emptyI, 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   280
		singleton_subsetI, apply_type]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   281
val vv2_subset = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   282
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   283
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   284
(* Case 2 : Union of images is the whole "y"				  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   285
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   286
goal thy "!!a. [| ALL g<a. ALL d<a. domain(uu(f,b,g,d)) ~= 0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   287
\	domain(uu(f,b,g,d)) eqpoll succ(m);  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   288
\	ALL b<a. f`b lepoll succ(m); y*y<=y;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   289
\	(UN b<a.f`b)=y; Ord(a); m:nat; aa:f`b; b<a |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   290
\	==> (UN g<a++a. (lam g:a++a. if(g<a, vv2(f,b,g,aa),  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   291
\			ww2(f,b,THE l. l<a & g=a++l,aa)))`g) = y";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   292
by (resolve_tac [UN_oadd RS ssubst] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   293
by (resolve_tac [subst] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   294
by (resolve_tac [UN_eq] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   295
by (forw_inst_tac [("i","a"),("k","ba")] lt_oadd1 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   296
	THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   297
by (forw_inst_tac [("j","a"),("k","ba")] oadd_lt_mono2 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   298
	THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   299
by (asm_simp_tac (ZF_ss addsimps [ltD RS beta,
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   300
	oadd_le_self RS le_imp_not_lt RS if_not_P, lt_Ord]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   301
by (resolve_tac [the_only_b RS subst] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   302
by (asm_simp_tac (ZF_ss 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   303
	addsimps [vv2_subset RS subset_imp_Un_Diff_eq, ltI, ww2_def]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   304
val UN_eq_y_2 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   305
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   306
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   307
(* every value of defined function is less than or equipollent to m	  *)
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
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   310
goalw thy [vv2_def]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   311
	"!!m. [| m:nat; m~=0 |] ==> vv2(f,b,g,aa) lesspoll succ(m)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   312
by (resolve_tac [conjI RS (expand_if RS iffD2)] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   313
by (asm_simp_tac (AC_ss
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   314
	addsimps [empty_lepollI RS lepoll_imp_lesspoll_succ]) 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   315
by (fast_tac (AC_cs
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   316
	addSDs [le_imp_subset RS subset_imp_lepoll RS lepoll_0_is_0]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   317
	addSIs [singleton_eqpoll_1 RS eqpoll_imp_lepoll RS 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   318
			lepoll_trans RS lepoll_imp_lesspoll_succ,
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   319
		not_lt_imp_le RS le_imp_subset RS subset_imp_lepoll,
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   320
		nat_into_Ord, nat_1I]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   321
val vv2_lesspoll_succ = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   322
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   323
goalw thy [ww2_def] "!!m. [| ALL b<a. f`b lepoll succ(m); g<a; m:nat;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   324
\			vv2(f,b,g,d) <= f`g |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   325
\			==> ww2(f,b,g,d) lesspoll succ(m)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   326
by (excluded_middle_tac "f`g = 0" 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   327
by (asm_simp_tac (AC_ss
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   328
		addsimps [empty_lepollI RS lepoll_imp_lesspoll_succ]) 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   329
by (dresolve_tac [ospec] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   330
by (resolve_tac [Diff_lepoll RS lepoll_imp_lesspoll_succ] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   331
	THEN (TRYALL atac));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   332
by (asm_simp_tac (AC_ss addsimps [vv2_def, expand_if, not_emptyI]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   333
val ww2_lesspoll_succ = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   334
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   335
goal thy "!!a. [| ALL g<a. ALL d<a. domain(uu(f,b,g,d)) ~= 0 -->  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   336
\		domain(uu(f,b,g,d)) eqpoll succ(m);  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   337
\		ALL b<a. f`b lepoll succ(m); y*y <= y;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   338
\		(UN b<a. f`b)=y; b<a; aa:f`b; m:nat; m~= 0 |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   339
\		==> ALL ba<a++a. (lam g:a++a. if(g<a, vv2(f,b,g,aa),  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   340
\			ww2(f,b,THE l. l<a & g=a++l,aa)))`ba lepoll m";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   341
by (resolve_tac [oallI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   342
by (asm_full_simp_tac AC_ss 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   343
by (resolve_tac [lesspoll_succ_imp_lepoll] 1 THEN (atac 2));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   344
by (resolve_tac [conjI RS (expand_if RS iffD2)] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   345
by (asm_simp_tac (AC_ss addsimps [vv2_lesspoll_succ]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   346
by (forward_tac [lt_oadd_disj1] 1 THEN (REPEAT (ares_tac [lt_Ord2] 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   347
by (fast_tac (FOL_cs addSIs [ww2_lesspoll_succ, vv2_subset]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   348
		addSDs [theI]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   349
val all_sum_lepoll_m_2 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   350
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   351
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   352
(* lemma ii	 							  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   353
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   354
goalw thy [NN_def]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   355
	"!!y. [| succ(m) : NN(y); y*y <= y; m:nat; m~=0 |] ==> m : NN(y)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   356
by (REPEAT (eresolve_tac [CollectE, exE, conjE] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   357
by (resolve_tac [quant_domain_uu_lepoll_m RS cases RS disjE] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   358
    THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   359
(* case 1 *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   360
by (resolve_tac [CollectI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   361
by (atac 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   362
by (res_inst_tac [("x","a ++ a")] exI 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   363
by (res_inst_tac [("x","lam b:a++a. if (b<a, vv1(f,b,succ(m)),  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   364
\			ww1(f,THE l. l<a & b=a++l,succ(m)))")] exI 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   365
by (fast_tac (FOL_cs addSIs [Ord_oadd, lam_funtype RS domain_of_fun,
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   366
				UN_eq_y, all_sum_lepoll_m]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   367
(* case 2 *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   368
by (REPEAT (eresolve_tac [oexE, conjE] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   369
by (resolve_tac [CollectI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   370
by (eresolve_tac [succ_natD] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   371
by (res_inst_tac [("A","f`?B")] not_emptyE 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   372
by (res_inst_tac [("x","a++a")] exI 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   373
by (res_inst_tac [("x","lam g:a++a. if (g<a, vv2(f,b,g,x),  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   374
\			ww2(f,b,THE l. l<a & g=a++l,x))")] exI 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   375
by (fast_tac (FOL_cs addSIs [Ord_oadd, lam_funtype RS domain_of_fun,
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   376
				UN_eq_y_2, all_sum_lepoll_m_2]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   377
val lemma_ii = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   378
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   379
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   380
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   381
(* lemma iv - p. 4 :                                                      *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   382
(* For every set x there is a set y such that   x Un (y * y) <= y         *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   383
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   384
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   385
(* the quantifier ALL looks inelegant but makes the proofs shorter  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   386
(* (used only in the following two lemmas)                          *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   387
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   388
goal thy "ALL n:nat. rec(n, x, %k r. r Un r*r) <=  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   389
\                    rec(succ(n), x, %k r. r Un r*r)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   390
by (fast_tac (ZF_cs addIs [rec_succ RS ssubst]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   391
val z_n_subset_z_succ_n = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   392
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   393
goal thy "!!n. [| ALL n:nat. f(n)<=f(succ(n)); n le m; n : nat; m: nat |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   394
\              ==> f(n)<=f(m)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   395
by (res_inst_tac [("P","n le m")] impE 1 THEN (REPEAT (atac 2)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   396
by (res_inst_tac [("P","%z. n le z --> f(n) <= f(z)")] nat_induct 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   397
by (REPEAT (fast_tac lt_cs 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   398
val le_subsets = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   399
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   400
goal thy "!!n m. [| n le m; m:nat |] ==>  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   401
\	rec(n, x, %k r. r Un r*r) <= rec(m, x, %k r. r Un r*r)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   402
by (resolve_tac [z_n_subset_z_succ_n RS le_subsets] 1 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   403
    THEN (TRYALL atac));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   404
by (eresolve_tac [Ord_nat RSN (2, ltI) RSN (2, lt_trans1) RS ltD] 1
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   405
    THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   406
val le_imp_rec_subset = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   407
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   408
goal thy "!!x. EX y. x Un y*y <= y";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   409
by (res_inst_tac [("x","UN n:nat. rec(n, x, %k r. r Un r*r)")] exI 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   410
by (resolve_tac [subsetI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   411
by (eresolve_tac [UnE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   412
by (resolve_tac [UN_I] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   413
by (eresolve_tac [rec_0 RS ssubst] 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   414
by (resolve_tac [nat_0I] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   415
by (eresolve_tac [SigmaE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   416
by (REPEAT (eresolve_tac [UN_E] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   417
by (res_inst_tac [("a","succ(n Un na)")] UN_I 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   418
by (eresolve_tac [Un_nat_type RS nat_succI] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   419
by (resolve_tac [rec_succ RS ssubst] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   420
by (fast_tac (ZF_cs addIs [le_imp_rec_subset RS subsetD]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   421
		addSIs [Un_upper1_le, Un_upper2_le, Un_nat_type]
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   422
		addSEs [nat_into_Ord]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   423
val lemma_iv = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   424
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   425
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   426
(* Rubin & Rubin wrote :						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   427
(* "It follows from (ii) and mathematical induction that if y*y <= y then *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   428
(* y can be well-ordered"						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   429
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   430
(* In fact we have to prove :						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   431
(*	* WO6 ==> NN(y) ~= 0						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   432
(*	* reverse induction which lets us infer that 1 : NN(y)		  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   433
(*	* 1 : NN(y) ==> y can be well-ordered				  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   434
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   435
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   436
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   437
(*	WO6 ==> NN(y) ~= 0						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   438
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   439
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   440
goalw thy [WO6_def, NN_def] "!!y. WO6 ==> NN(y) ~= 0";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   441
by (eresolve_tac [allE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   442
by (fast_tac (ZF_cs addSIs [not_emptyI]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   443
val WO6_imp_NN_not_empty = result();
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
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   446
(*	1 : NN(y) ==> y can be well-ordered				  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   447
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   448
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   449
goal thy "!!f. [| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   450
\		==> EX c<a. f`c = {x}";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   451
by (fast_tac (AC_cs addSEs [lepoll_1_is_sing]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   452
val lemma1 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   453
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   454
goal thy "!!f. [| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   455
\		==> f` (LEAST i. f`i = {x}) = {x}";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   456
by (dresolve_tac [lemma1] 1 THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   457
by (fast_tac (AC_cs addSEs [lt_Ord] addIs [LeastI]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   458
val lemma2 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   459
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   460
goalw thy [NN_def] "!!y. 1 : NN(y) ==> EX a f. Ord(a) & f:inj(y, a)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   461
by (eresolve_tac [CollectE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   462
by (REPEAT (eresolve_tac [exE, conjE] 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   463
by (res_inst_tac [("x","a")] exI 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   464
by (res_inst_tac [("x","lam x:y. LEAST i. f`i = {x}")] exI 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   465
by (resolve_tac [conjI] 1 THEN (atac 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   466
by (res_inst_tac [("d","%i. THE x. x:f`i")] lam_injective 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   467
by (dresolve_tac [lemma1] 1 THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   468
by (fast_tac (AC_cs addSEs [Least_le RS lt_trans1 RS ltD, lt_Ord]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   469
by (resolve_tac [lemma2 RS ssubst] 1 THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   470
by (fast_tac (ZF_cs addSIs [the_equality]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   471
val NN_imp_ex_inj = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   472
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   473
goal thy "!!y. [| y*y <= y; 1 : NN(y) |] ==> EX r. well_ord(y, r)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   474
by (dresolve_tac [NN_imp_ex_inj] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   475
by (fast_tac (ZF_cs addSEs [well_ord_Memrel RSN (2,  well_ord_rvimage)]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   476
val y_well_ord = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   477
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   478
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   479
(*	reverse induction which lets us infer that 1 : NN(y)		  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   480
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   481
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   482
val [prem1, prem2] = goal thy
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   483
	"[| n:nat; !!m. [| m:nat; m~=0; P(succ(m)) |] ==> P(m) |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   484
\	==> n~=0 --> P(n) --> P(1)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   485
by (res_inst_tac [("n","n")] nat_induct 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   486
by (resolve_tac [prem1] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   487
by (fast_tac ZF_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   488
by (excluded_middle_tac "x=0" 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   489
by (fast_tac ZF_cs 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   490
by (fast_tac (ZF_cs addSIs [prem2]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   491
val rev_induct_lemma = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   492
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   493
val prems = goal thy
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   494
	"[| P(n); n:nat; n~=0;  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   495
\	!!m. [| m:nat; m~=0; P(succ(m)) |] ==> P(m) |]  \
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   496
\	==> P(1)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   497
by (resolve_tac [rev_induct_lemma RS impE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   498
by (eresolve_tac [impE] 4 THEN (atac 5));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   499
by (REPEAT (ares_tac prems 1));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   500
val rev_induct = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   501
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   502
goalw thy [NN_def] "!!n. n:NN(y) ==> n:nat";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   503
by (fast_tac ZF_cs 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   504
val NN_into_nat = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   505
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   506
goal thy "!!n. [| n:NN(y); y*y <= y; n~=0 |] ==> 1:NN(y)";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   507
by (resolve_tac [rev_induct] 1 THEN (REPEAT (ares_tac [NN_into_nat] 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   508
by (resolve_tac [lemma_ii] 1 THEN (REPEAT (atac 1)));
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   509
val lemma3 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   510
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   511
(* ********************************************************************** *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   512
(* Main theorem "WO6 ==> WO1"						  *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   513
(* ********************************************************************** *)
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
(* another helpful lemma *)
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   516
goalw thy [NN_def] "!!y. 0:NN(y) ==> y=0";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   517
by (fast_tac (AC_cs addSIs [equalityI] 
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   518
                    addSDs [lepoll_0_is_0] addEs [subst]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   519
val NN_y_0 = result();
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   520
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   521
goalw thy [WO1_def] "!!Z. WO6 ==> WO1";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   522
by (resolve_tac [allI] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   523
by (excluded_middle_tac "A=0" 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   524
by (fast_tac (ZF_cs addSIs [well_ord_Memrel, nat_0I RS nat_into_Ord]) 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   525
by (res_inst_tac [("x1","A")] (lemma_iv RS revcut_rl) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   526
by (eresolve_tac [exE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   527
by (dresolve_tac [WO6_imp_NN_not_empty] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   528
by (eresolve_tac [Un_subset_iff RS iffD1 RS conjE] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   529
by (eres_inst_tac [("A","NN(y)")] not_emptyE 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   530
by (forward_tac [y_well_ord] 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   531
by (fast_tac (ZF_cs addEs [well_ord_subset]) 2);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   532
by (fast_tac (ZF_cs addSIs [lemma3] addSDs [NN_y_0] addSEs [not_emptyE]) 1);
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   533
qed "WO6_imp_WO1";
4ef4f7ff2aeb New example of AC Equivalences by Krzysztof Grabczewski
lcp
parents:
diff changeset
   534