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, b, m
from proveit.core_expr_types import a_1_to_m
from proveit.logic import Equals, Forall, InSet
from proveit.numbers import Complex, Exp, Mult, NaturalPos, RealPos
from proveit.numbers.exponentiation import prod_ai_raise_b__1_to_m
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda(m, Conditional(Forall(instance_param_or_params = [a_1_to_m, b], instance_expr = Equals(Exp(Mult(a_1_to_m), b), prod_ai_raise_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_{\left(a_{1} \in \mathbb{R}^+\right), \left(a_{2} \in \mathbb{R}^+\right), \ldots, \left(a_{m} \in \mathbb{R}^+\right), b \in \mathbb{C}}~\left(\left(a_{1} \cdot  a_{2} \cdot  \ldots \cdot  a_{m}\right)^{b} = \left(\left(a_{1}\right)^{b} \cdot  \left(a_{2}\right)^{b} \cdot  \ldots \cdot  \left(a_{m}\right)^{b}\right)\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: 41
body: 3
2ExprTuple41
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 34
operands: 8
6Literal
7ExprTuple9
8ExprTuple41, 10
9Lambdaparameters: 11
body: 12
10Literal
11ExprTuple36, 45
12Conditionalvalue: 13
condition: 14
13Operationoperator: 15
operands: 16
14Operationoperator: 17
operands: 18
15Literal
16ExprTuple19, 20
17Literal
18ExprTuple21, 22
19Operationoperator: 42
operands: 23
20Operationoperator: 31
operands: 24
21ExprRangelambda_map: 25
start_index: 40
end_index: 41
22Operationoperator: 34
operands: 26
23ExprTuple27, 45
24ExprTuple28
25Lambdaparameter: 48
body: 29
26ExprTuple45, 30
27Operationoperator: 31
operands: 32
28ExprRangelambda_map: 33
start_index: 40
end_index: 41
29Operationoperator: 34
operands: 35
30Literal
31Literal
32ExprTuple36
33Lambdaparameter: 48
body: 37
34Literal
35ExprTuple44, 38
36ExprRangelambda_map: 39
start_index: 40
end_index: 41
37Operationoperator: 42
operands: 43
38Literal
39Lambdaparameter: 48
body: 44
40Literal
41Variable
42Literal
43ExprTuple44, 45
44IndexedVarvariable: 46
index: 48
45Variable
46Variable
47ExprTuple48
48Variable