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 ortho_projectors_are_hermitian
In [2]:
# check that the built expression is the same as the stored expression
assert ortho_projectors_are_hermitian.expr == stored_expr
assert ortho_projectors_are_hermitian.expr._style_id == stored_expr._style_id
print("Passed sanity check: ortho_projectors_are_hermitian matches stored_expr")
Passed sanity check: ortho_projectors_are_hermitian matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{\mathcal{H} \underset{{\scriptscriptstyle c}}{\in} \textrm{HilbertSpaces}}~\left[\forall_{X~|~X \subseteq \mathcal{H}}~\left[\forall_{P~|~P = \textrm{OrthoProj}\left(\mathcal{H}, X\right)}~\left(P^{\dagger} = P\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: 16
operand: 2
1ExprTuple2
2Lambdaparameter: 34
body: 4
3ExprTuple34
4Conditionalvalue: 5
condition: 6
5Operationoperator: 16
operand: 10
6Operationoperator: 8
operands: 9
7ExprTuple10
8Literal
9ExprTuple34, 11
10Lambdaparameter: 35
body: 13
11Literal
12ExprTuple35
13Conditionalvalue: 14
condition: 15
14Operationoperator: 16
operand: 20
15Operationoperator: 18
operands: 19
16Literal
17ExprTuple20
18Literal
19ExprTuple35, 34
20Lambdaparameter: 33
body: 21
21Conditionalvalue: 22
condition: 23
22Operationoperator: 25
operands: 24
23Operationoperator: 25
operands: 26
24ExprTuple27, 33
25Literal
26ExprTuple33, 28
27Operationoperator: 29
operand: 33
28Operationoperator: 31
operands: 32
29Literal
30ExprTuple33
31Literal
32ExprTuple34, 35
33Variable
34Variable
35Variable