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 m, n, x, S
from proveit.logic import (Boolean, Implies, And, Forall, Equals, NotEquals,
InSet, SetEquiv, SetOfAll, SubsetEq)
from proveit.numbers import zero, one, Add, Natural, NaturalPos, greater
%begin axioms
zero_in_nats = InSet(zero, Natural)
successor_in_nats = Forall(n, InSet(Add(n, one), Natural), domain=Natural)
The following two axioms will ensure that successors are never repeated.
successor_is_injective = Forall((m, n), Equals(n, m), domain=Natural,
condition=Equals(Add(m, one), Add(n, one)))
zero_not_successor = Forall(n, NotEquals(Add(n, one), zero), domain=Natural)
The induction axiom defines the naturals as only zero and its successors and nothing else.
induction = Forall(S, Implies(And(InSet(zero, S), Forall(x, InSet(Add(x, one), S), domain=S)),
SetEquiv(S, Natural)),
condition=SubsetEq(S, Natural))
(We must be explicit about defining Natural as a genuine set.)
boolean_natural_membership = Forall(x, InSet(InSet(x, Natural), Boolean))
natural_pos_def = Equals(NaturalPos, SetOfAll(n, n, conditions=[greater(n, zero)], domain=Natural))
%end axioms