logo

Expression of type ExprTuple

from the theory of proveit.numbers.addition.subtraction

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 ExprRange, ExprTuple, IndexedVar, Variable, a, b, c, d, e, i, j, k
from proveit.logic import Equals, InSet
from proveit.numbers import Complex, one
In [2]:
# build up the expression from sub-expressions
sub_expr1 = Variable("_a", latex_format = r"{_{-}a}")
expr = ExprTuple(ExprRange(sub_expr1, InSet(IndexedVar(a, sub_expr1), Complex), one, i), InSet(b, Complex), ExprRange(sub_expr1, InSet(IndexedVar(c, sub_expr1), Complex), one, j), InSet(d, Complex), ExprRange(sub_expr1, InSet(IndexedVar(e, sub_expr1), Complex), one, k), Equals(b, 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_{1} \in \mathbb{C}\right), \left(a_{2} \in \mathbb{C}\right), \ldots, \left(a_{i} \in \mathbb{C}\right), b \in \mathbb{C},\left(c_{1} \in \mathbb{C}\right), \left(c_{2} \in \mathbb{C}\right), \ldots, \left(c_{j} \in \mathbb{C}\right), d \in \mathbb{C},\left(e_{1} \in \mathbb{C}\right), \left(e_{2} \in \mathbb{C}\right), \ldots, \left(e_{k} \in \mathbb{C}\right), b = d\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
1ExprRangelambda_map: 7
start_index: 14
end_index: 8
2Operationoperator: 25
operands: 9
3ExprRangelambda_map: 10
start_index: 14
end_index: 11
4Operationoperator: 25
operands: 12
5ExprRangelambda_map: 13
start_index: 14
end_index: 15
6Operationoperator: 16
operands: 17
7Lambdaparameter: 35
body: 18
8Variable
9ExprTuple21, 30
10Lambdaparameter: 35
body: 19
11Variable
12ExprTuple22, 30
13Lambdaparameter: 35
body: 20
14Literal
15Variable
16Literal
17ExprTuple21, 22
18Operationoperator: 25
operands: 23
19Operationoperator: 25
operands: 24
20Operationoperator: 25
operands: 26
21Variable
22Variable
23ExprTuple27, 30
24ExprTuple28, 30
25Literal
26ExprTuple29, 30
27IndexedVarvariable: 31
index: 35
28IndexedVarvariable: 32
index: 35
29IndexedVarvariable: 33
index: 35
30Literal
31Variable
32Variable
33Variable
34ExprTuple35
35Variable