logo

Expression of type ExprTuple

from the theory of proveit.numbers.summation

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, a, f, fa, fx, x
from proveit.logic import Equals, Forall
from proveit.numbers import Integer, Interval, Sum
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda(f, Forall(instance_param_or_params = [a], instance_expr = Equals(Sum(index_or_indices = [x], summand = fx, domain = Interval(a, a)), fa), domain = Integer)))
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(f \mapsto \left[\forall_{a \in \mathbb{Z}}~\left(\left(\sum_{x = a}^{a} f\left(x\right)\right) = f\left(a\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
1Lambdaparameter: 23
body: 3
2ExprTuple23
3Operationoperator: 4
operand: 6
4Literal
5ExprTuple6
6Lambdaparameter: 31
body: 7
7Conditionalvalue: 8
condition: 9
8Operationoperator: 10
operands: 11
9Operationoperator: 25
operands: 12
10Literal
11ExprTuple13, 14
12ExprTuple31, 15
13Operationoperator: 16
operand: 19
14Operationoperator: 23
operand: 31
15Literal
16Literal
17ExprTuple19
18ExprTuple31
19Lambdaparameter: 27
body: 20
20Conditionalvalue: 21
condition: 22
21Operationoperator: 23
operand: 27
22Operationoperator: 25
operands: 26
23Variable
24ExprTuple27
25Literal
26ExprTuple27, 28
27Variable
28Operationoperator: 29
operands: 30
29Literal
30ExprTuple31, 31
31Variable