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