src/ZF/upair.thy
author paulson
Tue, 06 Mar 2012 15:15:49 +0000
changeset 46820 c656222c4dc1
parent 45620 f2a587696afb
child 46821 ff6b0c1087f2
permissions -rw-r--r--
mathematical symbols instead of ASCII
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 124
diff changeset
     1
(*  Title:      ZF/upair.thy
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 124
diff changeset
     2
    Author:     Lawrence C Paulson and Martin D Coen, CU Computer Laboratory
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 124
diff changeset
     3
    Copyright   1993  University of Cambridge
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
     4
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
     5
Observe the order of dependence:
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
     6
    Upair is defined in terms of Replace
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
     7
    \<union> is defined in terms of Upair and \<Union>(similarly for Int)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
     8
    cons is defined in terms of Upair and Un
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
     9
    Ordered pairs and descriptions are defined using cons ("set notation")
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 124
diff changeset
    10
*)
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 124
diff changeset
    11
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
    12
header{*Unordered Pairs*}
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
    13
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15091
diff changeset
    14
theory upair imports ZF
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15091
diff changeset
    15
uses "Tools/typechk.ML" begin
6153
bff90585cce5 new typechecking solver for the simplifier
paulson
parents: 3924
diff changeset
    16
9907
473a6604da94 tuned ML code (the_context, bind_thms(s));
wenzelm
parents: 9570
diff changeset
    17
setup TypeCheck.setup
6153
bff90585cce5 new typechecking solver for the simplifier
paulson
parents: 3924
diff changeset
    18
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
    19
lemma atomize_ball [symmetric, rulify]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    20
     "(!!x. x:A ==> P(x)) == Trueprop (\<forall>x\<in>A. P(x))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
    21
by (simp add: Ball_def atomize_all atomize_imp)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    22
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    23
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
    24
subsection{*Unordered Pairs: constant @{term Upair}*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    25
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    26
lemma Upair_iff [simp]: "c \<in> Upair(a,b) <-> (c=a | c=b)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    27
by (unfold Upair_def, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    28
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    29
lemma UpairI1: "a \<in> Upair(a,b)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    30
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    31
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    32
lemma UpairI2: "b \<in> Upair(a,b)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    33
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    34
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    35
lemma UpairE: "[| a \<in> Upair(b,c);  a=b ==> P;  a=c ==> P |] ==> P"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
    36
by (simp, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    37
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
    38
subsection{*Rules for Binary Union, Defined via @{term Upair}*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    39
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    40
lemma Un_iff [simp]: "c \<in> A \<union> B <-> (c:A | c:B)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    41
apply (simp add: Un_def)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    42
apply (blast intro: UpairI1 UpairI2 elim: UpairE)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    43
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    44
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    45
lemma UnI1: "c \<in> A ==> c \<in> A \<union> B"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    46
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    47
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    48
lemma UnI2: "c \<in> B ==> c \<in> A \<union> B"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    49
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    50
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13259
diff changeset
    51
declare UnI1 [elim?]  UnI2 [elim?]
c9cfe1638bf2 improved presentation markup
paulson
parents: 13259
diff changeset
    52
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    53
lemma UnE [elim!]: "[| c \<in> A \<union> B;  c:A ==> P;  c:B ==> P |] ==> P"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
    54
by (simp, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    55
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    56
(*Stronger version of the rule above*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    57
lemma UnE': "[| c \<in> A \<union> B;  c:A ==> P;  [| c:B;  c\<notin>A |] ==> P |] ==> P"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
    58
by (simp, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    59
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    60
(*Classical introduction rule: no commitment to A vs B*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    61
lemma UnCI [intro!]: "(c \<notin> B ==> c \<in> A) ==> c \<in> A \<union> B"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
    62
by (simp, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    63
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
    64
subsection{*Rules for Binary Intersection, Defined via @{term Upair}*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    65
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    66
lemma Int_iff [simp]: "c \<in> A \<inter> B <-> (c:A & c:B)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    67
apply (unfold Int_def)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    68
apply (blast intro: UpairI1 UpairI2 elim: UpairE)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    69
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    70
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    71
lemma IntI [intro!]: "[| c \<in> A;  c \<in> B |] ==> c \<in> A \<inter> B"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    72
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    73
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    74
lemma IntD1: "c \<in> A \<inter> B ==> c \<in> A"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    75
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    76
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    77
lemma IntD2: "c \<in> A \<inter> B ==> c \<in> B"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    78
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    79
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    80
lemma IntE [elim!]: "[| c \<in> A \<inter> B;  [| c:A; c:B |] ==> P |] ==> P"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    81
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    82
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    83
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
    84
subsection{*Rules for Set Difference, Defined via @{term Upair}*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    85
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    86
lemma Diff_iff [simp]: "c \<in> A-B <-> (c:A & c\<notin>B)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    87
by (unfold Diff_def, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    88
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    89
lemma DiffI [intro!]: "[| c \<in> A;  c \<notin> B |] ==> c \<in> A - B"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    90
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    91
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    92
lemma DiffD1: "c \<in> A - B ==> c \<in> A"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    93
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    94
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    95
lemma DiffD2: "c \<in> A - B ==> c \<notin> B"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    96
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    97
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
    98
lemma DiffE [elim!]: "[| c \<in> A - B;  [| c:A; c\<notin>B |] ==> P |] ==> P"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
    99
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   100
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   101
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   102
subsection{*Rules for @{term cons}*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   103
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   104
lemma cons_iff [simp]: "a \<in> cons(b,A) <-> (a=b | a:A)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   105
apply (unfold cons_def)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   106
apply (blast intro: UpairI1 UpairI2 elim: UpairE)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   107
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   108
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   109
(*risky as a typechecking rule, but solves otherwise unconstrained goals of
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   110
the form x \<in> ?A*)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   111
lemma consI1 [simp,TC]: "a \<in> cons(a,B)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   112
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   113
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   114
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   115
lemma consI2: "a \<in> B ==> a \<in> cons(b,B)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   116
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   117
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   118
lemma consE [elim!]: "[| a \<in> cons(b,A);  a=b ==> P;  a:A ==> P |] ==> P"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   119
by (simp, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   120
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   121
(*Stronger version of the rule above*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   122
lemma consE':
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   123
    "[| a \<in> cons(b,A);  a=b ==> P;  [| a:A;  a\<noteq>b |] ==> P |] ==> P"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   124
by (simp, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   125
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   126
(*Classical introduction rule*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   127
lemma consCI [intro!]: "(a\<notin>B ==> a=b) ==> a: cons(b,B)"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   128
by (simp, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   129
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   130
lemma cons_not_0 [simp]: "cons(a,B) \<noteq> 0"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   131
by (blast elim: equalityE)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   132
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 32960
diff changeset
   133
lemmas cons_neq_0 = cons_not_0 [THEN notE]
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   134
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   135
declare cons_not_0 [THEN not_sym, simp]
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   136
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   137
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   138
subsection{*Singletons*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   139
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   140
lemma singleton_iff: "a \<in> {b} <-> a=b"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   141
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   142
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   143
lemma singletonI [intro!]: "a \<in> {a}"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   144
by (rule consI1)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   145
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 32960
diff changeset
   146
lemmas singletonE = singleton_iff [THEN iffD1, elim_format, elim!]
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   147
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   148
14883
ca000a495448 Groups, Rings and supporting lemmas
paulson
parents: 14153
diff changeset
   149
subsection{*Descriptions*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   150
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   151
lemma the_equality [intro]:
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   152
    "[| P(a);  !!x. P(x) ==> x=a |] ==> (THE x. P(x)) = a"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   153
apply (unfold the_def)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   154
apply (fast dest: subst)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   155
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   156
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   157
(* Only use this if you already know EX!x. P(x) *)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   158
lemma the_equality2: "[| EX! x. P(x);  P(a) |] ==> (THE x. P(x)) = a"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   159
by blast
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   160
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   161
lemma theI: "EX! x. P(x) ==> P(THE x. P(x))"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   162
apply (erule ex1E)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   163
apply (subst the_equality)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   164
apply (blast+)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   165
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   166
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   167
(*No congruence rule is necessary: if @{term"\<forall>y.P(y)<->Q(y)"} then
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   168
  @{term "THE x.P(x)"}  rewrites to @{term "THE x.Q(x)"} *)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   169
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   170
(*If it's "undefined", it's zero!*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   171
lemma the_0: "~ (EX! x. P(x)) ==> (THE x. P(x))=0"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   172
apply (unfold the_def)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   173
apply (blast elim!: ReplaceE)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   174
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   175
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   176
(*Easier to apply than theI: conclusion has only one occurrence of P*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   177
lemma theI2:
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   178
    assumes p1: "~ Q(0) ==> EX! x. P(x)"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   179
        and p2: "!!x. P(x) ==> Q(x)"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   180
    shows "Q(THE x. P(x))"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   181
apply (rule classical)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   182
apply (rule p2)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   183
apply (rule theI)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   184
apply (rule classical)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   185
apply (rule p1)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   186
apply (erule the_0 [THEN subst], assumption)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   187
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   188
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   189
lemma the_eq_trivial [simp]: "(THE x. x = a) = a"
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   190
by blast
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   191
13544
895994073bdf various new lemmas for Constructible
paulson
parents: 13357
diff changeset
   192
lemma the_eq_trivial2 [simp]: "(THE x. a = x) = a"
895994073bdf various new lemmas for Constructible
paulson
parents: 13357
diff changeset
   193
by blast
895994073bdf various new lemmas for Constructible
paulson
parents: 13357
diff changeset
   194
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   195
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   196
subsection{*Conditional Terms: @{text "if-then-else"}*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   197
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   198
lemma if_true [simp]: "(if True then a else b) = a"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   199
by (unfold if_def, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   200
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   201
lemma if_false [simp]: "(if False then a else b) = b"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   202
by (unfold if_def, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   203
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   204
(*Never use with case splitting, or if P is known to be true or false*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   205
lemma if_cong:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   206
    "[| P<->Q;  Q ==> a=c;  ~Q ==> b=d |]
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   207
     ==> (if P then a else b) = (if Q then c else d)"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   208
by (simp add: if_def cong add: conj_cong)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   209
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   210
(*Prevents simplification of x and y: faster and allows the execution
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   211
  of functional programs. NOW THE DEFAULT.*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   212
lemma if_weak_cong: "P<->Q ==> (if P then x else y) = (if Q then x else y)"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   213
by simp
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   214
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   215
(*Not needed for rewriting, since P would rewrite to True anyway*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   216
lemma if_P: "P ==> (if P then a else b) = a"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   217
by (unfold if_def, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   218
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   219
(*Not needed for rewriting, since P would rewrite to False anyway*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   220
lemma if_not_P: "~P ==> (if P then a else b) = b"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   221
by (unfold if_def, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   222
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   223
lemma split_if [split]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   224
     "P(if Q then x else y) <-> ((Q \<longrightarrow> P(x)) & (~Q \<longrightarrow> P(y)))"
14153
76a6ba67bd15 new case_tac
paulson
parents: 13780
diff changeset
   225
by (case_tac Q, simp_all)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   226
45620
f2a587696afb modernized some old-style infix operations, which were left over from the time of ML proof scripts;
wenzelm
parents: 45602
diff changeset
   227
(** Rewrite rules for boolean case-splitting: faster than split_if [split]
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   228
**)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   229
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 32960
diff changeset
   230
lemmas split_if_eq1 = split_if [of "%x. x = b"] for b
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 32960
diff changeset
   231
lemmas split_if_eq2 = split_if [of "%x. a = x"] for x
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   232
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   233
lemmas split_if_mem1 = split_if [of "%x. x \<in> b"] for b
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   234
lemmas split_if_mem2 = split_if [of "%x. a \<in> x"] for x
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   235
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   236
lemmas split_ifs = split_if_eq1 split_if_eq2 split_if_mem1 split_if_mem2
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   237
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   238
(*Logically equivalent to split_if_mem2*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   239
lemma if_iff: "a: (if P then x else y) <-> P & a:x | ~P & a:y"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   240
by simp
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   241
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   242
lemma if_type [TC]:
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   243
    "[| P ==> a: A;  ~P ==> b: A |] ==> (if P then a else b): A"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   244
by simp
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   245
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   246
(** Splitting IFs in the assumptions **)
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   247
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   248
lemma split_if_asm: "P(if Q then x else y) <-> (~((Q & ~P(x)) | (~Q & ~P(y))))"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   249
by simp
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   250
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   251
lemmas if_splits = split_if split_if_asm
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   252
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   253
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   254
subsection{*Consequences of Foundation*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   255
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   256
(*was called mem_anti_sym*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   257
lemma mem_asym: "[| a:b;  ~P ==> b:a |] ==> P"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   258
apply (rule classical)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   259
apply (rule_tac A1 = "{a,b}" in foundation [THEN disjE])
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   260
apply (blast elim!: equalityE)+
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   261
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   262
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   263
(*was called mem_anti_refl*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   264
lemma mem_irrefl: "a:a ==> P"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   265
by (blast intro: mem_asym)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   266
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   267
(*mem_irrefl should NOT be added to default databases:
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   268
      it would be tried on most goals, making proofs slower!*)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   269
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   270
lemma mem_not_refl: "a \<notin> a"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   271
apply (rule notI)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   272
apply (erule mem_irrefl)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   273
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   274
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   275
(*Good for proving inequalities by rewriting*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   276
lemma mem_imp_not_eq: "a:A ==> a \<noteq> A"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   277
by (blast elim!: mem_irrefl)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   278
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   279
lemma eq_imp_not_mem: "a=A ==> a \<notin> A"
13357
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   280
by (blast intro: elim: mem_irrefl)
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   281
6f54e992777e Removal of mono.thy
paulson
parents: 13356
diff changeset
   282
subsection{*Rules for Successor*}
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   283
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   284
lemma succ_iff: "i \<in> succ(j) <-> i=j | i:j"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   285
by (unfold succ_def, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   286
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   287
lemma succI1 [simp]: "i \<in> succ(i)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   288
by (simp add: succ_iff)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   289
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   290
lemma succI2: "i \<in> j ==> i \<in> succ(j)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   291
by (simp add: succ_iff)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   292
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   293
lemma succE [elim!]:
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   294
    "[| i \<in> succ(j);  i=j ==> P;  i:j ==> P |] ==> P"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   295
apply (simp add: succ_iff, blast)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   296
done
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   297
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   298
(*Classical introduction rule*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   299
lemma succCI [intro!]: "(i\<notin>j ==> i=j) ==> i: succ(j)"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   300
by (simp add: succ_iff, blast)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   301
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   302
lemma succ_not_0 [simp]: "succ(n) \<noteq> 0"
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   303
by (blast elim!: equalityE)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   304
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 32960
diff changeset
   305
lemmas succ_neq_0 = succ_not_0 [THEN notE, elim!]
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   306
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   307
declare succ_not_0 [THEN not_sym, simp]
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   308
declare sym [THEN succ_neq_0, elim!]
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   309
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   310
(* @{term"succ(c) \<subseteq> B ==> c \<in> B"} *)
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   311
lemmas succ_subsetD = succI1 [THEN [2] subsetD]
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   312
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   313
(* @{term"succ(b) \<noteq> b"} *)
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 32960
diff changeset
   314
lemmas succ_neq_self = succI1 [THEN mem_imp_not_eq, THEN not_sym]
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   315
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   316
lemma succ_inject_iff [simp]: "succ(m) = succ(n) <-> m=n"
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   317
by (blast elim: mem_asym elim!: equalityE)
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   318
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 32960
diff changeset
   319
lemmas succ_inject = succ_inject_iff [THEN iffD1, dest!]
13259
01fa0c8dbc92 conversion of many files to Isar format
paulson
parents: 11770
diff changeset
   320
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   321
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   322
subsection{*Miniscoping of the Bounded Universal Quantifier*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   323
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   324
lemma ball_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   325
     "(\<forall>x\<in>A. P(x) & Q)   <-> (\<forall>x\<in>A. P(x)) & (A=0 | Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   326
     "(\<forall>x\<in>A. P(x) | Q)   <-> ((\<forall>x\<in>A. P(x)) | Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   327
     "(\<forall>x\<in>A. P(x) \<longrightarrow> Q) <-> ((\<exists>x\<in>A. P(x)) \<longrightarrow> Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   328
     "(~(\<forall>x\<in>A. P(x))) <-> (\<exists>x\<in>A. ~P(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   329
     "(\<forall>x\<in>0.P(x)) <-> True"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   330
     "(\<forall>x\<in>succ(i).P(x)) <-> P(i) & (\<forall>x\<in>i. P(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   331
     "(\<forall>x\<in>cons(a,B).P(x)) <-> P(a) & (\<forall>x\<in>B. P(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   332
     "(\<forall>x\<in>RepFun(A,f). P(x)) <-> (\<forall>y\<in>A. P(f(y)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   333
     "(\<forall>x\<in>\<Union>(A).P(x)) <-> (\<forall>y\<in>A. \<forall>x\<in>y. P(x))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   334
by blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   335
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   336
lemma ball_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   337
     "(\<forall>x\<in>A. P & Q(x))   <-> (A=0 | P) & (\<forall>x\<in>A. Q(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   338
     "(\<forall>x\<in>A. P | Q(x))   <-> (P | (\<forall>x\<in>A. Q(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   339
     "(\<forall>x\<in>A. P \<longrightarrow> Q(x)) <-> (P \<longrightarrow> (\<forall>x\<in>A. Q(x)))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   340
by blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   341
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   342
lemma ball_simps3:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   343
     "(\<forall>x\<in>Collect(A,Q).P(x)) <-> (\<forall>x\<in>A. Q(x) \<longrightarrow> P(x))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   344
by blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   345
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   346
lemmas ball_simps [simp] = ball_simps1 ball_simps2 ball_simps3
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   347
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   348
lemma ball_conj_distrib:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   349
    "(\<forall>x\<in>A. P(x) & Q(x)) <-> ((\<forall>x\<in>A. P(x)) & (\<forall>x\<in>A. Q(x)))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   350
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   351
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   352
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   353
subsection{*Miniscoping of the Bounded Existential Quantifier*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   354
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   355
lemma bex_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   356
     "(\<exists>x\<in>A. P(x) & Q) <-> ((\<exists>x\<in>A. P(x)) & Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   357
     "(\<exists>x\<in>A. P(x) | Q) <-> (\<exists>x\<in>A. P(x)) | (A\<noteq>0 & Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   358
     "(\<exists>x\<in>A. P(x) \<longrightarrow> Q) <-> ((\<forall>x\<in>A. P(x)) \<longrightarrow> (A\<noteq>0 & Q))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   359
     "(\<exists>x\<in>0.P(x)) <-> False"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   360
     "(\<exists>x\<in>succ(i).P(x)) <-> P(i) | (\<exists>x\<in>i. P(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   361
     "(\<exists>x\<in>cons(a,B).P(x)) <-> P(a) | (\<exists>x\<in>B. P(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   362
     "(\<exists>x\<in>RepFun(A,f). P(x)) <-> (\<exists>y\<in>A. P(f(y)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   363
     "(\<exists>x\<in>\<Union>(A).P(x)) <-> (\<exists>y\<in>A. \<exists>x\<in>y.  P(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   364
     "(~(\<exists>x\<in>A. P(x))) <-> (\<forall>x\<in>A. ~P(x))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   365
by blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   366
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   367
lemma bex_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   368
     "(\<exists>x\<in>A. P & Q(x)) <-> (P & (\<exists>x\<in>A. Q(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   369
     "(\<exists>x\<in>A. P | Q(x)) <-> (A\<noteq>0 & P) | (\<exists>x\<in>A. Q(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   370
     "(\<exists>x\<in>A. P \<longrightarrow> Q(x)) <-> ((A=0 | P) \<longrightarrow> (\<exists>x\<in>A. Q(x)))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   371
by blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   372
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   373
lemma bex_simps3:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   374
     "(\<exists>x\<in>Collect(A,Q).P(x)) <-> (\<exists>x\<in>A. Q(x) & P(x))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   375
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   376
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   377
lemmas bex_simps [simp] = bex_simps1 bex_simps2 bex_simps3
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   378
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   379
lemma bex_disj_distrib:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   380
    "(\<exists>x\<in>A. P(x) | Q(x)) <-> ((\<exists>x\<in>A. P(x)) | (\<exists>x\<in>A. Q(x)))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   381
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   382
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   383
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   384
(** One-point rule for bounded quantifiers: see HOL/Set.ML **)
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   385
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   386
lemma bex_triv_one_point1 [simp]: "(\<exists>x\<in>A. x=a) <-> (a:A)"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   387
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   388
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   389
lemma bex_triv_one_point2 [simp]: "(\<exists>x\<in>A. a=x) <-> (a:A)"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   390
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   391
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   392
lemma bex_one_point1 [simp]: "(\<exists>x\<in>A. x=a & P(x)) <-> (a:A & P(a))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   393
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   394
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   395
lemma bex_one_point2 [simp]: "(\<exists>x\<in>A. a=x & P(x)) <-> (a:A & P(a))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   396
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   397
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   398
lemma ball_one_point1 [simp]: "(\<forall>x\<in>A. x=a \<longrightarrow> P(x)) <-> (a:A \<longrightarrow> P(a))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   399
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   400
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   401
lemma ball_one_point2 [simp]: "(\<forall>x\<in>A. a=x \<longrightarrow> P(x)) <-> (a:A \<longrightarrow> P(a))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   402
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   403
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   404
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   405
subsection{*Miniscoping of the Replacement Operator*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   406
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   407
text{*These cover both @{term Replace} and @{term Collect}*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   408
lemma Rep_simps [simp]:
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   409
     "{x. y:0, R(x,y)} = 0"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   410
     "{x:0. P(x)} = 0"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   411
     "{x:A. Q} = (if Q then A else 0)"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   412
     "RepFun(0,f) = 0"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   413
     "RepFun(succ(i),f) = cons(f(i), RepFun(i,f))"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   414
     "RepFun(cons(a,B),f) = cons(f(a), RepFun(B,f))"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   415
by (simp_all, blast+)
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   416
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   417
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   418
subsection{*Miniscoping of Unions*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   419
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   420
lemma UN_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   421
     "(\<Union>x\<in>C. cons(a, B(x))) = (if C=0 then 0 else cons(a, \<Union>x\<in>C. B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   422
     "(\<Union>x\<in>C. A(x) \<union> B')   = (if C=0 then 0 else (\<Union>x\<in>C. A(x)) \<union> B')"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   423
     "(\<Union>x\<in>C. A' \<union> B(x))   = (if C=0 then 0 else A' \<union> (\<Union>x\<in>C. B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   424
     "(\<Union>x\<in>C. A(x) \<inter> B')  = ((\<Union>x\<in>C. A(x)) \<inter> B')"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   425
     "(\<Union>x\<in>C. A' \<inter> B(x))  = (A' \<inter> (\<Union>x\<in>C. B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   426
     "(\<Union>x\<in>C. A(x) - B')    = ((\<Union>x\<in>C. A(x)) - B')"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   427
     "(\<Union>x\<in>C. A' - B(x))    = (if C=0 then 0 else A' - (\<Inter>x\<in>C. B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   428
apply (simp_all add: Inter_def)
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   429
apply (blast intro!: equalityI )+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   430
done
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   431
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   432
lemma UN_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   433
      "(\<Union>x\<in>\<Union>(A). B(x)) = (\<Union>y\<in>A. \<Union>x\<in>y. B(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   434
      "(\<Union>z\<in>(\<Union>x\<in>A. B(x)). C(z)) = (\<Union>x\<in>A. \<Union>z\<in>B(x). C(z))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   435
      "(\<Union>x\<in>RepFun(A,f). B(x))     = (\<Union>a\<in>A. B(f(a)))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   436
by blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   437
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   438
lemmas UN_simps [simp] = UN_simps1 UN_simps2
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   439
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   440
text{*Opposite of miniscoping: pull the operator out*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   441
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   442
lemma UN_extend_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   443
     "(\<Union>x\<in>C. A(x)) \<union> B   = (if C=0 then B else (\<Union>x\<in>C. A(x) \<union> B))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   444
     "((\<Union>x\<in>C. A(x)) \<inter> B) = (\<Union>x\<in>C. A(x) \<inter> B)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   445
     "((\<Union>x\<in>C. A(x)) - B) = (\<Union>x\<in>C. A(x) - B)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   446
apply simp_all
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   447
apply blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   448
done
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   449
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   450
lemma UN_extend_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   451
     "cons(a, \<Union>x\<in>C. B(x)) = (if C=0 then {a} else (\<Union>x\<in>C. cons(a, B(x))))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   452
     "A \<union> (\<Union>x\<in>C. B(x))   = (if C=0 then A else (\<Union>x\<in>C. A \<union> B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   453
     "(A \<inter> (\<Union>x\<in>C. B(x))) = (\<Union>x\<in>C. A \<inter> B(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   454
     "A - (\<Inter>x\<in>C. B(x))    = (if C=0 then A else (\<Union>x\<in>C. A - B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   455
     "(\<Union>y\<in>A. \<Union>x\<in>y. B(x)) = (\<Union>x\<in>\<Union>(A). B(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   456
     "(\<Union>a\<in>A. B(f(a))) = (\<Union>x\<in>RepFun(A,f). B(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   457
apply (simp_all add: Inter_def)
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   458
apply (blast intro!: equalityI)+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   459
done
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   460
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   461
lemma UN_UN_extend:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   462
     "(\<Union>x\<in>A. \<Union>z\<in>B(x). C(z)) = (\<Union>z\<in>(\<Union>x\<in>A. B(x)). C(z))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   463
by blast
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   464
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   465
lemmas UN_extend_simps = UN_extend_simps1 UN_extend_simps2 UN_UN_extend
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   466
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   467
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   468
subsection{*Miniscoping of Intersections*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   469
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   470
lemma INT_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   471
     "(\<Inter>x\<in>C. A(x) \<inter> B) = (\<Inter>x\<in>C. A(x)) \<inter> B"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   472
     "(\<Inter>x\<in>C. A(x) - B)   = (\<Inter>x\<in>C. A(x)) - B"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   473
     "(\<Inter>x\<in>C. A(x) \<union> B)  = (if C=0 then 0 else (\<Inter>x\<in>C. A(x)) \<union> B)"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   474
by (simp_all add: Inter_def, blast+)
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   475
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   476
lemma INT_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   477
     "(\<Inter>x\<in>C. A \<inter> B(x)) = A \<inter> (\<Inter>x\<in>C. B(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   478
     "(\<Inter>x\<in>C. A - B(x))   = (if C=0 then 0 else A - (\<Union>x\<in>C. B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   479
     "(\<Inter>x\<in>C. cons(a, B(x))) = (if C=0 then 0 else cons(a, \<Inter>x\<in>C. B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   480
     "(\<Inter>x\<in>C. A \<union> B(x))  = (if C=0 then 0 else A \<union> (\<Inter>x\<in>C. B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   481
apply (simp_all add: Inter_def)
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   482
apply (blast intro!: equalityI)+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   483
done
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   484
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   485
lemmas INT_simps [simp] = INT_simps1 INT_simps2
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   486
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   487
text{*Opposite of miniscoping: pull the operator out*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   488
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   489
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   490
lemma INT_extend_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   491
     "(\<Inter>x\<in>C. A(x)) \<inter> B = (\<Inter>x\<in>C. A(x) \<inter> B)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   492
     "(\<Inter>x\<in>C. A(x)) - B = (\<Inter>x\<in>C. A(x) - B)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   493
     "(\<Inter>x\<in>C. A(x)) \<union> B  = (if C=0 then B else (\<Inter>x\<in>C. A(x) \<union> B))"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   494
apply (simp_all add: Inter_def, blast+)
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   495
done
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   496
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   497
lemma INT_extend_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   498
     "A \<inter> (\<Inter>x\<in>C. B(x)) = (\<Inter>x\<in>C. A \<inter> B(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   499
     "A - (\<Union>x\<in>C. B(x))   = (if C=0 then A else (\<Inter>x\<in>C. A - B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   500
     "cons(a, \<Inter>x\<in>C. B(x)) = (if C=0 then {a} else (\<Inter>x\<in>C. cons(a, B(x))))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   501
     "A \<union> (\<Inter>x\<in>C. B(x))  = (if C=0 then A else (\<Inter>x\<in>C. A \<union> B(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   502
apply (simp_all add: Inter_def)
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   503
apply (blast intro!: equalityI)+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   504
done
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   505
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   506
lemmas INT_extend_simps = INT_extend_simps1 INT_extend_simps2
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   507
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   508
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   509
subsection{*Other simprules*}
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   510
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   511
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   512
(*** Miniscoping: pushing in big Unions, Intersections, quantifiers, etc. ***)
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   513
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   514
lemma misc_simps [simp]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   515
     "0 \<union> A = A"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   516
     "A \<union> 0 = A"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   517
     "0 \<inter> A = 0"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   518
     "A \<inter> 0 = 0"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   519
     "0 - A = 0"
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   520
     "A - 0 = A"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   521
     "\<Union>(0) = 0"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   522
     "\<Union>(cons(b,A)) = b \<union> \<Union>(A)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45620
diff changeset
   523
     "\<Inter>({b}) = b"
13780
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   524
by blast+
af7b79271364 more new-style theories
paulson
parents: 13544
diff changeset
   525
6153
bff90585cce5 new typechecking solver for the simplifier
paulson
parents: 3924
diff changeset
   526
end