src/ZF/Sum.thy
author wenzelm
Wed, 27 Mar 2013 16:38:25 +0100
changeset 51553 63327f679cff
parent 46953 2b6e55924af3
child 58860 fee7cfa69c50
permissions -rw-r--r--
more ambitious Goal.skip_proofs: covers Goal.prove forms as well, and do not insist in quick_and_dirty (for the sake of Isabelle/jEdit);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41777
1f7cbe39d425 more precise headers;
wenzelm
parents: 38514
diff changeset
     1
(*  Title:      ZF/Sum.thy
1478
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
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    12
definition sum :: "[i,i]=>i" (infixr "+" 65) where
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
    13
     "A+B == {0}*A \<union> {1}*B"
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    14
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    15
definition Inl :: "i=>i" where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    16
     "Inl(a) == <0,a>"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    17
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    18
definition Inr :: "i=>i" where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    19
     "Inr(b) == <1,b>"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    20
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32960
diff changeset
    21
definition "case" :: "[i=>i, i=>i, i]=>i" where
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    22
     "case(c,d) == (%<y,z>. cond(y, d(z), c(z)))"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    23
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    24
  (*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
    25
definition Part :: "[i,i=>i] => i" where
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    26
     "Part(A,h) == {x \<in> A. \<exists>z. x = h(z)}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
    28
subsection{*Rules for the @{term Part} Primitive*}
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    29
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    30
lemma Part_iff:
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    31
    "a \<in> Part(A,h) \<longleftrightarrow> a \<in> A & (\<exists>y. a=h(y))"
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    32
apply (unfold Part_def)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    33
apply (rule separation)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    34
done
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    35
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    36
lemma Part_eqI [intro]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
    37
    "[| a \<in> A;  a=h(b) |] ==> a \<in> Part(A,h)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    38
by (unfold Part_def, blast)
13240
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
lemmas PartI = refl [THEN [2] Part_eqI]
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    41
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    42
lemma PartE [elim!]:
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    43
    "[| a \<in> Part(A,h);  !!z. [| a \<in> A;  a=h(z) |] ==> P
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    44
     |] ==> P"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    45
apply (unfold Part_def, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    46
done
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    47
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
    48
lemma Part_subset: "Part(A,h) \<subseteq> A"
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    49
apply (unfold Part_def)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    50
apply (rule Collect_subset)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    51
done
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    52
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    53
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
    54
subsection{*Rules for Disjoint Sums*}
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    55
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    56
lemmas sum_defs = sum_def Inl_def Inr_def case_def
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    57
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    58
lemma Sigma_bool: "Sigma(bool,C) = C(0) + C(1)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    59
by (unfold bool_def sum_def, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    60
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    61
(** Introduction rules for the injections **)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    62
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
    63
lemma InlI [intro!,simp,TC]: "a \<in> A ==> Inl(a) \<in> A+B"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    64
by (unfold sum_defs, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    65
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
    66
lemma InrI [intro!,simp,TC]: "b \<in> B ==> Inr(b) \<in> A+B"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    67
by (unfold sum_defs, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    68
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    69
(** Elimination rules **)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    70
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    71
lemma sumE [elim!]:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    72
    "[| u \<in> A+B;
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    73
        !!x. [| x \<in> A;  u=Inl(x) |] ==> P;
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    74
        !!y. [| y \<in> B;  u=Inr(y) |] ==> P
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    75
     |] ==> P"
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
    76
by (unfold sum_defs, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    77
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    78
(** Injection and freeness equivalences, for rewriting **)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    79
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
    80
lemma Inl_iff [iff]: "Inl(a)=Inl(b) \<longleftrightarrow> a=b"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    81
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    82
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
    83
lemma Inr_iff [iff]: "Inr(a)=Inr(b) \<longleftrightarrow> a=b"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    84
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    85
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
    86
lemma Inl_Inr_iff [simp]: "Inl(a)=Inr(b) \<longleftrightarrow> False"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    87
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    88
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
    89
lemma Inr_Inl_iff [simp]: "Inr(b)=Inl(a) \<longleftrightarrow> False"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    90
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    91
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    92
lemma sum_empty [simp]: "0+0 = 0"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
    93
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    94
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    95
(*Injection and freeness rules*)
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
    96
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 41777
diff changeset
    97
lemmas Inl_inject = Inl_iff [THEN iffD1]
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 41777
diff changeset
    98
lemmas Inr_inject = Inr_iff [THEN iffD1]
13823
d49ffd9f9662 fixed anomalies in the installed classical rules
paulson
parents: 13356
diff changeset
    99
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
   100
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
   101
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   102
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   103
lemma InlD: "Inl(a): A+B ==> a \<in> A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   104
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   105
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   106
lemma InrD: "Inr(b): A+B ==> b \<in> B"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   107
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   108
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   109
lemma sum_iff: "u \<in> A+B \<longleftrightarrow> (\<exists>x. x \<in> A & u=Inl(x)) | (\<exists>y. y \<in> B & u=Inr(y))"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   110
by blast
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   111
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
   112
lemma Inl_in_sum_iff [simp]: "(Inl(x) \<in> A+B) \<longleftrightarrow> (x \<in> A)";
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   113
by auto
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   114
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
   115
lemma Inr_in_sum_iff [simp]: "(Inr(y) \<in> A+B) \<longleftrightarrow> (y \<in> B)";
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   116
by auto
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   117
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
   118
lemma sum_subset_iff: "A+B \<subseteq> C+D \<longleftrightarrow> A<=C & B<=D"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   119
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   120
46821
ff6b0c1087f2 Using mathematical notation for <-> and cardinal arithmetic
paulson
parents: 46820
diff changeset
   121
lemma sum_equal_iff: "A+B = C+D \<longleftrightarrow> A=C & B=D"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   122
by (simp add: extension sum_subset_iff, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   123
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   124
lemma sum_eq_2_times: "A+A = 2*A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   125
by (simp add: sum_def, blast)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   126
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   127
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
   128
subsection{*The Eliminator: @{term case}*}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   129
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   130
lemma case_Inl [simp]: "case(c, d, Inl(a)) = c(a)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   131
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   132
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   133
lemma case_Inr [simp]: "case(c, d, Inr(b)) = d(b)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   134
by (simp add: sum_defs)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   135
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   136
lemma case_type [TC]:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   137
    "[| u \<in> A+B;
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   138
        !!x. x \<in> A ==> c(x): C(Inl(x));
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   139
        !!y. y \<in> B ==> d(y): C(Inr(y))
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
   140
     |] ==> case(c,d,u) \<in> C(u)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   141
by auto
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   142
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   143
lemma expand_case: "u \<in> A+B ==>
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   144
        R(case(c,d,u)) \<longleftrightarrow>
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   145
        ((\<forall>x\<in>A. u = Inl(x) \<longrightarrow> R(c(x))) &
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
   146
        (\<forall>y\<in>B. u = Inr(y) \<longrightarrow> R(d(y))))"
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   147
by auto
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   148
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   149
lemma case_cong:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   150
  "[| z \<in> A+B;
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   151
      !!x. x \<in> A ==> c(x)=c'(x);
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   152
      !!y. y \<in> B ==> d(y)=d'(y)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   153
   |] ==> case(c,d,z) = case(c',d',z)"
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   154
by auto
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   155
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   156
lemma case_case: "z \<in> A+B ==>
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   157
        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
   158
        case(%x. c(c'(x)), %y. d(d'(y)), z)"
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   159
by auto
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   160
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   161
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13255
diff changeset
   162
subsection{*More Rules for @{term "Part(A,h)"}*}
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   163
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   164
lemma Part_mono: "A<=B ==> Part(A,h)<=Part(B,h)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   165
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   166
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   167
lemma Part_Collect: "Part(Collect(A,P), h) = Collect(Part(A,h), P)"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   168
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   169
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   170
lemmas Part_CollectE =
45602
2a858377c3d2 eliminated obsolete "standard";
wenzelm
parents: 41777
diff changeset
   171
     Part_Collect [THEN equalityD1, THEN subsetD, THEN CollectE]
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   172
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   173
lemma Part_Inl: "Part(A+B,Inl) = {Inl(x). x \<in> A}"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   174
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   175
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   176
lemma Part_Inr: "Part(A+B,Inr) = {Inr(y). y \<in> B}"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   177
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   178
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
   179
lemma PartD1: "a \<in> Part(A,h) ==> a \<in> A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   180
by (simp add: Part_def)
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   181
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   182
lemma Part_id: "Part(A,%x. x) = A"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   183
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   184
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46821
diff changeset
   185
lemma Part_Inr2: "Part(A+B, %x. Inr(h(x))) = {Inr(y). y \<in> Part(B,h)}"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   186
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   187
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45602
diff changeset
   188
lemma Part_sum_equality: "C \<subseteq> A+B ==> Part(C,Inl) \<union> Part(C,Inr) = C"
13255
407ad9c3036d new theorems, tidying
paulson
parents: 13240
diff changeset
   189
by blast
13240
bb5f4faea1f3 conversion of Sum, pair to Isar script
paulson
parents: 13220
diff changeset
   190
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
end