With some manually added simplification rules, Mathematica is able to simplify the expression as expected:
fullSimplify[args___] := FullSimplify[args,
TransformationFunctions -> {
Automatic,
ReplaceAll[
HoldPattern[
Product[f1_, {v1_, l1_, u1_}]^
e1_. Product[f2_, {v2_, l2_, u2_}]^e2_.] :>
fullSimplify /@ Unevaluated[
Product[f1, {v1, l1, Max[l1, l2] - 1}]^e1
Product[f1, {v1, Min[u1, u2] + 1, u1}]^e1
Product[f1^e1 (f2 /. v2 -> v1)^e2, {v1, Max[l1, l2],
Min[u1, u2]}]
Product[f2, {v2, l2, Max[l1, l2] - 1}]^e2
Product[f2, {v2, Min[u1, u2] + 1, u2}]^e2
]
],
ReplaceAll[
Sum[s_, {v_, l_, u_}] :>
Sum[Assuming[l <= v <= u, fullSimplify[s]], {v, l, u}]
]
}
]
fullSimplify[
Sum[((1 - pf[K[2]])/Product[ν*pf[K[1]], {K[1], 0, K[2]}])*
Product[ν*pf[K[1]], {K[1], 0, -1 + n}], {K[2], 0, -1 + n}]]
The first additional rule effectively simplifies products of Product
s:
$$\left(\prod_{i_1=l_1}^{u_1}f_1(i_1)\right)^{e_1}\left(\prod_{i_2=l_2}^{u_2}f_2(i_2)\right)^{e_2}$$
This can be split into a product of 5 parts: The intersecting part of the index ranges, and the four remaining parts (most of which are hopefully empty):
$$\begin{align}
&\left(\prod_{i_1=l_1}^{u_1}f_1(i_1)\right)^{e_1}\left(\prod_{i_2=l_2}^{u_2}f_2(i_2)\right)^{e_2}\\
=&\left(\prod_{i_1=l_1}^{\min(l_1,l_2)-1}f_1(i_1)\right)^{e_1}\left(\prod_{i_2=l_2}^{\min(l_1,l_2)-1}f_2(i_2)\right)^{e_2}\\
&\times\prod_{i=\max(l_1,l_2)}^{\min(u_1,u_2)}f_1(i)^{e_1}f_2(i)^{e_2}\\
&\times\left(\prod_{i_1=\max(u_1,u_2)+1}^{u_1}f_1(i_1)\right)^{e_1}\left(\prod_{i_2=\max(u_1,u_2)+1}^{u_2}f_2(i_2)\right)^{e_2}
\end{align}$$
Two subtleties: a/b
is effectively Times[a, Power[b, -1]]
, which is why the rule matches. And with a_^e_.
, we also match a
(since the e
can be defaulted to 1).
The second rule helps with the simplification of the Min
and Max
expressions: We tell Mathematica that the value of the index variable inside the Sum
will always be between the two bounds, and to simplify based on that.
Another important part is that we apply our custom simplification rules again to the individual parts of the transformed expressions, otherwise FullSimplify
gives up to soon. So effectively we use the second rule, set $Assumptions
, then apply the first rule to the content of the sum, simplifying the individual parts again (where now the $Assumptions
) set in the first step help to get rid of some of the products). It is important that we map fullSimplify
over the individual parts of the transformed product, otherwise we end up in a near-endless loop (since we can always recursively replace 2 products by 5)
InputForm
prior to copy and paste. $\endgroup$