src/ZF/AC/WO6_WO1.ML
changeset 5315 c9ad6bbf3a34
parent 5268 59ef39008514
child 5325 f7a5e06adea1
equal deleted inserted replaced
5314:c061e6f9d546 5315:c9ad6bbf3a34
   156 (* ********************************************************************** *)
   156 (* ********************************************************************** *)
   157 (* Case 2 : vv2_subset                                                    *)
   157 (* Case 2 : vv2_subset                                                    *)
   158 (* ********************************************************************** *)
   158 (* ********************************************************************** *)
   159 
   159 
   160 Goalw [uu_def] "[| b<a;  g<a;  f`b~=0;  f`g~=0;        \
   160 Goalw [uu_def] "[| b<a;  g<a;  f`b~=0;  f`g~=0;        \
   161 \                           y*y <= y;  (UN b<a. f`b)=y          \
   161 \                  y*y <= y;  (UN b<a. f`b)=y          \
   162 \                        |] ==> EX d<a. uu(f,b,g,d) ~= 0";
   162 \               |] ==> EX d<a. uu(f,b,g,d) ~= 0";
   163 by (fast_tac (claset() addSIs [not_emptyI] 
   163 by (fast_tac (claset() addSIs [not_emptyI] 
   164                     addSDs [SigmaI RSN (2, subsetD)]
   164                     addSDs [SigmaI RSN (2, subsetD)]
   165                     addSEs [not_emptyE]) 1);
   165                     addSEs [not_emptyE]) 1);
   166 qed "ex_d_uu_not_empty";
   166 qed "ex_d_uu_not_empty";
   167 
   167 
   168 Goal "[| b<a; g<a; f`b~=0; f`g~=0;  \
   168 Goal "[| b<a; g<a; f`b~=0; f`g~=0;  \
   169 \                       y*y<=y; (UN b<a. f`b)=y |]  \
   169 \        y*y<=y; (UN b<a. f`b)=y |]  \
   170 \               ==> uu(f,b,g,LEAST d. (uu(f,b,g,d) ~= 0)) ~= 0";
   170 \     ==> uu(f,b,g,LEAST d. (uu(f,b,g,d) ~= 0)) ~= 0";
   171 by (dtac ex_d_uu_not_empty 1 THEN REPEAT (assume_tac 1));
   171 by (dtac ex_d_uu_not_empty 1 THEN REPEAT (assume_tac 1));
   172 by (fast_tac (claset() addSEs [LeastI, lt_Ord]) 1);
   172 by (fast_tac (claset() addSEs [LeastI, lt_Ord]) 1);
   173 qed "uu_not_empty";
   173 qed "uu_not_empty";
   174 
   174 
   175 goal ZF.thy "!!r. [| r<=A*B; r~=0 |] ==> domain(r)~=0";
   175 goal ZF.thy "!!r. [| r<=A*B; r~=0 |] ==> domain(r)~=0";
   176 by (REPEAT (eresolve_tac [asm_rl, not_emptyE, subsetD RS SigmaE, 
   176 by (REPEAT (eresolve_tac [asm_rl, not_emptyE, subsetD RS SigmaE, 
   177                 sym RSN (2, subst_elem) RS domainI RS not_emptyI] 1));
   177                 sym RSN (2, subst_elem) RS domainI RS not_emptyI] 1));
   178 qed "not_empty_rel_imp_domain";
   178 qed "not_empty_rel_imp_domain";
   179 
   179 
   180 Goal "[| b<a; g<a; f`b~=0; f`g~=0;  \
   180 Goal "[| b<a; g<a; f`b~=0; f`g~=0;  \
   181 \                       y*y <= y; (UN b<a. f`b)=y |]  \
   181 \        y*y <= y; (UN b<a. f`b)=y |]  \
   182 \               ==> (LEAST d. uu(f,b,g,d) ~= 0) < a";
   182 \     ==> (LEAST d. uu(f,b,g,d) ~= 0) < a";
   183 by (eresolve_tac [ex_d_uu_not_empty RS oexE] 1
   183 by (eresolve_tac [ex_d_uu_not_empty RS oexE] 1
   184         THEN REPEAT (assume_tac 1));
   184         THEN REPEAT (assume_tac 1));
   185 by (resolve_tac [Least_le RS lt_trans1] 1
   185 by (resolve_tac [Least_le RS lt_trans1] 1
   186         THEN (REPEAT (ares_tac [lt_Ord] 1)));
   186         THEN (REPEAT (ares_tac [lt_Ord] 1)));
   187 qed "Least_uu_not_empty_lt_a";
   187 qed "Least_uu_not_empty_lt_a";
   257 
   257 
   258 (* ********************************************************************** *)
   258 (* ********************************************************************** *)
   259 (* every value of defined function is less than or equipollent to m       *)
   259 (* every value of defined function is less than or equipollent to m       *)
   260 (* ********************************************************************** *)
   260 (* ********************************************************************** *)
   261 
   261 
   262 Goalw [vv2_def]
   262 Goalw [vv2_def] "[| m:nat; m~=0 |] ==> vv2(f,b,g,s) lepoll m";
   263     "!!m. [| m:nat; m~=0 |] ==> vv2(f,b,g,s) lepoll m";
       
   264 by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 1);
   263 by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 1);
   265 by (fast_tac (claset()
   264 by (fast_tac (claset()
   266         addSDs [le_imp_subset RS subset_imp_lepoll RS lepoll_0_is_0]
   265         addSDs [le_imp_subset RS subset_imp_lepoll RS lepoll_0_is_0]
   267         addSIs [singleton_eqpoll_1 RS eqpoll_imp_lepoll RS lepoll_trans,
   266         addSIs [singleton_eqpoll_1 RS eqpoll_imp_lepoll RS lepoll_trans,
   268                 not_lt_imp_le RS le_imp_subset RS subset_imp_lepoll,
   267                 not_lt_imp_le RS le_imp_subset RS subset_imp_lepoll,
   269                 nat_into_Ord, nat_1I]) 1);
   268                 nat_into_Ord, nat_1I]) 1);
   270 qed "vv2_lepoll";
   269 qed "vv2_lepoll";
   271 
   270 
   272 Goalw [ww2_def]
   271 Goalw [ww2_def]
   273     "!!m. [| ALL b<a. f`b lepoll succ(m);  g<a;  m:nat;  vv2(f,b,g,d) <= f`g  \
   272     "[| ALL b<a. f`b lepoll succ(m);  g<a;  m:nat;  vv2(f,b,g,d) <= f`g |] \
   274 \         |] ==> ww2(f,b,g,d) lepoll m";
   273 \    ==> ww2(f,b,g,d) lepoll m";
   275 by (excluded_middle_tac "f`g = 0" 1);
   274 by (excluded_middle_tac "f`g = 0" 1);
   276 by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 2);
   275 by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 2);
   277 by (dtac ospec 1 THEN (assume_tac 1));
   276 by (dtac ospec 1 THEN (assume_tac 1));
   278 by (rtac Diff_lepoll 1 THEN (TRYALL assume_tac));
   277 by (rtac Diff_lepoll 1 THEN (TRYALL assume_tac));
   279 by (asm_simp_tac (simpset() addsimps [vv2_def, not_emptyI]) 1);
   278 by (asm_simp_tac (simpset() addsimps [vv2_def, not_emptyI]) 1);
   292 qed "gg2_lepoll_m";
   291 qed "gg2_lepoll_m";
   293 
   292 
   294 (* ********************************************************************** *)
   293 (* ********************************************************************** *)
   295 (* lemma ii                                                               *)
   294 (* lemma ii                                                               *)
   296 (* ********************************************************************** *)
   295 (* ********************************************************************** *)
   297 Goalw [NN_def]
   296 Goalw [NN_def] "[| succ(m) : NN(y); y*y <= y; m:nat; m~=0 |] ==> m : NN(y)";
   298         "!!y. [| succ(m) : NN(y); y*y <= y; m:nat; m~=0 |] ==> m : NN(y)";
       
   299 by (REPEAT (eresolve_tac [CollectE, exE, conjE] 1));
   297 by (REPEAT (eresolve_tac [CollectE, exE, conjE] 1));
   300 by (resolve_tac [quant_domain_uu_lepoll_m RS cases RS disjE] 1
   298 by (resolve_tac [quant_domain_uu_lepoll_m RS cases RS disjE] 1
   301     THEN (assume_tac 1));
   299     THEN (assume_tac 1));
   302 (* case 1 *)
   300 (* case 1 *)
   303 by (asm_full_simp_tac (simpset() addsimps [lesspoll_succ_iff]) 1);
   301 by (asm_full_simp_tac (simpset() addsimps [lesspoll_succ_iff]) 1);
   330 \                    rec(succ(n), x, %k r. r Un r*r)";
   328 \                    rec(succ(n), x, %k r. r Un r*r)";
   331 by (fast_tac (claset() addIs [rec_succ RS ssubst]) 1);
   329 by (fast_tac (claset() addIs [rec_succ RS ssubst]) 1);
   332 qed "z_n_subset_z_succ_n";
   330 qed "z_n_subset_z_succ_n";
   333 
   331 
   334 Goal "[| ALL n:nat. f(n)<=f(succ(n)); n le m; n : nat; m: nat |]  \
   332 Goal "[| ALL n:nat. f(n)<=f(succ(n)); n le m; n : nat; m: nat |]  \
   335 \              ==> f(n)<=f(m)";
   333 \     ==> f(n)<=f(m)";
   336 by (eres_inst_tac [("P","n le m")] rev_mp 1);
   334 by (eres_inst_tac [("P","n le m")] rev_mp 1);
   337 by (res_inst_tac [("P","%z. n le z --> f(n) <= f(z)")] nat_induct 1);
   335 by (res_inst_tac [("P","%z. n le z --> f(n) <= f(z)")] nat_induct 1);
   338 by (REPEAT (fast_tac le_cs 1));
   336 by (REPEAT (fast_tac le_cs 1));
   339 qed "le_subsets";
   337 qed "le_subsets";
   340 
   338 
   371 
   369 
   372 (* ********************************************************************** *)
   370 (* ********************************************************************** *)
   373 (*      WO6 ==> NN(y) ~= 0                                                *)
   371 (*      WO6 ==> NN(y) ~= 0                                                *)
   374 (* ********************************************************************** *)
   372 (* ********************************************************************** *)
   375 
   373 
   376 Goalw [WO6_def, NN_def] "!!y. WO6 ==> NN(y) ~= 0";
   374 Goalw [WO6_def, NN_def] "WO6 ==> NN(y) ~= 0";
   377 by (fast_tac ZF_cs 1);  (*SLOW if current claset is used*)
   375 by (fast_tac ZF_cs 1);  (*SLOW if current claset is used*)
   378 qed "WO6_imp_NN_not_empty";
   376 qed "WO6_imp_NN_not_empty";
   379 
   377 
   380 (* ********************************************************************** *)
   378 (* ********************************************************************** *)
   381 (*      1 : NN(y) ==> y can be well-ordered                               *)
   379 (*      1 : NN(y) ==> y can be well-ordered                               *)
   382 (* ********************************************************************** *)
   380 (* ********************************************************************** *)
   383 
   381 
   384 Goal "[| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |]  \
   382 Goal "[| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |]  \
   385 \               ==> EX c<a. f`c = {x}";
   383 \     ==> EX c<a. f`c = {x}";
   386 by (fast_tac (claset() addSEs [lepoll_1_is_sing]) 1);
   384 by (fast_tac (claset() addSEs [lepoll_1_is_sing]) 1);
   387 val lemma1 = result();
   385 val lemma1 = result();
   388 
   386 
   389 Goal "[| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |]  \
   387 Goal "[| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |]  \
   390 \               ==> f` (LEAST i. f`i = {x}) = {x}";
   388 \     ==> f` (LEAST i. f`i = {x}) = {x}";
   391 by (dtac lemma1 1 THEN REPEAT (assume_tac 1));
   389 by (dtac lemma1 1 THEN REPEAT (assume_tac 1));
   392 by (fast_tac (claset() addSEs [lt_Ord] addIs [LeastI]) 1);
   390 by (fast_tac (claset() addSEs [lt_Ord] addIs [LeastI]) 1);
   393 val lemma2 = result();
   391 val lemma2 = result();
   394 
   392 
   395 Goalw [NN_def] "1 : NN(y) ==> EX a f. Ord(a) & f:inj(y, a)";
   393 Goalw [NN_def] "1 : NN(y) ==> EX a f. Ord(a) & f:inj(y, a)";
   423 by (excluded_middle_tac "x=0" 1);
   421 by (excluded_middle_tac "x=0" 1);
   424 by (Blast_tac 2);
   422 by (Blast_tac 2);
   425 by (fast_tac (claset() addSIs [prem2]) 1);
   423 by (fast_tac (claset() addSIs [prem2]) 1);
   426 qed "rev_induct_lemma";
   424 qed "rev_induct_lemma";
   427 
   425 
   428 val prems = goal thy
   426 val prems = 
   429         "[| P(n); n:nat; n~=0;  \
   427 Goal    "[| P(n); n:nat; n~=0;  \
   430 \       !!m. [| m:nat; m~=0; P(succ(m)) |] ==> P(m) |]  \
   428 \           !!m. [| m:nat; m~=0; P(succ(m)) |] ==> P(m) |]  \
   431 \       ==> P(1)";
   429 \        ==> P(1)";
   432 by (resolve_tac [rev_induct_lemma RS impE] 1);
   430 by (resolve_tac [rev_induct_lemma RS impE] 1);
   433 by (etac impE 4 THEN (assume_tac 5));
   431 by (etac impE 4 THEN (assume_tac 5));
   434 by (REPEAT (ares_tac prems 1));
   432 by (REPEAT (ares_tac prems 1));
   435 qed "rev_induct";
   433 qed "rev_induct";
   436 
   434 
   448 (* ********************************************************************** *)
   446 (* ********************************************************************** *)
   449 
   447 
   450 (* another helpful lemma *)
   448 (* another helpful lemma *)
   451 Goalw [NN_def] "0:NN(y) ==> y=0";
   449 Goalw [NN_def] "0:NN(y) ==> y=0";
   452 by (fast_tac (claset() addSIs [equalityI] 
   450 by (fast_tac (claset() addSIs [equalityI] 
   453                     addSDs [lepoll_0_is_0] addEs [subst]) 1);
   451                        addSDs [lepoll_0_is_0] addEs [subst]) 1);
   454 qed "NN_y_0";
   452 qed "NN_y_0";
   455 
   453 
   456 Goalw [WO1_def] "WO6 ==> WO1";
   454 Goalw [WO1_def] "WO6 ==> WO1";
   457 by (rtac allI 1);
   455 by (rtac allI 1);
   458 by (excluded_middle_tac "A=0" 1);
   456 by (excluded_middle_tac "A=0" 1);