[Math] de morgan’s law for greater and less than

discrete mathematicslogic

Suppose that we let $!$ mean not (negation) and let
$a,z,p$ be integer variables. We have the expression.

$$! ( (a>7) \& (z<=p) ) $$

and we can solve it by De Morgan's laws to yield:

$$(a<=7) \text{OR} (z>p)$$

Firstly, is this the correct answer? And secondly, in De Morgan laws, when do we negate the variable it self, like $A$ becomes $A'$, do we negate the variable just in binary variables?

Best Answer

De Morgan's laws are functioning as normal in this situation; it is true that $$\neg((a>7)\wedge(a\leq p))$$ is equivalent to $$(\neg (a>7))\vee (\neg (a\leq p)).$$ Your question is then how we manipulate things like $\neg(a>7)$ - well this is somewhat beyond just De Morgan's laws, since that treats $(a>7)$ just as some proposition that might be true or false, and doesn't care about what it might mean. However, if we, for instance, looked at a number line (or used the properties of orders), we would find that $\neg(a>7)$ is equivalent to changing the direction of the $>$ to be $\leq$ instead - to we get $a\leq 7$. In general, to negate a statement involving order, just change the direction (and whether it's strict (like $<$ and $>$) or non-strict (like $\leq$ and $\geq$)). We don't manipulate the integer variables, since negation of an integer is a very different operation from negation of a boolean.

Related Question