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 ExprTuple, ExprArray, VertExprArray, ExprRange, IndexedVar
from proveit import a, b, c, d, f, i, j, k, m, n, fab
from proveit.logic import Forall, Equals, And, Or, NotEquals, InSet
from proveit.core_expr_types import \
(a_1_to_i, b_1_to_i, b_1_to_j, c_1_to_i)
from proveit.numbers import zero, one
from proveit.numbers import Natural, NaturalPos, Add, subtract
%begin theorems
array_eq_via_elem_eq = Forall(i, Forall((a_1_to_i, b_1_to_i),
Equals(ExprArray(a_1_to_i), ExprArray(b_1_to_i)),
conditions=[ExprRange(k, Equals(IndexedVar(a, k),
IndexedVar(b, k)),
one, i)]),
domain=NaturalPos)
varray_eq_via_elem_eq = Forall(
i, Forall((a_1_to_i, b_1_to_i),
Equals(VertExprArray(a_1_to_i), VertExprArray(b_1_to_i)),
conditions=[ExprRange(k, Equals(IndexedVar(a, k),
IndexedVar(b, k)),
one, i)]),
domain=NaturalPos)
array_neq_via_any_elem_neq = Forall(
i, Forall((a_1_to_i, b_1_to_i),
NotEquals(ExprArray(a_1_to_i), ExprArray(b_1_to_i)),
condition=Or(ExprRange(k, NotEquals(IndexedVar(a, k),
IndexedVar(b, k)),
one, i))),
domain=NaturalPos)
varray_neq_via_any_elem_neq = Forall(
i, Forall((a_1_to_i, b_1_to_i),
NotEquals(VertExprArray(a_1_to_i), VertExprArray(b_1_to_i)),
condition=Or(ExprRange(k, NotEquals(IndexedVar(a, k),
IndexedVar(b, k)),
one, i))),
domain=NaturalPos)
%end theorems