import proveit
# Prepare this notebook for defining the axioms of a theory:
%axioms_notebook # Keep this at the top following 'import proveit'.
from proveit import ExprTuple, ExprRange
from proveit import a, b, c, d, f, i, j, m, n, fab
from proveit.logic import Forall, Equals, And, NotEquals, InSet
from proveit.core_expr_types import Len
from proveit.core_expr_types import \
(a_1_to_i, a_1_to_ip1, b_1_to_i, b_1_to_j, b_1_to_ip1, c_1_to_i, a_ip1, b_ip1,
x_1_to_n, y_1_to_n, tuple_len_incr_equiv, fi, fj, f_jp1,
f_i_to_j, f_i_to_jp1, f__x_1_to_n, f__y_1_to_n, iter_ext_equiv)
from proveit.numbers import zero, one
from proveit.numbers import Natural, NaturalPos, Add, subtract
%begin axioms
tuple_len_0 = Equals(Len([]), zero)
tuple_len_incr = Forall(i, Forall((a_1_to_i, b),
Equals(Len([a_1_to_i, b]),
Add(i, one))),
domain = Natural)
tuple_eq_def = Forall(i, Forall((a_1_to_i, b, c_1_to_i, d),
Equals(Equals([a_1_to_i, b], [c_1_to_i, d]),
And(Equals([a_1_to_i], [c_1_to_i]),
Equals(b, d))) \
.with_wrap_after_operator()),
domain = Natural)
tuple_neq_with_diff_len = Forall(
(i, j), Forall((a_1_to_i, b_1_to_j),
NotEquals([a_1_to_i], [b_1_to_j])),
domain=Natural,
condition=NotEquals(i, j))
empty_range_def = Forall((f, i, j), Equals(ExprTuple(f_i_to_j),
ExprTuple()),
conditions=[Equals(Add(j, one), i)])
range_extension_def = Forall((f, i, j), iter_ext_equiv,
conditions=[InSet(Len([f_i_to_j]),
Natural)])
%end axioms