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_right
In [2]:
# check that the built expression is the same as the stored expression
assert inner_prod_vec_add_right.expr == stored_expr
assert inner_prod_vec_add_right.expr._style_id == stored_expr._style_id
print("Passed sanity check: inner_prod_vec_add_right matches stored_expr")
Passed sanity check: inner_prod_vec_add_right 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, y\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: 41
body: 7
6ExprTuple41
7Conditionalvalue: 8
condition: 9
8Operationoperator: 10
operand: 14
9Operationoperator: 12
operands: 13
10Literal
11ExprTuple14
12Literal
13ExprTuple41, 15
14Lambdaparameters: 16
body: 17
15Operationoperator: 18
operand: 22
16ExprTuple48, 47, 49
17Conditionalvalue: 20
condition: 21
18Literal
19ExprTuple22
20Operationoperator: 23
operands: 24
21Operationoperator: 25
operands: 26
22Variable
23Literal
24ExprTuple27, 28
25Literal
26ExprTuple29, 30, 31
27Operationoperator: 45
operands: 32
28Operationoperator: 42
operands: 33
29Operationoperator: 36
operands: 34
30Operationoperator: 36
operands: 35
31Operationoperator: 36
operands: 37
32ExprTuple48, 38
33ExprTuple39, 40
34ExprTuple48, 41
35ExprTuple47, 41
36Literal
37ExprTuple49, 41
38Operationoperator: 42
operands: 43
39Operationoperator: 45
operands: 44
40Operationoperator: 45
operands: 46
41Variable
42Literal
43ExprTuple47, 49
44ExprTuple48, 47
45Literal
46ExprTuple48, 49
47Variable
48Variable
49Variable