src/HOL/Finite_Set.thy
changeset 16632 ad2895beef79
parent 16550 e14b89d6ef13
child 16733 236dfafbeb63
equal deleted inserted replaced
16631:58b4a689ae85 16632:ad2895beef79
   889 
   889 
   890 lemma setsum_cong:
   890 lemma setsum_cong:
   891   "A = B ==> (!!x. x:B ==> f x = g x) ==> setsum f A = setsum g B"
   891   "A = B ==> (!!x. x:B ==> f x = g x) ==> setsum f A = setsum g B"
   892 by(fastsimp simp: setsum_def intro: AC_add.fold_cong)
   892 by(fastsimp simp: setsum_def intro: AC_add.fold_cong)
   893 
   893 
       
   894 lemma strong_setsum_cong:
       
   895   "A = B ==> (!!x. x:B =simp=> f x = g x) ==> setsum f A = setsum g B"
       
   896 by(fastsimp simp: simp_implies_def setsum_def intro: AC_add.fold_cong)
       
   897 
   894 lemma setsum_cong2: "\<lbrakk>\<And>x. x \<in> A \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> setsum f A = setsum g A";
   898 lemma setsum_cong2: "\<lbrakk>\<And>x. x \<in> A \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> setsum f A = setsum g A";
   895   by (rule setsum_cong[OF refl], auto);
   899   by (rule setsum_cong[OF refl], auto);
   896 
   900 
   897 lemma setsum_reindex_cong:
   901 lemma setsum_reindex_cong:
   898      "[|inj_on f A; B = f ` A; !!a. a:A \<Longrightarrow> g a = h (f a)|] 
   902      "[|inj_on f A; B = f ` A; !!a. a:A \<Longrightarrow> g a = h (f a)|] 
  1269 by (auto simp add: setprod_reindex)
  1273 by (auto simp add: setprod_reindex)
  1270 
  1274 
  1271 lemma setprod_cong:
  1275 lemma setprod_cong:
  1272   "A = B ==> (!!x. x:B ==> f x = g x) ==> setprod f A = setprod g B"
  1276   "A = B ==> (!!x. x:B ==> f x = g x) ==> setprod f A = setprod g B"
  1273 by(fastsimp simp: setprod_def intro: AC_mult.fold_cong)
  1277 by(fastsimp simp: setprod_def intro: AC_mult.fold_cong)
       
  1278 
       
  1279 lemma strong_setprod_cong:
       
  1280   "A = B ==> (!!x. x:B =simp=> f x = g x) ==> setprod f A = setprod g B"
       
  1281 by(fastsimp simp: simp_implies_def setprod_def intro: AC_mult.fold_cong)
  1274 
  1282 
  1275 lemma setprod_reindex_cong: "inj_on f A ==>
  1283 lemma setprod_reindex_cong: "inj_on f A ==>
  1276     B = f ` A ==> g = h \<circ> f ==> setprod h B = setprod g A"
  1284     B = f ` A ==> g = h \<circ> f ==> setprod h B = setprod g A"
  1277   by (frule setprod_reindex, simp)
  1285   by (frule setprod_reindex, simp)
  1278 
  1286