src/ZF/perm.ML
changeset 6 8ce8c4d13d4d
parent 0 a5a9c433f639
child 37 cebe01deba80
equal deleted inserted replaced
5:75e163863e16 6:8ce8c4d13d4d
    49 by (etac IntD2 1);
    49 by (etac IntD2 1);
    50 val bij_is_surj = result();
    50 val bij_is_surj = result();
    51 
    51 
    52 (* f: bij(A,B) ==> f: A->B *)
    52 (* f: bij(A,B) ==> f: A->B *)
    53 val bij_is_fun = standard (bij_is_inj RS inj_is_fun);
    53 val bij_is_fun = standard (bij_is_inj RS inj_is_fun);
       
    54 
    54 
    55 
    55 (** Identity function **)
    56 (** Identity function **)
    56 
    57 
    57 val [prem] = goalw Perm.thy [id_def] "a:A ==> <a,a> : id(A)";  
    58 val [prem] = goalw Perm.thy [id_def] "a:A ==> <a,a> : id(A)";  
    58 by (rtac (prem RS lamI) 1);
    59 by (rtac (prem RS lamI) 1);
    74 by (rtac (prem RS lam_mono) 1);
    75 by (rtac (prem RS lam_mono) 1);
    75 val id_mono = result();
    76 val id_mono = result();
    76 
    77 
    77 goalw Perm.thy [inj_def,id_def] "id(A): inj(A,A)";
    78 goalw Perm.thy [inj_def,id_def] "id(A): inj(A,A)";
    78 by (REPEAT (ares_tac [CollectI,lam_type] 1));
    79 by (REPEAT (ares_tac [CollectI,lam_type] 1));
    79 by (SIMP_TAC ZF_ss 1);
    80 by (simp_tac ZF_ss 1);
    80 val id_inj = result();
    81 val id_inj = result();
    81 
    82 
    82 goalw Perm.thy [id_def,surj_def] "id(A): surj(A,A)";
    83 goalw Perm.thy [id_def,surj_def] "id(A): surj(A,A)";
    83 by (fast_tac (ZF_cs addIs [lam_type,beta]) 1);
    84 by (fast_tac (ZF_cs addIs [lam_type,beta]) 1);
    84 val id_surj = result();
    85 val id_surj = result();
   260 
   261 
   261 goalw Perm.thy [inj_def]
   262 goalw Perm.thy [inj_def]
   262     "!!f g. [| (f O g): inj(A,C);  g: A->B;  f: B->C |] ==> g: inj(A,B)";
   263     "!!f g. [| (f O g): inj(A,C);  g: A->B;  f: B->C |] ==> g: inj(A,B)";
   263 by (safe_tac comp_cs);
   264 by (safe_tac comp_cs);
   264 by (REPEAT (eresolve_tac [asm_rl, bspec RS bspec RS mp] 1));
   265 by (REPEAT (eresolve_tac [asm_rl, bspec RS bspec RS mp] 1));
   265 by (ASM_SIMP_TAC (ZF_ss addrews [comp_func_apply]) 1);
   266 by (asm_simp_tac (FOL_ss addsimps [comp_func_apply]) 1);
   266 val comp_mem_injD1 = result();
   267 val comp_mem_injD1 = result();
   267 
   268 
   268 goalw Perm.thy [inj_def,surj_def]
   269 goalw Perm.thy [inj_def,surj_def]
   269     "!!f g. [| (f O g): inj(A,C);  g: surj(A,B);  f: B->C |] ==> f: inj(B,C)";
   270     "!!f g. [| (f O g): inj(A,C);  g: surj(A,B);  f: B->C |] ==> f: inj(B,C)";
   270 by (safe_tac comp_cs);
   271 by (safe_tac comp_cs);
   271 by (res_inst_tac [("x1", "x")] (bspec RS bexE) 1);
   272 by (res_inst_tac [("x1", "x")] (bspec RS bexE) 1);
   272 by (eres_inst_tac [("x1", "w")] (bspec RS bexE) 3);
   273 by (eres_inst_tac [("x1", "w")] (bspec RS bexE) 3);
   273 by (REPEAT (assume_tac 1));
   274 by (REPEAT (assume_tac 1));
   274 by (safe_tac (comp_cs addSIs ZF_congs));
   275 by (safe_tac comp_cs);
       
   276 by (res_inst_tac [("t", "op `(g)")] subst_context 1);
   275 by (REPEAT (eresolve_tac [asm_rl, bspec RS bspec RS mp] 1));
   277 by (REPEAT (eresolve_tac [asm_rl, bspec RS bspec RS mp] 1));
   276 by (ASM_SIMP_TAC (ZF_ss addrews [comp_func_apply]) 1);
   278 by (asm_simp_tac (FOL_ss addsimps [comp_func_apply]) 1);
   277 val comp_mem_injD2 = result();
   279 val comp_mem_injD2 = result();
   278 
   280 
   279 goalw Perm.thy [surj_def]
   281 goalw Perm.thy [surj_def]
   280     "!!f g. [| (f O g): surj(A,C);  g: A->B;  f: B->C |] ==> f: surj(B,C)";
   282     "!!f g. [| (f O g): surj(A,C);  g: A->B;  f: B->C |] ==> f: surj(B,C)";
   281 by (fast_tac (comp_cs addSIs [comp_func_apply RS sym, apply_type]) 1);
   283 by (fast_tac (comp_cs addSIs [comp_func_apply RS sym, apply_type]) 1);
   425 by (etac CollectE 1);
   427 by (etac CollectE 1);
   426 by (rtac CollectI 1);
   428 by (rtac CollectI 1);
   427 by (etac fun_extend 1);
   429 by (etac fun_extend 1);
   428 by (REPEAT (ares_tac [ballI] 1));
   430 by (REPEAT (ares_tac [ballI] 1));
   429 by (REPEAT_FIRST (eresolve_tac [consE,ssubst]));
   431 by (REPEAT_FIRST (eresolve_tac [consE,ssubst]));
   430 (*Assumption ALL w:A. ALL x:A. f`w = f`x --> w=x makes ASM_SIMP_TAC loop!*)
   432 (*Assumption ALL w:A. ALL x:A. f`w = f`x --> w=x would make asm_simp_tac loop
   431 by (ALLGOALS (SIMP_TAC (ZF_ss addrews [fun_extend_apply2,fun_extend_apply1])));
   433   using ZF_ss!  But FOL_ss ignores the assumption...*)
       
   434 by (ALLGOALS (asm_simp_tac 
       
   435 	      (FOL_ss addsimps [fun_extend_apply2,fun_extend_apply1])));
   432 by (ALLGOALS (fast_tac (ZF_cs addIs [apply_type])));
   436 by (ALLGOALS (fast_tac (ZF_cs addIs [apply_type])));
   433 val inj_extend = result();
   437 val inj_extend = result();