src/ZF/Epsilon.ML
changeset 6070 032babd0120b
parent 5809 bacf85370ce0
child 6071 1b2392ac5752
equal deleted inserted replaced
6069:a99879bd9f13 6070:032babd0120b
   285 by (rtac equalityI 1);
   285 by (rtac equalityI 1);
   286 by (rtac ([Transset_eclose, subset_refl] MRS eclose_least) 1);
   286 by (rtac ([Transset_eclose, subset_refl] MRS eclose_least) 1);
   287 by (rtac arg_subset_eclose 1);
   287 by (rtac arg_subset_eclose 1);
   288 qed "eclose_idem";
   288 qed "eclose_idem";
   289 
   289 
   290 (*Transfinite recursion for definitions based on the three cases of ordinals*)
   290 (** Transfinite recursion for definitions based on the 
       
   291     three cases of ordinals **)
   291 
   292 
   292 Goal "transrec2(0,a,b) = a";
   293 Goal "transrec2(0,a,b) = a";
   293 by (rtac (transrec2_def RS def_transrec RS trans) 1);
   294 by (rtac (transrec2_def RS def_transrec RS trans) 1);
   294 by (Simp_tac 1);
   295 by (Simp_tac 1);
   295 qed "transrec2_0";
   296 qed "transrec2_0";
   310 by (blast_tac (claset() addSDs [Limit_has_0] addSEs [succ_LimitE]) 1);
   311 by (blast_tac (claset() addSDs [Limit_has_0] addSEs [succ_LimitE]) 1);
   311 qed "transrec2_Limit";
   312 qed "transrec2_Limit";
   312 
   313 
   313 Addsimps [transrec2_0, transrec2_succ];
   314 Addsimps [transrec2_0, transrec2_succ];
   314 
   315 
       
   316 
       
   317 (** recursor -- better than nat_rec; the succ case has no type requirement! **)
       
   318 
       
   319 (*NOT suitable for rewriting*)
       
   320 val lemma = recursor_def RS def_transrec RS trans;
       
   321 
       
   322 Goal "recursor(a,b,0) = a";
       
   323 by (rtac (nat_case_0 RS lemma) 1);
       
   324 qed "recursor_0";
       
   325 
       
   326 Goal "recursor(a,b,succ(m)) = b(m, recursor(a,b,m))";
       
   327 by (rtac lemma 1);
       
   328 by (Simp_tac 1);
       
   329 qed "recursor_succ";
       
   330 
       
   331 
       
   332 (** rec: old version for compatibility **)
       
   333 
       
   334 Goalw [rec_def] "rec(0,a,b) = a";
       
   335 by (rtac recursor_0 1);
       
   336 qed "rec_0";
       
   337 
       
   338 Goalw [rec_def] "rec(succ(m),a,b) = b(m, rec(m,a,b))";
       
   339 by (rtac recursor_succ 1);
       
   340 qed "rec_succ";
       
   341 
       
   342 Addsimps [rec_0, rec_succ];
       
   343 
       
   344 val major::prems = Goal
       
   345     "[| n: nat;  \
       
   346 \       a: C(0);  \
       
   347 \       !!m z. [| m: nat;  z: C(m) |] ==> b(m,z): C(succ(m))  \
       
   348 \    |] ==> rec(n,a,b) : C(n)";
       
   349 by (rtac (major RS nat_induct) 1);
       
   350 by (ALLGOALS (asm_simp_tac (simpset() addsimps prems)));
       
   351 qed "rec_type";
       
   352