logo

Expression of type ExprTuple

from the theory of proveit.linear_algebra.inner_products

In [1]:
import proveit
# Automation is not needed when building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_expr # Load the stored expression as 'stored_expr'
# import Expression classes needed to build the expression
from proveit import A, Composition, Conditional, ExprTuple, Lambda, U
from proveit.linear_algebra import Adj, Hspace, Identity, LinMap
from proveit.logic import Equals, Exists, InSet
from proveit.numbers import sqrt
In [2]:
# build up the expression from sub-expressions
sub_expr1 = LinMap(Hspace, Hspace)
expr = ExprTuple(Lambda(A, Conditional(Exists(instance_param_or_params = [U], instance_expr = Equals(A, Composition(sqrt(Composition(A, Adj(A))), U)), domain = sub_expr1, condition = Equals(Composition(Adj(U), U), Identity(Hspace))).with_wrapping(), InSet(A, sub_expr1))))
expr:
In [3]:
# check that the built expression is the same as the stored expression
assert expr == stored_expr
assert expr._style_id == stored_expr._style_id
print("Passed sanity check: expr matches stored_expr")
Passed sanity check: expr matches stored_expr
In [4]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\left(A \mapsto \left\{\begin{array}{l}\exists_{U \in \mathcal{L}\left(\mathcal{H}, \mathcal{H}\right)~|~\left(U^{\dagger} \circ U\right) = I_{\mathcal{H}}}~\\
\left(A = \left(\sqrt{\left(A \circ A^{\dagger}\right)} \circ U\right)\right)\end{array} \textrm{ if } A \in \mathcal{L}\left(\mathcal{H}, \mathcal{H}\right)\right..\right)
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1
1Lambdaparameter: 49
body: 2
2Conditionalvalue: 3
condition: 4
3Operationoperator: 5
operand: 8
4Operationoperator: 19
operands: 7
5Literal
6ExprTuple8
7ExprTuple49, 24
8Lambdaparameter: 46
body: 9
9Conditionalvalue: 10
condition: 11
10Operationoperator: 21
operands: 12
11Operationoperator: 13
operands: 14
12ExprTuple49, 15
13Literal
14ExprTuple16, 17
15Operationoperator: 38
operands: 18
16Operationoperator: 19
operands: 20
17Operationoperator: 21
operands: 22
18ExprTuple23, 46
19Literal
20ExprTuple46, 24
21Literal
22ExprTuple25, 26
23Operationoperator: 27
operands: 28
24Operationoperator: 29
operands: 30
25Operationoperator: 38
operands: 31
26Operationoperator: 32
operand: 37
27Literal
28ExprTuple34, 35
29Literal
30ExprTuple37, 37
31ExprTuple36, 46
32Literal
33ExprTuple37
34Operationoperator: 38
operands: 39
35Operationoperator: 40
operands: 41
36Operationoperator: 47
operand: 46
37Variable
38Literal
39ExprTuple49, 43
40Literal
41ExprTuple44, 45
42ExprTuple46
43Operationoperator: 47
operand: 49
44Literal
45Literal
46Variable
47Literal
48ExprTuple49
49Variable