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
from proveit.numbers import Add, Complex, Exp, NaturalPos, RealPos
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 = [RealPos, Complex]), 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{R}^+,\left(b_{1} \in \mathbb{C}\right), \left(b_{2} \in \mathbb{C}\right), \ldots, \left(b_{m} \in \mathbb{C}\right)}~\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: 32
operands: 5
3Literal
4ExprTuple6
5ExprTuple41, 7
6Lambdaparameters: 8
body: 9
7Literal
8ExprTuple42, 35
9Conditionalvalue: 10
condition: 11
10Operationoperator: 12
operands: 13
11Operationoperator: 14
operands: 15
12Literal
13ExprTuple16, 17
14Literal
15ExprTuple18, 19
16Operationoperator: 20
operands: 21
17Operationoperator: 37
operands: 22
18Operationoperator: 32
operands: 23
19ExprRangelambda_map: 24
start_index: 40
end_index: 41
20Literal
21ExprTuple25
22ExprTuple42, 26
23ExprTuple42, 27
24Lambdaparameter: 46
body: 28
25ExprRangelambda_map: 29
start_index: 40
end_index: 41
26Operationoperator: 30
operands: 31
27Literal
28Operationoperator: 32
operands: 33
29Lambdaparameter: 46
body: 34
30Literal
31ExprTuple35
32Literal
33ExprTuple43, 36
34Operationoperator: 37
operands: 38
35ExprRangelambda_map: 39
start_index: 40
end_index: 41
36Literal
37Literal
38ExprTuple42, 43
39Lambdaparameter: 46
body: 43
40Literal
41Variable
42Variable
43IndexedVarvariable: 44
index: 46
44Variable
45ExprTuple46
46Variable