예제 #1
0
from proveit.numbers.common import zero, one, two
from proveit import begin_theorems, end_theorems

begin_theorems(locals())

exp_nat_closure = Forall((a, b),
                         InSet(Exp(a, b), NaturalPos),
                         domain=Natural,
                         conditions=[NotEquals(a, zero)])
exp_nat_closure

exp_real_closure = Forall(
    [a, b],
    InSet(Exp(a, b), Real),
    domain=Real,
    conditions=[GreaterThanEquals(a, zero),
                GreaterThan(b, zero)])
exp_real_closure

exp_real_pos_closure = Forall([a, b],
                              InSet(Exp(a, b), RealPos),
                              domain=Real,
                              conditions=[GreaterThan(a, zero)])
exp_real_pos_closure

exp_complex_closure = Forall([a, b],
                             InSet(Exp(a, b), Complex),
                             domain=Complex,
                             conditions=[NotEquals(a, zero)])
exp_complex_closure
예제 #2
0
in_ints_is_bool = Forall(a, InSet(InSet(a, Integer), Boolean))
in_ints_is_bool

not_in_ints_is_bool = Forall(a, InSet(NotInSet(a, Integer), Boolean))
not_in_ints_is_bool

int_within_real = Forall(a, InSet(a, Real), domain=Integer)
int_within_real

int_within_complex = Forall(a, InSet(a, Complex), domain=Integer)
int_within_complex

in_natural_if_non_neg = Forall(a,
                               InSet(a, Natural),
                               domain=Integer,
                               conditions=[GreaterThanEquals(a, zero)])
in_natural_if_non_neg

in_natural_pos_if_pos = Forall(a,
                               InSet(a, NaturalPos),
                               domain=Integer,
                               conditions=[GreaterThan(a, zero)])
in_natural_pos_if_pos

interval_is_int = Forall((a, b),
                         Forall(n, InSet(n, Integer), domain=Interval(a, b)),
                         domain=Integer)
interval_is_int

interval_is_nat = Forall((a, b),
                         Forall(n, InSet(n, Natural), domain=Interval(a, b)),
예제 #3
0
        Abs(a),
        RealPos),
    domain=Complex,
    conditions=[
        NotEquals(
            a,
            zero)])
abs_nonzero_closure

# transferred by wdc 3/11/2020
mod_in_interval_c_o = Forall((a, b), InSet(
    Mod(a, b), IntervalCO(zero, b)), domain=Real)
mod_in_interval_c_o

# transferred by wdc 3/11/2020
abs_is_non_neg = Forall(a, GreaterThanEquals(Abs(a), zero), domain=Complex)
abs_is_non_neg

# transferred by wdc 3/11/2020
abs_not_eq_zero = Forall(
    [a],
    NotEquals(
        Abs(a),
        zero),
    domain=Complex,
    conditions=[
        NotEquals(
            a,
            zero)])
abs_not_eq_zero
예제 #4
0
from proveit.numbers import LessThan, LessThanEquals, GreaterThan, GreaterThanEquals
from proveit.common import x, y, z
from proveit import begin_axioms, end_axioms

begin_axioms(locals())

less_than_equals_def = Forall([x, y],
                              Or(LessThan(x, y), Equals(x, y)),
                              domain=Real,
                              conditions=LessThanEquals(x, y))
less_than_equals_def

greater_than_equals_def = Forall([x, y],
                                 Or(GreaterThan(x, y), Equals(x, y)),
                                 domain=Real,
                                 conditions=GreaterThanEquals(x, y))
greater_than_equals_def

reverse_greater_than_equals = Forall((x, y),
                                     Implies(GreaterThanEquals(x, y),
                                             LessThanEquals(y, x)))
reverse_greater_than_equals

reverse_less_than_equals = Forall((x, y),
                                  Implies(LessThanEquals(x, y),
                                          GreaterThanEquals(y, x)))
reverse_less_than_equals

reverse_greater_than = Forall((x, y), Implies(GreaterThan(x, y),
                                              LessThan(y, x)))
reverse_greater_than
예제 #5
0
begin_axioms(locals())

# Define the set of Natural as, essentially, the minimum set that contains zero and all of its successors;
# that is, n is in Natural iff n is in all sets that contain zero and all
# successors.
naturals_def = Forall(
    n,
    Equals(
        InSet(n, Natural),
        Forall(
            S,
            Implies(
                And(InSet(zero, S), Forall(x, InSet(Add(x, one), S),
                                           domain=S)), InSet(n, S)))))

# Define the length of an ExpressionList inductively.
expr_list_length_def = And(
    Equals(Len(), zero),
    Forall((x_multi, y), Equals(Len(x_etc, y), Add(Len(x_etc), one))))

naturals_pos_def = Forall(n,
                          Iff(InSet(n, NaturalPos), GreaterThanEquals(n, one)),
                          domain=Natural)
naturals_pos_def

integers_def = Equals(Integer,
                      Union(Natural, SetOfAll(n, Neg(n), domain=Natural)))

end_axioms(locals(), __package__)
예제 #6
0
from proveit.numbers import Sub, Natural, NaturalPos, Integer, Real, Complex, Add, Neg, GreaterThan, GreaterThanEquals
from proveit.common import a, b, w, x, y, z, x_etc, y_etc, v_etc, w_etc, z_etc, y_multi
from proveit.numbers.common import zero, one
from proveit import begin_theorems, end_theorems

begin_theorems(locals())

subtract_int_closure = Forall([a, b],
                              InSet(Sub(a, b), Integer),
                              domain=Integer)
subtract_int_closure

subtract_closure_nats = Forall([a, b],
                               InSet(Sub(a, b), Natural),
                               domain=Integer,
                               conditions=[GreaterThanEquals(a, b)])
subtract_closure_nats

subtract_closure_nats_pos = Forall([a, b],
                                   InSet(Sub(a, b), NaturalPos),
                                   domain=Integer,
                                   conditions=[GreaterThan(a, b)])
subtract_closure_nats_pos

subtract_complex_closure = Forall([a, b],
                                  InSet(Sub(a, b), Complex),
                                  domain=Complex)
subtract_complex_closure

subtract_real_closure = Forall([a, b], InSet(Sub(a, b), Real), domain=Real)
subtract_real_closure
예제 #7
0
min_real_pos_closure = Forall((a, b),
                              InSet(Min(a, b), RealPos),
                              domain=RealPos)
min_real_pos_closure

max_real_closure = Forall((a, b), InSet(Max(a, b), Real), domain=Real)
max_real_closure

max_real_pos_closure = Forall((a, b),
                              InSet(Max(a, b), RealPos),
                              domain=RealPos)
max_real_pos_closure

relax_greater_than = Forall([a, b],
                            GreaterThanEquals(a, b),
                            domain=Real,
                            conditions=GreaterThan(a, b))
relax_greater_than

relax_less_than = Forall([a, b],
                         LessThanEquals(a, b),
                         domain=Real,
                         conditions=LessThan(a, b))
relax_less_than

less_than_is_bool = Forall([a, b], InSet(LessThan(a, b), Boolean), domain=Real)
less_than_is_bool

less_than_equals_is_bool = Forall([a, b],
                                  InSet(LessThanEquals(a, b), Boolean),