src/ZF/Sum.ML
author wenzelm
Mon, 03 Nov 1997 12:24:13 +0100
changeset 4091 771b1f6422a8
parent 3840 e0baea4d485a
child 4477 b3e5857d8d99
permissions -rw-r--r--
isatool fixclasimp;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1107
diff changeset
     1
(*  Title:      ZF/Sum
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1107
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Disjoint sums in Zermelo-Fraenkel Set Theory 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
open Sum;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    11
(*** Rules for the Part primitive ***)
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    12
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    13
goalw Sum.thy [Part_def]
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    14
    "a : Part(A,h) <-> a:A & (EX y. a=h(y))";
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    15
by (rtac separation 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    16
qed "Part_iff";
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    17
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    18
goalw Sum.thy [Part_def]
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    19
    "!!a b A h. [| a : A;  a=h(b) |] ==> a : Part(A,h)";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
    20
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    21
qed "Part_eqI";
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    22
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    23
val PartI = refl RSN (2,Part_eqI);
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    24
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    25
val major::prems = goalw Sum.thy [Part_def]
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    26
    "[| a : Part(A,h);  !!z. [| a : A;  a=h(z) |] ==> P  \
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    27
\    |] ==> P";
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    28
by (rtac (major RS CollectE) 1);
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    29
by (etac exE 1);
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    30
by (REPEAT (ares_tac prems 1));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    31
qed "PartE";
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    32
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
    33
AddIs  [Part_eqI];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    34
AddSEs [PartE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    35
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    36
goalw Sum.thy [Part_def] "Part(A,h) <= A";
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    37
by (rtac Collect_subset 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    38
qed "Part_subset";
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    39
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    40
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    41
(*** Rules for Disjoint Sums ***)
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
    42
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
val sum_defs = [sum_def,Inl_def,Inr_def,case_def];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
521
dfca17a698b0 ZF/Sum/Sigma_bool: new
lcp
parents: 435
diff changeset
    45
goalw Sum.thy (bool_def::sum_defs) "Sigma(bool,C) = C(0) + C(1)";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
    46
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    47
qed "Sigma_bool";
521
dfca17a698b0 ZF/Sum/Sigma_bool: new
lcp
parents: 435
diff changeset
    48
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
(** Introduction rules for the injections **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
goalw Sum.thy sum_defs "!!a A B. a : A ==> Inl(a) : A+B";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
    52
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    53
qed "InlI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
goalw Sum.thy sum_defs "!!b A B. b : B ==> Inr(b) : A+B";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
    56
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    57
qed "InrI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
(** Elimination rules **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
val major::prems = goalw Sum.thy sum_defs
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
    "[| u: A+B;  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
\       !!x. [| x:A;  u=Inl(x) |] ==> P; \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
\       !!y. [| y:B;  u=Inr(y) |] ==> P \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
\    |] ==> P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
by (rtac (major RS UnE) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
by (REPEAT (rtac refl 1
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
     ORELSE eresolve_tac (prems@[SigmaE,singletonE,ssubst]) 1));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    69
qed "sumE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
(** Injection and freeness equivalences, for rewriting **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
    73
goalw Sum.thy sum_defs "Inl(a)=Inl(b) <-> a=b";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    74
by (Simp_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    75
qed "Inl_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
    77
goalw Sum.thy sum_defs "Inr(a)=Inr(b) <-> a=b";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    78
by (Simp_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    79
qed "Inr_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
    81
goalw Sum.thy sum_defs "Inl(a)=Inr(b) <-> False";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    82
by (Simp_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    83
qed "Inl_Inr_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
    85
goalw Sum.thy sum_defs "Inr(b)=Inl(a) <-> False";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    86
by (Simp_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
    87
qed "Inr_Inl_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    89
goalw Sum.thy sum_defs "0+0 = 0";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    90
by (Simp_tac 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    91
qed "sum_empty";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
    92
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
    93
(*Injection and freeness rules*)
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
    94
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 773
diff changeset
    95
bind_thm ("Inl_inject", (Inl_iff RS iffD1));
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 773
diff changeset
    96
bind_thm ("Inr_inject", (Inr_iff RS iffD1));
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 773
diff changeset
    97
bind_thm ("Inl_neq_Inr", (Inl_Inr_iff RS iffD1 RS FalseE));
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 773
diff changeset
    98
bind_thm ("Inr_neq_Inl", (Inr_Inl_iff RS iffD1 RS FalseE));
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
    99
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   100
AddSIs [InlI, InrI];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   101
AddSEs [sumE, Inl_neq_Inr, Inr_neq_Inl];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   102
AddSDs [Inl_inject, Inr_inject];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   103
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   104
Addsimps [InlI, InrI, Inl_iff, Inr_iff, Inl_Inr_iff, Inr_Inl_iff, sum_empty];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   105
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
   106
goal Sum.thy "!!A B. Inl(a): A+B ==> a: A";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   107
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   108
qed "InlD";
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
   109
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
   110
goal Sum.thy "!!A B. Inr(b): A+B ==> b: B";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   111
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   112
qed "InrD";
55
331d93292ee0 ZF/ind-syntax/refl_thin: new
lcp
parents: 6
diff changeset
   113
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
goal Sum.thy "u: A+B <-> (EX x. x:A & u=Inl(x)) | (EX y. y:B & u=Inr(y))";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   115
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   116
qed "sum_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
goal Sum.thy "A+B <= C+D <-> A<=C & B<=D";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   119
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   120
qed "sum_subset_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
goal Sum.thy "A+B = C+D <-> A=C & B=D";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   123
by (simp_tac (simpset() addsimps [extension,sum_subset_iff]) 1);
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   124
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   125
qed "sum_equal_iff";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
1611
35e0fd1b1775 New results from AC/Cardinal_aux.ML
paulson
parents: 1461
diff changeset
   127
goalw Sum.thy [sum_def] "A+A = 2*A";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   128
by (Blast_tac 1);
1611
35e0fd1b1775 New results from AC/Cardinal_aux.ML
paulson
parents: 1461
diff changeset
   129
qed "sum_eq_2_times";
35e0fd1b1775 New results from AC/Cardinal_aux.ML
paulson
parents: 1461
diff changeset
   130
521
dfca17a698b0 ZF/Sum/Sigma_bool: new
lcp
parents: 435
diff changeset
   131
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
(*** Eliminator -- case ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
goalw Sum.thy sum_defs "case(c, d, Inl(a)) = c(a)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   135
by (simp_tac (simpset() addsimps [cond_0]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   136
qed "case_Inl";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
goalw Sum.thy sum_defs "case(c, d, Inr(b)) = d(b)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   139
by (simp_tac (simpset() addsimps [cond_1]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   140
qed "case_Inr";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   142
Addsimps [case_Inl, case_Inr];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   143
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
val major::prems = goal Sum.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
    "[| u: A+B; \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
\       !!x. x: A ==> c(x): C(Inl(x));   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
\       !!y. y: B ==> d(y): C(Inr(y)) \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
\    |] ==> case(c,d,u) : C(u)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
by (rtac (major RS sumE) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
by (ALLGOALS (etac ssubst));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   151
by (ALLGOALS (asm_simp_tac (simpset() addsimps prems)));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   152
qed "case_type";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 55
diff changeset
   154
goal Sum.thy
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 55
diff changeset
   155
  "!!u. u: A+B ==>   \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 55
diff changeset
   156
\       R(case(c,d,u)) <-> \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 55
diff changeset
   157
\       ((ALL x:A. u = Inl(x) --> R(c(x))) & \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 55
diff changeset
   158
\       (ALL y:B. u = Inr(y) --> R(d(y))))";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   159
by (Auto_tac());
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   160
qed "expand_case";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 55
diff changeset
   161
858
b87867b3fd91 Proved case_cong and case_case.
lcp
parents: 803
diff changeset
   162
val major::prems = goal Sum.thy
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1107
diff changeset
   163
  "[| z: A+B;   \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1107
diff changeset
   164
\     !!x. x:A ==> c(x)=c'(x);  \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1107
diff changeset
   165
\     !!y. y:B ==> d(y)=d'(y)   \
858
b87867b3fd91 Proved case_cong and case_case.
lcp
parents: 803
diff changeset
   166
\  |] ==> case(c,d,z) = case(c',d',z)";
b87867b3fd91 Proved case_cong and case_case.
lcp
parents: 803
diff changeset
   167
by (resolve_tac [major RS sumE] 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   168
by (ALLGOALS (asm_simp_tac (simpset() addsimps prems)));
858
b87867b3fd91 Proved case_cong and case_case.
lcp
parents: 803
diff changeset
   169
qed "case_cong";
b87867b3fd91 Proved case_cong and case_case.
lcp
parents: 803
diff changeset
   170
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   171
goal Sum.thy
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   172
  "!!z. z: A+B ==>   \
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   173
\       case(c, d, case(%x. Inl(c'(x)), %y. Inr(d'(y)), z)) = \
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   174
\       case(%x. c(c'(x)), %y. d(d'(y)), z)";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1611
diff changeset
   175
by (Auto_tac());
858
b87867b3fd91 Proved case_cong and case_case.
lcp
parents: 803
diff changeset
   176
qed "case_case";
b87867b3fd91 Proved case_cong and case_case.
lcp
parents: 803
diff changeset
   177
773
9f8bcf1a4cff sum_ss: moved down and added the rewrite rules for "case"
lcp
parents: 760
diff changeset
   178
9f8bcf1a4cff sum_ss: moved down and added the rewrite rules for "case"
lcp
parents: 760
diff changeset
   179
(*** More rules for Part(A,h) ***)
9f8bcf1a4cff sum_ss: moved down and added the rewrite rules for "case"
lcp
parents: 760
diff changeset
   180
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
goal Sum.thy "!!A B h. A<=B ==> Part(A,h)<=Part(B,h)";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   182
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   183
qed "Part_mono";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
   185
goal Sum.thy "Part(Collect(A,P), h) = Collect(Part(A,h), P)";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   186
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   187
qed "Part_Collect";
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
   188
803
4c8333ab3eae changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents: 782
diff changeset
   189
bind_thm ("Part_CollectE", Part_Collect RS equalityD1 RS subsetD RS CollectE);
744
2054fa3c8d76 tidied proofs, using fast_tac etc. as much as possible
lcp
parents: 521
diff changeset
   190
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
goal Sum.thy "Part(A+B,Inl) = {Inl(x). x: A}";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   192
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   193
qed "Part_Inl";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
goal Sum.thy "Part(A+B,Inr) = {Inr(y). y: B}";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   196
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   197
qed "Part_Inr";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   198
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   199
goalw Sum.thy [Part_def] "!!a. a : Part(A,h) ==> a : A";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
by (etac CollectD1 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   201
qed "PartD1";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
3840
e0baea4d485a fixed dots;
wenzelm
parents: 2925
diff changeset
   203
goal Sum.thy "Part(A,%x. x) = A";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   204
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   205
qed "Part_id";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   206
3840
e0baea4d485a fixed dots;
wenzelm
parents: 2925
diff changeset
   207
goal Sum.thy "Part(A+B, %x. Inr(h(x))) = {Inr(y). y: Part(B,h)}";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   208
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   209
qed "Part_Inr2";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   211
goal Sum.thy "!!A B C. C <= A+B ==> Part(C,Inl) Un Part(C,Inr) = C";
2925
b0ae2e13db93 Using Blast_tac
paulson
parents: 2493
diff changeset
   212
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 744
diff changeset
   213
qed "Part_sum_equality";