4
$\begingroup$

Simplify is very gullible: if it gets a False assumption, it'll believe anything is True:

Simplify[x > y, False]
(* Simplify::fas -- Simplify: Warning: one or more assumptions evaluated to False. *)
(* True *)

Simplify[1 > 2, False]
(* Simplify::fas -- Simplify: Warning: one or more assumptions evaluated to False. *)
(* True *)

This also holds for $Assumptions that turn out to be False (which is how I ran into this problem):

$Assumptions = {x > 0};
Simplify[1 > 2]
(* False *)

x = -1;
Simplify[1 > 2]
(* Simplify::fas -- Simplify: Warning: one or more assumptions evaluated to False. *)
(* True *)

I'm sure there's a reason why this happens (and I'd be curious to hear it), but I find this behavior potentially misleading. Is there a good way to work around this behavior, so that the warning message shows but False assumptions are ignored?

$\endgroup$
7
  • 6
    $\begingroup$ Most likely this is based on logic fundamentals like de Morgan's laws. E.g. Implies[False, a] yields True and so the issue with Simplify turns out no longer to be misleading. $\endgroup$
    – Artes
    Commented Jun 28, 2022 at 0:59
  • 3
    $\begingroup$ You get a warning message telling you this is GIGO. I don't see what more Simplify could do here. Wash your dishes? $\endgroup$ Commented Jun 28, 2022 at 14:57
  • 2
    $\begingroup$ The rule $(F \Rightarrow e) \mapsto T$, as inferred, is applied in Simplify[e, False] only if the expression $e$ (or its parts) is a traditional boolean-valued expression. Yes in Simplify[x + y && x + y, False] but not in Simplify[x + y && x + y // Simplify, False] (because the e here becomes simply x + y). An odd example: Simplify[False + y, False] becomes True + y, and two wrongs Simplify[False + False, False] make a double right (too true!). But these inputs seem nonsensical and of not much real practical importance. $\endgroup$
    – Michael E2
    Commented Jun 28, 2022 at 14:57
  • 2
    $\begingroup$ It is not possible to disregard false assumptions. If your assumptions are {a<b,a>b}, which do you discard? $\endgroup$ Commented Jun 28, 2022 at 15:19
  • 2
    $\begingroup$ @DanielLichtblau Hmm, I guess a general solution is trickier than I thought. Luckily in my context, the problem will be single expressions that are False on their own, which are easily screened out. $\endgroup$
    – Chris K
    Commented Jun 28, 2022 at 15:56

2 Answers 2

6
$\begingroup$

This is the expected behaviour. Think Simplify[q,p] as $p⇒q$. You are evaluating the truth of "$q$ under the premise $p$".

From a false premise, you can get either True or False implications. So $\left(False⇒q\right)$ is a True statement regardless of the value of $q$.

We can build a truth table

Column[
   Row[
      {
        "(",#2,"\[Implies]",#1, ") is ", 
        Simplify[#1,#2]
      }
   ]& @@@ Tuples[{True,False},2]
]

enter image description here

You get the General::fas warning.

"This message is generated when the symbol False is encountered in a position where valid assumptions are expected."

You are been warned that you are starting from a false premise, but you get the expected truth table.

As discussed in the chat, you can see this on Wikipedia under Truth Table on column 11 (Credit to @CarlLange).

$\endgroup$
0
1
$\begingroup$

Thanks to @Artes for the comment explaining the reason. I haven't tested these thoroughly, but as for a workaround:

Simplify[1 > 2, Assumptions -> DeleteCases[$Assumptions, False]]
(* False *)

seems to do the trick in the case of False $Assumptions.

SetOptions[Simplify, Assumptions :> DeleteCases[$Assumptions, False]]

could be a blanket solution, and

If[Cases[$Assumptions, False] != {}, Message[Simplify::fas]];

could provide the warning if desired.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.