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, b, n
from proveit.logic import Equals, Forall, InSet, NotEquals
from proveit.numbers import Complex, Exp, Integer, Mult, zero
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda(n, Conditional(Forall(instance_param_or_params = [a, b], instance_expr = Equals(Exp(Exp(a, b), n), Exp(a, Mult(b, n))), domain = Complex, condition = NotEquals(a, zero)), InSet(n, Integer))))
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(n \mapsto \left\{\forall_{a, b \in \mathbb{C}~|~a \neq 0}~\left((a^{b})^{n} = a^{b \cdot n}\right) \textrm{ if } n \in \mathbb{Z}\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: 40
body: 3
2ExprTuple40
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 26
operands: 8
6Literal
7ExprTuple9
8ExprTuple40, 10
9Lambdaparameters: 35
body: 11
10Literal
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operands: 15
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18, 19
16Literal
17ExprTuple20, 21, 22
18Operationoperator: 34
operands: 23
19Operationoperator: 34
operands: 24
20Operationoperator: 26
operands: 25
21Operationoperator: 26
operands: 27
22Operationoperator: 28
operands: 29
23ExprTuple30, 40
24ExprTuple38, 31
25ExprTuple38, 32
26Literal
27ExprTuple39, 32
28Literal
29ExprTuple38, 33
30Operationoperator: 34
operands: 35
31Operationoperator: 36
operands: 37
32Literal
33Literal
34Literal
35ExprTuple38, 39
36Literal
37ExprTuple39, 40
38Variable
39Variable
40Variable