logo

Expression of type ExprTuple

from the theory of proveit.numbers.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 Conditional, ExprTuple, Lambda, b, i, j
from proveit.core_expr_types import a_1_to_i, c_1_to_j
from proveit.logic import And, Forall, InSet
from proveit.numbers import Add, Natural, Real, RealPos, greater, zero
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([i, j], Conditional(Forall(instance_param_or_params = [a_1_to_i, c_1_to_j], instance_expr = Forall(instance_param_or_params = [b], instance_expr = greater(Add(a_1_to_i, b, c_1_to_j), b), domain = Real), domain = RealPos), And(InSet(i, Natural), InSet(j, Natural), greater(Add(i, j), zero)))))
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(i, j\right) \mapsto \left\{\forall_{a_{1}, a_{2}, \ldots, a_{i}, c_{1}, c_{2}, \ldots, c_{j} \in \mathbb{R}^+}~\left[\forall_{b \in \mathbb{R}}~\left(\left(a_{1} +  a_{2} +  \ldots +  a_{i} + b+ c_{1} +  c_{2} +  \ldots +  c_{j}\right) > b\right)\right] \textrm{ if } i \in \mathbb{N} ,  j \in \mathbb{N} ,  \left(i + j\right) > 0\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: 25
body: 2
2Conditionalvalue: 3
condition: 4
3Operationoperator: 21
operand: 7
4Operationoperator: 23
operands: 6
5ExprTuple7
6ExprTuple8, 9, 10
7Lambdaparameters: 11
body: 12
8Operationoperator: 41
operands: 13
9Operationoperator: 41
operands: 14
10Operationoperator: 37
operands: 15
11ExprTuple48, 50
12Conditionalvalue: 16
condition: 17
13ExprTuple52, 18
14ExprTuple55, 18
15ExprTuple19, 20
16Operationoperator: 21
operand: 26
17Operationoperator: 23
operands: 24
18Literal
19Literal
20Operationoperator: 46
operands: 25
21Literal
22ExprTuple26
23Literal
24ExprTuple27, 28
25ExprTuple52, 55
26Lambdaparameter: 49
body: 30
27ExprRangelambda_map: 31
start_index: 54
end_index: 52
28ExprRangelambda_map: 32
start_index: 54
end_index: 55
29ExprTuple49
30Conditionalvalue: 33
condition: 34
31Lambdaparameter: 61
body: 35
32Lambdaparameter: 61
body: 36
33Operationoperator: 37
operands: 38
34Operationoperator: 41
operands: 39
35Operationoperator: 41
operands: 40
36Operationoperator: 41
operands: 42
37Literal
38ExprTuple49, 43
39ExprTuple49, 44
40ExprTuple56, 45
41Literal
42ExprTuple57, 45
43Operationoperator: 46
operands: 47
44Literal
45Literal
46Literal
47ExprTuple48, 49, 50
48ExprRangelambda_map: 51
start_index: 54
end_index: 52
49Variable
50ExprRangelambda_map: 53
start_index: 54
end_index: 55
51Lambdaparameter: 61
body: 56
52Variable
53Lambdaparameter: 61
body: 57
54Literal
55Variable
56IndexedVarvariable: 58
index: 61
57IndexedVarvariable: 59
index: 61
58Variable
59Variable
60ExprTuple61
61Variable