import proveit
# Prepare this notebook for defining the common expressions of a theory:
%common_expressions_notebook # Keep this at the top following 'import proveit'.
from proveit import ExprRange, IndexedVar
from proveit import a, b, i, k, n, x, y, U, V, W
from proveit.core_expr_types import a_k, x_k
from proveit.logic import Or, Set, Difference, NotEquals
from proveit.numbers import zero, one
from proveit.linear_algebra import VecAdd, VecZero, ScalarMult
%begin common
A binary linear combination:
binary_lin_comb_ax_by = VecAdd(ScalarMult(a, x), ScalarMult(b, y))
A general linear combination:
lin_comb_axn = VecAdd(ExprRange(k, ScalarMult(a_k, x_k), one, n))
At least one $a_i$ is not zero
some_nonzero_a = Or(ExprRange(k, NotEquals(a_k, zero), one, n))
%end common