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, 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 = 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 = [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(m \mapsto \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..\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: 48
body: 3
2ExprTuple48
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 39
operands: 8
6Literal
7ExprTuple9
8ExprTuple48, 10
9Lambdaparameters: 11
body: 12
10Literal
11ExprTuple49, 42
12Conditionalvalue: 13
condition: 14
13Operationoperator: 15
operands: 16
14Operationoperator: 17
operands: 18
15Literal
16ExprTuple19, 20
17Literal
18ExprTuple21, 22, 23
19Operationoperator: 24
operands: 25
20Operationoperator: 44
operands: 26
21Operationoperator: 39
operands: 27
22ExprRangelambda_map: 28
start_index: 47
end_index: 48
23Operationoperator: 29
operands: 30
24Literal
25ExprTuple31
26ExprTuple49, 32
27ExprTuple49, 33
28Lambdaparameter: 53
body: 34
29Literal
30ExprTuple49, 35
31ExprRangelambda_map: 36
start_index: 47
end_index: 48
32Operationoperator: 37
operands: 38
33Literal
34Operationoperator: 39
operands: 40
35Literal
36Lambdaparameter: 53
body: 41
37Literal
38ExprTuple42
39Literal
40ExprTuple50, 43
41Operationoperator: 44
operands: 45
42ExprRangelambda_map: 46
start_index: 47
end_index: 48
43Literal
44Literal
45ExprTuple49, 50
46Lambdaparameter: 53
body: 50
47Literal
48Variable
49Variable
50IndexedVarvariable: 51
index: 53
51Variable
52ExprTuple53
53Variable