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, m, n
from proveit.core_expr_types import a_1_to_m
from proveit.logic import And, Equals, Forall, InSet
from proveit.numbers import Complex, Exp, Mult, NaturalPos
from proveit.numbers.exponentiation import prod_ai_raise_n__1_to_m
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([m, n], Conditional(Forall(instance_param_or_params = [a_1_to_m], instance_expr = Equals(Exp(Mult(a_1_to_m), n), prod_ai_raise_n__1_to_m), domain = Complex), And(InSet(m, NaturalPos), InSet(n, 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(\left(m, n\right) \mapsto \left\{\forall_{a_{1}, a_{2}, \ldots, a_{m} \in \mathbb{C}}~\left(\left(a_{1} \cdot  a_{2} \cdot  \ldots \cdot  a_{m}\right)^{n} = \left(\left(a_{1}\right)^{n} \cdot  \left(a_{2}\right)^{n} \cdot  \ldots \cdot  \left(a_{m}\right)^{n}\right)\right) \textrm{ if } m \in \mathbb{N}^+ ,  n \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
1Lambdaparameters: 2
body: 3
2ExprTuple41, 45
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 20
operands: 8
6Literal
7ExprTuple9
8ExprTuple10, 11
9Lambdaparameters: 32
body: 12
10Operationoperator: 34
operands: 13
11Operationoperator: 34
operands: 14
12Conditionalvalue: 15
condition: 16
13ExprTuple41, 17
14ExprTuple45, 17
15Operationoperator: 18
operands: 19
16Operationoperator: 20
operands: 21
17Literal
18Literal
19ExprTuple22, 23
20Literal
21ExprTuple24
22Operationoperator: 42
operands: 25
23Operationoperator: 31
operands: 26
24ExprRangelambda_map: 27
start_index: 40
end_index: 41
25ExprTuple28, 45
26ExprTuple29
27Lambdaparameter: 48
body: 30
28Operationoperator: 31
operands: 32
29ExprRangelambda_map: 33
start_index: 40
end_index: 41
30Operationoperator: 34
operands: 35
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