20 |
20 |
21 constdefs |
21 constdefs |
22 Unity :: unit ("'(')") |
22 Unity :: unit ("'(')") |
23 "() == Abs_unit True" |
23 "() == Abs_unit True" |
24 |
24 |
25 lemma unit_eq: "u = ()" |
25 lemma unit_eq [noatp]: "u = ()" |
26 by (induct u) (simp add: unit_def Unity_def) |
26 by (induct u) (simp add: unit_def Unity_def) |
27 |
27 |
28 text {* |
28 text {* |
29 Simplification procedure for @{thm [source] unit_eq}. Cannot use |
29 Simplification procedure for @{thm [source] unit_eq}. Cannot use |
30 this rule directly --- it loops! |
30 this rule directly --- it loops! |
44 by simp |
44 by simp |
45 |
45 |
46 lemma unit_all_eq2: "(!!x::unit. PROP P) == PROP P" |
46 lemma unit_all_eq2: "(!!x::unit. PROP P) == PROP P" |
47 by (rule triv_forall_equality) |
47 by (rule triv_forall_equality) |
48 |
48 |
49 lemma unit_induct [induct type: unit]: "P () ==> P x" |
49 lemma unit_induct [noatp,induct type: unit]: "P () ==> P x" |
50 by simp |
50 by simp |
51 |
51 |
52 text {* |
52 text {* |
53 This rewrite counters the effect of @{text unit_eq_proc} on @{term |
53 This rewrite counters the effect of @{text unit_eq_proc} on @{term |
54 [source] "%u::unit. f u"}, replacing it by @{term [source] |
54 [source] "%u::unit. f u"}, replacing it by @{term [source] |
55 f} rather than by @{term [source] "%u. f ()"}. |
55 f} rather than by @{term [source] "%u. f ()"}. |
56 *} |
56 *} |
57 |
57 |
58 lemma unit_abs_eta_conv [simp]: "(%u::unit. f ()) = f" |
58 lemma unit_abs_eta_conv [simp,noatp]: "(%u::unit. f ()) = f" |
59 by (rule ext) simp |
59 by (rule ext) simp |
60 |
60 |
61 |
61 |
62 subsection {* Pairs *} |
62 subsection {* Pairs *} |
63 |
63 |
441 *} |
441 *} |
442 |
442 |
443 lemma split_beta: "(%(x, y). P x y) z = P (fst z) (snd z)" |
443 lemma split_beta: "(%(x, y). P x y) z = P (fst z) (snd z)" |
444 by (subst surjective_pairing, rule split_conv) |
444 by (subst surjective_pairing, rule split_conv) |
445 |
445 |
446 lemma split_split: "R (split c p) = (ALL x y. p = (x, y) --> R (c x y))" |
446 lemma split_split [noatp]: "R(split c p) = (ALL x y. p = (x, y) --> R(c x y))" |
447 -- {* For use with @{text split} and the Simplifier. *} |
447 -- {* For use with @{text split} and the Simplifier. *} |
448 by (insert surj_pair [of p], clarify, simp) |
448 by (insert surj_pair [of p], clarify, simp) |
449 |
449 |
450 text {* |
450 text {* |
451 @{thm [source] split_split} could be declared as @{text "[split]"} |
451 @{thm [source] split_split} could be declared as @{text "[split]"} |
452 done after the Splitter has been speeded up significantly; |
452 done after the Splitter has been speeded up significantly; |
453 precompute the constants involved and don't do anything unless the |
453 precompute the constants involved and don't do anything unless the |
454 current goal contains one of those constants. |
454 current goal contains one of those constants. |
455 *} |
455 *} |
456 |
456 |
457 lemma split_split_asm: "R (split c p) = (~(EX x y. p = (x, y) & (~R (c x y))))" |
457 lemma split_split_asm [noatp]: "R (split c p) = (~(EX x y. p = (x, y) & (~R (c x y))))" |
458 by (subst split_split, simp) |
458 by (subst split_split, simp) |
459 |
459 |
460 |
460 |
461 text {* |
461 text {* |
462 \medskip @{term split} used as a logical connective or set former. |
462 \medskip @{term split} used as a logical connective or set former. |
523 (* This prevents applications of splitE for already splitted arguments leading |
523 (* This prevents applications of splitE for already splitted arguments leading |
524 to quite time-consuming computations (in particular for nested tuples) *) |
524 to quite time-consuming computations (in particular for nested tuples) *) |
525 change_claset (fn cs => cs addSbefore ("split_conv_tac", split_conv_tac)); |
525 change_claset (fn cs => cs addSbefore ("split_conv_tac", split_conv_tac)); |
526 *} |
526 *} |
527 |
527 |
528 lemma split_eta_SetCompr [simp]: "(%u. EX x y. u = (x, y) & P (x, y)) = P" |
528 lemma split_eta_SetCompr [simp,noatp]: "(%u. EX x y. u = (x, y) & P (x, y)) = P" |
529 by (rule ext) fast |
529 by (rule ext) fast |
530 |
530 |
531 lemma split_eta_SetCompr2 [simp]: "(%u. EX x y. u = (x, y) & P x y) = split P" |
531 lemma split_eta_SetCompr2 [simp,noatp]: "(%u. EX x y. u = (x, y) & P x y) = split P" |
532 by (rule ext) fast |
532 by (rule ext) fast |
533 |
533 |
534 lemma split_part [simp]: "(%(a,b). P & Q a b) = (%ab. P & split Q ab)" |
534 lemma split_part [simp]: "(%(a,b). P & Q a b) = (%ab. P & split Q ab)" |
535 -- {* Allows simplifications of nested splits in case of independent predicates. *} |
535 -- {* Allows simplifications of nested splits in case of independent predicates. *} |
536 by (rule ext) blast |
536 by (rule ext) blast |
694 lemma UN_Times_distrib: |
694 lemma UN_Times_distrib: |
695 "(UN (a,b):(A <*> B). E a <*> F b) = (UNION A E) <*> (UNION B F)" |
695 "(UN (a,b):(A <*> B). E a <*> F b) = (UNION A E) <*> (UNION B F)" |
696 -- {* Suggested by Pierre Chartier *} |
696 -- {* Suggested by Pierre Chartier *} |
697 by blast |
697 by blast |
698 |
698 |
699 lemma split_paired_Ball_Sigma [simp]: |
699 lemma split_paired_Ball_Sigma [simp,noatp]: |
700 "(ALL z: Sigma A B. P z) = (ALL x:A. ALL y: B x. P(x,y))" |
700 "(ALL z: Sigma A B. P z) = (ALL x:A. ALL y: B x. P(x,y))" |
701 by blast |
701 by blast |
702 |
702 |
703 lemma split_paired_Bex_Sigma [simp]: |
703 lemma split_paired_Bex_Sigma [simp,noatp]: |
704 "(EX z: Sigma A B. P z) = (EX x:A. EX y: B x. P(x,y))" |
704 "(EX z: Sigma A B. P z) = (EX x:A. EX y: B x. P(x,y))" |
705 by blast |
705 by blast |
706 |
706 |
707 lemma Sigma_Un_distrib1: "(SIGMA i:I Un J. C(i)) = (SIGMA i:I. C(i)) Un (SIGMA j:J. C(j))" |
707 lemma Sigma_Un_distrib1: "(SIGMA i:I Un J. C(i)) = (SIGMA i:I. C(i)) Un (SIGMA j:J. C(j))" |
708 by blast |
708 by blast |