logo

Expression of type Lambda

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, 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 = 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())
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..
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Lambdaparameter: 54
body: 2
1ExprTuple54
2Conditionalvalue: 3
condition: 4
3Operationoperator: 13
operand: 7
4Operationoperator: 15
operands: 6
5ExprTuple7
6ExprTuple54, 8
7Lambdaparameter: 55
body: 10
8Literal
9ExprTuple55
10Conditionalvalue: 11
condition: 12
11Operationoperator: 13
operand: 17
12Operationoperator: 15
operands: 16
13Literal
14ExprTuple17
15Literal
16ExprTuple55, 18
17Lambdaparameters: 32
body: 19
18Literal
19Conditionalvalue: 20
condition: 21
20Operationoperator: 23
operands: 22
21Operationoperator: 23
operands: 24
22ExprTuple25, 26
23Literal
24ExprTuple27, 28
25Operationoperator: 31
operands: 29
26Operationoperator: 33
operands: 30
27Operationoperator: 31
operands: 32
28Operationoperator: 33
operands: 34
29ExprTuple35, 38
30ExprTuple36, 38
31Literal
32ExprTuple44, 38
33Literal
34ExprTuple37, 38
35Operationoperator: 39
operands: 40
36Operationoperator: 42
operands: 41
37Operationoperator: 42
operands: 43
38Variable
39Literal
40ExprTuple44, 54
41ExprTuple46, 45
42Literal
43ExprTuple46, 47
44Variable
45Operationoperator: 52
operands: 48
46Literal
47Operationoperator: 52
operands: 49
48ExprTuple51, 50
49ExprTuple51, 55
50Operationoperator: 52
operands: 53
51Literal
52Literal
53ExprTuple54, 55
54Variable
55Variable