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_idempotent
In [2]:
# check that the built expression is the same as the stored expression
assert ortho_projectors_are_idempotent.expr == stored_expr
assert ortho_projectors_are_idempotent.expr._style_id == stored_expr._style_id
print("Passed sanity check: ortho_projectors_are_idempotent matches stored_expr")
Passed sanity check: ortho_projectors_are_idempotent 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^{2} = 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: 36
body: 4
3ExprTuple36
4Conditionalvalue: 5
condition: 6
5Operationoperator: 16
operand: 10
6Operationoperator: 8
operands: 9
7ExprTuple10
8Literal
9ExprTuple36, 11
10Lambdaparameter: 37
body: 13
11Literal
12ExprTuple37
13Conditionalvalue: 14
condition: 15
14Operationoperator: 16
operand: 20
15Operationoperator: 18
operands: 19
16Literal
17ExprTuple20
18Literal
19ExprTuple37, 36
20Lambdaparameter: 34
body: 22
21ExprTuple34
22Conditionalvalue: 23
condition: 24
23Operationoperator: 26
operands: 25
24Operationoperator: 26
operands: 27
25ExprTuple28, 34
26Literal
27ExprTuple34, 29
28Operationoperator: 30
operands: 31
29Operationoperator: 32
operands: 33
30Literal
31ExprTuple34, 35
32Literal
33ExprTuple36, 37
34Variable
35Literal
36Variable
37Variable