# HG changeset patch # User Andreas Lochbihler # Date 1416572336 -3600 # Node ID d885cff91200d92a7fe4a684e62d29bc74a55ab8 # Parent 5fcfeae84b963317b07206ec83b66d8181221cd7 add lemma following a proof suggestion by Joachim Breitner diff -r 5fcfeae84b96 -r d885cff91200 src/HOL/Series.thy --- a/src/HOL/Series.thy Fri Nov 21 12:24:59 2014 +0100 +++ b/src/HOL/Series.thy Fri Nov 21 13:18:56 2014 +0100 @@ -676,4 +676,67 @@ using z by (auto intro!: exI[of _ 0] mult_left_le_one_le simp: abs_mult nonneg power_abs less_imp_le le_1) qed +lemma + fixes f :: "nat \ real" + assumes "summable f" + and "inj g" + and pos: "!!x. 0 \ f x" + shows summable_reindex: "summable (f o g)" + and suminf_reindex_mono: "suminf (f o g) \ suminf f" + and suminf_reindex: "(\x. x \ range g \ f x = 0) \ suminf (f \ g) = suminf f" +proof - + from \inj g\ have [simp]: "\A. inj_on g A" by(rule subset_inj_on) simp + + have smaller: "\n. (\i g) i) \ suminf f" + proof + fix n + have "\ n' \ (g ` {..n'. n' < n \ g n' < m" by blast + + have "(\i \ (\i \ suminf f" + using `summable f` + by (rule setsum_le_suminf) (simp add: pos) + finally show "(\i g) i) \ suminf f" by simp + qed + + have "incseq (\n. \i g) i)" + by (rule incseq_SucI) (auto simp add: pos) + then obtain L where L: "(\ n. \i g) i) ----> L" + using smaller by(rule incseq_convergent) + hence "(f \ g) sums L" by (simp add: sums_def) + thus "summable (f o g)" by (auto simp add: sums_iff) + + hence "(\n. \i g) i) ----> suminf (f \ g)" + by(rule summable_LIMSEQ) + thus le: "suminf (f \ g) \ suminf f" + by(rule LIMSEQ_le_const2)(blast intro: smaller[rule_format]) + + assume f: "\x. x \ range g \ f x = 0" + + from \summable f\ have "suminf f \ suminf (f \ g)" + proof(rule suminf_le_const) + fix n + have "\ n' \ (g -` {..n'. g n' < n \ n' < m" by blast + + have "(\ii\{.. range g. f i)" + using f by(auto intro: setsum.mono_neutral_cong_right) + also have "\ = (\i\g -` {.. g) i)" + by(rule setsum.reindex_cong[where l=g])(auto) + also have "\ \ (\i g) i)" + by(rule setsum_mono3)(auto simp add: pos n) + also have "\ \ suminf (f \ g)" + using \summable (f o g)\ + by(rule setsum_le_suminf)(simp add: pos) + finally show "setsum f {.. suminf (f \ g)" . + qed + with le show "suminf (f \ g) = suminf f" by(rule antisym) +qed + end