logo

Expression of type Equals

from the theory of proveit.core_expr_types.tuples

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, Variable, i, j, k
from proveit.logic import Equals
from proveit.numbers import Add, Exp, e, four, one, three, two
In [2]:
# build up the expression from sub-expressions
sub_expr1 = Variable("_a", latex_format = r"{_{-}a}")
expr = Equals([ExprRange(sub_expr1, Exp(e, Add(sub_expr1, j)), i, k)], [Exp(e, Add(i, j)), Exp(e, Add(Add(i, one), j)), Exp(e, Add(Add(i, two), j)), Exp(e, Add(Add(i, three), j)), Exp(e, Add(Add(i, four), j))])
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(\mathsf{e}^{i + j}, \mathsf{e}^{\left(i + 1\right) + j}, \ldots, \mathsf{e}^{k + j}\right) = \left(\mathsf{e}^{i + j}, \mathsf{e}^{\left(i + 1\right) + j}, \mathsf{e}^{\left(i + 2\right) + j}, \mathsf{e}^{\left(i + 3\right) + j}, \mathsf{e}^{\left(i + 4\right) + j}\right)
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
operation'infix' or 'function' style formattinginfixinfix
wrap_positionsposition(s) at which wrapping is to occur; '2 n - 1' is after the nth operand, '2 n' is after the nth operation.()()('with_wrapping_at', 'with_wrap_before_operator', 'with_wrap_after_operator', 'without_wrapping', 'wrap_positions')
justificationif any wrap positions are set, justify to the 'left', 'center', or 'right'centercenter('with_justification',)
directionDirection of the relation (normal or reversed)normalnormal('with_direction_reversed', 'is_reversed')
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 1
operands: 2
1Literal
2ExprTuple3, 4
3ExprTuple5
4ExprTuple6, 7, 8, 9, 10
5ExprRangelambda_map: 11
start_index: 49
end_index: 12
6Operationoperator: 25
operands: 13
7Operationoperator: 25
operands: 14
8Operationoperator: 25
operands: 15
9Operationoperator: 25
operands: 16
10Operationoperator: 25
operands: 17
11Lambdaparameter: 44
body: 19
12Variable
13ExprTuple32, 20
14ExprTuple32, 21
15ExprTuple32, 22
16ExprTuple32, 23
17ExprTuple32, 24
18ExprTuple44
19Operationoperator: 25
operands: 26
20Operationoperator: 42
operands: 27
21Operationoperator: 42
operands: 28
22Operationoperator: 42
operands: 29
23Operationoperator: 42
operands: 30
24Operationoperator: 42
operands: 31
25Literal
26ExprTuple32, 33
27ExprTuple49, 45
28ExprTuple34, 45
29ExprTuple35, 45
30ExprTuple36, 45
31ExprTuple37, 45
32Literal
33Operationoperator: 42
operands: 38
34Operationoperator: 42
operands: 39
35Operationoperator: 42
operands: 40
36Operationoperator: 42
operands: 41
37Operationoperator: 42
operands: 43
38ExprTuple44, 45
39ExprTuple49, 46
40ExprTuple49, 47
41ExprTuple49, 48
42Literal
43ExprTuple49, 50
44Variable
45Variable
46Literal
47Literal
48Literal
49Variable
50Literal