# Theorems (or conjectures) for the theory of proveit.core_expr_types.expr_arrays¶

In [1]:
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

In [2]:
%begin theorems

Defining theorems for theory 'proveit.core_expr_types.expr_arrays'
Subsequent end-of-cell assignments will define theorems
'%end theorems' will finalize the definitions

In [3]:
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)

array_eq_via_elem_eq (conjecture without proof):

In [4]:
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)

varray_eq_via_elem_eq (conjecture without proof):

In [5]:
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)

array_neq_via_any_elem_neq (conjecture without proof):

In [6]:
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)

varray_neq_via_any_elem_neq (conjecture without proof):

In [7]:
%end theorems

These theorems may now be imported from the theory package: proveit.core_expr_types.expr_arrays