logo

Theorem partition of type Forall

from the theory of proveit.core_expr_types.tuples

see dependencies

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.tuples import partition
In [2]:
# check that the built expression is the same as the stored expression
assert partition.expr == stored_expr
assert partition.expr._style_id == stored_expr._style_id
print("Passed sanity check: partition matches stored_expr")
Passed sanity check: partition matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{f, i, j, k~|~\left(\left(j + 1\right) - i\right) \in \mathbb{N}, \left(k - j\right) \in \mathbb{N}}~\left(\begin{array}{c} \begin{array}{l} \left(f\left(i\right), f\left(i + 1\right), \ldots, f\left(k\right)\right) =  \\ \left(f\left(i\right), f\left(i + 1\right), \ldots, f\left(j\right),f\left(j + 1\right), f\left(j + 2\right), \ldots, f\left(k\right)\right) \end{array} \end{array}\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: 1
operand: 3
1Literal
2ExprTuple3
3Lambdaparameters: 4
body: 5
4ExprTuple29, 42, 43, 33
5Conditionalvalue: 6
condition: 7
6Operationoperator: 8
operands: 9
7Operationoperator: 10
operands: 11
8Literal
9ExprTuple12, 13
10Literal
11ExprTuple14, 15
12ExprTuple16
13ExprTuple17, 18
14Operationoperator: 20
operands: 19
15Operationoperator: 20
operands: 21
16ExprRangelambda_map: 22
start_index: 42
end_index: 33
17ExprRangelambda_map: 22
start_index: 42
end_index: 43
18ExprRangelambda_map: 22
start_index: 31
end_index: 33
19ExprTuple23, 25
20Literal
21ExprTuple24, 25
22Lambdaparameter: 35
body: 26
23Operationoperator: 36
operands: 27
24Operationoperator: 36
operands: 28
25Literal
26Operationoperator: 29
operand: 35
27ExprTuple31, 32
28ExprTuple33, 34
29Variable
30ExprTuple35
31Operationoperator: 36
operands: 37
32Operationoperator: 39
operand: 42
33Variable
34Operationoperator: 39
operand: 43
35Variable
36Literal
37ExprTuple43, 41
38ExprTuple42
39Literal
40ExprTuple43
41Literal
42Variable
43Variable