# Many global assumptions

I will do some calculations with probability distribution p[t] - which is a vector and each term corresponds to a probability of some event. Accordingly the sum over the terms in p[t] has to be one, for all times t. I have tried to implement it in such a way

p[t_] := {p0[t], p1[t], p2[t], p3[t]};
$$Assumptions = Total[p[_]] == 1;$$Assumptions = p[_] \[Element] PositiveReals


But it doesn't work, as

In:= Simplify[Total[p[_]]]

Out= p0[_] + p1[_] + p2[_] + p3[_]

In:= Simplify[Total[p]]

Out= p0 + p1 + p2 + p3


And I would expect 1 as the output, in both cases. Thanks the comments I know that the problem is the second assumption, which "delate" the first one. How can I include many global assumptions in the different parts of my notebook (as I have many assumptions concerning different things which are defined at different places)?

• Refine[Total[p], Total[p[_]] == 1] works for me and gives 1. Also for Simplify. – Alx Jul 19 at 11:37
• But how can I set Total[p[_]] = 1 everywhere, in the whole notebook? – Agnieszka Jul 19 at 12:06
• I checked with fresh starded Mathematica, all your commands work for me and give 1 as expected. – Alx Jul 19 at 12:15
• I have used Clear["Global*"] and run it once again and have still the same problem. I have Mathematica 12.0.0 – Agnieszka Jul 19 at 12:18
• Clear["Global*"] does not remove $Assumptions. Save your nb and Quit Kernel, then start Local Kernel again, and check commands. I did this and all is working. – Alx Jul 19 at 12:35 ## 1 Answer You can append new assumptions to $Assumptions using AppendTo:

p[t_] := {p0[t], p1[t], p2[t], p3[t]};

$$Assumptions = {Total[p[_]] == 1}; AppendTo[$$Assumptions , p[_] ∈ PositiveReals];

Simplify[Total[p[_]]]


1

Simplify[Total[p]]


1