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 norm_is_nonneg
In [2]:
# check that the built expression is the same as the stored expression
assert norm_is_nonneg.expr == stored_expr
assert norm_is_nonneg.expr._style_id == stored_expr._style_id
print("Passed sanity check: norm_is_nonneg matches stored_expr")
Passed sanity check: norm_is_nonneg 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(H\right)}~\left[\forall_{x \in H}~\left(\left \|x\right \| \in \mathbb{R}^{\ge 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: 11
operand: 2
1ExprTuple2
2Lambdaparameter: 5
body: 4
3ExprTuple5
4Operationoperator: 11
operand: 7
5Variable
6ExprTuple7
7Lambdaparameter: 27
body: 8
8Conditionalvalue: 9
condition: 10
9Operationoperator: 11
operand: 15
10Operationoperator: 13
operands: 14
11Literal
12ExprTuple15
13Literal
14ExprTuple27, 16
15Lambdaparameter: 30
body: 17
16Operationoperator: 18
operand: 27
17Conditionalvalue: 20
condition: 21
18Literal
19ExprTuple27
20Operationoperator: 23
operands: 22
21Operationoperator: 23
operands: 24
22ExprTuple25, 26
23Literal
24ExprTuple30, 27
25Operationoperator: 28
operand: 30
26Literal
27Variable
28Literal
29ExprTuple30
30Variable