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_equality
In [2]:
# check that the built expression is the same as the stored expression
assert cauchy_schwartz_equality.expr == stored_expr
assert cauchy_schwartz_equality.expr._style_id == stored_expr._style_id
print("Passed sanity check: cauchy_schwartz_equality matches stored_expr")
Passed sanity check: cauchy_schwartz_equality 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 \|\left \langle v, w\right \rangle\right \|^{2} = \left(\left \langle v, v\right \rangle \cdot \left \langle w, w\right \rangle\right)\right) \Leftrightarrow \left(v \in \textrm{Span}\left(\left\{w\right\}\right)\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: 36
body: 4
3ExprTuple36
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 11
6Operationoperator: 9
operands: 10
7Literal
8ExprTuple11
9Literal
10ExprTuple36, 12
11Lambdaparameters: 56
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: 31
operands: 29
25Operationoperator: 31
operands: 30
26Operationoperator: 31
operands: 32
27Literal
28ExprTuple33, 34
29ExprTuple57, 35
30ExprTuple57, 36
31Literal
32ExprTuple58, 36
33Operationoperator: 37
operands: 38
34Operationoperator: 39
operands: 40
35Operationoperator: 41
operand: 47
36Variable
37Literal
38ExprTuple43, 44
39Literal
40ExprTuple45, 46
41Literal
42ExprTuple47
43Operationoperator: 48
operand: 54
44Literal
45Operationoperator: 55
operands: 50
46Operationoperator: 55
operands: 51
47Operationoperator: 52
operand: 58
48Literal
49ExprTuple54
50ExprTuple57, 57
51ExprTuple58, 58
52Literal
53ExprTuple58
54Operationoperator: 55
operands: 56
55Literal
56ExprTuple57, 58
57Variable
58Variable