src/ZF/Sum.thy
author wenzelm
Thu, 20 May 2010 20:20:52 +0200
changeset 37012 106c56e916f8
parent 35416 d8d7d1b785af
child 38514 bd9c4e8281ec
permissions -rw-r--r--
enable shell script editor mode;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/sum.thy
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
     6
header{*Disjoint Sums*}
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
     7
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 13823
diff changeset
     8
theory Sum imports Bool equalities begin
3923
c257b82a1200 global;
wenzelm
parents: 2469
diff changeset
     9
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
    10
text{*And the "Part" primitive for simultaneous recursive type definitions*}
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
    11
3923
c257b82a1200 global;
wenzelm
parents: 2469
diff changeset
    12
global
c257b82a1200 global;
wenzelm
parents: 2469
diff changeset
    13
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    14
definition sum :: "[i,i]=>i" (infixr "+" 65) where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    15
     "A+B == {0}*A Un {1}*B"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    16
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    17
definition Inl :: "i=>i" where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    18
     "Inl(a) == <0,a>"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    19
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    20
definition Inr :: "i=>i" where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    21
     "Inr(b) == <1,b>"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    22
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    23
definition "case" :: "[i=>i, i=>i, i]=>i" where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    24
     "case(c,d) == (%<y,z>. cond(y, d(z), c(z)))"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    25
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    26
  (*operator for selecting out the various summands*)
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    27
definition Part :: "[i,i=>i] => i" where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    28
     "Part(A,h) == {x: A. EX z. x = h(z)}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
3940
wenzelm
parents: 3923
diff changeset
    30
local
3923
c257b82a1200 global;
wenzelm
parents: 2469
diff changeset
    31
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
    32
subsection{*Rules for the @{term Part} Primitive*}
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    33
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    34
lemma Part_iff: 
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    35
    "a : Part(A,h) <-> a:A & (EX y. a=h(y))"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    36
apply (unfold Part_def)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    37
apply (rule separation)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    38
done
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    39
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    40
lemma Part_eqI [intro]: 
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    41
    "[| a : A;  a=h(b) |] ==> a : Part(A,h)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    42
by (unfold Part_def, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    43
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    44
lemmas PartI = refl [THEN [2] Part_eqI]
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    45
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    46
lemma PartE [elim!]: 
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    47
    "[| a : Part(A,h);  !!z. [| a : A;  a=h(z) |] ==> P   
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    48
     |] ==> P"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    49
apply (unfold Part_def, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    50
done
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    51
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    52
lemma Part_subset: "Part(A,h) <= A"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    53
apply (unfold Part_def)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    54
apply (rule Collect_subset)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    55
done
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    56
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    57
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
    58
subsection{*Rules for Disjoint Sums*}
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    59
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    60
lemmas sum_defs = sum_def Inl_def Inr_def case_def
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    61
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    62
lemma Sigma_bool: "Sigma(bool,C) = C(0) + C(1)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    63
by (unfold bool_def sum_def, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    64
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    65
(** Introduction rules for the injections **)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    66
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    67
lemma InlI [intro!,simp,TC]: "a : A ==> Inl(a) : A+B"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    68
by (unfold sum_defs, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    69
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    70
lemma InrI [intro!,simp,TC]: "b : B ==> Inr(b) : A+B"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    71
by (unfold sum_defs, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    72
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    73
(** Elimination rules **)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    74
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    75
lemma sumE [elim!]:
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    76
    "[| u: A+B;   
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    77
        !!x. [| x:A;  u=Inl(x) |] ==> P;  
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    78
        !!y. [| y:B;  u=Inr(y) |] ==> P  
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    79
     |] ==> P"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    80
by (unfold sum_defs, blast) 
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    81
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    82
(** Injection and freeness equivalences, for rewriting **)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    83
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    84
lemma Inl_iff [iff]: "Inl(a)=Inl(b) <-> a=b"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    85
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    86
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    87
lemma Inr_iff [iff]: "Inr(a)=Inr(b) <-> a=b"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    88
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    89
13823
d49ffd9f9662 fixed anomalies in the installed classical rules
paulson
parents: 13356
diff changeset
    90
lemma Inl_Inr_iff [simp]: "Inl(a)=Inr(b) <-> False"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    91
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    92
13823
d49ffd9f9662 fixed anomalies in the installed classical rules
paulson
parents: 13356
diff changeset
    93
lemma Inr_Inl_iff [simp]: "Inr(b)=Inl(a) <-> False"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    94
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    95
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    96
lemma sum_empty [simp]: "0+0 = 0"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    97
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    98
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    99
(*Injection and freeness rules*)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   100
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   101
lemmas Inl_inject = Inl_iff [THEN iffD1, standard]
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   102
lemmas Inr_inject = Inr_iff [THEN iffD1, standard]
13823
d49ffd9f9662 fixed anomalies in the installed classical rules
paulson
parents: 13356
diff changeset
   103
lemmas Inl_neq_Inr = Inl_Inr_iff [THEN iffD1, THEN FalseE, elim!]
d49ffd9f9662 fixed anomalies in the installed classical rules
paulson
parents: 13356
diff changeset
   104
lemmas Inr_neq_Inl = Inr_Inl_iff [THEN iffD1, THEN FalseE, elim!]
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   105
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   106
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   107
lemma InlD: "Inl(a): A+B ==> a: A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   108
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   109
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   110
lemma InrD: "Inr(b): A+B ==> b: B"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   111
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   112
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   113
lemma sum_iff: "u: A+B <-> (EX x. x:A & u=Inl(x)) | (EX y. y:B & u=Inr(y))"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   114
by blast
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   115
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   116
lemma Inl_in_sum_iff [simp]: "(Inl(x) \<in> A+B) <-> (x \<in> A)";
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   117
by auto
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   118
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   119
lemma Inr_in_sum_iff [simp]: "(Inr(y) \<in> A+B) <-> (y \<in> B)";
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   120
by auto
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   121
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   122
lemma sum_subset_iff: "A+B <= C+D <-> A<=C & B<=D"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   123
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   124
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   125
lemma sum_equal_iff: "A+B = C+D <-> A=C & B=D"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   126
by (simp add: extension sum_subset_iff, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   127
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   128
lemma sum_eq_2_times: "A+A = 2*A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   129
by (simp add: sum_def, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   130
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   131
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
   132
subsection{*The Eliminator: @{term case}*}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   134
lemma case_Inl [simp]: "case(c, d, Inl(a)) = c(a)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   135
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   136
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   137
lemma case_Inr [simp]: "case(c, d, Inr(b)) = d(b)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   138
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   139
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   140
lemma case_type [TC]:
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   141
    "[| u: A+B;  
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   142
        !!x. x: A ==> c(x): C(Inl(x));    
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   143
        !!y. y: B ==> d(y): C(Inr(y))  
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   144
     |] ==> case(c,d,u) : C(u)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   145
by auto
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   146
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   147
lemma expand_case: "u: A+B ==>    
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   148
        R(case(c,d,u)) <->  
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   149
        ((ALL x:A. u = Inl(x) --> R(c(x))) &  
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   150
        (ALL y:B. u = Inr(y) --> R(d(y))))"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   151
by auto
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   152
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   153
lemma case_cong:
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   154
  "[| z: A+B;    
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   155
      !!x. x:A ==> c(x)=c'(x);   
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   156
      !!y. y:B ==> d(y)=d'(y)    
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   157
   |] ==> case(c,d,z) = case(c',d',z)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   158
by auto 
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   159
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   160
lemma case_case: "z: A+B ==>    
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 24893
diff changeset
   161
        case(c, d, case(%x. Inl(c'(x)), %y. Inr(d'(y)), z)) =  
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   162
        case(%x. c(c'(x)), %y. d(d'(y)), z)"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   163
by auto
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   164
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   165
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
   166
subsection{*More Rules for @{term "Part(A,h)"}*}
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   167
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   168
lemma Part_mono: "A<=B ==> Part(A,h)<=Part(B,h)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   169
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   170
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   171
lemma Part_Collect: "Part(Collect(A,P), h) = Collect(Part(A,h), P)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   172
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   173
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   174
lemmas Part_CollectE =
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   175
     Part_Collect [THEN equalityD1, THEN subsetD, THEN CollectE, standard]
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   176
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   177
lemma Part_Inl: "Part(A+B,Inl) = {Inl(x). x: A}"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   178
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   179
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   180
lemma Part_Inr: "Part(A+B,Inr) = {Inr(y). y: B}"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   181
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   182
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   183
lemma PartD1: "a : Part(A,h) ==> a : A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   184
by (simp add: Part_def)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   185
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   186
lemma Part_id: "Part(A,%x. x) = A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   187
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   188
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   189
lemma Part_Inr2: "Part(A+B, %x. Inr(h(x))) = {Inr(y). y: Part(B,h)}"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   190
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   191
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   192
lemma Part_sum_equality: "C <= A+B ==> Part(C,Inl) Un Part(C,Inr) = C"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   193
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   194
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
end