373 in SkipProof.prove_global thy [] [] (Logic.mk_implies |
373 in SkipProof.prove_global thy [] [] (Logic.mk_implies |
374 (HOLogic.mk_Trueprop (HOLogic.list_all |
374 (HOLogic.mk_Trueprop (HOLogic.list_all |
375 (map (pair "x") Ts, S $ app_bnds f i)), |
375 (map (pair "x") Ts, S $ app_bnds f i)), |
376 HOLogic.mk_Trueprop (HOLogic.mk_eq (list_abs (map (pair "x") Ts, |
376 HOLogic.mk_Trueprop (HOLogic.mk_eq (list_abs (map (pair "x") Ts, |
377 r $ (a $ app_bnds f i)), f)))) |
377 r $ (a $ app_bnds f i)), f)))) |
378 (fn _ => EVERY [REPEAT (rtac ext 1), REPEAT (etac allE 1), rtac thm 1, atac 1]) |
378 (fn _ => EVERY [REPEAT_DETERM_N i (rtac ext 1), |
|
379 REPEAT (etac allE 1), rtac thm 1, atac 1]) |
379 end |
380 end |
380 in map (fn r => r RS subst) (thm :: map mk_thm arities) end; |
381 in map (fn r => r RS subst) (thm :: map mk_thm arities) end; |
381 |
382 |
382 (* prove inj dt_Rep_i and dt_Rep_i x : dt_rep_set_i *) |
383 (* prove inj dt_Rep_i and dt_Rep_i x : dt_rep_set_i *) |
|
384 |
|
385 val fun_congs = map (fn T => make_elim (Drule.instantiate' |
|
386 [SOME (ctyp_of thy5 T)] [] fun_cong)) branchTs; |
383 |
387 |
384 fun prove_iso_thms (ds, (inj_thms, elem_thms)) = |
388 fun prove_iso_thms (ds, (inj_thms, elem_thms)) = |
385 let |
389 let |
386 val (_, (tname, _, _)) = hd ds; |
390 val (_, (tname, _, _)) = hd ds; |
387 val {induction, ...} = the (Symtab.lookup dt_info tname); |
391 val {induction, ...} = the (Symtab.lookup dt_info tname); |
420 REPEAT (cong_tac 1), rtac refl 1, |
424 REPEAT (cong_tac 1), rtac refl 1, |
421 REPEAT (atac 1 ORELSE (EVERY |
425 REPEAT (atac 1 ORELSE (EVERY |
422 [REPEAT (rtac ext 1), |
426 [REPEAT (rtac ext 1), |
423 REPEAT (eresolve_tac (mp :: allE :: |
427 REPEAT (eresolve_tac (mp :: allE :: |
424 map make_elim (Suml_inject :: Sumr_inject :: |
428 map make_elim (Suml_inject :: Sumr_inject :: |
425 Lim_inject :: fun_cong :: inj_thms')) 1), |
429 Lim_inject :: inj_thms') @ fun_congs) 1), |
426 atac 1]))])])])]); |
430 atac 1]))])])])]); |
427 |
431 |
428 val inj_thms'' = map (fn r => r RS @{thm datatype_injI}) |
432 val inj_thms'' = map (fn r => r RS @{thm datatype_injI}) |
429 (split_conj_thm inj_thm); |
433 (split_conj_thm inj_thm); |
430 |
434 |