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 x, y
from proveit.logic import Equals, Forall, InSet
from proveit.numbers import (one, two, Abs, Ceil, Floor, frac, greater_eq,
Integer, LessEq, Real, Round, subtract)
%begin axioms
ceil_is_an_int = Forall(
x,
InSet(Ceil(x), Integer),
domain=Real)
ceil_of_x_greater_eq_x = Forall(
x,
greater_eq(Ceil(x), x),
domain=Real)
ceil_of_x_less_eq = Forall(
(x, y),
LessEq(Ceil(x), y),
domains=[Real, Integer],
conditions=[greater_eq(y, x)])
floor_is_an_int = Forall(
x,
InSet(Floor(x), Integer),
domain=Real)
floor_of_x_less_eq_x = Forall(
x,
LessEq(Floor(x), x),
domain=Real)
floor_of_x_greater_eq = Forall(
(x, y),
greater_eq(Floor(x), y),
domains=[Real, Integer],
conditions=[LessEq(y, x)])
round_is_an_int = Forall(
x,
InSet(Round(x), Integer),
domain=Real)
round_is_closest_int = Forall(
(x, y),
LessEq(Abs(subtract(Round(x), x)), Abs(subtract(y, x))),
domains=[Real, Integer])
# Leaving this instantiation for futher consider later;
# see next cell for current round_up axiom
# round_up = Forall(
# x,
# greater_eq(Round(x), x),
# domain=Real,
# conditions=[Equals(Abs(subtract(Round(x), x)), frac(one, two))])
round_up = Forall(
x,
Equals(Round(x), Ceil(x)),
domain=Real,
conditions=[Equals(subtract(x, Floor(x)), subtract(Ceil(x), x))])
%end axioms