5

I am interested in the most efficient way to impose assumptions on indexed variables. In the following stylized problem, the following code

a := f[1] > 0 && f[2] > 0 && f[1] < 1 && f[2] < 1 && f[1] + f[2]== 1;
Simplify[f[1] + f[2] <= 0, a]

Obviously returns false. Now I want to impose assumptions in a "more general" way. I have tried many different ways and didn't find a convincing solution.

1.) The function/pattern approach.

a := f[i_Integer] > 0 && f[i_Integer] < 1;
Simplify[f[1] + f[2] <= 0, a]

Returns the input. This is really surprising since the assumptions seem to work for a similar example,

a := f[i_Integer] > 0 && f[i_Integer] < 1;
Simplify[f[1]<= 0, a]

again, returning false. This behavior seems to be, if not wrong, then at least very annoying. Even stranger

a := f[i_Integer] > 0 && f[i_Integer] < 1;
Simplify[f[1]<0, a]

again (???) returns the input.

From a mathematical standpoint, this is complete nonsense. I would like to work with conditionals in the assumptions of the form f[x_Integer /; x < 10]<0 or f[x_,y_]<=1/2/; x < y, a flexible approach is, therefore necessary. Using patterns in Assumptions seems to be somehow problematic, e.g. ($Assumptions = _ ∈ Reals results in incorrect simplification of ConjugateTranspose[..]).

How can I impose such variable assumptions in an efficient way?

Should I work with subscripts? This seems to be problematic, as demonstrated here:(Assumptions about list elements). Symbolizing seems a problem, too: (How to treat indexed variables as Reals? Can they be symbolized?).

I am also interested in the pros and cons of different ways to work with variable indexes. Is there a universally accepted dominant way?

oyy
  • 187
  • 7

1 Answers1

1

What about this:

Clear[a];
a[i_] := f[i] > 0 && f[i] < 1;

With[{i = 3}, Simplify[f[i] > 5, a[i]]]

(* False *)

??

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96
  • Thank you, If I got you right, this approach works by fixing i in every evaluation I will use later on. This doesn't seem to be an efficient way to set assumptions for indexed variables - I am interested in specifying assumptions once, and proceeding with what I call "normal coding". My suggestion to impose assumptions in 1.) seems to work partially - what do I miss there? – oyy Feb 13 '23 at 15:37
  • @oyy "If I got you right, this approach works by fixing i in every evaluation..." Yes and no. First, you define a[i]. This you do once during the session. Second, you use Simplify or Reduce with the already defined a[i]. You may specify the value of i and may not. It works also with a symbol there. – Alexei Boulbitch Feb 13 '23 at 16:53