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 inner_prod_vec_add_left
In [2]:
# check that the built expression is the same as the stored expression
assert inner_prod_vec_add_left.expr == stored_expr
assert inner_prod_vec_add_left.expr._style_id == stored_expr._style_id
print("Passed sanity check: inner_prod_vec_add_left matches stored_expr")
Passed sanity check: inner_prod_vec_add_left 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_{H \underset{{\scriptscriptstyle c}}{\in} \textrm{InnerProdSpaces}\left(K\right)}~\left[\forall_{x, y, z \in H}~\left(\left \langle x + y, z\right \rangle = \left(\left \langle x, z\right \rangle + \left \langle x, z\right \rangle\right)\right)\right]\right]
In [4]:
stored_expr.style_options()
Out[4]:
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()
Out[5]:
 core typesub-expressionsexpression
0Operationoperator: 10
operand: 2
1ExprTuple2
2Lambdaparameter: 22
body: 3
3Operationoperator: 10
operand: 5
4ExprTuple5
5Lambdaparameter: 40
body: 7
6ExprTuple40
7Conditionalvalue: 8
condition: 9
8Operationoperator: 10
operand: 14
9Operationoperator: 12
operands: 13
10Literal
11ExprTuple14
12Literal
13ExprTuple40, 15
14Lambdaparameters: 16
body: 17
15Operationoperator: 18
operand: 22
16ExprTuple46, 45, 47
17Conditionalvalue: 20
condition: 21
18Literal
19ExprTuple22
20Operationoperator: 23
operands: 24
21Operationoperator: 25
operands: 26
22Variable
23Literal
24ExprTuple27, 28
25Literal
26ExprTuple29, 30, 31
27Operationoperator: 43
operands: 32
28Operationoperator: 41
operands: 33
29Operationoperator: 36
operands: 34
30Operationoperator: 36
operands: 35
31Operationoperator: 36
operands: 37
32ExprTuple38, 47
33ExprTuple39, 39
34ExprTuple46, 40
35ExprTuple45, 40
36Literal
37ExprTuple47, 40
38Operationoperator: 41
operands: 42
39Operationoperator: 43
operands: 44
40Variable
41Literal
42ExprTuple46, 45
43Literal
44ExprTuple46, 47
45Variable
46Variable
47Variable