# Why are some of my assumptions ignored?

In my opinion Mathematica should be able to further calculate and simplify the output of G1[...].

g[z_, A_, e_, b_] :=
Assuming[A > b/2 && z \[Element] Reals && A \[Element] Reals &&
b > 0 && e >= 0 && b \[Element] Reals && e \[Element] Reals &&
z > A - b/2 + e && z < A + b/2 + e,
PDF[UniformDistribution[{A + e - b/2, A + e + b/2}], z]]
G[z_, A_, e_, b_] :=
Assuming[A > b/2 && z \[Element] Reals && A \[Element] Reals &&
b > 0 && e >= 0 && b \[Element] Reals && e \[Element] Reals &&
z > A - b/2 + e && z < A + b/2 + e,
CDF[UniformDistribution[{A + e - b/2, A + e + b/2}], z]]

H10[A_, b_, y_, s_] :=
Assuming[A > b/2 && y ∈ Reals && A ∈ Reals &&
b > 0 && b ∈ Reals && y < A + 1 + b/2 &&
y > A - b/2 + 1 && s > A - b/2 && s < A + b/2,
G[s, A, 0, b]/G[y, A, 1, b]] // FullSimplify

H11[A_, b_, y_, s_] :=
Assuming[A > b/2 && y ∈ Reals && A ∈ Reals &&
b > 0 && b ∈ Reals && y > A + 1 - b/2 &&
y < A + 1 + b/2 && s > A + 1 - b/2 && s < A + 1 + b/2,
G[s, A, 1, b]/G[y, A, 1, b]] // FullSimplify

G1[A_, b_, y_, p0h_, p0l_, c1_] =
Assuming[A > b/2 && y ∈ Reals && A ∈ Reals &&
b > 0 && f ∈ Reals && e ∈ Reals &&
b ∈ Reals && y > A + 1 - b/2 && y < A + 1 + b/2,
Integrate[g[y, A, 1, b]*1/2 (
p0h*
Integrate[H10[A, b, y, s], {s, A + 0 - b/2, y}] + (1 - p0h)*
Integrate[H11[A, b, y, s], {s, A + 1 - b/2, y}] +
p0l*
Integrate[H10[A, b, y, s], {s, A + 0 - b/2, y}] + (1 - p0l)*
Integrate[H11[A, b, y, s], {s, A + 1 - b/2, y}]), {y,
A + 1 - b/2, A + 1 + b/2}] - c1] // FullSimplify I think I clearly told Mathematica in G1[...] that A<b/2 && b>0, but somehow it did not use it in FullSimplify.

In my opinion Mathematica should give me a closed form expression without any cases inside.

Did I misuse Assuming or am I missing something else?

• Take a look at what you are trying to simplify: G[s, A, 0, b]/G[y, A, 1, b]. This term is a ratio of two piecewise functions, one is a function of s and one a function of y. What possible simplification is there? Jul 7, 2019 at 21:17
• Note that Assuming[a, e] affects only the evaluation of e if e contains a function that applies \$Assumptions. However, H10, H11, and G1 are of the form Assuming[a, e] // FullSimplify, so the assumptions a will not be applied by FullSimplify; the assumptions in H10 and H11 will be applied in G1 by Integrate and FullSimplify (although the assumptions in G1 will be applied by Integrate only. It's not clear just from reading the question if this is what you want or not -- that is, which assumptions you think are being ignored. PiecewiseExpand might help. Jul 7, 2019 at 21:54
• @bills The first piecewise function should reduce to simply 1/b. PiecewiseExpand will do this, if given the appropriate assumptions. Jul 8, 2019 at 0:32
• Thx, Michael. I updated my question and I hope it is more clear, now. Jul 8, 2019 at 13:33
• Welcome! To make the most of Mma.SE start by taking the tour now. It always help us to help you when you write an excellent question. Edit if improvable, show due diligence, pay attention to the comments, you still have FullSimplify outside Assuming! Doesn't that solves your problem? As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. Why not choosing a meaningful username? Jul 8, 2019 at 14:06

As pointed out by @Michael E2, you must use Assuming[a, FullSimplify[b]] and not FullSimplify[Assuming[a, b]] if you want FullSimplify to use the assumptions.

g[z_, A_, e_, b_] :=
PDF[UniformDistribution[{A + e - b/2, A + e + b/2}], z];
G[z_, A_, e_, b_] :=
CDF[UniformDistribution[{A + e - b/2, A + e + b/2}], z];

H10[A_, b_, y_, s_] := Assuming[
A > b/2 && y ∈ Reals && A ∈ Reals && b > 0 && b ∈ Reals && y < A + 1 + b/2 && y > A - b/2 + 1 && s > A - b/2 && s < A + b/2,
FullSimplify[G[s, A, 0, b]/G[y, A, 1, b]]
]

H11[A_, b_, y_, s_] := Assuming[
A > b/2 && y ∈ Reals && A ∈ Reals && b > 0 && b ∈ Reals && y > A + 1 - b/2 && y < A + 1 + b/2 && s > A + 1 - b/2 && s < A + 1 + b/2,
FullSimplify[
G[s, A, 1, b]/G[y, A, 1, b]]
]

Assuming[A > b/2 && y ∈ Reals && A ∈ Reals && b > 0 && f ∈ Reals && e ∈ Reals && b ∈ Reals && y > A + 1 - b/2 && y < A + 1 + b/2,
FullSimplify[
Integrate[
g[y, A, 1, b]*1/
2 (p0h*
Integrate[H10[A, b, y, s], {s, A + 0 - b/2, y}] + (1 - p0h)*
Integrate[H11[A, b, y, s], {s, A + 1 - b/2, y}] +
p0l*Integrate[
H10[A, b, y, s], {s, A + 0 - b/2, y}] + (1 - p0l)*
Integrate[H11[A, b, y, s], {s, A + 1 - b/2, y}]), {y,
A + 1 - b/2, A + 1 + b/2}] - c1]
] 