logo

Theorem general_len 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 general_len
In [2]:
# check that the built expression is the same as the stored expression
assert general_len.expr == stored_expr
assert general_len.expr._style_id == stored_expr._style_id
print("Passed sanity check: general_len matches stored_expr")
Passed sanity check: general_len matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{n \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{f_{1}, f_{2}, \ldots, f_{n}, i_{1}, i_{2}, \ldots, i_{n}, j_{1}, j_{2}, \ldots, j_{n}~|~\left(\left(j_{1} - i_{1} + 1\right) \in \mathbb{N}\right), \left(\left(j_{2} - i_{2} + 1\right) \in \mathbb{N}\right), \ldots, \left(\left(j_{n} - i_{n} + 1\right) \in \mathbb{N}\right)}~\\
\left(\begin{array}{c} \begin{array}{l} |\left(f_{1}\left(i_{1}\right), f_{1}\left(i_{1} + 1\right), \ldots, f_{1}\left(j_{1}\right), f_{2}\left(i_{2}\right), f_{2}\left(i_{2} + 1\right), \ldots, f_{2}\left(j_{2}\right), \ldots\ldots, f_{n}\left(i_{n}\right), f_{n}\left(i_{n} + 1\right), \ldots, f_{n}\left(j_{n}\right)\right)| \\  = \left(\left(j_{1} - i_{1} + 1\right) +  \left(j_{2} - i_{2} + 1\right) +  \ldots +  \left(j_{n} - i_{n} + 1\right)\right) \end{array} \end{array}\right)\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: 7
operand: 2
1ExprTuple2
2Lambdaparameter: 39
body: 4
3ExprTuple39
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 40
operands: 9
7Literal
8ExprTuple10
9ExprTuple39, 11
10Lambdaparameters: 12
body: 13
11Literal
12ExprTuple14, 15, 16
13Conditionalvalue: 17
condition: 18
14ExprRangelambda_map: 19
start_index: 53
end_index: 39
15ExprRangelambda_map: 20
start_index: 53
end_index: 39
16ExprRangelambda_map: 21
start_index: 53
end_index: 39
17Operationoperator: 22
operands: 23
18Operationoperator: 24
operands: 25
19Lambdaparameter: 64
body: 26
20Lambdaparameter: 64
body: 60
21Lambdaparameter: 64
body: 51
22Literal
23ExprTuple27, 28
24Literal
25ExprTuple29
26IndexedVarvariable: 58
index: 64
27Operationoperator: 30
operands: 31
28Operationoperator: 48
operands: 32
29ExprRangelambda_map: 33
start_index: 53
end_index: 39
30Literal
31ExprTuple34
32ExprTuple35
33Lambdaparameter: 64
body: 36
34ExprRangelambda_map: 37
start_index: 53
end_index: 39
35ExprRangelambda_map: 38
start_index: 53
end_index: 39
36Operationoperator: 40
operands: 41
37Lambdaparameter: 61
body: 42
38Lambdaparameter: 64
body: 43
39Variable
40Literal
41ExprTuple43, 44
42ExprRangelambda_map: 45
start_index: 46
end_index: 47
43Operationoperator: 48
operands: 49
44Literal
45Lambdaparameter: 64
body: 50
46IndexedVarvariable: 62
index: 61
47IndexedVarvariable: 55
index: 61
48Literal
49ExprTuple51, 52, 53
50Operationoperator: 54
operand: 64
51IndexedVarvariable: 55
index: 64
52Operationoperator: 56
operand: 60
53Literal
54IndexedVarvariable: 58
index: 61
55Variable
56Literal
57ExprTuple60
58Variable
59ExprTuple61
60IndexedVarvariable: 62
index: 64
61Variable
62Variable
63ExprTuple64
64Variable