diff -r cbfc1058df7c -r daa604a00491 src/HOL/Set_Interval.thy --- a/src/HOL/Set_Interval.thy Wed Aug 07 20:56:31 2024 +0200 +++ b/src/HOL/Set_Interval.thy Thu Aug 08 18:56:14 2024 +0100 @@ -1697,6 +1697,34 @@ by simp qed +lemma finite_countable_subset: + assumes "finite A" and A: "A \ (\i::nat. B i)" + obtains n where "A \ (\ix. x \ A \ x \ B(f x)" + by (metis in_mono UN_iff A) + define n where "n = Suc (Max (f`A))" + have "finite (f ` A)" + by (simp add: \finite A\) + then have "A \ (\ii::nat. B i)" + obtains n where "A = (\i (\i \ (range B)" + by (force simp: assms) + qed (use assms in auto) + with that show ?thesis + by (force simp: assms) +qed + subsection \Lemmas useful with the summation operator sum\ text \For examples, see Algebra/poly/UnivPoly2.thy\