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, Real, e, i, pi, two
In [2]:
# build up the expression from sub-expressions
expr = Lambda(rho, Conditional(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))), InSet(rho, Real)))
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())
\rho \mapsto \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) \textrm{ if } \rho \in \mathbb{R}\right..
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Lambdaparameter: 49
body: 2
1ExprTuple49
2Conditionalvalue: 3
condition: 4
3Operationoperator: 5
operand: 9
4Operationoperator: 7
operands: 8
5Literal
6ExprTuple9
7Literal
8ExprTuple49, 10
9Lambdaparameters: 24
body: 11
10Literal
11Conditionalvalue: 12
condition: 13
12Operationoperator: 15
operands: 14
13Operationoperator: 15
operands: 16
14ExprTuple17, 18
15Literal
16ExprTuple19, 20
17Operationoperator: 23
operands: 21
18Operationoperator: 25
operands: 22
19Operationoperator: 23
operands: 24
20Operationoperator: 25
operands: 26
21ExprTuple27, 30
22ExprTuple28, 30
23Literal
24ExprTuple36, 30
25Literal
26ExprTuple29, 30
27Operationoperator: 31
operands: 32
28Operationoperator: 34
operands: 33
29Operationoperator: 34
operands: 35
30Variable
31Literal
32ExprTuple36, 48
33ExprTuple38, 37
34Literal
35ExprTuple38, 39
36Variable
37Operationoperator: 46
operands: 40
38Literal
39Operationoperator: 46
operands: 41
40ExprTuple43, 44, 45, 42
41ExprTuple43, 44, 45, 49
42Operationoperator: 46
operands: 47
43Literal
44Literal
45Literal
46Literal
47ExprTuple48, 49
48Variable
49Variable