logo

Expression of type ExprTuple

from the theory of proveit.numbers.integration

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, S, f, fx, x
from proveit.logic import Forall, Implies, InSet
from proveit.numbers import Integrate, Real
In [2]:
# build up the expression from sub-expressions
sub_expr1 = [x]
expr = ExprTuple(Lambda([f, S], Implies(Forall(instance_param_or_params = sub_expr1, instance_expr = InSet(fx, Real), domain = S), InSet(Integrate(index_or_indices = sub_expr1, integrand = fx, domain = S), Real))))
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, S\right) \mapsto \left(\left[\forall_{x \in S}~\left(f\left(x\right) \in \mathbb{R}\right)\right] \Rightarrow \left(\left[\int_{x \in S}~f\left(x\right)\right] \in \mathbb{R}\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
2ExprTuple23, 28
3Operationoperator: 4
operands: 5
4Literal
5ExprTuple6, 7
6Operationoperator: 8
operand: 11
7Operationoperator: 25
operands: 10
8Literal
9ExprTuple11
10ExprTuple12, 20
11Lambdaparameter: 27
body: 13
12Operationoperator: 14
operand: 17
13Conditionalvalue: 16
condition: 22
14Literal
15ExprTuple17
16Operationoperator: 25
operands: 18
17Lambdaparameter: 27
body: 19
18ExprTuple21, 20
19Conditionalvalue: 21
condition: 22
20Literal
21Operationoperator: 23
operand: 27
22Operationoperator: 25
operands: 26
23Variable
24ExprTuple27
25Literal
26ExprTuple27, 28
27Variable
28Variable