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, theta, 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
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda(m, Conditional(Forall(instance_param_or_params = [theta], instance_expr = Forall(instance_param_or_params = [A, x], instance_expr = Equals(MatrixMult(MatrixExp(A, m), x), ScalarMult(Exp(e, Mult(i, Mult(m, theta))), x)), condition = Equals(MatrixMult(A, x), ScalarMult(Exp(e, Mult(i, theta)), 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_{\theta \in \mathbb{R}}~\left[\forall_{A, x~|~\left(A \thinspace x\right) = \left(\mathsf{e}^{\mathsf{i} \cdot \theta} \cdot x\right)}~\left(\left(A^{m} \thinspace x\right) = \left(\mathsf{e}^{\mathsf{i} \cdot \left(m \cdot \theta\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: 55
body: 3
2ExprTuple55
3Conditionalvalue: 4
condition: 5
4Operationoperator: 14
operand: 8
5Operationoperator: 16
operands: 7
6ExprTuple8
7ExprTuple55, 9
8Lambdaparameter: 56
body: 11
9Literal
10ExprTuple56
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operand: 18
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18
16Literal
17ExprTuple56, 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, 55
42ExprTuple47, 46
43Literal
44ExprTuple47, 48
45Variable
46Operationoperator: 53
operands: 49
47Literal
48Operationoperator: 53
operands: 50
49ExprTuple52, 51
50ExprTuple52, 56
51Operationoperator: 53
operands: 54
52Literal
53Literal
54ExprTuple55, 56
55Variable
56Variable