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_pos_def
In [2]:
# check that the built expression is the same as the stored expression
assert inner_prod_pos_def.expr == stored_expr
assert inner_prod_pos_def.expr._style_id == stored_expr._style_id
print("Passed sanity check: inner_prod_pos_def matches stored_expr")
Passed sanity check: inner_prod_pos_def 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 \in H~|~x \neq \vec{0}\left(H\right)}~\left(\left \langle x, x\right \rangle > 0\right)\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: 9
operand: 2
1ExprTuple2
2Lambdaparameter: 21
body: 3
3Operationoperator: 9
operand: 5
4ExprTuple5
5Lambdaparameter: 40
body: 6
6Conditionalvalue: 7
condition: 8
7Operationoperator: 9
operand: 13
8Operationoperator: 11
operands: 12
9Literal
10ExprTuple13
11Literal
12ExprTuple40, 14
13Lambdaparameter: 36
body: 16
14Operationoperator: 17
operand: 21
15ExprTuple36
16Conditionalvalue: 19
condition: 20
17Literal
18ExprTuple21
19Operationoperator: 22
operands: 23
20Operationoperator: 24
operands: 25
21Variable
22Literal
23ExprTuple26, 27
24Literal
25ExprTuple28, 29
26Literal
27Operationoperator: 30
operands: 31
28Operationoperator: 32
operands: 33
29Operationoperator: 34
operands: 35
30Literal
31ExprTuple36, 36
32Literal
33ExprTuple36, 40
34Literal
35ExprTuple36, 37
36Variable
37Operationoperator: 38
operand: 40
38Literal
39ExprTuple40
40Variable