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, Neg, 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, Neg(b)), Neg(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: 42
body: 2
2Conditionalvalue: 3
condition: 4
3Operationoperator: 5
operand: 8
4Operationoperator: 26
operands: 7
5Literal
6ExprTuple8
7ExprTuple42, 9
8Lambdaparameters: 10
body: 11
9Literal
10ExprTuple40, 45
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operands: 15
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18, 19
16Literal
17ExprTuple20, 21, 22
18Operationoperator: 35
operands: 23
19Operationoperator: 35
operands: 24
20Operationoperator: 26
operands: 25
21Operationoperator: 26
operands: 27
22Operationoperator: 28
operands: 29
23ExprTuple30, 31
24ExprTuple40, 32
25ExprTuple40, 33
26Literal
27ExprTuple45, 33
28Literal
29ExprTuple40, 34
30Operationoperator: 35
operands: 36
31Operationoperator: 43
operand: 42
32Operationoperator: 38
operands: 39
33Literal
34Literal
35Literal
36ExprTuple40, 41
37ExprTuple42
38Literal
39ExprTuple45, 42
40Variable
41Operationoperator: 43
operand: 45
42Variable
43Literal
44ExprTuple45
45Variable