import proveit
# Prepare this notebook for defining the axioms of a theory:
%axioms_notebook # Keep this at the top following 'import proveit'.
from proveit.logic import Forall, Iff, Equals, And, Distinct, Disjoint, Intersect, EmptySet, NotInSet, Set
from proveit import m, n, y, A, B, X
from proveit.core_expr_types import A_1_to_m, x_1_to_n
from proveit.logic.sets import x_singletons_range
from proveit.numbers import Natural, NaturalPos
%begin axioms
An empty collection of sets are mutually disjoint simply because there are no pairs:
vacuously_disjoint = Disjoint()
Define disjoint
for a pair of sets to mean that the intersection of the pair is the empty set:
disjoint_pair_def = Forall((A, B), Iff(Disjoint(A, B), Equals(Intersect(A, B), EmptySet)))
Define disjoint
(mutually disjoint) through induction: adding a set to a disjoint
collection will maintain disjointness if and only if the new set is disjoint with all of the sets in the original collection:
disjoint_induction = Forall(m, Forall((A_1_to_m, B),
Iff(Disjoint(A_1_to_m, B),
And(Disjoint(A_1_to_m),
Forall(X, Disjoint(X, B),
domain=Set(A_1_to_m)))).with_wrap_after_operator()),
domain=Natural)
Elements being distinct
is the same as their associated singletons being disjoint
:
distinct_def = Forall(n, Forall(x_1_to_n,
Equals(Distinct(x_1_to_n),
Disjoint(x_singletons_range))),
domain=NaturalPos)
%end axioms