Skip to content

Simplifying And boolean operation removes a condition #25603

@Teskann

Description

@Teskann

Hi,

Simplifying a Piecewise with boolean operations results in the wrong simplification:

Here is what I get from Sympy live shell entering

parse_expr("Piecewise((log(x), (x <= 5) & (x > 3)), (x, True))")

vs

parse_expr("Piecewise((log(x), (x <= 5) & (x > 3)), (x, True))").simplify()

image

As you can see, the simplified expression removes a condition on x: x>3 has disappeared despite it's not implied by x <= 5 (e.g., 0 is less than 5 but not greater than 3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions