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.linear_algebra.inner_products import ortho_norm_basis_existence_with_any_vector
In [2]:
# check that the built expression is the same as the stored expression
assert ortho_norm_basis_existence_with_any_vector.expr == stored_expr
assert ortho_norm_basis_existence_with_any_vector.expr._style_id == stored_expr._style_id
print("Passed sanity check: ortho_norm_basis_existence_with_any_vector matches stored_expr")
Passed sanity check: ortho_norm_basis_existence_with_any_vector matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{K}~\left[\forall_{n \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{H \underset{{\scriptscriptstyle c}}{\in} \textrm{InnerProdSpaces}\left(K\right)~|~\textrm{Dim}\left(H\right) = n}~\\
\left[\forall_{v \in H}~\left[\exists_{x_{1}, x_{2}, \ldots, x_{n}}~\left(\begin{array}{c} \left(v \in \left\{x_{1}, x_{2}, \ldots, x_{n}\right\}\right) \land  \\ \left(\left\{x_{1}, x_{2}, \ldots, x_{n}\right\} \in \textrm{O.N.Bases}\left(H\right)\right) \end{array}\right)\right]\right]\end{array}\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: 17
operand: 2
1ExprTuple2
2Lambdaparameter: 40
body: 3
3Operationoperator: 17
operand: 5
4ExprTuple5
5Lambdaparameter: 60
body: 7
6ExprTuple60
7Conditionalvalue: 8
condition: 9
8Operationoperator: 17
operand: 12
9Operationoperator: 47
operands: 11
10ExprTuple12
11ExprTuple60, 13
12Lambdaparameter: 57
body: 14
13Literal
14Conditionalvalue: 15
condition: 16
15Operationoperator: 17
operand: 20
16Operationoperator: 42
operands: 19
17Literal
18ExprTuple20
19ExprTuple21, 22
20Lambdaparameter: 49
body: 24
21Operationoperator: 25
operands: 26
22Operationoperator: 27
operands: 28
23ExprTuple49
24Conditionalvalue: 29
condition: 30
25Literal
26ExprTuple57, 31
27Literal
28ExprTuple32, 60
29Operationoperator: 33
operand: 39
30Operationoperator: 47
operands: 35
31Operationoperator: 36
operand: 40
32Operationoperator: 38
operand: 57
33Literal
34ExprTuple39
35ExprTuple49, 57
36Literal
37ExprTuple40
38Literal
39Lambdaparameters: 53
body: 41
40Variable
41Operationoperator: 42
operands: 43
42Literal
43ExprTuple44, 45
44Operationoperator: 47
operands: 46
45Operationoperator: 47
operands: 48
46ExprTuple49, 50
47Literal
48ExprTuple50, 51
49Variable
50Operationoperator: 52
operands: 53
51Operationoperator: 54
operand: 57
52Literal
53ExprTuple56
54Literal
55ExprTuple57
56ExprRangelambda_map: 58
start_index: 59
end_index: 60
57Variable
58Lambdaparameter: 64
body: 61
59Literal
60Variable
61IndexedVarvariable: 62
index: 64
62Variable
63ExprTuple64
64Variable