logo

Expression of type ExprTuple

from the theory of proveit.logic.sets.disjointness

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 B, ExprTuple, X
from proveit.core_expr_types import A_1_to_m
from proveit.logic import And, Disjoint, Forall, Set
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Disjoint(A_1_to_m, B), And(Disjoint(A_1_to_m), Forall(instance_param_or_params = [X], instance_expr = Disjoint(X, B), domain = Set(A_1_to_m))))
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(\textrm{disjoint}\left(A_{1}, A_{2}, \ldots, A_{m}, B\right), \textrm{disjoint}\left(A_{1}, A_{2}, \ldots, A_{m}\right) \land \left[\forall_{X \in \left\{A_{1}, A_{2}, \ldots, A_{m}\right\}}~\textrm{disjoint}\left(X, B\right)\right]\right)
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
wrap_positionsposition(s) at which wrapping is to occur; 'n' is after the nth comma.()()('with_wrapping_at',)
justificationif any wrap positions are set, justify to the 'left', 'center', or 'right'leftleft('with_justification',)
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1, 2
1Operationoperator: 15
operands: 3
2Operationoperator: 4
operands: 5
3ExprTuple24, 19
4Literal
5ExprTuple6, 7
6Operationoperator: 15
operands: 23
7Operationoperator: 8
operand: 10
8Literal
9ExprTuple10
10Lambdaparameter: 20
body: 12
11ExprTuple20
12Conditionalvalue: 13
condition: 14
13Operationoperator: 15
operands: 16
14Operationoperator: 17
operands: 18
15Literal
16ExprTuple20, 19
17Literal
18ExprTuple20, 21
19Variable
20Variable
21Operationoperator: 22
operands: 23
22Literal
23ExprTuple24
24ExprRangelambda_map: 25
start_index: 26
end_index: 27
25Lambdaparameter: 31
body: 28
26Literal
27Variable
28IndexedVarvariable: 29
index: 31
29Variable
30ExprTuple31
31Variable