logo

Expression of type ExprTuple

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, ExprTuple, Lambda, 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 = ExprTuple(Lambda(m, 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(m \mapsto \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..\right)
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1
1Lambdaparameter: 44
body: 3
2ExprTuple44
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 35
operands: 8
6Literal
7ExprTuple9
8ExprTuple44, 10
9Lambdaparameters: 11
body: 12
10Literal
11ExprTuple45, 38
12Conditionalvalue: 13
condition: 14
13Operationoperator: 15
operands: 16
14Operationoperator: 17
operands: 18
15Literal
16ExprTuple19, 20
17Literal
18ExprTuple21, 22
19Operationoperator: 23
operands: 24
20Operationoperator: 40
operands: 25
21Operationoperator: 35
operands: 26
22ExprRangelambda_map: 27
start_index: 43
end_index: 44
23Literal
24ExprTuple28
25ExprTuple45, 29
26ExprTuple45, 30
27Lambdaparameter: 49
body: 31
28ExprRangelambda_map: 32
start_index: 43
end_index: 44
29Operationoperator: 33
operands: 34
30Literal
31Operationoperator: 35
operands: 36
32Lambdaparameter: 49
body: 37
33Literal
34ExprTuple38
35Literal
36ExprTuple46, 39
37Operationoperator: 40
operands: 41
38ExprRangelambda_map: 42
start_index: 43
end_index: 44
39Literal
40Literal
41ExprTuple45, 46
42Lambdaparameter: 49
body: 46
43Literal
44Variable
45Variable
46IndexedVarvariable: 47
index: 49
47Variable
48ExprTuple49
49Variable