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, b, m, x
from proveit.linear_algebra import MatrixExp, MatrixMult, ScalarMult
from proveit.logic import Equals, Forall, InSet
from proveit.numbers import Complex, Exp, NaturalPos
In [2]:
# build up the expression from sub-expressions
expr = Lambda(m, Conditional(Forall(instance_param_or_params = [b], instance_expr = Forall(instance_param_or_params = [A, x], instance_expr = Equals(MatrixMult(MatrixExp(A, m), x), MatrixMult(Exp(b, m), x)), condition = Equals(MatrixMult(A, x), ScalarMult(b, x))), domain = Complex), 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_{b \in \mathbb{C}}~\left[\forall_{A, x~|~\left(A \thinspace x\right) = \left(b \cdot x\right)}~\left(\left(A^{m} \thinspace x\right) = \left(b^{m} \thinspace 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: 44
body: 2
1ExprTuple44
2Conditionalvalue: 3
condition: 4
3Operationoperator: 13
operand: 7
4Operationoperator: 15
operands: 6
5ExprTuple7
6ExprTuple44, 8
7Lambdaparameter: 43
body: 10
8Literal
9ExprTuple43
10Conditionalvalue: 11
condition: 12
11Operationoperator: 13
operand: 17
12Operationoperator: 15
operands: 16
13Literal
14ExprTuple17
15Literal
16ExprTuple43, 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: 31
operands: 30
27Operationoperator: 31
operands: 32
28Operationoperator: 33
operands: 34
29ExprTuple35, 37
30ExprTuple36, 37
31Literal
32ExprTuple42, 37
33Literal
34ExprTuple43, 37
35Operationoperator: 38
operands: 39
36Operationoperator: 40
operands: 41
37Variable
38Literal
39ExprTuple42, 44
40Literal
41ExprTuple43, 44
42Variable
43Variable
44Variable