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)), n), Exp(a, Neg(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^{-\left(b \cdot n\right)}\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: 46
body: 3
2ExprTuple46
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 27
operands: 8
6Literal
7ExprTuple9
8ExprTuple46, 10
9Lambdaparameters: 11
body: 12
10Literal
11ExprTuple38, 45
12Conditionalvalue: 13
condition: 14
13Operationoperator: 15
operands: 16
14Operationoperator: 17
operands: 18
15Literal
16ExprTuple19, 20
17Literal
18ExprTuple21, 22, 23
19Operationoperator: 35
operands: 24
20Operationoperator: 35
operands: 25
21Operationoperator: 27
operands: 26
22Operationoperator: 27
operands: 28
23Operationoperator: 29
operands: 30
24ExprTuple31, 46
25ExprTuple38, 32
26ExprTuple38, 33
27Literal
28ExprTuple45, 33
29Literal
30ExprTuple38, 34
31Operationoperator: 35
operands: 36
32Operationoperator: 41
operand: 40
33Literal
34Literal
35Literal
36ExprTuple38, 39
37ExprTuple40
38Variable
39Operationoperator: 41
operand: 45
40Operationoperator: 43
operands: 44
41Literal
42ExprTuple45
43Literal
44ExprTuple45, 46
45Variable
46Variable