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, c, d
from proveit.logic import And, Equals, InSet
from proveit.numbers import Add, Exp, Mult, Real, RealPos
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([a, b, c, d], Conditional(Equals(Exp(a, b), Mult(Exp(a, c), Exp(a, d))), And(InSet(a, RealPos), InSet(b, Real), InSet(c, Real), InSet(d, Real), Equals(b, Add(c, d))))))
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(a, b, c, d\right) \mapsto \left\{a^{b} = \left(a^{c} \cdot a^{d}\right) \textrm{ if } a \in \mathbb{R}^+ ,  b \in \mathbb{R} ,  c \in \mathbb{R} ,  d \in \mathbb{R} ,  b = \left(c + d\right)\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
2ExprTuple37, 30, 38, 39
3Conditionalvalue: 4
condition: 5
4Operationoperator: 24
operands: 6
5Operationoperator: 7
operands: 8
6ExprTuple9, 10
7Literal
8ExprTuple11, 12, 13, 14, 15
9Operationoperator: 33
operands: 16
10Operationoperator: 17
operands: 18
11Operationoperator: 22
operands: 19
12Operationoperator: 22
operands: 20
13Operationoperator: 22
operands: 21
14Operationoperator: 22
operands: 23
15Operationoperator: 24
operands: 25
16ExprTuple37, 30
17Literal
18ExprTuple26, 27
19ExprTuple37, 28
20ExprTuple30, 29
21ExprTuple38, 29
22Literal
23ExprTuple39, 29
24Literal
25ExprTuple30, 31
26Operationoperator: 33
operands: 32
27Operationoperator: 33
operands: 34
28Literal
29Literal
30Variable
31Operationoperator: 35
operands: 36
32ExprTuple37, 38
33Literal
34ExprTuple37, 39
35Literal
36ExprTuple38, 39
37Variable
38Variable
39Variable