import proveit
# Prepare this notebook for defining the axioms of a theory:
%axioms_notebook # Keep this at the top following 'import proveit'.
from proveit.logic import Equals, NotEquals, Not, Forall, Implies, And, in_bool
from proveit import f, x, y, z, fx, fy
%begin axioms
By definition, two expressions are either equal or not (though one may not always be able to know which it is):
equality_in_bool = Forall((x, y), in_bool(Equals(x, y)))
Equality is transitive (two things equal to the same thing must be equal to each other):
equals_transitivity = Forall((x, y, z), Equals(x, z), conditions=[Equals(x, y), Equals(y, z)])
Equality is reflexive (everything is equal to itself):
equals_reflexivity = Forall(x, Equals(x, x))
Equality is symmetric (it is a mutual relationship):
equals_symmetry = Forall((x, y), Equals(Equals(y, x), Equals(x, y)))
$\neq$ is defined as the negation of $=$:
not_equals_def = Forall((x, y), Equals(NotEquals(x, y), Not(Equals(x, y))))
When two things are equal, one may be substituted the other within any expression:
substitution = Forall((f, x, y), Equals(fx, fy), conditions=Equals(x, y))
Also see the proveit.core_expr_types.operation.operands_substitution
and proveit.core_expr_types.lambda_maps.lambda_substitution
axioms. Also note that while it would seem that proveit.logic.equality.substitution
could be derived from proveit.core_expr_types.operation.operands_substitution
, that derivation would require proveit.logic.equality.substitution
(circularly) to be able to prove that $\{x = y\} \vdash (x) = (y).$
%end axioms