logo

Expression of type ExprTuple

from the theory of proveit.linear_algebra.addition

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, Lambda, Q, f, j, n
from proveit.core_expr_types import x_1_to_n
from proveit.linear_algebra.addition import vec_summation_b1toj_fQ
from proveit.logic import Equals, Forall
from proveit.numbers import Complex, NaturalPos
from proveit.numbers.summation import summation_b1toj_fQ
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([f, Q], Forall(instance_param_or_params = [n, j], instance_expr = Forall(instance_param_or_params = [x_1_to_n], instance_expr = Equals(vec_summation_b1toj_fQ, summation_b1toj_fQ), domain = Complex), domain = NaturalPos)))
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(f, Q\right) \mapsto \left[\forall_{n, j \in \mathbb{N}^+}~\left[\forall_{x_{1}, x_{2}, \ldots, x_{n} \in \mathbb{C}}~\left(\left[\sum_{b_{1}, b_{2}, \ldots, b_{j}~|~Q\left(b_{1}, b_{2}, \ldots, b_{j}\right)}~f\left(b_{1}, b_{2}, \ldots, b_{j}\right)\right] = \left[\sum_{b_{1}, b_{2}, \ldots, b_{j}~|~Q\left(b_{1}, b_{2}, \ldots, b_{j}\right)}~f\left(b_{1}, b_{2}, \ldots, b_{j}\right)\right]\right)\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
2ExprTuple46, 47
3Operationoperator: 10
operand: 5
4ExprTuple5
5Lambdaparameters: 6
body: 7
6ExprTuple36, 53
7Conditionalvalue: 8
condition: 9
8Operationoperator: 10
operand: 13
9Operationoperator: 27
operands: 12
10Literal
11ExprTuple13
12ExprTuple14, 15
13Lambdaparameters: 16
body: 17
14Operationoperator: 40
operands: 18
15Operationoperator: 40
operands: 19
16ExprTuple20
17Conditionalvalue: 21
condition: 22
18ExprTuple36, 23
19ExprTuple53, 23
20ExprRangelambda_map: 24
start_index: 52
end_index: 36
21Operationoperator: 25
operands: 26
22Operationoperator: 27
operands: 28
23Literal
24Lambdaparameter: 57
body: 44
25Literal
26ExprTuple29, 30
27Literal
28ExprTuple31
29Operationoperator: 32
operand: 37
30Operationoperator: 33
operand: 37
31ExprRangelambda_map: 35
start_index: 52
end_index: 36
32Literal
33Literal
34ExprTuple37
35Lambdaparameter: 57
body: 38
36Variable
37Lambdaparameters: 48
body: 39
38Operationoperator: 40
operands: 41
39Conditionalvalue: 42
condition: 43
40Literal
41ExprTuple44, 45
42Operationoperator: 46
operands: 48
43Operationoperator: 47
operands: 48
44IndexedVarvariable: 49
index: 57
45Literal
46Variable
47Variable
48ExprTuple50
49Variable
50ExprRangelambda_map: 51
start_index: 52
end_index: 53
51Lambdaparameter: 57
body: 54
52Literal
53Variable
54IndexedVarvariable: 55
index: 57
55Variable
56ExprTuple57
57Variable