import proveit
from proveit import A, B, C
from proveit.logic import Not, Equals, NotEquals, TRUE, FALSE, Implies, in_bool, Boolean
%begin demonstrations
"Boolean" is a logical term used to denote a type of variable that has two possible values: True
or False
. Negation is the act of outputing the opposite of the original term.
True to the nature of members of the Boolean set, we can perform operations on True
and False
themselves.
Not(FALSE).prove()
Because we know that there are only two possible values in the Boolean set, the opposite or $\lnot$ of one value must produce the other.
FALSE.prove(assumptions=[Not(TRUE)])
Equals(Not(FALSE), TRUE).prove()
Equals(Not(TRUE), FALSE).prove()
Implies(Not(TRUE),FALSE).prove()
Implicit in the following set of axioms is that $\lnot A$ is in the Boolean set iff $A$ is in Boolean. Otherwise, $\lnot A$ is simply undefined.
These next theorems prove what is implicit in the following axioms.
in_bool(Not(A)).prove(assumptions=[in_bool(A)])
in_bool(Not(Not(A))).prove(assumptions=[in_bool(A)])
in_bool(A).prove(assumptions=[in_bool(Not(A))])
Not(Not(A)).double_negation_equivalence(assumptions=[in_bool(A)]).prove()
Unless specifically defined otherwise, $A$'s default definition is True
. Therefore, since $A$ is True
, we can define $\lnot A$ as False
n_aeq_f = Equals(Not(A), FALSE)
n_aeq_f.prove(assumptions=[A])
Similarly, given $\lnot A$ we can show that $A$ = False
.
AeqF = Equals(A,FALSE)
AeqF.prove(assumptions=[Not(A)])
We can also show the inverse is true.
Not(A).prove(assumptions=[AeqF])
On the other hand, we can also show that $\lnot A$ is $\neq$ to True
because $A$ is equal to True
.
AneqT = NotEquals(A, TRUE)
AneqT.prove(assumptions=[Not(A)])
Similarly, the double negation negates the original negation, providing the original statement.
A.prove(assumptions=[Not(Not(A))])
Again, the inverse is also true.
Not(Not(A)).prove(assumptions=[A])
By going one step further, we can prove that three $\lnot$'s are the same as a single $\lnot$.
Not(Not(Not(A))).prove(assumptions=[Not(A)])
We can also prove the inverse.
Not(A).prove(assumptions=[Not(Not(Not(A)))])
Not(Not(B)).double_negation_equivalence(assumptions=[in_bool(B)])
%end demonstrations