I'm trying to get Mathematica to simplify a piecewise function, but as you can see below it's making some strange errors:
- I'm telling it i and g are integers, so it ought to know that 2g>4+i is extraneous;
- In the cases where equality is assigned, it doesn't make the obvious substitutions: if 2g=5+i can I make it output an expression involving g instead?
- Also, can I get it to output the cases "solved for i?" That is, instead of saying 2g>5+i say i<2g-5?
Thanks for any insight!
Edit: Here's a minimal working example:
c = 1;
cPlane = 1;
f[i_] := Piecewise[{{1 + i, 0 <= i < 2*g - 4}, {1 - i, i >= 2*g - 4}}]
w[i_, j_] := Piecewise[{{f[i + 1] - f[j], 0 <= j <= i}, {0, j > i}}]
sigma[i_] := f[i] - c*Sum[w[i, j], {j, 0, i}]
fPlane[i_] := Sum[w[i, j], {j, 0, 2 g - 5}]
sigmaPlane[i_] := fPlane[i] - cPlane*Sum[w[i, j], {j, 0, i}]
Refine[FullSimplify[-sigmaPlane[i]/sigma[i], 0 < i && i <= n - 2 && Element[i | g, Integers] && g >= 3]]
sigmaPlane
andsigma
.) $\endgroup$