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 cauchy_schwartz_inequality
In [2]:
# check that the built expression is the same as the stored expression
assert cauchy_schwartz_inequality.expr == stored_expr
assert cauchy_schwartz_inequality.expr._style_id == stored_expr._style_id
print("Passed sanity check: cauchy_schwartz_inequality matches stored_expr")
Passed sanity check: cauchy_schwartz_inequality matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{H \underset{{\scriptscriptstyle c}}{\in} \textrm{InnerProdSpaces}\left(\mathbb{C}\right)}~\left[\forall_{v, w \in H}~\left(\left \|\left \langle v, w\right \rangle\right \|^{2} \leq \left(\left \langle v, v\right \rangle \cdot \left \langle w, w\right \rangle\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: 7
operand: 2
1ExprTuple2
2Lambdaparameter: 38
body: 4
3ExprTuple38
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 11
6Operationoperator: 9
operands: 10
7Literal
8ExprTuple11
9Literal
10ExprTuple38, 12
11Lambdaparameters: 45
body: 13
12Operationoperator: 14
operand: 18
13Conditionalvalue: 16
condition: 17
14Literal
15ExprTuple18
16Operationoperator: 19
operands: 20
17Operationoperator: 21
operands: 22
18Literal
19Literal
20ExprTuple23, 24
21Literal
22ExprTuple25, 26
23Operationoperator: 27
operands: 28
24Operationoperator: 29
operands: 30
25Operationoperator: 32
operands: 31
26Operationoperator: 32
operands: 33
27Literal
28ExprTuple34, 35
29Literal
30ExprTuple36, 37
31ExprTuple46, 38
32Literal
33ExprTuple47, 38
34Operationoperator: 39
operand: 43
35Literal
36Operationoperator: 44
operands: 41
37Operationoperator: 44
operands: 42
38Variable
39Literal
40ExprTuple43
41ExprTuple46, 46
42ExprTuple47, 47
43Operationoperator: 44
operands: 45
44Literal
45ExprTuple46, 47
46Variable
47Variable