import proveit
# Prepare this notebook for defining the theorems of a theory:
%theorems_notebook # Keep this at the top following 'import proveit'.
from proveit import f, g, n
from proveit import ExprTuple
from proveit.core_expr_types import x_1_to_n, y_1_to_n, f__x_1_to_n, f__y_1_to_n, g__x_1_to_n
from proveit.logic import Forall, Equals
from proveit.numbers import Natural
%begin theorems
operands_substitution_via_tuple = Forall(
n, Forall((f, x_1_to_n, y_1_to_n),
Equals(f__x_1_to_n, f__y_1_to_n).with_wrap_after_operator(),
condition=Equals(ExprTuple(x_1_to_n), ExprTuple(y_1_to_n))),
domain=Natural)
We can derive operator_substitution
as a special case of proveit.logic.equality.substitution
.
operator_substitution = Forall(n, Forall((f, g, x_1_to_n),
Equals(f__x_1_to_n, g__x_1_to_n),
conditions = [Equals(f, g)]),
domain=Natural)
%end theorems