Welcome to Prove-It’s documentation!

proveit Package

Functions

as_expression(truth_or_expression)

Return the argument as Expressions.

as_expressions(\*truth_or_expressions)

Return the arguments as a list of Expressions via as_expression.

auto_equality_prover(past_tense, present_tense)

auto_prover(func)

auto_relation_prover(func)

bundle(expr, bundle_thm[, num_levels])

Given a nested OperationOverInstances, derive or equate an

composite_expression(expressions)

Put the appropriate CompositeExpression wrapper around expressions.

equality_prover(past_tense, present_tense[, …])

@equality_prover works the same way as the @relation_prover decorator except that it also registers the “equality method” in InnerExpr with the past tense and present tense names.

expression_depth(expr)

Returns the depth of the expression tree for the given expression.

extract_var_tuple_indices(indexed_var_tuple)

Given an ExprTuple of only IndexedVar and ExprRange entries, returns an ExprTuple of just the corresponding indices (including ranges of indices and nested ranges of indices).

free_var_ranges(expr[, exclusions])

Return the dictionary mapping Variables to forms w.r.t. ranges of indices (or solo) in which the variable occurs as free (not within a lambda map that parameterizes the base variable). Examples of “forms”: x x_i x_1, …, x_n x_{i, 1}, …, x_{i, n_i} x_{1, 1}, …, x_{1, n_1}, ……, x_{m, 1}, …, x_{m, n_m} For example, (x_1, …, x_n) -> x_1 + … + x_n + x_{n+1} would report {x_{n+1}} for the x entry but not x_1, …, x_n. In another example, (x_1, …, x_n) -> x_1 + … + x_k + x_{k+1} + … + x_{n} would report {x_1, …, x_k, x_{k+1}, …, x_{n}} for the x entry because the masking is not “explicit” and actually depends upon what may be assumed about k.

free_vars(expr)

Returns the set of variables for that are free (unbound) in the given expression. For example, given (x_1, …, x_n) -> x_1 + … + x_{m} n is free. Even though there is ambiguity about the range of indices of x on the right versus the left without knowing m relative to n, lambda maps in Prove-It are not allowed to partially mask a range of parameters (in this example, m>n is not allowed). However, this restriction isn’t enforced until it really matters. When the ranges of x are relabeled or instantiated, then Prove-It will check that this restriction is satisfied. Axioms and theorems must not have any variables that are entirely free.

generate_inner_expressions(expr, inner)

Yield the InnerExpr objects that represent ‘inner’ as an inner expression of ‘expr’.

horiz_var_array(var, start_index_or_indices, …)

maybe_fenced(format_type, inner_formatted, …)

Return the inner_formatted string/latex iff kwargs[‘fence’]=True.

maybe_fenced_latex(inner_latex, \*\*kwargs)

Return inner_latex, wrapped in parentheses iff kwargs[‘fence’]==True.

maybe_fenced_string(inner_str, \*\*kwargs)

Return inner_str, wrapped in parentheses iff kwargs[‘fence’]==True.

prover(func)

@prover is a decorator for methods that are to return a proven judgment valid under “active” (default) assumptions.

relation_prover(func)

@relation_prover is a decorator for methods that are to return a proven judgment valid under “active” (default) assumptions, is a Relation type Expression, and has the original expression (self or self.expr) on the left hand side.

reset()

Clear all references to Prove-It information.

safe_default_or_dummy_var(default_var, …)

safe_dummy_var(\*expressions[, start_index, …])

Return a dummy variable that isn’t contained in any of the given expression and not contained in any of the default assumptions.

safe_dummy_vars(n, \*expressions[, …])

simplified_index(index, \*[, requirements])

simplified_indices(\*indices[, requirements])

single_or_composite_expression(expr_or_exprs)

Put the approriate CompositeExpression wrapper around a list (iterable) or dictionary of Expressions, or simply return the given Expression if it is one.

total_ordering(\*relations[, prove])

Return a conjunction of relations in the total ordering style.

traverse_inner_expressions(expr)

A simple algorithm to yield all inner expressions of an expression, including the expression itself.

unbundle(expr, unbundle_thm[, num_param_entries])

Given a nested OperationOverInstances, derive or equate an

used_literals(expr)

Return all of the used Literals of this Expression, included those in sub-expressions.

used_vars(expr)

Return all of the used Variables of this Expression, included those in sub-expressions.

var_array(var, start_index_or_indices, …)

var_range(var, start_index_or_indices, …)

vert_var_array(var, start_index_or_indices, …)

Classes

ArgumentExtractionError(specifics)

Assumption(expr[, assumptions, …])

Axiom(expr, theory, name, *[, …])

Composite()

The base class for NamedExprs, ExprTuple, and ExprArray.

Composition(*maps[, styles])

A Composition is an Expression that represents the composition of functions (lambda maps).

Conditional(value, condition_or_conditions, *)

A Conditional expression is one that may reduce to its ‘value’ if and only if its ‘condition’ evaluates to TRUE.

ConditionalSet(*conditionals[, styles])

Deduction(consequent_truth, antecedent_expr, *)

DuplicateLiteralError(message)

ExprArray(*rows_or_columns[, styles])

An ExprArray represents a 2-dimensional array.

ExprRange(parameter, body[, start_index, …])

An ExprRange expression represents a range of “element” expressions within a containing ExprTuple.

ExprTuple(*expressions[, styles])

An ExprTuple is a composite Expression composed of an ordered list of member Expression “entries”.

ExprTupleError(msg)

Expression(core_info[, sub_expressions])

Function(operator[, operand_or_operands, …])

A Function is an Operation that will format as a function: f(x), Q(x, y), etc.

Generalization(instance_truth, …[, …])

GeneralizationFailure(expr, assumptions, message)

ImproperReplacement(orig_expr, repl_map, message)

IndexedVar(var, index_or_indices, *[, styles])

An IndexedVar Expression expresses a Variable or nested IndexedVar, representing an ExprTuple (or ExprArray which is really just an ExprTuple of ExprTuples), being indexed to yield an element. The indices are typically parameters of containing ExprRanges, or additively shifted versions of such parameters. For example, (x_{1, 1+1} + … + x_{1, j+1} + … + x_{1, n+1}) * … * (x_{i, 1+1} + … + x_{i, j+1} + … + x_{i, n+1}) * … * (x_{m, 1+1} + … + x_{m, j+1} + … + x_{m, n+1}) is represented by a doubly-nested ExprRange using the IndexedVar x_{i, j+1}.

InnerExpr(top_level[, inner_expr_path, …])

Represents an “inner” sub-expression of a particular “top_level” Expression or Judgment.

InnerExprGenerator(expr)

Iterator for InnerExpr objects of a given top-level expression.

Instantiation(orig_judgment, …[, …])

An Instantiation proof step eliminates some number of nested Forall operations and simultaneously replaces Variables with Expressions according to the replacement map (repl_map).

InstantiationFailure(original_judgment, …)

InvalidAssumptions()

Judgment(expression, assumptions, *[, …])

Label(string_format[, latex_format, …])

Label is the base class for the Variable, Literal, and Multi_variable expr classes (Label is not itself an expr class).

Lambda(parameter_or_parameters, body, *[, …])

A lambda-function Expression.

LambdaApplicationError(parameters, body, …)

Literal(string_format[, latex_format, …])

A Literal expresses contextual meaning.

MakeNotImplemented(expr_sub_class)

ModusPonens(implication_expr[, assumptions, …])

ModusPonensFailure(expr, assumptions, message)

NamedExprs(*items[, styles])

An NamedExprs is a composite expr that maps strings to Expressions.

Operation(operator[, operand_or_operands, …])

OperationError(message)

OperationOverInstances(operator, …[, …])

OperationOverInstances description: TODO

ParameterCollisionError(parameters, main_msg)

ParameterMaskingError(msg)

Lambda’s are not allowed to mask a range of parameters while the body contains parameters outside of this range (partial masking).

ParameterRelabelingError(expr, relabel_map)

Proof(proven_truth, required_truths[, …])

ProofFailure(expr, assumptions, message)

RangeInstanceError(msg)

SimplificationDirectives(**kwargs)

SimplificationDirectives are used to specify the directives to use during simplification (or shallow_simplification) that are particular to each Expression class.

StyleOptions(expr)

An Object for displaying the valid style options of an Expression.

Theorem(expr, theory, name, *[, …])

Theory([path, active_folder, owns_active_folder])

A Theory object provides an interface into the __pv_it database for access to the common expressions, axioms, theorems and associated proofs of a Prove-It theory.

TheoryException(message)

TheoryPackage(name, filename, attr_dict)

Used in __init__.py modules of theory packages for accessing common expressions, axioms, and theorems of the package.

TransRelUpdater(expr[, assumptions])

Transitive relation updater: A convenient class for updating a transitive relation (equality, less, subset, etc.) by adding relations that modify the relation via transitivity.

TransitiveRelation(operator, normal_lhs, …)

Base class for generic transitive relations.

TransitivityException(expr, assumptions, message)

UnsatisfiedPrerequisites(msg)

UnusableProof(proving_theorem, unusable_proof)

Variable(string_format[, latex_format, …])

A Variable is an interchangeable label.

VertExprArray(*columns[, styles])

An ExprArray represented in column-major order.

proveit.core_expr_types Package

Classes

Len(operands, *[, styles])

TheoryPackage(name, filename, attr_dict)

Used in __init__.py modules of theory packages for accessing common expressions, axioms, and theorems of the package.

proveit.logic Package

Functions

compose(\*expressions, \*\*defaults_config)

Returns [A and B and …], the And operator applied to the collection of given arguments, derived from each separately.

conclude_via_implication(consequent, …)

Perform a breadth-first search of implications going in reverse from the consequent until reaching an antecedent that has been proven.

deduce_equal_or_not(lhs, rhs, …)

Prove and return that lhs=rhs or lhs≠rhs or raise an UnsatisfiedPrerequisites or NotImplementedError if neither of these is readily known.

evaluate_falsehood(expr, \*\*defaults_config)

Attempts to prove that the given expression equals FALSE under the given assumptions via disproving the expression.

evaluate_truth(expr, \*\*defaults_config)

Attempts to prove that the given expression equals TRUE under the given assumptions via proving the expression.

evaluation_or_simplification(expr[, …])

Return a nontrivial evaluation of the given expression if possible; otherwise return a nontrivial simplification if possible.

in_bool(\*elements)

is_irreducible_value(expr)

not_proper_superset(A, B)

Return the expression representing (A not_proper_superset B), internally represented as (B not_proper_subset A) but with a style that reverses the direction.

not_superset_eq(A, B)

Return the expression representing (A not_superset_eq B), internally represented as (B not_subset_eq A) but with a style that reverses the direction.

proper_superset(A, B)

Return the expression representing (A superset B), internally represented as (B subset A) but with a style that reverses the direction.

superset_eq(A, B)

Return the expression representing (A superset_eq B), internally represented as (B subset_eq A) but with a style that reverses the direction.

Classes

And(*operands[, styles])

Bijections(domain, codomain, *[, styles])

A set of functions from a domain to a codomain that are one-to-one and onto.

BooleanSet(*[, styles])

Card(domain, *[, styles])

CartExp(base, exponent, *[, styles])

CartExp represents an exponentiation of a set by a positive, natural number to denote repeated Cartesion products.

CartProd(*operands[, styles])

A CartProd represents the Cartesian product of sets to produce a new set.

ClassMembership(element, domain, *[, expr])

ClassNonmembership(element, domain, *[, expr])

Base class for any ‘nonmembership object’ return by a domain’s ‘nonmembership_object’ method.

Difference(A, B, *[, styles])

Disjoint(*sets[, styles])

The Disjoint operation defines a property for a collection of sets.

Distinct(*elements[, styles])

The Distinct operation defines a property for any collection.

Equals(a, b, *[, styles])

EvaluationError(expr[, assumptions])

Exists(instance_param_or_params, …[, …])

FalseLiteral(*[, styles])

Forall(instance_param_or_params, …[, …])

Functions(domain, codomain, *[, styles])

A set of functions from a domain to a codomain.

Iff(A, B, *[, styles])

Image(elem_function, set_of_elems, *[, styles])

Represents the image of a set under a function (operator) which is the set obtained by applying the function to each element of the original set.

Implies(antecedent, consequent, *[, styles])

InClass(element, domain, *[, operator, styles])

Class membership denotes a collection of mathmematical objects that satisfy a certain common property.

InSet(element, domain, *[, styles])

Set membership is a special case of class membership, so we’ll derive from InClass for code re-use.

Injections(domain, codomain, *[, styles])

A set of functions from a domain to a codomain that are one-to-one and onto.

Intersect(*operands[, styles])

IntersectAll(instance_param_or_params, …)

InvImage(elem_function, *[, styles])

Represents a function (operator) that may be applied to a set or tuple (ordered set) for applying the inverse of a function to each element.

IrreducibleValue()

Not(A, *[, styles])

NotEquals(a, b, *[, styles])

NotExists(instance_param_or_params, …[, …])

NotInClass(element, domain, *[, operator, …])

NotInClass denotes the logical negation of class membership (see InClass).

NotInSet(element, domain, *[, styles])

Set nonmembership is a special case of class nonmembership, so we’ll derive from NotInClass for code re-use.

NotProperSubset(A, B, *[, styles])

NotSubsetEq(A, B, *[, styles])

Or(*operands[, styles])

PowerSet(operand, *[, styles])

ProperSubset(A, B, *[, styles])

Class to represent proper subset relation, such as A proper_subset B, to represent the claim that any element in set A is also in set B, while B also has at least one element not in set A.

Set(*elems[, styles])

Defines an enumerated set (i.e.

SetEquiv(a, b, *[, styles])

Class to capture the membership equivalence of 2 sets A and B.

SetMembership(element, domain)

SetNonmembership(element, domain)

SetNotEquiv(a, b, *[, styles])

Class to capture the LACK of membership equivalence of 2 sets A and B.

SetOfAll(instance_param_or_params, …[, …])

SimplificationError(message)

StrictSubset

alias of proveit.logic.ProperSubset

SubsetEq(A, B, *[, styles])

SubsetProper

alias of proveit.logic.ProperSubset

Surjections(domain, codomain, *[, styles])

A set of functions from a domain to a codomain that are one-to-one and onto.

TheoryPackage(name, filename, attr_dict)

Used in __init__.py modules of theory packages for accessing common expressions, axioms, and theorems of the package.

TrueLiteral(*[, styles])

Union(*operands[, styles])

UnionAll(instance_param_or_params, …[, …])

UniqueExists(instance_param_or_params, …)

proveit.numbers Package

Functions

complex_polar_coordinates(expr, \*[, …])

Given an expression, expr, of the complex number polar form,

compose_fraction(numerator, denominator)

Return the expression representing a fraction making obvious simplifications if the denominator is one or if either/both the numerator/denominator are fractions.

compose_product(\*factors)

Return an expression representing the product of the given factors using obvious simplifications: return ‘one’ if there are no factors, return the single factor if there is only 1, return ‘zero’ if there are any zeros, and combine fractions.

deduce_as_mon_dec_func(fxn, \*[, domain, strict])

Prove that the Lambda-map specified by fxn is contained in the set of monotonically-decreasing functions defined over the domain.

deduce_in_number_set(expr, number_set, …)

Prove that ‘expr’ is an Expression that respresents a number in the given ‘number_set’.

deduce_not_equal_numeric_rationals(lhs, rhs, …)

Assuming a and b are numeric rationals, prove and return that a ≠ b.

deduce_number_set(expr, \*\*defaults_config)

Prove the most restrictive standard number set membership of the given expression.

dist_add(\*terms)

Returns the distributed sum of expression.

dist_subtract(a, b)

Returns the distributed a-b expression.

exp(exponent, \*[, styles])

exp2pi_i(\*exp_factors)

frac(numer, denom)

greater(a, b)

Return an expression representing a > b, internally represented as b < a but with a style that reverses the direction.

greater_eq(a, b)

Return an expression representing a >= b, internally represented as b <= a but with a style that reverses the direction.

is_numeric_int(expr)

Return True iff the ‘expr’ represents an explicit, numeric integer.

is_numeric_natural(expr)

Return True iff the ‘expr’ represents an explicit, numeric natural number.

is_numeric_rational(expr)

Return True iff ‘expr’ represents an explicit, numeric rational number (as a numeric integer or fraction of numeric integers with a nonzero denominator).

less_eq_numeric_ints(a, b)

Return True iff a ≤ b.

less_eq_numeric_rationals(a, b)

Return True iff a ≤ b.

less_numeric_ints(a, b)

Return True iff a < b.

less_numeric_rationals(a, b)

Return True iff a < b.

negated(expr)

Returns the negated form of this expression.

not_equal_numeric_rationals(a, b)

Return True iff a and b are numeric rational expressions that are not equal to each other.

num(x)

number_ordering(\*relations)

Return a conjunction of number ordering relations with a total-ordering style; for example, a < b <= c = d < e

numeric_rational_ints(expr)

Return the integer numerator and denominator of a numeric rational.

quick_simplified_index(expr)

Return a simplified version of this expression with a quick-n-dirty approach suitable for additively shifted and/or negated integer indices and nested versions thereof.

readily_factorable(term, factor)

Return True iff the ‘factor’ can obviously be factors out of ‘term’.

readily_provable_number_set(expr, \*[, …])

Return the most restrictive number set that the given expression may readily be proven to be within.

remove_common_factors(expr_A, expr_B)

Return the portion of expr_A that remains after removing the factors that are in common with expr_B.

simplified_numeric_rational(numer_int, denom_int)

Given a numerator and a denominator as integers, return an Expression of the equivalent irreducible rational.

sqrd(base)

Special function for squaring root version of an exponential.

sqrt(base)

Special function for square root version of an exponential.

standard_number_set(given_set, …)

For the number set given_set (which might, for example, be a continuous interval, an integer interval, etc.), return the most restrictive number set (such as Real, RealPos, Integer, etc.) that is already known to contain the given_set, or return the original given_set if no such standard set inclusion is already known.

subtract(a, b)

Return the a-b expression (which is internally a+(-b)).

union_number_set(\*sets)

Utility function to produce a minimal standard number set that contains all the given number sets, if possible.

unit_length_complex_polar_angle(expr, \*[, …])

Given an expression, expr, of the complex number polar form,

Classes

Abs(A, *[, styles])

Add(*operands[, styles])

BinarySequence(*bits[, styles])

Ceil(A, *[, styles])

Conjugate(num, *[, styles])

The complex conjugate of a + i b for real numbers a and b is equal to a - i b.

DecimalSequence(*digits[, styles])

Div(numerator, denominator, *[, styles])

Divides(x, …)

(equivalently, x is a factor of y, y is a multiple of x, or y/x is an integer).

DividesProper(a, b, *[, styles])

DividesProper(x, y) represents the claim that x divides y (i.e.

Exp(base, exponent, *[, styles])

An Expression class to represent an exponentiation.

Floor(A, *[, styles])

GCD(a, b, *[, styles])

Integrate(index_or_indices, integrand, *[, …])

Interval(lower_bound, upper_bound, *[, styles])

IntervalCC(lower_bound, upper_bound, *[, styles])

IntervalCO(lower_bound, upper_bound, *[, styles])

IntervalOC(lower_bound, upper_bound, *[, styles])

IntervalOO(lower_bound, upper_bound, *[, styles])

KroneckerDelta(i, j, *[, styles])

The Kronecker delta function of i and j is equal to 1 if i=j or equals 0 otherwise.

Less(lhs, rhs, *[, styles])

LessEq(a, b, *[, styles])

Log(base, antilog, *[, styles])

Max(*operands[, styles])

Min(*operands[, styles])

Mod(dividend, divisor, *[, styles])

ModAbs(value, divisor, *[, styles])

MonDecFuncs(domain, *[, codomain, styles, …])

MonDecFuncs denotes the set of monotonically-decreasing functions on some domain D and codomain C and is meant to capture and articulate properties of functions such as 1/x^2 on (0, infty).

Mult(*operands[, styles])

Neg(A, *[, styles])

NumberOperation(operator, operand_or_operands, *)

Base class for number operation (i.e.

NumberOrderingRelation(operator, lhs, rhs, …)

Numeral(n[, string_format, latex_format, styles])

Prod(indices, summand, domain, *[, …])

RealInterval(operator, lower_bound, …[, …])

Base class for all permutations of closed and open intervals.

Round(A, *[, styles])

Sum(index_or_indices, summand, *[, domain, …])

TheoryPackage(name, filename, attr_dict)

Used in __init__.py modules of theory packages for accessing common expressions, axioms, and theorems of the package.

proveit.physics Package

Indices and tables