logo
In [1]:
import proveit
# Automation is not needed when only building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_theorem_expr # Load the stored theorem expression as 'stored_expr'
# import the special expression
from proveit.core_expr_types.expr_arrays import varray_neq_via_any_elem_neq
In [2]:
# check that the built expression is the same as the stored expression
assert varray_neq_via_any_elem_neq.expr == stored_expr
assert varray_neq_via_any_elem_neq.expr._style_id == stored_expr._style_id
print("Passed sanity check: varray_neq_via_any_elem_neq matches stored_expr")
Passed sanity check: varray_neq_via_any_elem_neq matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{i \in \mathbb{N}^+}~\left[\forall_{a_{1}, a_{2}, \ldots, a_{i}, b_{1}, b_{2}, \ldots, b_{i}~|~\left(a_{1} \neq b_{1}\right) \lor  \left(a_{2} \neq b_{2}\right) \lor  \ldots \lor  \left(a_{i} \neq b_{i}\right)}~\left(\left(\begin{array}{cccc} 
 \multirow{1}{*}{$\begin{array}{c} \uparrow \\ a_{1} \\ \downarrow \end{array}$} & \multirow{1}{*}{$\begin{array}{c} \uparrow \\ a_{2} \\ \downarrow \end{array}$} & \multirow{1}{*}{$\begin{array}{c} \uparrow \\ \cdots \\ \downarrow \end{array}$} & \multirow{1}{*}{$\begin{array}{c} \uparrow \\ a_{i} \\ \downarrow \end{array}$} \\
\end{array}
\right) \neq \left(\begin{array}{cccc} 
 \multirow{1}{*}{$\begin{array}{c} \uparrow \\ b_{1} \\ \downarrow \end{array}$} & \multirow{1}{*}{$\begin{array}{c} \uparrow \\ b_{2} \\ \downarrow \end{array}$} & \multirow{1}{*}{$\begin{array}{c} \uparrow \\ \cdots \\ \downarrow \end{array}$} & \multirow{1}{*}{$\begin{array}{c} \uparrow \\ b_{i} \\ \downarrow \end{array}$} \\
\end{array}
\right)\right)\right]
In [4]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneNone/False('with_wrapping',)
condition_wrappingWrap 'before' or 'after' the condition (or None).NoneNone/False('with_wrap_after_condition', 'with_wrap_before_condition')
wrap_paramsIf 'True', wraps every two parameters AND wraps the Expression after the parametersNoneNone/False('with_params',)
justificationjustify to the 'left', 'center', or 'right' in the array cellscentercenter('with_justification',)
In [5]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 7
operand: 2
1ExprTuple2
2Lambdaparameter: 29
body: 4
3ExprTuple29
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 11
6Operationoperator: 9
operands: 10
7Literal
8ExprTuple11
9Literal
10ExprTuple29, 12
11Lambdaparameters: 13
body: 14
12Literal
13ExprTuple23, 24
14Conditionalvalue: 15
condition: 16
15Operationoperator: 31
operands: 17
16Operationoperator: 18
operands: 19
17ExprTuple20, 21
18Literal
19ExprTuple22
20ExprTuple23
21ExprTuple24
22ExprRangelambda_map: 25
start_index: 28
end_index: 29
23ExprRangelambda_map: 26
start_index: 28
end_index: 29
24ExprRangelambda_map: 27
start_index: 28
end_index: 29
25Lambdaparameter: 38
body: 30
26Lambdaparameter: 38
body: 33
27Lambdaparameter: 38
body: 34
28Literal
29Variable
30Operationoperator: 31
operands: 32
31Literal
32ExprTuple33, 34
33IndexedVarvariable: 35
index: 38
34IndexedVarvariable: 36
index: 38
35Variable
36Variable
37ExprTuple38
38Variable