src/HOL/Library/Groups_Big_Fun.thy
author paulson <lp15@cam.ac.uk>
Fri, 12 Apr 2024 09:58:32 +0100
changeset 80095 0f9cd1a5edbe
parent 69164 74f1b0f10b2b
child 80768 c7723cc15de8
permissions -rw-r--r--
Tidying ugly proofs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     1
(* Author: Florian Haftmann, TU Muenchen *)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     2
58881
b9556a055632 modernized header;
wenzelm
parents: 58437
diff changeset
     3
section \<open>Big sum and product over function bodies\<close>
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     4
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     5
theory Groups_Big_Fun
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     6
imports
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     7
  Main
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     8
begin
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
     9
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    10
subsection \<open>Abstract product\<close>
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    11
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    12
locale comm_monoid_fun = comm_monoid
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    13
begin
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    14
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    15
definition G :: "('b \<Rightarrow> 'a) \<Rightarrow> 'a"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    16
where
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    17
  expand_set: "G g = comm_monoid_set.F f \<^bold>1 g {a. g a \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    18
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    19
interpretation F: comm_monoid_set f "\<^bold>1"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    20
  ..
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    21
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    22
lemma expand_superset:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    23
  assumes "finite A" and "{a. g a \<noteq> \<^bold>1} \<subseteq> A"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    24
  shows "G g = F.F g A"
80095
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
    25
  using F.mono_neutral_right assms expand_set by fastforce
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    26
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    27
lemma conditionalize:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    28
  assumes "finite A"
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    29
  shows "F.F g A = G (\<lambda>a. if a \<in> A then g a else \<^bold>1)"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    30
  using assms
80095
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
    31
  by (smt (verit, ccfv_threshold) Diff_iff F.mono_neutral_cong_right expand_set mem_Collect_eq subsetI)
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
    32
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    33
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    34
lemma neutral [simp]:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    35
  "G (\<lambda>a. \<^bold>1) = \<^bold>1"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    36
  by (simp add: expand_set)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    37
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    38
lemma update [simp]:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    39
  assumes "finite {a. g a \<noteq> \<^bold>1}"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    40
  assumes "g a = \<^bold>1"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    41
  shows "G (g(a := b)) = b \<^bold>* G g"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    42
proof (cases "b = \<^bold>1")
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    43
  case True with \<open>g a = \<^bold>1\<close> show ?thesis
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    44
    by (simp add: expand_set) (rule F.cong, auto)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    45
next
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    46
  case False
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    47
  moreover have "{a'. a' \<noteq> a \<longrightarrow> g a' \<noteq> \<^bold>1} = insert a {a. g a \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    48
    by auto
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    49
  moreover from \<open>g a = \<^bold>1\<close> have "a \<notin> {a. g a \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    50
    by simp
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    51
  moreover have "F.F (\<lambda>a'. if a' = a then b else g a') {a. g a \<noteq> \<^bold>1} = F.F g {a. g a \<noteq> \<^bold>1}"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    52
    by (rule F.cong) (auto simp add: \<open>g a = \<^bold>1\<close>)
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    53
  ultimately show ?thesis using \<open>finite {a. g a \<noteq> \<^bold>1}\<close> by (simp add: expand_set)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    54
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    55
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    56
lemma infinite [simp]:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    57
  "\<not> finite {a. g a \<noteq> \<^bold>1} \<Longrightarrow> G g = \<^bold>1"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    58
  by (simp add: expand_set)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    59
69164
74f1b0f10b2b uniform naming of strong congruence rules
nipkow
parents: 67764
diff changeset
    60
lemma cong [cong]:
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    61
  assumes "\<And>a. g a = h a"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    62
  shows "G g = G h"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    63
  using assms by (simp add: expand_set)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    64
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    65
lemma not_neutral_obtains_not_neutral:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    66
  assumes "G g \<noteq> \<^bold>1"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    67
  obtains a where "g a \<noteq> \<^bold>1"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    68
  using assms by (auto elim: F.not_neutral_contains_not_neutral simp add: expand_set)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    69
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    70
lemma reindex_cong:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    71
  assumes "bij l"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    72
  assumes "g \<circ> l = h"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    73
  shows "G g = G h"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    74
proof -
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    75
  from assms have unfold: "h = g \<circ> l" by simp
60500
903bb1495239 isabelle update_cartouches;
wenzelm
parents: 58881
diff changeset
    76
  from \<open>bij l\<close> have "inj l" by (rule bij_is_inj)
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    77
  then have "inj_on l {a. h a \<noteq> \<^bold>1}" by (rule subset_inj_on) simp
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    78
  moreover from \<open>bij l\<close> have "{a. g a \<noteq> \<^bold>1} = l ` {a. h a \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    79
    by (auto simp add: image_Collect unfold elim: bij_pointE)
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    80
  moreover have "\<And>x. x \<in> {a. h a \<noteq> \<^bold>1} \<Longrightarrow> g (l x) = h x"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    81
    by (simp add: unfold)
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    82
  ultimately have "F.F g {a. g a \<noteq> \<^bold>1} = F.F h {a. h a \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    83
    by (rule F.reindex_cong)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    84
  then show ?thesis by (simp add: expand_set)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    85
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    86
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    87
lemma distrib:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    88
  assumes "finite {a. g a \<noteq> \<^bold>1}" and "finite {a. h a \<noteq> \<^bold>1}"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    89
  shows "G (\<lambda>a. g a \<^bold>* h a) = G g \<^bold>* G h"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    90
proof -
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    91
  from assms have "finite ({a. g a \<noteq> \<^bold>1} \<union> {a. h a \<noteq> \<^bold>1})" by simp
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    92
  moreover have "{a. g a \<^bold>* h a \<noteq> \<^bold>1} \<subseteq> {a. g a \<noteq> \<^bold>1} \<union> {a. h a \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    93
    by auto (drule sym, simp)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    94
  ultimately show ?thesis
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    95
    using assms
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
    96
    by (simp add: expand_superset [of "{a. g a \<noteq> \<^bold>1} \<union> {a. h a \<noteq> \<^bold>1}"] F.distrib)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    97
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
    98
66804
3f9bb52082c4 avoid name clashes on interpretation of abstract locales
haftmann
parents: 64272
diff changeset
    99
lemma swap:
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   100
  assumes "finite C"
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   101
  assumes subset: "{a. \<exists>b. g a b \<noteq> \<^bold>1} \<times> {b. \<exists>a. g a b \<noteq> \<^bold>1} \<subseteq> C" (is "?A \<times> ?B \<subseteq> C")
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   102
  shows "G (\<lambda>a. G (g a)) = G (\<lambda>b. G (\<lambda>a. g a b))"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   103
proof -
60500
903bb1495239 isabelle update_cartouches;
wenzelm
parents: 58881
diff changeset
   104
  from \<open>finite C\<close> subset
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   105
    have "finite ({a. \<exists>b. g a b \<noteq> \<^bold>1} \<times> {b. \<exists>a. g a b \<noteq> \<^bold>1})"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   106
    by (rule rev_finite_subset)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   107
  then have fins:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   108
    "finite {b. \<exists>a. g a b \<noteq> \<^bold>1}" "finite {a. \<exists>b. g a b \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   109
    by (auto simp add: finite_cartesian_product_iff)
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   110
  have subsets: "\<And>a. {b. g a b \<noteq> \<^bold>1} \<subseteq> {b. \<exists>a. g a b \<noteq> \<^bold>1}"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   111
    "\<And>b. {a. g a b \<noteq> \<^bold>1} \<subseteq> {a. \<exists>b. g a b \<noteq> \<^bold>1}"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   112
    "{a. F.F (g a) {b. \<exists>a. g a b \<noteq> \<^bold>1} \<noteq> \<^bold>1} \<subseteq> {a. \<exists>b. g a b \<noteq> \<^bold>1}"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   113
    "{a. F.F (\<lambda>aa. g aa a) {a. \<exists>b. g a b \<noteq> \<^bold>1} \<noteq> \<^bold>1} \<subseteq> {b. \<exists>a. g a b \<noteq> \<^bold>1}"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   114
    by (auto elim: F.not_neutral_contains_not_neutral)
66804
3f9bb52082c4 avoid name clashes on interpretation of abstract locales
haftmann
parents: 64272
diff changeset
   115
  from F.swap have
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   116
    "F.F (\<lambda>a. F.F (g a) {b. \<exists>a. g a b \<noteq> \<^bold>1}) {a. \<exists>b. g a b \<noteq> \<^bold>1} =
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   117
      F.F (\<lambda>b. F.F (\<lambda>a. g a b) {a. \<exists>b. g a b \<noteq> \<^bold>1}) {b. \<exists>a. g a b \<noteq> \<^bold>1}" .
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   118
  with subsets fins have "G (\<lambda>a. F.F (g a) {b. \<exists>a. g a b \<noteq> \<^bold>1}) =
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   119
    G (\<lambda>b. F.F (\<lambda>a. g a b) {a. \<exists>b. g a b \<noteq> \<^bold>1})"
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   120
    by (auto simp add: expand_superset [of "{b. \<exists>a. g a b \<noteq> \<^bold>1}"]
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   121
      expand_superset [of "{a. \<exists>b. g a b \<noteq> \<^bold>1}"])
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   122
  with subsets fins show ?thesis
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   123
    by (auto simp add: expand_superset [of "{b. \<exists>a. g a b \<noteq> \<^bold>1}"]
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   124
      expand_superset [of "{a. \<exists>b. g a b \<noteq> \<^bold>1}"])
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   125
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   126
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   127
lemma cartesian_product:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   128
  assumes "finite C"
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   129
  assumes subset: "{a. \<exists>b. g a b \<noteq> \<^bold>1} \<times> {b. \<exists>a. g a b \<noteq> \<^bold>1} \<subseteq> C" (is "?A \<times> ?B \<subseteq> C")
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   130
  shows "G (\<lambda>a. G (g a)) = G (\<lambda>(a, b). g a b)"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   131
proof -
60500
903bb1495239 isabelle update_cartouches;
wenzelm
parents: 58881
diff changeset
   132
  from subset \<open>finite C\<close> have fin_prod: "finite (?A \<times> ?B)"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   133
    by (rule finite_subset)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   134
  from fin_prod have "finite ?A" and "finite ?B"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   135
    by (auto simp add: finite_cartesian_product_iff)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   136
  have *: "G (\<lambda>a. G (g a)) =
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   137
    (F.F (\<lambda>a. F.F (g a) {b. \<exists>a. g a b \<noteq> \<^bold>1}) {a. \<exists>b. g a b \<noteq> \<^bold>1})"
80095
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   138
    using \<open>finite ?A\<close> \<open>finite ?B\<close> expand_superset
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   139
    by (smt (verit, del_insts) Collect_mono local.cong not_neutral_obtains_not_neutral)
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   140
  have **: "{p. (case p of (a, b) \<Rightarrow> g a b) \<noteq> \<^bold>1} \<subseteq> ?A \<times> ?B"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   141
    by auto
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   142
  show ?thesis
80095
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   143
    using \<open>finite C\<close> expand_superset
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   144
    using "*" ** F.cartesian_product fin_prod by force
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   145
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   146
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   147
lemma cartesian_product2:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   148
  assumes fin: "finite D"
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   149
  assumes subset: "{(a, b). \<exists>c. g a b c \<noteq> \<^bold>1} \<times> {c. \<exists>a b. g a b c \<noteq> \<^bold>1} \<subseteq> D" (is "?AB \<times> ?C \<subseteq> D")
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   150
  shows "G (\<lambda>(a, b). G (g a b)) = G (\<lambda>(a, b, c). g a b c)"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   151
proof -
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   152
  have bij: "bij (\<lambda>(a, b, c). ((a, b), c))"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   153
    by (auto intro!: bijI injI simp add: image_def)
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   154
  have "{p. \<exists>c. g (fst p) (snd p) c \<noteq> \<^bold>1} \<times> {c. \<exists>p. g (fst p) (snd p) c \<noteq> \<^bold>1} \<subseteq> D"
61424
c3658c18b7bc prod_case as canonical name for product type eliminator
haftmann
parents: 61378
diff changeset
   155
    by auto (insert subset, blast)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   156
  with fin have "G (\<lambda>p. G (g (fst p) (snd p))) = G (\<lambda>(p, c). g (fst p) (snd p) c)"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   157
    by (rule cartesian_product)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   158
  then have "G (\<lambda>(a, b). G (g a b)) = G (\<lambda>((a, b), c). g a b c)"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   159
    by (auto simp add: split_def)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   160
  also have "G (\<lambda>((a, b), c). g a b c) = G (\<lambda>(a, b, c). g a b c)"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   161
    using bij by (rule reindex_cong [of "\<lambda>(a, b, c). ((a, b), c)"]) (simp add: fun_eq_iff)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   162
  finally show ?thesis .
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   163
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   164
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   165
lemma delta [simp]:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   166
  "G (\<lambda>b. if b = a then g b else \<^bold>1) = g a"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   167
proof -
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   168
  have "{b. (if b = a then g b else \<^bold>1) \<noteq> \<^bold>1} \<subseteq> {a}" by auto
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   169
  then show ?thesis by (simp add: expand_superset [of "{a}"])
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   170
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   171
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   172
lemma delta' [simp]:
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   173
  "G (\<lambda>b. if a = b then g b else \<^bold>1) = g a"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   174
proof -
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   175
  have "(\<lambda>b. if a = b then g b else \<^bold>1) = (\<lambda>b. if b = a then g b else \<^bold>1)"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   176
    by (simp add: fun_eq_iff)
63290
9ac558ab0906 boldify syntax in abstract algebraic structures, to avoid clashes with concrete syntax in corresponding type classes
haftmann
parents: 61955
diff changeset
   177
  then have "G (\<lambda>b. if a = b then g b else \<^bold>1) = G (\<lambda>b. if b = a then g b else \<^bold>1)"
69164
74f1b0f10b2b uniform naming of strong congruence rules
nipkow
parents: 67764
diff changeset
   178
    by (simp cong del: cong)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   179
  then show ?thesis by simp
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   180
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   181
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   182
end
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   183
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   184
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   185
subsection \<open>Concrete sum\<close>
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   186
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   187
context comm_monoid_add
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   188
begin
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   189
61776
57bb7da5c867 modernized
haftmann
parents: 61671
diff changeset
   190
sublocale Sum_any: comm_monoid_fun plus 0
67764
0f8cb5568b63 Drop rewrites after defines in interpretations.
ballarin
parents: 66804
diff changeset
   191
  rewrites "comm_monoid_set.F plus 0 = sum"
63433
wenzelm
parents: 63290
diff changeset
   192
  defines Sum_any = Sum_any.G
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   193
proof -
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   194
  show "comm_monoid_fun plus 0" ..
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61424
diff changeset
   195
  then interpret Sum_any: comm_monoid_fun plus 0 .
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
   196
  from sum_def show "comm_monoid_set.F plus 0 = sum" by (auto intro: sym)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   197
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   198
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   199
end
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   200
61955
e96292f32c3c former "xsymbols" syntax is used by default, and ASCII replacement syntax with print mode "ASCII";
wenzelm
parents: 61776
diff changeset
   201
syntax (ASCII)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   202
  "_Sum_any" :: "pttrn \<Rightarrow> 'a \<Rightarrow> 'a::comm_monoid_add"    ("(3SUM _. _)" [0, 10] 10)
61955
e96292f32c3c former "xsymbols" syntax is used by default, and ASCII replacement syntax with print mode "ASCII";
wenzelm
parents: 61776
diff changeset
   203
syntax
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   204
  "_Sum_any" :: "pttrn \<Rightarrow> 'a \<Rightarrow> 'a::comm_monoid_add"    ("(3\<Sum>_. _)" [0, 10] 10)
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   205
translations
61955
e96292f32c3c former "xsymbols" syntax is used by default, and ASCII replacement syntax with print mode "ASCII";
wenzelm
parents: 61776
diff changeset
   206
  "\<Sum>a. b" \<rightleftharpoons> "CONST Sum_any (\<lambda>a. b)"
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   207
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   208
lemma Sum_any_left_distrib:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   209
  fixes r :: "'a :: semiring_0"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   210
  assumes "finite {a. g a \<noteq> 0}"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   211
  shows "Sum_any g * r = (\<Sum>n. g n * r)"
80095
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   212
  by (metis (mono_tags, lifting) Collect_mono Sum_any.expand_superset assms mult_zero_left sum_distrib_right)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   213
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   214
lemma Sum_any_right_distrib:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   215
  fixes r :: "'a :: semiring_0"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   216
  assumes "finite {a. g a \<noteq> 0}"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   217
  shows "r * Sum_any g = (\<Sum>n. r * g n)"
80095
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   218
  by (metis (mono_tags, lifting) Collect_mono Sum_any.expand_superset assms mult_zero_right sum_distrib_left)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   219
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   220
lemma Sum_any_product:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   221
  fixes f g :: "'b \<Rightarrow> 'a::semiring_0"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   222
  assumes "finite {a. f a \<noteq> 0}" and "finite {b. g b \<noteq> 0}"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   223
  shows "Sum_any f * Sum_any g = (\<Sum>a. \<Sum>b. f a * g b)"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   224
proof -
80095
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   225
  have "\<forall>a. (\<Sum>b. a * g b) = a * Sum_any g"
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   226
    by (simp add: Sum_any_right_distrib assms(2))
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   227
  then show ?thesis
0f9cd1a5edbe Tidying ugly proofs
paulson <lp15@cam.ac.uk>
parents: 69164
diff changeset
   228
    by (simp add: Sum_any_left_distrib assms(1))
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   229
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   230
58437
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   231
lemma Sum_any_eq_zero_iff [simp]: 
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   232
  fixes f :: "'a \<Rightarrow> nat"
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   233
  assumes "finite {a. f a \<noteq> 0}"
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   234
  shows "Sum_any f = 0 \<longleftrightarrow> f = (\<lambda>_. 0)"
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   235
  using assms by (simp add: Sum_any.expand_set fun_eq_iff)
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   236
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   237
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   238
subsection \<open>Concrete product\<close>
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   239
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   240
context comm_monoid_mult
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   241
begin
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   242
61776
57bb7da5c867 modernized
haftmann
parents: 61671
diff changeset
   243
sublocale Prod_any: comm_monoid_fun times 1
67764
0f8cb5568b63 Drop rewrites after defines in interpretations.
ballarin
parents: 66804
diff changeset
   244
  rewrites "comm_monoid_set.F times 1 = prod"
63433
wenzelm
parents: 63290
diff changeset
   245
  defines Prod_any = Prod_any.G
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   246
proof -
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   247
  show "comm_monoid_fun times 1" ..
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61424
diff changeset
   248
  then interpret Prod_any: comm_monoid_fun times 1 .
64272
f76b6dda2e56 setprod -> prod
nipkow
parents: 64267
diff changeset
   249
  from prod_def show "comm_monoid_set.F times 1 = prod" by (auto intro: sym)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   250
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   251
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   252
end
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   253
61955
e96292f32c3c former "xsymbols" syntax is used by default, and ASCII replacement syntax with print mode "ASCII";
wenzelm
parents: 61776
diff changeset
   254
syntax (ASCII)
e96292f32c3c former "xsymbols" syntax is used by default, and ASCII replacement syntax with print mode "ASCII";
wenzelm
parents: 61776
diff changeset
   255
  "_Prod_any" :: "pttrn \<Rightarrow> 'a \<Rightarrow> 'a::comm_monoid_mult"  ("(3PROD _. _)" [0, 10] 10)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   256
syntax
61955
e96292f32c3c former "xsymbols" syntax is used by default, and ASCII replacement syntax with print mode "ASCII";
wenzelm
parents: 61776
diff changeset
   257
  "_Prod_any" :: "pttrn \<Rightarrow> 'a \<Rightarrow> 'a::comm_monoid_mult"  ("(3\<Prod>_. _)" [0, 10] 10)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   258
translations
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   259
  "\<Prod>a. b" == "CONST Prod_any (\<lambda>a. b)"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   260
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   261
lemma Prod_any_zero:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   262
  fixes f :: "'b \<Rightarrow> 'a :: comm_semiring_1"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   263
  assumes "finite {a. f a \<noteq> 1}"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   264
  assumes "f a = 0"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   265
  shows "(\<Prod>a. f a) = 0"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   266
proof -
60500
903bb1495239 isabelle update_cartouches;
wenzelm
parents: 58881
diff changeset
   267
  from \<open>f a = 0\<close> have "f a \<noteq> 1" by simp
903bb1495239 isabelle update_cartouches;
wenzelm
parents: 58881
diff changeset
   268
  with \<open>f a = 0\<close> have "\<exists>a. f a \<noteq> 1 \<and> f a = 0" by blast
903bb1495239 isabelle update_cartouches;
wenzelm
parents: 58881
diff changeset
   269
  with \<open>finite {a. f a \<noteq> 1}\<close> show ?thesis
64272
f76b6dda2e56 setprod -> prod
nipkow
parents: 64267
diff changeset
   270
    by (simp add: Prod_any.expand_set prod_zero)
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   271
qed
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   272
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   273
lemma Prod_any_not_zero:
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   274
  fixes f :: "'b \<Rightarrow> 'a :: comm_semiring_1"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   275
  assumes "finite {a. f a \<noteq> 1}"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   276
  assumes "(\<Prod>a. f a) \<noteq> 0"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   277
  shows "f a \<noteq> 0"
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   278
  using assms Prod_any_zero [of f] by blast
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   279
58437
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   280
lemma power_Sum_any:
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   281
  assumes "finite {a. f a \<noteq> 0}"
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   282
  shows "c ^ (\<Sum>a. f a) = (\<Prod>a. c ^ f a)"
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   283
proof -
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   284
  have "{a. c ^ f a \<noteq> 1} \<subseteq> {a. f a \<noteq> 0}"
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   285
    by (auto intro: ccontr)
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   286
  with assms show ?thesis
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
   287
    by (simp add: Sum_any.expand_set Prod_any.expand_superset power_sum)
58437
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   288
qed
8d124c73c37a added lemmas
haftmann
parents: 58197
diff changeset
   289
58197
4fd7f47ead6c theory about sum and product on function bodies
haftmann
parents:
diff changeset
   290
end