src/HOL/Analysis/Infinite_Set_Sum.thy
author Wenda Li <wl302@cam.ac.uk>
Sat, 08 Dec 2018 20:27:34 +0000
changeset 69423 3922aa1df44e
parent 68651 16d98ef49a2c
child 69517 dc20f278e8f3
permissions -rw-r--r--
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     1
(*  
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     2
  Title:    HOL/Analysis/Infinite_Set_Sum.thy
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     3
  Author:   Manuel Eberl, TU München
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     4
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     5
  A theory of sums over possible infinite sets. (Only works for absolute summability)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     6
*)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     7
section \<open>Sums over infinite sets\<close>
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     8
theory Infinite_Set_Sum
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
     9
  imports Set_Integral
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    10
begin
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    11
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    12
(* TODO Move *)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    13
lemma sets_eq_countable:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    14
  assumes "countable A" "space M = A" "\<And>x. x \<in> A \<Longrightarrow> {x} \<in> sets M"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    15
  shows   "sets M = Pow A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    16
proof (intro equalityI subsetI)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    17
  fix X assume "X \<in> Pow A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    18
  hence "(\<Union>x\<in>X. {x}) \<in> sets M"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    19
    by (intro sets.countable_UN' countable_subset[OF _ assms(1)]) (auto intro!: assms(3))
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    20
  also have "(\<Union>x\<in>X. {x}) = X" by auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    21
  finally show "X \<in> sets M" .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    22
next
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    23
  fix X assume "X \<in> sets M"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    24
  from sets.sets_into_space[OF this] and assms 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    25
    show "X \<in> Pow A" by simp
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    26
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    27
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    28
lemma measure_eqI_countable':
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    29
  assumes spaces: "space M = A" "space N = A" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    30
  assumes sets: "\<And>x. x \<in> A \<Longrightarrow> {x} \<in> sets M" "\<And>x. x \<in> A \<Longrightarrow> {x} \<in> sets N"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    31
  assumes A: "countable A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    32
  assumes eq: "\<And>a. a \<in> A \<Longrightarrow> emeasure M {a} = emeasure N {a}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    33
  shows "M = N"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    34
proof (rule measure_eqI_countable)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    35
  show "sets M = Pow A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    36
    by (intro sets_eq_countable assms)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    37
  show "sets N = Pow A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    38
    by (intro sets_eq_countable assms)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    39
qed fact+
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    40
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    41
lemma PiE_singleton: 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    42
  assumes "f \<in> extensional A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    43
  shows   "PiE A (\<lambda>x. {f x}) = {f}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    44
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    45
  {
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    46
    fix g assume "g \<in> PiE A (\<lambda>x. {f x})"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    47
    hence "g x = f x" for x
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    48
      using assms by (cases "x \<in> A") (auto simp: extensional_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    49
    hence "g = f" by (simp add: fun_eq_iff)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    50
  }
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    51
  thus ?thesis using assms by (auto simp: extensional_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    52
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    53
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    54
lemma count_space_PiM_finite:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    55
  fixes B :: "'a \<Rightarrow> 'b set"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    56
  assumes "finite A" "\<And>i. countable (B i)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    57
  shows   "PiM A (\<lambda>i. count_space (B i)) = count_space (PiE A B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    58
proof (rule measure_eqI_countable')
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    59
  show "space (PiM A (\<lambda>i. count_space (B i))) = PiE A B" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    60
    by (simp add: space_PiM)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    61
  show "space (count_space (PiE A B)) = PiE A B" by simp
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    62
next
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    63
  fix f assume f: "f \<in> PiE A B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    64
  hence "PiE A (\<lambda>x. {f x}) \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    65
    by (intro sets_PiM_I_finite assms) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    66
  also from f have "PiE A (\<lambda>x. {f x}) = {f}" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    67
    by (intro PiE_singleton) (auto simp: PiE_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    68
  finally show "{f} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))" .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    69
next
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    70
  interpret product_sigma_finite "(\<lambda>i. count_space (B i))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    71
    by (intro product_sigma_finite.intro sigma_finite_measure_count_space_countable assms)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    72
  thm sigma_finite_measure_count_space
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    73
  fix f assume f: "f \<in> PiE A B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    74
  hence "{f} = PiE A (\<lambda>x. {f x})"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    75
    by (intro PiE_singleton [symmetric]) (auto simp: PiE_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    76
  also have "emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) \<dots> = 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    77
               (\<Prod>i\<in>A. emeasure (count_space (B i)) {f i})"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    78
    using f assms by (subst emeasure_PiM) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    79
  also have "\<dots> = (\<Prod>i\<in>A. 1)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    80
    by (intro prod.cong refl, subst emeasure_count_space_finite) (use f in auto)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    81
  also have "\<dots> = emeasure (count_space (PiE A B)) {f}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    82
    using f by (subst emeasure_count_space_finite) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    83
  finally show "emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {f} =
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    84
                  emeasure (count_space (Pi\<^sub>E A B)) {f}" .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    85
qed (simp_all add: countable_PiE assms)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    86
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    87
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    88
68651
Manuel Eberl <eberlm@in.tum.de>
parents: 67974
diff changeset
    89
definition%important abs_summable_on ::
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    90
    "('a \<Rightarrow> 'b :: {banach, second_countable_topology}) \<Rightarrow> 'a set \<Rightarrow> bool" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    91
    (infix "abs'_summable'_on" 50)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    92
 where
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    93
   "f abs_summable_on A \<longleftrightarrow> integrable (count_space A) f"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    94
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    95
68651
Manuel Eberl <eberlm@in.tum.de>
parents: 67974
diff changeset
    96
definition%important infsetsum ::
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    97
    "('a \<Rightarrow> 'b :: {banach, second_countable_topology}) \<Rightarrow> 'a set \<Rightarrow> 'b"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    98
 where
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
    99
   "infsetsum f A = lebesgue_integral (count_space A) f"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   100
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   101
syntax (ASCII)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   102
  "_infsetsum" :: "pttrn \<Rightarrow> 'a set \<Rightarrow> 'b \<Rightarrow> 'b::{banach, second_countable_topology}" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   103
  ("(3INFSETSUM _:_./ _)" [0, 51, 10] 10)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   104
syntax
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   105
  "_infsetsum" :: "pttrn \<Rightarrow> 'a set \<Rightarrow> 'b \<Rightarrow> 'b::{banach, second_countable_topology}" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   106
  ("(2\<Sum>\<^sub>a_\<in>_./ _)" [0, 51, 10] 10)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   107
translations \<comment> \<open>Beware of argument permutation!\<close>
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   108
  "\<Sum>\<^sub>ai\<in>A. b" \<rightleftharpoons> "CONST infsetsum (\<lambda>i. b) A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   109
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   110
syntax (ASCII)
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   111
  "_uinfsetsum" :: "pttrn \<Rightarrow> 'a set \<Rightarrow> 'b \<Rightarrow> 'b::{banach, second_countable_topology}" 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   112
  ("(3INFSETSUM _:_./ _)" [0, 51, 10] 10)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   113
syntax
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   114
  "_uinfsetsum" :: "pttrn \<Rightarrow> 'b \<Rightarrow> 'b::{banach, second_countable_topology}" 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   115
  ("(2\<Sum>\<^sub>a_./ _)" [0, 10] 10)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   116
translations \<comment> \<open>Beware of argument permutation!\<close>
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   117
  "\<Sum>\<^sub>ai. b" \<rightleftharpoons> "CONST infsetsum (\<lambda>i. b) (CONST UNIV)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   118
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   119
syntax (ASCII)
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   120
  "_qinfsetsum" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a::{banach, second_countable_topology}" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   121
  ("(3INFSETSUM _ |/ _./ _)" [0, 0, 10] 10)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   122
syntax
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   123
  "_qinfsetsum" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a::{banach, second_countable_topology}" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   124
  ("(2\<Sum>\<^sub>a_ | (_)./ _)" [0, 0, 10] 10)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   125
translations
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   126
  "\<Sum>\<^sub>ax|P. t" => "CONST infsetsum (\<lambda>x. t) {x. P}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   127
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   128
print_translation \<open>
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   129
let
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   130
  fun sum_tr' [Abs (x, Tx, t), Const (@{const_syntax Collect}, _) $ Abs (y, Ty, P)] =
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   131
        if x <> y then raise Match
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   132
        else
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   133
          let
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   134
            val x' = Syntax_Trans.mark_bound_body (x, Tx);
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   135
            val t' = subst_bound (x', t);
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   136
            val P' = subst_bound (x', P);
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   137
          in
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   138
            Syntax.const @{syntax_const "_qinfsetsum"} $ Syntax_Trans.mark_bound_abs (x, Tx) $ P' $ t'
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   139
          end
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   140
    | sum_tr' _ = raise Match;
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   141
in [(@{const_syntax infsetsum}, K sum_tr')] end
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   142
\<close>
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   143
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   144
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   145
lemma restrict_count_space_subset:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   146
  "A \<subseteq> B \<Longrightarrow> restrict_space (count_space B) A = count_space A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   147
  by (subst restrict_count_space) (simp_all add: Int_absorb2)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   148
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   149
lemma abs_summable_on_restrict:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   150
  fixes f :: "'a \<Rightarrow> 'b :: {banach, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   151
  assumes "A \<subseteq> B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   152
  shows   "f abs_summable_on A \<longleftrightarrow> (\<lambda>x. indicator A x *\<^sub>R f x) abs_summable_on B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   153
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   154
  have "count_space A = restrict_space (count_space B) A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   155
    by (rule restrict_count_space_subset [symmetric]) fact+
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   156
  also have "integrable \<dots> f \<longleftrightarrow> set_integrable (count_space B) A f"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   157
    by (simp add: integrable_restrict_space set_integrable_def)
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   158
  finally show ?thesis 
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   159
    unfolding abs_summable_on_def set_integrable_def .
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   160
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   161
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   162
lemma abs_summable_on_altdef: "f abs_summable_on A \<longleftrightarrow> set_integrable (count_space UNIV) A f"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   163
  unfolding abs_summable_on_def set_integrable_def
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   164
  by (metis (no_types) inf_top.right_neutral integrable_restrict_space restrict_count_space sets_UNIV)
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   165
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   166
lemma abs_summable_on_altdef': 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   167
  "A \<subseteq> B \<Longrightarrow> f abs_summable_on A \<longleftrightarrow> set_integrable (count_space B) A f"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   168
  unfolding abs_summable_on_def set_integrable_def
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   169
  by (metis (no_types) Pow_iff abs_summable_on_def inf.orderE integrable_restrict_space restrict_count_space_subset set_integrable_def sets_count_space space_count_space)
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   170
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   171
lemma abs_summable_on_norm_iff [simp]: 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   172
  "(\<lambda>x. norm (f x)) abs_summable_on A \<longleftrightarrow> f abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   173
  by (simp add: abs_summable_on_def integrable_norm_iff)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   174
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   175
lemma abs_summable_on_normI: "f abs_summable_on A \<Longrightarrow> (\<lambda>x. norm (f x)) abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   176
  by simp
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   177
67268
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   178
lemma abs_summable_complex_of_real [simp]: "(\<lambda>n. complex_of_real (f n)) abs_summable_on A \<longleftrightarrow> f abs_summable_on A"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   179
  by (simp add: abs_summable_on_def complex_of_real_integrable_eq)
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   180
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   181
lemma abs_summable_on_comparison_test:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   182
  assumes "g abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   183
  assumes "\<And>x. x \<in> A \<Longrightarrow> norm (f x) \<le> norm (g x)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   184
  shows   "f abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   185
  using assms Bochner_Integration.integrable_bound[of "count_space A" g f] 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   186
  unfolding abs_summable_on_def by (auto simp: AE_count_space)  
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   187
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   188
lemma abs_summable_on_comparison_test':
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   189
  assumes "g abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   190
  assumes "\<And>x. x \<in> A \<Longrightarrow> norm (f x) \<le> g x"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   191
  shows   "f abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   192
proof (rule abs_summable_on_comparison_test[OF assms(1), of f])
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   193
  fix x assume "x \<in> A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   194
  with assms(2) have "norm (f x) \<le> g x" .
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   195
  also have "\<dots> \<le> norm (g x)" by simp
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   196
  finally show "norm (f x) \<le> norm (g x)" .
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   197
qed
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   198
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   199
lemma abs_summable_on_cong [cong]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   200
  "(\<And>x. x \<in> A \<Longrightarrow> f x = g x) \<Longrightarrow> A = B \<Longrightarrow> (f abs_summable_on A) \<longleftrightarrow> (g abs_summable_on B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   201
  unfolding abs_summable_on_def by (intro integrable_cong) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   202
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   203
lemma abs_summable_on_cong_neutral:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   204
  assumes "\<And>x. x \<in> A - B \<Longrightarrow> f x = 0"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   205
  assumes "\<And>x. x \<in> B - A \<Longrightarrow> g x = 0"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   206
  assumes "\<And>x. x \<in> A \<inter> B \<Longrightarrow> f x = g x"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   207
  shows   "f abs_summable_on A \<longleftrightarrow> g abs_summable_on B"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   208
  unfolding abs_summable_on_altdef set_integrable_def using assms
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   209
  by (intro Bochner_Integration.integrable_cong refl)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   210
     (auto simp: indicator_def split: if_splits)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   211
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   212
lemma abs_summable_on_restrict':
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   213
  fixes f :: "'a \<Rightarrow> 'b :: {banach, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   214
  assumes "A \<subseteq> B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   215
  shows   "f abs_summable_on A \<longleftrightarrow> (\<lambda>x. if x \<in> A then f x else 0) abs_summable_on B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   216
  by (subst abs_summable_on_restrict[OF assms]) (intro abs_summable_on_cong, auto)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   217
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   218
lemma abs_summable_on_nat_iff:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   219
  "f abs_summable_on (A :: nat set) \<longleftrightarrow> summable (\<lambda>n. if n \<in> A then norm (f n) else 0)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   220
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   221
  have "f abs_summable_on A \<longleftrightarrow> summable (\<lambda>x. norm (if x \<in> A then f x else 0))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   222
    by (subst abs_summable_on_restrict'[of _ UNIV]) 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   223
       (simp_all add: abs_summable_on_def integrable_count_space_nat_iff)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   224
  also have "(\<lambda>x. norm (if x \<in> A then f x else 0)) = (\<lambda>x. if x \<in> A then norm (f x) else 0)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   225
    by auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   226
  finally show ?thesis .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   227
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   228
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   229
lemma abs_summable_on_nat_iff':
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   230
  "f abs_summable_on (UNIV :: nat set) \<longleftrightarrow> summable (\<lambda>n. norm (f n))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   231
  by (subst abs_summable_on_nat_iff) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   232
67268
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   233
lemma nat_abs_summable_on_comparison_test:
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   234
  fixes f :: "nat \<Rightarrow> 'a :: {banach, second_countable_topology}"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   235
  assumes "g abs_summable_on I"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   236
  assumes "\<And>n. \<lbrakk>n\<ge>N; n \<in> I\<rbrakk> \<Longrightarrow> norm (f n) \<le> g n"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   237
  shows   "f abs_summable_on I"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   238
  using assms by (fastforce simp add: abs_summable_on_nat_iff intro: summable_comparison_test')
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   239
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   240
lemma abs_summable_comparison_test_ev:
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   241
  assumes "g abs_summable_on I"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   242
  assumes "eventually (\<lambda>x. x \<in> I \<longrightarrow> norm (f x) \<le> g x) sequentially"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   243
  shows   "f abs_summable_on I"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   244
  by (metis (no_types, lifting) nat_abs_summable_on_comparison_test eventually_at_top_linorder assms)
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   245
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   246
lemma abs_summable_on_Cauchy:
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   247
  "f abs_summable_on (UNIV :: nat set) \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>m\<ge>N. \<forall>n. (\<Sum>x = m..<n. norm (f x)) < e)"
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   248
  by (simp add: abs_summable_on_nat_iff' summable_Cauchy sum_nonneg)
bdf25939a550 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product
paulson <lp15@cam.ac.uk>
parents: 67167
diff changeset
   249
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   250
lemma abs_summable_on_finite [simp]: "finite A \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   251
  unfolding abs_summable_on_def by (rule integrable_count_space)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   252
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   253
lemma abs_summable_on_empty [simp, intro]: "f abs_summable_on {}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   254
  by simp
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   255
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   256
lemma abs_summable_on_subset:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   257
  assumes "f abs_summable_on B" and "A \<subseteq> B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   258
  shows   "f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   259
  unfolding abs_summable_on_altdef
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   260
  by (rule set_integrable_subset) (insert assms, auto simp: abs_summable_on_altdef)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   261
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   262
lemma abs_summable_on_union [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   263
  assumes "f abs_summable_on A" and "f abs_summable_on B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   264
  shows   "f abs_summable_on (A \<union> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   265
  using assms unfolding abs_summable_on_altdef by (intro set_integrable_Un) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   266
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   267
lemma abs_summable_on_insert_iff [simp]:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   268
  "f abs_summable_on insert x A \<longleftrightarrow> f abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   269
proof safe
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   270
  assume "f abs_summable_on insert x A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   271
  thus "f abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   272
    by (rule abs_summable_on_subset) auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   273
next
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   274
  assume "f abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   275
  from abs_summable_on_union[OF this, of "{x}"]
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   276
    show "f abs_summable_on insert x A" by simp
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   277
qed
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   278
67167
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   279
lemma abs_summable_sum: 
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   280
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x abs_summable_on B"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   281
  shows   "(\<lambda>y. \<Sum>x\<in>A. f x y) abs_summable_on B"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   282
  using assms unfolding abs_summable_on_def by (intro Bochner_Integration.integrable_sum)
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   283
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   284
lemma abs_summable_Re: "f abs_summable_on A \<Longrightarrow> (\<lambda>x. Re (f x)) abs_summable_on A"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   285
  by (simp add: abs_summable_on_def)
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   286
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   287
lemma abs_summable_Im: "f abs_summable_on A \<Longrightarrow> (\<lambda>x. Im (f x)) abs_summable_on A"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   288
  by (simp add: abs_summable_on_def)
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   289
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   290
lemma abs_summable_on_finite_diff:
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   291
  assumes "f abs_summable_on A" "A \<subseteq> B" "finite (B - A)"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   292
  shows   "f abs_summable_on B"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   293
proof -
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   294
  have "f abs_summable_on (A \<union> (B - A))"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   295
    by (intro abs_summable_on_union assms abs_summable_on_finite)
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   296
  also from assms have "A \<union> (B - A) = B" by blast
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   297
  finally show ?thesis .
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   298
qed
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   299
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   300
lemma abs_summable_on_reindex_bij_betw:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   301
  assumes "bij_betw g A B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   302
  shows   "(\<lambda>x. f (g x)) abs_summable_on A \<longleftrightarrow> f abs_summable_on B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   303
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   304
  have *: "count_space B = distr (count_space A) (count_space B) g"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   305
    by (rule distr_bij_count_space [symmetric]) fact
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   306
  show ?thesis unfolding abs_summable_on_def
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   307
    by (subst *, subst integrable_distr_eq[of _ _ "count_space B"]) 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   308
       (insert assms, auto simp: bij_betw_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   309
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   310
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   311
lemma abs_summable_on_reindex:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   312
  assumes "(\<lambda>x. f (g x)) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   313
  shows   "f abs_summable_on (g ` A)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   314
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   315
  define g' where "g' = inv_into A g"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   316
  from assms have "(\<lambda>x. f (g x)) abs_summable_on (g' ` g ` A)" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   317
    by (rule abs_summable_on_subset) (auto simp: g'_def inv_into_into)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   318
  also have "?this \<longleftrightarrow> (\<lambda>x. f (g (g' x))) abs_summable_on (g ` A)" unfolding g'_def
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   319
    by (intro abs_summable_on_reindex_bij_betw [symmetric] inj_on_imp_bij_betw inj_on_inv_into) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   320
  also have "\<dots> \<longleftrightarrow> f abs_summable_on (g ` A)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   321
    by (intro abs_summable_on_cong refl) (auto simp: g'_def f_inv_into_f)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   322
  finally show ?thesis .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   323
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   324
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   325
lemma abs_summable_on_reindex_iff: 
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   326
  "inj_on g A \<Longrightarrow> (\<lambda>x. f (g x)) abs_summable_on A \<longleftrightarrow> f abs_summable_on (g ` A)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   327
  by (intro abs_summable_on_reindex_bij_betw inj_on_imp_bij_betw)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   328
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   329
lemma abs_summable_on_Sigma_project2:
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   330
  fixes A :: "'a set" and B :: "'a \<Rightarrow> 'b set"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   331
  assumes "f abs_summable_on (Sigma A B)" "x \<in> A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   332
  shows   "(\<lambda>y. f (x, y)) abs_summable_on (B x)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   333
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   334
  from assms(2) have "f abs_summable_on (Sigma {x} B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   335
    by (intro abs_summable_on_subset [OF assms(1)]) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   336
  also have "?this \<longleftrightarrow> (\<lambda>z. f (x, snd z)) abs_summable_on (Sigma {x} B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   337
    by (rule abs_summable_on_cong) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   338
  finally have "(\<lambda>y. f (x, y)) abs_summable_on (snd ` Sigma {x} B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   339
    by (rule abs_summable_on_reindex)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   340
  also have "snd ` Sigma {x} B = B x"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   341
    using assms by (auto simp: image_iff)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   342
  finally show ?thesis .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   343
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   344
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   345
lemma abs_summable_on_Times_swap:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   346
  "f abs_summable_on A \<times> B \<longleftrightarrow> (\<lambda>(x,y). f (y,x)) abs_summable_on B \<times> A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   347
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   348
  have bij: "bij_betw (\<lambda>(x,y). (y,x)) (B \<times> A) (A \<times> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   349
    by (auto simp: bij_betw_def inj_on_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   350
  show ?thesis
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   351
    by (subst abs_summable_on_reindex_bij_betw[OF bij, of f, symmetric])
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   352
       (simp_all add: case_prod_unfold)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   353
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   354
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   355
lemma abs_summable_on_0 [simp, intro]: "(\<lambda>_. 0) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   356
  by (simp add: abs_summable_on_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   357
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   358
lemma abs_summable_on_uminus [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   359
  "f abs_summable_on A \<Longrightarrow> (\<lambda>x. -f x) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   360
  unfolding abs_summable_on_def by (rule Bochner_Integration.integrable_minus)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   361
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   362
lemma abs_summable_on_add [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   363
  assumes "f abs_summable_on A" and "g abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   364
  shows   "(\<lambda>x. f x + g x) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   365
  using assms unfolding abs_summable_on_def by (rule Bochner_Integration.integrable_add)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   366
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   367
lemma abs_summable_on_diff [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   368
  assumes "f abs_summable_on A" and "g abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   369
  shows   "(\<lambda>x. f x - g x) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   370
  using assms unfolding abs_summable_on_def by (rule Bochner_Integration.integrable_diff)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   371
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   372
lemma abs_summable_on_scaleR_left [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   373
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   374
  shows   "(\<lambda>x. f x *\<^sub>R c) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   375
  using assms unfolding abs_summable_on_def by (intro Bochner_Integration.integrable_scaleR_left)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   376
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   377
lemma abs_summable_on_scaleR_right [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   378
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   379
  shows   "(\<lambda>x. c *\<^sub>R f x) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   380
  using assms unfolding abs_summable_on_def by (intro Bochner_Integration.integrable_scaleR_right)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   381
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   382
lemma abs_summable_on_cmult_right [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   383
  fixes f :: "'a \<Rightarrow> 'b :: {banach, real_normed_algebra, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   384
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   385
  shows   "(\<lambda>x. c * f x) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   386
  using assms unfolding abs_summable_on_def by (intro Bochner_Integration.integrable_mult_right)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   387
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   388
lemma abs_summable_on_cmult_left [intro]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   389
  fixes f :: "'a \<Rightarrow> 'b :: {banach, real_normed_algebra, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   390
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   391
  shows   "(\<lambda>x. f x * c) abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   392
  using assms unfolding abs_summable_on_def by (intro Bochner_Integration.integrable_mult_left)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   393
66568
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   394
lemma abs_summable_on_prod_PiE:
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   395
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c :: {real_normed_field,banach,second_countable_topology}"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   396
  assumes finite: "finite A" and countable: "\<And>x. x \<in> A \<Longrightarrow> countable (B x)"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   397
  assumes summable: "\<And>x. x \<in> A \<Longrightarrow> f x abs_summable_on B x"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   398
  shows   "(\<lambda>g. \<Prod>x\<in>A. f x (g x)) abs_summable_on PiE A B"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   399
proof -
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   400
  define B' where "B' = (\<lambda>x. if x \<in> A then B x else {})"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   401
  from assms have [simp]: "countable (B' x)" for x
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   402
    by (auto simp: B'_def)
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   403
  then interpret product_sigma_finite "count_space \<circ> B'"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   404
    unfolding o_def by (intro product_sigma_finite.intro sigma_finite_measure_count_space_countable)
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   405
  from assms have "integrable (PiM A (count_space \<circ> B')) (\<lambda>g. \<Prod>x\<in>A. f x (g x))"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   406
    by (intro product_integrable_prod) (auto simp: abs_summable_on_def B'_def)
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   407
  also have "PiM A (count_space \<circ> B') = count_space (PiE A B')"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   408
    unfolding o_def using finite by (intro count_space_PiM_finite) simp_all
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   409
  also have "PiE A B' = PiE A B" by (intro PiE_cong) (simp_all add: B'_def)
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   410
  finally show ?thesis by (simp add: abs_summable_on_def)
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   411
qed
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   412
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   413
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   414
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   415
lemma not_summable_infsetsum_eq:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   416
  "\<not>f abs_summable_on A \<Longrightarrow> infsetsum f A = 0"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   417
  by (simp add: abs_summable_on_def infsetsum_def not_integrable_integral_eq)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   418
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   419
lemma infsetsum_altdef:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   420
  "infsetsum f A = set_lebesgue_integral (count_space UNIV) A f"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   421
  unfolding set_lebesgue_integral_def
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   422
  by (subst integral_restrict_space [symmetric])
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   423
     (auto simp: restrict_count_space_subset infsetsum_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   424
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   425
lemma infsetsum_altdef':
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   426
  "A \<subseteq> B \<Longrightarrow> infsetsum f A = set_lebesgue_integral (count_space B) A f"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   427
  unfolding set_lebesgue_integral_def
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   428
  by (subst integral_restrict_space [symmetric])
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   429
     (auto simp: restrict_count_space_subset infsetsum_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   430
66568
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   431
lemma nn_integral_conv_infsetsum:
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   432
  assumes "f abs_summable_on A" "\<And>x. x \<in> A \<Longrightarrow> f x \<ge> 0"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   433
  shows   "nn_integral (count_space A) f = ennreal (infsetsum f A)"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   434
  using assms unfolding infsetsum_def abs_summable_on_def
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   435
  by (subst nn_integral_eq_integral) auto
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   436
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   437
lemma infsetsum_conv_nn_integral:
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   438
  assumes "nn_integral (count_space A) f \<noteq> \<infinity>" "\<And>x. x \<in> A \<Longrightarrow> f x \<ge> 0"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   439
  shows   "infsetsum f A = enn2real (nn_integral (count_space A) f)"
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   440
  unfolding infsetsum_def using assms
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   441
  by (subst integral_eq_nn_integral) auto
52b5cf533fd6 Connecting PMFs to infinite sums
eberlm <eberlm@in.tum.de>
parents: 66526
diff changeset
   442
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   443
lemma infsetsum_cong [cong]:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   444
  "(\<And>x. x \<in> A \<Longrightarrow> f x = g x) \<Longrightarrow> A = B \<Longrightarrow> infsetsum f A = infsetsum g B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   445
  unfolding infsetsum_def by (intro Bochner_Integration.integral_cong) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   446
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   447
lemma infsetsum_0 [simp]: "infsetsum (\<lambda>_. 0) A = 0"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   448
  by (simp add: infsetsum_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   449
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   450
lemma infsetsum_all_0: "(\<And>x. x \<in> A \<Longrightarrow> f x = 0) \<Longrightarrow> infsetsum f A = 0"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   451
  by simp
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   452
67167
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   453
lemma infsetsum_nonneg: "(\<And>x. x \<in> A \<Longrightarrow> f x \<ge> (0::real)) \<Longrightarrow> infsetsum f A \<ge> 0"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   454
  unfolding infsetsum_def by (rule Bochner_Integration.integral_nonneg) auto
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   455
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   456
lemma sum_infsetsum:
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   457
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x abs_summable_on B"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   458
  shows   "(\<Sum>x\<in>A. \<Sum>\<^sub>ay\<in>B. f x y) = (\<Sum>\<^sub>ay\<in>B. \<Sum>x\<in>A. f x y)"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   459
  using assms by (simp add: infsetsum_def abs_summable_on_def Bochner_Integration.integral_sum)
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   460
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   461
lemma Re_infsetsum: "f abs_summable_on A \<Longrightarrow> Re (infsetsum f A) = (\<Sum>\<^sub>ax\<in>A. Re (f x))"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   462
  by (simp add: infsetsum_def abs_summable_on_def)
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   463
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   464
lemma Im_infsetsum: "f abs_summable_on A \<Longrightarrow> Im (infsetsum f A) = (\<Sum>\<^sub>ax\<in>A. Im (f x))"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   465
  by (simp add: infsetsum_def abs_summable_on_def)
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   466
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   467
lemma infsetsum_of_real: 
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   468
  shows "infsetsum (\<lambda>x. of_real (f x) 
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   469
           :: 'a :: {real_normed_algebra_1,banach,second_countable_topology,real_inner}) A = 
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   470
             of_real (infsetsum f A)"
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   471
  unfolding infsetsum_def
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   472
  by (rule integral_bounded_linear'[OF bounded_linear_of_real bounded_linear_inner_left[of 1]]) auto
88d1c9d86f48 Moved analysis material from AFP
Manuel Eberl <eberlm@in.tum.de>
parents: 66568
diff changeset
   473
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   474
lemma infsetsum_finite [simp]: "finite A \<Longrightarrow> infsetsum f A = (\<Sum>x\<in>A. f x)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   475
  by (simp add: infsetsum_def lebesgue_integral_count_space_finite)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   476
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   477
lemma infsetsum_nat: 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   478
  assumes "f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   479
  shows   "infsetsum f A = (\<Sum>n. if n \<in> A then f n else 0)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   480
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   481
  from assms have "infsetsum f A = (\<Sum>n. indicator A n *\<^sub>R f n)"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   482
    unfolding infsetsum_altdef abs_summable_on_altdef set_lebesgue_integral_def set_integrable_def
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   483
 by (subst integral_count_space_nat) auto
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   484
  also have "(\<lambda>n. indicator A n *\<^sub>R f n) = (\<lambda>n. if n \<in> A then f n else 0)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   485
    by auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   486
  finally show ?thesis .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   487
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   488
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   489
lemma infsetsum_nat': 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   490
  assumes "f abs_summable_on UNIV"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   491
  shows   "infsetsum f UNIV = (\<Sum>n. f n)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   492
  using assms by (subst infsetsum_nat) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   493
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   494
lemma sums_infsetsum_nat:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   495
  assumes "f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   496
  shows   "(\<lambda>n. if n \<in> A then f n else 0) sums infsetsum f A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   497
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   498
  from assms have "summable (\<lambda>n. if n \<in> A then norm (f n) else 0)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   499
    by (simp add: abs_summable_on_nat_iff)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   500
  also have "(\<lambda>n. if n \<in> A then norm (f n) else 0) = (\<lambda>n. norm (if n \<in> A then f n else 0))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   501
    by auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   502
  finally have "summable (\<lambda>n. if n \<in> A then f n else 0)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   503
    by (rule summable_norm_cancel)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   504
  with assms show ?thesis
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   505
    by (auto simp: sums_iff infsetsum_nat)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   506
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   507
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   508
lemma sums_infsetsum_nat':
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   509
  assumes "f abs_summable_on UNIV"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   510
  shows   "f sums infsetsum f UNIV"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   511
  using sums_infsetsum_nat [OF assms] by simp
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   512
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   513
lemma infsetsum_Un_disjoint:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   514
  assumes "f abs_summable_on A" "f abs_summable_on B" "A \<inter> B = {}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   515
  shows   "infsetsum f (A \<union> B) = infsetsum f A + infsetsum f B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   516
  using assms unfolding infsetsum_altdef abs_summable_on_altdef
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   517
  by (subst set_integral_Un) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   518
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   519
lemma infsetsum_Diff:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   520
  assumes "f abs_summable_on B" "A \<subseteq> B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   521
  shows   "infsetsum f (B - A) = infsetsum f B - infsetsum f A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   522
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   523
  have "infsetsum f ((B - A) \<union> A) = infsetsum f (B - A) + infsetsum f A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   524
    using assms(2) by (intro infsetsum_Un_disjoint abs_summable_on_subset[OF assms(1)]) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   525
  also from assms(2) have "(B - A) \<union> A = B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   526
    by auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   527
  ultimately show ?thesis
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   528
    by (simp add: algebra_simps)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   529
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   530
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   531
lemma infsetsum_Un_Int:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   532
  assumes "f abs_summable_on (A \<union> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   533
  shows   "infsetsum f (A \<union> B) = infsetsum f A + infsetsum f B - infsetsum f (A \<inter> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   534
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   535
  have "A \<union> B = A \<union> (B - A \<inter> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   536
    by auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   537
  also have "infsetsum f \<dots> = infsetsum f A + infsetsum f (B - A \<inter> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   538
    by (intro infsetsum_Un_disjoint abs_summable_on_subset[OF assms]) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   539
  also have "infsetsum f (B - A \<inter> B) = infsetsum f B - infsetsum f (A \<inter> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   540
    by (intro infsetsum_Diff abs_summable_on_subset[OF assms]) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   541
  finally show ?thesis 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   542
    by (simp add: algebra_simps)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   543
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   544
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   545
lemma infsetsum_reindex_bij_betw:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   546
  assumes "bij_betw g A B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   547
  shows   "infsetsum (\<lambda>x. f (g x)) A = infsetsum f B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   548
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   549
  have *: "count_space B = distr (count_space A) (count_space B) g"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   550
    by (rule distr_bij_count_space [symmetric]) fact
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   551
  show ?thesis unfolding infsetsum_def
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   552
    by (subst *, subst integral_distr[of _ _ "count_space B"]) 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   553
       (insert assms, auto simp: bij_betw_def)    
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   554
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   555
68651
Manuel Eberl <eberlm@in.tum.de>
parents: 67974
diff changeset
   556
theorem infsetsum_reindex:
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   557
  assumes "inj_on g A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   558
  shows   "infsetsum f (g ` A) = infsetsum (\<lambda>x. f (g x)) A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   559
  by (intro infsetsum_reindex_bij_betw [symmetric] inj_on_imp_bij_betw assms)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   560
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   561
lemma infsetsum_cong_neutral:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   562
  assumes "\<And>x. x \<in> A - B \<Longrightarrow> f x = 0"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   563
  assumes "\<And>x. x \<in> B - A \<Longrightarrow> g x = 0"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   564
  assumes "\<And>x. x \<in> A \<inter> B \<Longrightarrow> f x = g x"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   565
  shows   "infsetsum f A = infsetsum g B"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   566
  unfolding infsetsum_altdef set_lebesgue_integral_def using assms
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   567
  by (intro Bochner_Integration.integral_cong refl)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   568
     (auto simp: indicator_def split: if_splits)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   569
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   570
lemma infsetsum_mono_neutral:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   571
  fixes f g :: "'a \<Rightarrow> real"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   572
  assumes "f abs_summable_on A" and "g abs_summable_on B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   573
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<le> g x"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   574
  assumes "\<And>x. x \<in> A - B \<Longrightarrow> f x \<le> 0"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   575
  assumes "\<And>x. x \<in> B - A \<Longrightarrow> g x \<ge> 0"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   576
  shows   "infsetsum f A \<le> infsetsum g B"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   577
  using assms unfolding infsetsum_altdef set_lebesgue_integral_def abs_summable_on_altdef set_integrable_def
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   578
  by (intro Bochner_Integration.integral_mono) (auto simp: indicator_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   579
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   580
lemma infsetsum_mono_neutral_left:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   581
  fixes f g :: "'a \<Rightarrow> real"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   582
  assumes "f abs_summable_on A" and "g abs_summable_on B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   583
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<le> g x"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   584
  assumes "A \<subseteq> B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   585
  assumes "\<And>x. x \<in> B - A \<Longrightarrow> g x \<ge> 0"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   586
  shows   "infsetsum f A \<le> infsetsum g B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   587
  using \<open>A \<subseteq> B\<close> by (intro infsetsum_mono_neutral assms) auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   588
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   589
lemma infsetsum_mono_neutral_right:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   590
  fixes f g :: "'a \<Rightarrow> real"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   591
  assumes "f abs_summable_on A" and "g abs_summable_on B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   592
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<le> g x"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   593
  assumes "B \<subseteq> A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   594
  assumes "\<And>x. x \<in> A - B \<Longrightarrow> f x \<le> 0"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   595
  shows   "infsetsum f A \<le> infsetsum g B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   596
  using \<open>B \<subseteq> A\<close> by (intro infsetsum_mono_neutral assms) auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   597
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   598
lemma infsetsum_mono:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   599
  fixes f g :: "'a \<Rightarrow> real"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   600
  assumes "f abs_summable_on A" and "g abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   601
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<le> g x"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   602
  shows   "infsetsum f A \<le> infsetsum g A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   603
  by (intro infsetsum_mono_neutral assms) auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   604
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   605
lemma norm_infsetsum_bound:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   606
  "norm (infsetsum f A) \<le> infsetsum (\<lambda>x. norm (f x)) A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   607
  unfolding abs_summable_on_def infsetsum_def
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   608
  by (rule Bochner_Integration.integral_norm_bound)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   609
68651
Manuel Eberl <eberlm@in.tum.de>
parents: 67974
diff changeset
   610
theorem infsetsum_Sigma:
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   611
  fixes A :: "'a set" and B :: "'a \<Rightarrow> 'b set"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   612
  assumes [simp]: "countable A" and "\<And>i. countable (B i)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   613
  assumes summable: "f abs_summable_on (Sigma A B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   614
  shows   "infsetsum f (Sigma A B) = infsetsum (\<lambda>x. infsetsum (\<lambda>y. f (x, y)) (B x)) A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   615
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   616
  define B' where "B' = (\<Union>i\<in>A. B i)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   617
  have [simp]: "countable B'" 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   618
    unfolding B'_def by (intro countable_UN assms)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   619
  interpret pair_sigma_finite "count_space A" "count_space B'"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   620
    by (intro pair_sigma_finite.intro sigma_finite_measure_count_space_countable) fact+
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   621
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   622
  have "integrable (count_space (A \<times> B')) (\<lambda>z. indicator (Sigma A B) z *\<^sub>R f z)"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   623
    using summable
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   624
    by (metis (mono_tags, lifting) abs_summable_on_altdef abs_summable_on_def integrable_cong integrable_mult_indicator set_integrable_def sets_UNIV)
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   625
  also have "?this \<longleftrightarrow> integrable (count_space A \<Otimes>\<^sub>M count_space B') (\<lambda>(x, y). indicator (B x) y *\<^sub>R f (x, y))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   626
    by (intro Bochner_Integration.integrable_cong)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   627
       (auto simp: pair_measure_countable indicator_def split: if_splits)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   628
  finally have integrable: \<dots> .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   629
  
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   630
  have "infsetsum (\<lambda>x. infsetsum (\<lambda>y. f (x, y)) (B x)) A =
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   631
          (\<integral>x. infsetsum (\<lambda>y. f (x, y)) (B x) \<partial>count_space A)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   632
    unfolding infsetsum_def by simp
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   633
  also have "\<dots> = (\<integral>x. \<integral>y. indicator (B x) y *\<^sub>R f (x, y) \<partial>count_space B' \<partial>count_space A)"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   634
  proof (rule Bochner_Integration.integral_cong [OF refl])
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   635
    show "\<And>x. x \<in> space (count_space A) \<Longrightarrow>
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   636
         (\<Sum>\<^sub>ay\<in>B x. f (x, y)) = LINT y|count_space B'. indicat_real (B x) y *\<^sub>R f (x, y)"
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   637
      using infsetsum_altdef'[of _ B'] 
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   638
      unfolding set_lebesgue_integral_def B'_def
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   639
      by auto 
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   640
  qed
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   641
  also have "\<dots> = (\<integral>(x,y). indicator (B x) y *\<^sub>R f (x, y) \<partial>(count_space A \<Otimes>\<^sub>M count_space B'))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   642
    by (subst integral_fst [OF integrable]) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   643
  also have "\<dots> = (\<integral>z. indicator (Sigma A B) z *\<^sub>R f z \<partial>count_space (A \<times> B'))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   644
    by (intro Bochner_Integration.integral_cong)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   645
       (auto simp: pair_measure_countable indicator_def split: if_splits)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   646
  also have "\<dots> = infsetsum f (Sigma A B)"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   647
    unfolding set_lebesgue_integral_def [symmetric]
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   648
    by (rule infsetsum_altdef' [symmetric]) (auto simp: B'_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   649
  finally show ?thesis ..
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   650
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   651
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   652
lemma infsetsum_Sigma':
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   653
  fixes A :: "'a set" and B :: "'a \<Rightarrow> 'b set"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   654
  assumes [simp]: "countable A" and "\<And>i. countable (B i)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   655
  assumes summable: "(\<lambda>(x,y). f x y) abs_summable_on (Sigma A B)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   656
  shows   "infsetsum (\<lambda>x. infsetsum (\<lambda>y. f x y) (B x)) A = infsetsum (\<lambda>(x,y). f x y) (Sigma A B)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   657
  using assms by (subst infsetsum_Sigma) auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   658
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   659
lemma infsetsum_Times:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   660
  fixes A :: "'a set" and B :: "'b set"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   661
  assumes [simp]: "countable A" and "countable B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   662
  assumes summable: "f abs_summable_on (A \<times> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   663
  shows   "infsetsum f (A \<times> B) = infsetsum (\<lambda>x. infsetsum (\<lambda>y. f (x, y)) B) A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   664
  using assms by (subst infsetsum_Sigma) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   665
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   666
lemma infsetsum_Times':
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   667
  fixes A :: "'a set" and B :: "'b set"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   668
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c :: {banach, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   669
  assumes [simp]: "countable A" and [simp]: "countable B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   670
  assumes summable: "(\<lambda>(x,y). f x y) abs_summable_on (A \<times> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   671
  shows   "infsetsum (\<lambda>x. infsetsum (\<lambda>y. f x y) B) A = infsetsum (\<lambda>(x,y). f x y) (A \<times> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   672
  using assms by (subst infsetsum_Times) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   673
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   674
lemma infsetsum_swap:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   675
  fixes A :: "'a set" and B :: "'b set"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   676
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c :: {banach, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   677
  assumes [simp]: "countable A" and [simp]: "countable B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   678
  assumes summable: "(\<lambda>(x,y). f x y) abs_summable_on A \<times> B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   679
  shows   "infsetsum (\<lambda>x. infsetsum (\<lambda>y. f x y) B) A = infsetsum (\<lambda>y. infsetsum (\<lambda>x. f x y) A) B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   680
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   681
  from summable have summable': "(\<lambda>(x,y). f y x) abs_summable_on B \<times> A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   682
    by (subst abs_summable_on_Times_swap) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   683
  have bij: "bij_betw (\<lambda>(x, y). (y, x)) (B \<times> A) (A \<times> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   684
    by (auto simp: bij_betw_def inj_on_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   685
  have "infsetsum (\<lambda>x. infsetsum (\<lambda>y. f x y) B) A = infsetsum (\<lambda>(x,y). f x y) (A \<times> B)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   686
    using summable by (subst infsetsum_Times) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   687
  also have "\<dots> = infsetsum (\<lambda>(x,y). f y x) (B \<times> A)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   688
    by (subst infsetsum_reindex_bij_betw[OF bij, of "\<lambda>(x,y). f x y", symmetric])
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   689
       (simp_all add: case_prod_unfold)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   690
  also have "\<dots> = infsetsum (\<lambda>y. infsetsum (\<lambda>x. f x y) A) B"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   691
    using summable' by (subst infsetsum_Times) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   692
  finally show ?thesis .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   693
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   694
68651
Manuel Eberl <eberlm@in.tum.de>
parents: 67974
diff changeset
   695
theorem abs_summable_on_Sigma_iff:
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   696
  assumes [simp]: "countable A" and "\<And>x. x \<in> A \<Longrightarrow> countable (B x)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   697
  shows   "f abs_summable_on Sigma A B \<longleftrightarrow> 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   698
             (\<forall>x\<in>A. (\<lambda>y. f (x, y)) abs_summable_on B x) \<and>
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   699
             ((\<lambda>x. infsetsum (\<lambda>y. norm (f (x, y))) (B x)) abs_summable_on A)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   700
proof safe
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   701
  define B' where "B' = (\<Union>x\<in>A. B x)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   702
  have [simp]: "countable B'" 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   703
    unfolding B'_def using assms by auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   704
  interpret pair_sigma_finite "count_space A" "count_space B'"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   705
    by (intro pair_sigma_finite.intro sigma_finite_measure_count_space_countable) fact+
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   706
  {
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   707
    assume *: "f abs_summable_on Sigma A B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   708
    thus "(\<lambda>y. f (x, y)) abs_summable_on B x" if "x \<in> A" for x
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   709
      using that by (rule abs_summable_on_Sigma_project2)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   710
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   711
    have "set_integrable (count_space (A \<times> B')) (Sigma A B) (\<lambda>z. norm (f z))"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   712
      using abs_summable_on_normI[OF *]
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   713
      by (subst abs_summable_on_altdef' [symmetric]) (auto simp: B'_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   714
    also have "count_space (A \<times> B') = count_space A \<Otimes>\<^sub>M count_space B'"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   715
      by (simp add: pair_measure_countable)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   716
    finally have "integrable (count_space A) 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   717
                    (\<lambda>x. lebesgue_integral (count_space B') 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   718
                      (\<lambda>y. indicator (Sigma A B) (x, y) *\<^sub>R norm (f (x, y))))"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   719
      unfolding set_integrable_def by (rule integrable_fst')
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   720
    also have "?this \<longleftrightarrow> integrable (count_space A)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   721
                    (\<lambda>x. lebesgue_integral (count_space B') 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   722
                      (\<lambda>y. indicator (B x) y *\<^sub>R norm (f (x, y))))"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   723
      by (intro integrable_cong refl) (simp_all add: indicator_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   724
    also have "\<dots> \<longleftrightarrow> integrable (count_space A) (\<lambda>x. infsetsum (\<lambda>y. norm (f (x, y))) (B x))"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   725
      unfolding set_lebesgue_integral_def [symmetric]
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   726
      by (intro integrable_cong refl infsetsum_altdef' [symmetric]) (auto simp: B'_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   727
    also have "\<dots> \<longleftrightarrow> (\<lambda>x. infsetsum (\<lambda>y. norm (f (x, y))) (B x)) abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   728
      by (simp add: abs_summable_on_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   729
    finally show \<dots> .
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   730
  }
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   731
  {
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   732
    assume *: "\<forall>x\<in>A. (\<lambda>y. f (x, y)) abs_summable_on B x"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   733
    assume "(\<lambda>x. \<Sum>\<^sub>ay\<in>B x. norm (f (x, y))) abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   734
    also have "?this \<longleftrightarrow> (\<lambda>x. \<integral>y\<in>B x. norm (f (x, y)) \<partial>count_space B') abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   735
      by (intro abs_summable_on_cong refl infsetsum_altdef') (auto simp: B'_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   736
    also have "\<dots> \<longleftrightarrow> (\<lambda>x. \<integral>y. indicator (Sigma A B) (x, y) *\<^sub>R norm (f (x, y)) \<partial>count_space B')
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   737
                        abs_summable_on A" (is "_ \<longleftrightarrow> ?h abs_summable_on _")
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   738
      unfolding set_lebesgue_integral_def
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   739
      by (intro abs_summable_on_cong) (auto simp: indicator_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   740
    also have "\<dots> \<longleftrightarrow> integrable (count_space A) ?h"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   741
      by (simp add: abs_summable_on_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   742
    finally have **: \<dots> .
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   743
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   744
    have "integrable (count_space A \<Otimes>\<^sub>M count_space B') (\<lambda>z. indicator (Sigma A B) z *\<^sub>R f z)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   745
    proof (rule Fubini_integrable, goal_cases)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   746
      case 3
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   747
      {
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   748
        fix x assume x: "x \<in> A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   749
        with * have "(\<lambda>y. f (x, y)) abs_summable_on B x"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   750
          by blast
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   751
        also have "?this \<longleftrightarrow> integrable (count_space B') 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   752
                      (\<lambda>y. indicator (B x) y *\<^sub>R f (x, y))"
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   753
          unfolding set_integrable_def [symmetric]
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   754
         using x by (intro abs_summable_on_altdef') (auto simp: B'_def)
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   755
        also have "(\<lambda>y. indicator (B x) y *\<^sub>R f (x, y)) = 
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   756
                     (\<lambda>y. indicator (Sigma A B) (x, y) *\<^sub>R f (x, y))"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   757
          using x by (auto simp: indicator_def)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   758
        finally have "integrable (count_space B')
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   759
                        (\<lambda>y. indicator (Sigma A B) (x, y) *\<^sub>R f (x, y))" .
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   760
      }
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   761
      thus ?case by (auto simp: AE_count_space)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   762
    qed (insert **, auto simp: pair_measure_countable)
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   763
    moreover have "count_space A \<Otimes>\<^sub>M count_space B' = count_space (A \<times> B')"
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   764
      by (simp add: pair_measure_countable)
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   765
    moreover have "set_integrable (count_space (A \<times> B')) (Sigma A B) f \<longleftrightarrow>
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   766
                 f abs_summable_on Sigma A B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   767
      by (rule abs_summable_on_altdef' [symmetric]) (auto simp: B'_def)
67974
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   768
    ultimately show "f abs_summable_on Sigma A B"
3f352a91b45a replacement of set integral abbreviations by actual definitions!
paulson <lp15@cam.ac.uk>
parents: 67268
diff changeset
   769
      by (simp add: set_integrable_def)
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   770
  }
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   771
qed
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   772
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   773
lemma abs_summable_on_Sigma_project1:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   774
  assumes "(\<lambda>(x,y). f x y) abs_summable_on Sigma A B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   775
  assumes [simp]: "countable A" and "\<And>x. x \<in> A \<Longrightarrow> countable (B x)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   776
  shows   "(\<lambda>x. infsetsum (\<lambda>y. norm (f x y)) (B x)) abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   777
  using assms by (subst (asm) abs_summable_on_Sigma_iff) auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   778
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   779
lemma abs_summable_on_Sigma_project1':
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   780
  assumes "(\<lambda>(x,y). f x y) abs_summable_on Sigma A B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   781
  assumes [simp]: "countable A" and "\<And>x. x \<in> A \<Longrightarrow> countable (B x)"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   782
  shows   "(\<lambda>x. infsetsum (\<lambda>y. f x y) (B x)) abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   783
  by (intro abs_summable_on_comparison_test' [OF abs_summable_on_Sigma_project1[OF assms]]
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   784
        norm_infsetsum_bound)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   785
68651
Manuel Eberl <eberlm@in.tum.de>
parents: 67974
diff changeset
   786
theorem infsetsum_prod_PiE:
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   787
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c :: {real_normed_field,banach,second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   788
  assumes finite: "finite A" and countable: "\<And>x. x \<in> A \<Longrightarrow> countable (B x)"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   789
  assumes summable: "\<And>x. x \<in> A \<Longrightarrow> f x abs_summable_on B x"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   790
  shows   "infsetsum (\<lambda>g. \<Prod>x\<in>A. f x (g x)) (PiE A B) = (\<Prod>x\<in>A. infsetsum (f x) (B x))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   791
proof -
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   792
  define B' where "B' = (\<lambda>x. if x \<in> A then B x else {})"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   793
  from assms have [simp]: "countable (B' x)" for x
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   794
    by (auto simp: B'_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   795
  then interpret product_sigma_finite "count_space \<circ> B'"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   796
    unfolding o_def by (intro product_sigma_finite.intro sigma_finite_measure_count_space_countable)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   797
  have "infsetsum (\<lambda>g. \<Prod>x\<in>A. f x (g x)) (PiE A B) =
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   798
          (\<integral>g. (\<Prod>x\<in>A. f x (g x)) \<partial>count_space (PiE A B))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   799
    by (simp add: infsetsum_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   800
  also have "PiE A B = PiE A B'"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   801
    by (intro PiE_cong) (simp_all add: B'_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   802
  hence "count_space (PiE A B) = count_space (PiE A B')"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   803
    by simp
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   804
  also have "\<dots> = PiM A (count_space \<circ> B')"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   805
    unfolding o_def using finite by (intro count_space_PiM_finite [symmetric]) simp_all
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   806
  also have "(\<integral>g. (\<Prod>x\<in>A. f x (g x)) \<partial>\<dots>) = (\<Prod>x\<in>A. infsetsum (f x) (B' x))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   807
    by (subst product_integral_prod) 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   808
       (insert summable finite, simp_all add: infsetsum_def B'_def abs_summable_on_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   809
  also have "\<dots> = (\<Prod>x\<in>A. infsetsum (f x) (B x))"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   810
    by (intro prod.cong refl) (simp_all add: B'_def)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   811
  finally show ?thesis .
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   812
qed
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   813
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   814
lemma infsetsum_uminus: "infsetsum (\<lambda>x. -f x) A = -infsetsum f A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   815
  unfolding infsetsum_def abs_summable_on_def 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   816
  by (rule Bochner_Integration.integral_minus)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   817
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   818
lemma infsetsum_add:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   819
  assumes "f abs_summable_on A" and "g abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   820
  shows   "infsetsum (\<lambda>x. f x + g x) A = infsetsum f A + infsetsum g A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   821
  using assms unfolding infsetsum_def abs_summable_on_def 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   822
  by (rule Bochner_Integration.integral_add)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   823
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   824
lemma infsetsum_diff:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   825
  assumes "f abs_summable_on A" and "g abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   826
  shows   "infsetsum (\<lambda>x. f x - g x) A = infsetsum f A - infsetsum g A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   827
  using assms unfolding infsetsum_def abs_summable_on_def 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   828
  by (rule Bochner_Integration.integral_diff)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   829
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   830
lemma infsetsum_scaleR_left:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   831
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   832
  shows   "infsetsum (\<lambda>x. f x *\<^sub>R c) A = infsetsum f A *\<^sub>R c"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   833
  using assms unfolding infsetsum_def abs_summable_on_def 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   834
  by (rule Bochner_Integration.integral_scaleR_left)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   835
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   836
lemma infsetsum_scaleR_right:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   837
  "infsetsum (\<lambda>x. c *\<^sub>R f x) A = c *\<^sub>R infsetsum f A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   838
  unfolding infsetsum_def abs_summable_on_def 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   839
  by (subst Bochner_Integration.integral_scaleR_right) auto
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   840
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   841
lemma infsetsum_cmult_left:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   842
  fixes f :: "'a \<Rightarrow> 'b :: {banach, real_normed_algebra, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   843
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   844
  shows   "infsetsum (\<lambda>x. f x * c) A = infsetsum f A * c"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   845
  using assms unfolding infsetsum_def abs_summable_on_def 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   846
  by (rule Bochner_Integration.integral_mult_left)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   847
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   848
lemma infsetsum_cmult_right:
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   849
  fixes f :: "'a \<Rightarrow> 'b :: {banach, real_normed_algebra, second_countable_topology}"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   850
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   851
  shows   "infsetsum (\<lambda>x. c * f x) A = c * infsetsum f A"
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   852
  using assms unfolding infsetsum_def abs_summable_on_def 
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   853
  by (rule Bochner_Integration.integral_mult_right)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   854
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   855
lemma infsetsum_cdiv:
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   856
  fixes f :: "'a \<Rightarrow> 'b :: {banach, real_normed_field, second_countable_topology}"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   857
  assumes "c \<noteq> 0 \<Longrightarrow> f abs_summable_on A"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   858
  shows   "infsetsum (\<lambda>x. f x / c) A = infsetsum f A / c"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   859
  using assms unfolding infsetsum_def abs_summable_on_def by auto
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   860
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   861
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   862
(* TODO Generalise with bounded_linear *)
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   863
66526
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   864
lemma
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   865
  fixes f :: "'a \<Rightarrow> 'c :: {banach, real_normed_field, second_countable_topology}"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   866
  assumes [simp]: "countable A" and [simp]: "countable B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   867
  assumes "f abs_summable_on A" and "g abs_summable_on B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   868
  shows   abs_summable_on_product: "(\<lambda>(x,y). f x * g y) abs_summable_on A \<times> B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   869
    and   infsetsum_product: "infsetsum (\<lambda>(x,y). f x * g y) (A \<times> B) =
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   870
                                infsetsum f A * infsetsum g B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   871
proof -
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   872
  from assms show "(\<lambda>(x,y). f x * g y) abs_summable_on A \<times> B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   873
    by (subst abs_summable_on_Sigma_iff)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   874
       (auto intro!: abs_summable_on_cmult_right simp: norm_mult infsetsum_cmult_right)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   875
  with assms show "infsetsum (\<lambda>(x,y). f x * g y) (A \<times> B) = infsetsum f A * infsetsum g B"
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   876
    by (subst infsetsum_Sigma)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   877
       (auto simp: infsetsum_cmult_left infsetsum_cmult_right)
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   878
qed
322120e880c5 More material on infinite sums
eberlm <eberlm@in.tum.de>
parents: 66480
diff changeset
   879
66480
4b8d1df8933b HOL-Analysis: Convergent FPS and infinite sums
Manuel Eberl <eberlm@in.tum.de>
parents:
diff changeset
   880
end