# 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[275]:= Simplify[Total[p[_]]]

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

In[276]:= Simplify[Total[p[7]]]

Out[276]= p0[7] + p1[7] + p2[7] + p3[7]


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[7]], Total[p[_]] == 1] works for me and gives 1. Also for Simplify.
– Alx
Commented Jul 19, 2019 at 11:37
• But how can I set Total[p[_]] = 1 everywhere, in the whole notebook? Commented Jul 19, 2019 at 12:06
• I checked with fresh starded Mathematica, all your commands work for me and give 1 as expected.
– Alx
Commented Jul 19, 2019 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 Commented Jul 19, 2019 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 Commented Jul 19, 2019 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[7]]]


1