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, 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 = 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())
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..
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Lambdaparameter: 56
body: 2
1ExprTuple56
2Conditionalvalue: 3
condition: 4
3Operationoperator: 13
operand: 7
4Operationoperator: 15
operands: 6
5ExprTuple7
6ExprTuple56, 8
7Lambdaparameter: 57
body: 10
8Literal
9ExprTuple57
10Conditionalvalue: 11
condition: 12
11Operationoperator: 13
operand: 17
12Operationoperator: 15
operands: 16
13Literal
14ExprTuple17
15Literal
16ExprTuple57, 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, 56
41ExprTuple46, 45
42Literal
43ExprTuple46, 47
44Variable
45Operationoperator: 54
operands: 48
46Literal
47Operationoperator: 54
operands: 49
48ExprTuple51, 52, 53, 50
49ExprTuple51, 52, 53, 57
50Operationoperator: 54
operands: 55
51Literal
52Literal
53Literal
54Literal
55ExprTuple56, 57
56Variable
57Variable