Albert
Albert

Reputation: 68160

Simplify SymPy Eq/Equality and Ge/GreaterThan integer expression

I have this SymPy code:

n = Symbol("n", integer=True)
expr = Eq(n, 0) | (n >= 1)

I would expect that expr.simplify() results in n >= 0 but it does not. How can I make this simplification work?


I reported that upstream here.

Upvotes: 1

Views: 263

Answers (1)

smichr
smichr

Reputation: 19047

This is a discontinuous set (the point 0 and all points from 1 and greater) so it can't be simplified. The inequality n >= 0 includes, for example, n = 1/2 which is not part of the given expr.

Upvotes: 1

Related Questions