logo

Expression of type Conditional

from the theory of proveit.numbers.exponentiation

In [1]:
import proveit
# Automation is not needed when building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_expr # Load the stored expression as 'stored_expr'
# import Expression classes needed to build the expression
from proveit import Conditional, a, m
from proveit.core_expr_types import b_1_to_m
from proveit.logic import Equals, Forall, InSet, NotEquals
from proveit.numbers import Add, Complex, Exp, NaturalPos, Real, zero
from proveit.numbers.exponentiation import prod_a_raise_bi__1_to_m
In [2]:
# build up the expression from sub-expressions
expr = Conditional(Forall(instance_param_or_params = [a, b_1_to_m], instance_expr = Equals(prod_a_raise_bi__1_to_m, Exp(a, Add(b_1_to_m))), domains = [Complex, Real], condition = NotEquals(a, zero)), InSet(m, NaturalPos))
expr:
In [3]:
# check that the built expression is the same as the stored expression
assert expr == stored_expr
assert expr._style_id == stored_expr._style_id
print("Passed sanity check: expr matches stored_expr")
Passed sanity check: expr matches stored_expr
In [4]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\left\{\forall_{a \in \mathbb{C},\left(b_{1} \in \mathbb{R}\right), \left(b_{2} \in \mathbb{R}\right), \ldots, \left(b_{m} \in \mathbb{R}\right)~|~a \neq 0}~\left(\left(a^{b_{1}} \cdot  a^{b_{2}} \cdot  \ldots \cdot  a^{b_{m}}\right) = a^{b_{1} +  b_{2} +  \ldots +  b_{m}}\right) \textrm{ if } m \in \mathbb{N}^+\right..
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
condition_delimiter'comma' or 'and'commacomma('with_comma_delimiter', 'with_conjunction_delimiter')
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Conditionalvalue: 1
condition: 2
1Operationoperator: 3
operand: 6
2Operationoperator: 36
operands: 5
3Literal
4ExprTuple6
5ExprTuple45, 7
6Lambdaparameters: 8
body: 9
7Literal
8ExprTuple46, 39
9Conditionalvalue: 10
condition: 11
10Operationoperator: 12
operands: 13
11Operationoperator: 14
operands: 15
12Literal
13ExprTuple16, 17
14Literal
15ExprTuple18, 19, 20
16Operationoperator: 21
operands: 22
17Operationoperator: 41
operands: 23
18Operationoperator: 36
operands: 24
19ExprRangelambda_map: 25
start_index: 44
end_index: 45
20Operationoperator: 26
operands: 27
21Literal
22ExprTuple28
23ExprTuple46, 29
24ExprTuple46, 30
25Lambdaparameter: 50
body: 31
26Literal
27ExprTuple46, 32
28ExprRangelambda_map: 33
start_index: 44
end_index: 45
29Operationoperator: 34
operands: 35
30Literal
31Operationoperator: 36
operands: 37
32Literal
33Lambdaparameter: 50
body: 38
34Literal
35ExprTuple39
36Literal
37ExprTuple47, 40
38Operationoperator: 41
operands: 42
39ExprRangelambda_map: 43
start_index: 44
end_index: 45
40Literal
41Literal
42ExprTuple46, 47
43Lambdaparameter: 50
body: 47
44Literal
45Variable
46Variable
47IndexedVarvariable: 48
index: 50
48Variable
49ExprTuple50
50Variable