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 ExprTuple, a, b, c, d, u, v, w, x, y, z
from proveit.logic import InSet
from proveit.numbers import Less, LessEq, Real, RealNeg, RealNonNeg, RealNonPos, RealPos, greater, zero
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(InSet(a, RealPos), InSet(b, RealNonNeg), InSet(c, RealNeg), InSet(d, RealNonPos), InSet(u, RealNeg), InSet(v, RealNeg), InSet(x, Real), InSet(y, Real), InSet(z, Real), InSet(w, RealPos), Less(u, v), LessEq(u, c), greater(x, zero), greater(y, x), LessEq(x, z))
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(a \in \mathbb{R}^+, b \in \mathbb{R}^{\ge 0}, c \in \mathbb{R}^-, d \in \mathbb{R}^{\le 0}, u \in \mathbb{R}^-, v \in \mathbb{R}^-, x \in \mathbb{R}, y \in \mathbb{R}, z \in \mathbb{R}, w \in \mathbb{R}^+, u < v, u \leq c, x > 0, y > x, x \leq z\right)
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
wrap_positionsposition(s) at which wrapping is to occur; 'n' is after the nth comma.()()('with_wrapping_at',)
justificationif any wrap positions are set, justify to the 'left', 'center', or 'right'leftleft('with_justification',)
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
1Operationoperator: 25
operands: 16
2Operationoperator: 25
operands: 17
3Operationoperator: 25
operands: 18
4Operationoperator: 25
operands: 19
5Operationoperator: 25
operands: 20
6Operationoperator: 25
operands: 21
7Operationoperator: 25
operands: 22
8Operationoperator: 25
operands: 23
9Operationoperator: 25
operands: 24
10Operationoperator: 25
operands: 26
11Operationoperator: 30
operands: 27
12Operationoperator: 32
operands: 28
13Operationoperator: 30
operands: 29
14Operationoperator: 30
operands: 31
15Operationoperator: 32
operands: 33
16ExprTuple34, 42
17ExprTuple35, 36
18ExprTuple45, 39
19ExprTuple37, 38
20ExprTuple44, 39
21ExprTuple43, 39
22ExprTuple48, 40
23ExprTuple47, 40
24ExprTuple49, 40
25Literal
26ExprTuple41, 42
27ExprTuple44, 43
28ExprTuple44, 45
29ExprTuple46, 48
30Literal
31ExprTuple48, 47
32Literal
33ExprTuple48, 49
34Variable
35Variable
36Literal
37Variable
38Literal
39Literal
40Literal
41Variable
42Literal
43Variable
44Variable
45Variable
46Literal
47Variable
48Variable
49Variable