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 spectral_decomposition_as_ortho_ortho_projectors
In [2]:
# check that the built expression is the same as the stored expression
assert spectral_decomposition_as_ortho_ortho_projectors.expr == stored_expr
assert spectral_decomposition_as_ortho_ortho_projectors.expr._style_id == stored_expr._style_id
print("Passed sanity check: spectral_decomposition_as_ortho_ortho_projectors matches stored_expr")
Passed sanity check: spectral_decomposition_as_ortho_ortho_projectors matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{n \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{\mathcal{H} \underset{{\scriptscriptstyle c}}{\in} \textrm{HilbertSpaces}~|~\textrm{Dim}\left(\mathcal{H}\right) = n}~\\
\left[\forall_{M \in \mathcal{L}\left(\mathcal{H}, \mathcal{H}\right)}~\left(\begin{array}{c} \begin{array}{l} \left(\left(M^{\dagger} \circ M\right) = \left(M \circ M^{\dagger}\right)\right) \Leftrightarrow  \\ \left[\begin{array}{l}\exists_{x_{1}, x_{2}, \ldots, x_{n}~|~\left\{x_{1}, x_{2}, \ldots, x_{n}\right\} \in \textrm{O.N.Bases}\left(\mathcal{H}\right)}~\\
\left[\begin{array}{l}\exists_{a_{1}, a_{2}, \ldots, a_{n} \in \mathbb{C}}~\\
\left(M = \left(\sum_{i=1}^{n} \left(a_{i} \cdot \textrm{OrthoProj}\left(\mathcal{H}, \textrm{Span}\left(\left\{x_{i}\right\}\right)\right)\right)\right)\right)\end{array}\right]\end{array}\right] \end{array} \end{array}\right)\right]\end{array}\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: 14
operand: 2
1ExprTuple2
2Lambdaparameter: 104
body: 4
3ExprTuple104
4Conditionalvalue: 5
condition: 6
5Operationoperator: 14
operand: 9
6Operationoperator: 89
operands: 8
7ExprTuple9
8ExprTuple104, 10
9Lambdaparameter: 101
body: 11
10Literal
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operand: 17
13Operationoperator: 69
operands: 16
14Literal
15ExprTuple17
16ExprTuple18, 19
17Lambdaparameter: 72
body: 20
18Operationoperator: 21
operands: 22
19Operationoperator: 67
operands: 23
20Conditionalvalue: 24
condition: 25
21Literal
22ExprTuple101, 26
23ExprTuple27, 104
24Operationoperator: 28
operands: 29
25Operationoperator: 89
operands: 30
26Literal
27Operationoperator: 31
operand: 101
28Literal
29ExprTuple32, 33
30ExprTuple72, 34
31Literal
32Operationoperator: 67
operands: 35
33Operationoperator: 51
operand: 41
34Operationoperator: 37
operands: 38
35ExprTuple39, 40
36ExprTuple41
37Literal
38ExprTuple101, 101
39Operationoperator: 43
operands: 42
40Operationoperator: 43
operands: 44
41Lambdaparameters: 59
body: 45
42ExprTuple46, 72
43Literal
44ExprTuple72, 46
45Conditionalvalue: 47
condition: 48
46Operationoperator: 49
operand: 72
47Operationoperator: 51
operand: 54
48Operationoperator: 89
operands: 53
49Literal
50ExprTuple72
51Literal
52ExprTuple54
53ExprTuple55, 56
54Lambdaparameters: 57
body: 58
55Operationoperator: 108
operands: 59
56Operationoperator: 60
operand: 101
57ExprTuple62
58Conditionalvalue: 63
condition: 64
59ExprTuple65
60Literal
61ExprTuple101
62ExprRangelambda_map: 66
start_index: 103
end_index: 104
63Operationoperator: 67
operands: 68
64Operationoperator: 69
operands: 70
65ExprRangelambda_map: 71
start_index: 103
end_index: 104
66Lambdaparameter: 95
body: 85
67Literal
68ExprTuple72, 73
69Literal
70ExprTuple74
71Lambdaparameter: 95
body: 75
72Variable
73Operationoperator: 76
operand: 79
74ExprRangelambda_map: 78
start_index: 103
end_index: 104
75IndexedVarvariable: 111
index: 95
76Literal
77ExprTuple79
78Lambdaparameter: 95
body: 80
79Lambdaparameter: 113
body: 81
80Operationoperator: 89
operands: 82
81Conditionalvalue: 83
condition: 84
82ExprTuple85, 86
83Operationoperator: 87
operands: 88
84Operationoperator: 89
operands: 90
85IndexedVarvariable: 96
index: 95
86Literal
87Literal
88ExprTuple92, 93
89Literal
90ExprTuple113, 94
91ExprTuple95
92IndexedVarvariable: 96
index: 113
93Operationoperator: 97
operands: 98
94Operationoperator: 99
operands: 100
95Variable
96Variable
97Literal
98ExprTuple101, 102
99Literal
100ExprTuple103, 104
101Variable
102Operationoperator: 105
operand: 107
103Literal
104Variable
105Literal
106ExprTuple107
107Operationoperator: 108
operand: 110
108Literal
109ExprTuple110
110IndexedVarvariable: 111
index: 113
111Variable
112ExprTuple113
113Variable