Casting lemmas for rational numbers involving sums and products #
@[simp]
theorem
Rat.cast_multiset_sum
{α : Type u_2}
[DivisionRing α]
[CharZero α]
(s : Multiset ℚ)
:
↑(Multiset.sum s) = Multiset.sum (Multiset.map Rat.cast s)
@[simp]
theorem
Rat.cast_sum
{ι : Type u_1}
{α : Type u_2}
[DivisionRing α]
[CharZero α]
(s : Finset ι)
(f : ι → ℚ)
:
↑(Finset.sum s fun (i : ι) => f i) = Finset.sum s fun (i : ι) => ↑(f i)
@[simp]
theorem
Rat.cast_multiset_prod
{α : Type u_2}
[Field α]
[CharZero α]
(s : Multiset ℚ)
:
↑(Multiset.prod s) = Multiset.prod (Multiset.map Rat.cast s)
@[simp]
theorem
Rat.cast_prod
{ι : Type u_1}
{α : Type u_2}
[Field α]
[CharZero α]
(s : Finset ι)
(f : ι → ℚ)
:
↑(Finset.prod s fun (i : ι) => f i) = Finset.prod s fun (i : ι) => ↑(f i)