True

True
is the symbol for the Boolean value true.

Background
Background

  • True is the symbol for the Boolean value true. Expressions that can be rigorously established to be true return this symbol. Examples of testing expressions that may return True include Equal, Unequal, SameQ, UnsameQ, Less/Greater/etc., Exists, and quantifier elimination via Resolve. Constructs that can be used to take a different evaluation path depending on if a condition is True or False include If, Which, and Piecewise.
  • The negation Not[True] of True is given by False. The domain consisting of True and False is denoted Booleans.
  • TrueQ is a special case of If that yields True if an expression is explicitly True, and otherwise yields False.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Evaluate a Boolean expression:

In[1]:=
Click for copyable input
Out[1]=

Use a conditional:

In[1]:=
Click for copyable input
Out[1]=

Test a structural property:

In[1]:=
Click for copyable input
Out[1]=

Test a mathematical property:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 1988
(1.0)