logo

Expression of type ExprTuple

from the theory of proveit.linear_algebra.matrices.exponentiation

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, Conditional, ExprTuple, Lambda, m, rho, x
from proveit.linear_algebra import MatrixExp, MatrixMult, ScalarMult
from proveit.logic import Equals, Forall, InSet
from proveit.numbers import Exp, Mult, NaturalPos, Real, e, i, pi, two
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda(m, Conditional(Forall(instance_param_or_params = [rho], instance_expr = Forall(instance_param_or_params = [A, x], instance_expr = Equals(MatrixMult(MatrixExp(A, m), x), ScalarMult(Exp(e, Mult(two, pi, i, Mult(m, rho))), x)), condition = Equals(MatrixMult(A, x), ScalarMult(Exp(e, Mult(two, pi, i, rho)), x))), domain = Real), InSet(m, NaturalPos))))
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(m \mapsto \left\{\forall_{\rho \in \mathbb{R}}~\left[\forall_{A, x~|~\left(A \thinspace x\right) = \left(\mathsf{e}^{2 \cdot \pi \cdot \mathsf{i} \cdot \rho} \cdot x\right)}~\left(\left(A^{m} \thinspace x\right) = \left(\mathsf{e}^{2 \cdot \pi \cdot \mathsf{i} \cdot \left(m \cdot \rho\right)} \cdot x\right)\right)\right] \textrm{ if } m \in \mathbb{N}^+\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: 57
body: 3
2ExprTuple57
3Conditionalvalue: 4
condition: 5
4Operationoperator: 14
operand: 8
5Operationoperator: 16
operands: 7
6ExprTuple8
7ExprTuple57, 9
8Lambdaparameter: 58
body: 11
9Literal
10ExprTuple58
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operand: 18
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18
16Literal
17ExprTuple58, 19
18Lambdaparameters: 33
body: 20
19Literal
20Conditionalvalue: 21
condition: 22
21Operationoperator: 24
operands: 23
22Operationoperator: 24
operands: 25
23ExprTuple26, 27
24Literal
25ExprTuple28, 29
26Operationoperator: 32
operands: 30
27Operationoperator: 34
operands: 31
28Operationoperator: 32
operands: 33
29Operationoperator: 34
operands: 35
30ExprTuple36, 39
31ExprTuple37, 39
32Literal
33ExprTuple45, 39
34Literal
35ExprTuple38, 39
36Operationoperator: 40
operands: 41
37Operationoperator: 43
operands: 42
38Operationoperator: 43
operands: 44
39Variable
40Literal
41ExprTuple45, 57
42ExprTuple47, 46
43Literal
44ExprTuple47, 48
45Variable
46Operationoperator: 55
operands: 49
47Literal
48Operationoperator: 55
operands: 50
49ExprTuple52, 53, 54, 51
50ExprTuple52, 53, 54, 58
51Operationoperator: 55
operands: 56
52Literal
53Literal
54Literal
55Literal
56ExprTuple57, 58
57Variable
58Variable