logo

Expression of type Lambda

from the theory of proveit.linear_algebra.matrices

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, k, x
from proveit.linear_algebra import MatrixMult, ScalarMult
from proveit.logic import Equals, Forall, Implies, InSet
from proveit.numbers import Complex, Exp, NaturalPos
In [2]:
# build up the expression from sub-expressions
expr = Lambda(k, Conditional(Forall(instance_param_or_params = [b], instance_expr = Forall(instance_param_or_params = [A, x], instance_expr = Implies(Equals(MatrixMult(A, x), ScalarMult(b, x)), Equals(MatrixMult(Exp(A, k), x), ScalarMult(Exp(b, k), x)))), domain = Complex), InSet(k, 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())
k \mapsto \left\{\forall_{b \in \mathbb{C}}~\left[\forall_{A, x}~\left(\left(\left(A \thinspace x\right) = \left(b \cdot x\right)\right) \Rightarrow \left(\left(A^{k} \thinspace x\right) = \left(b^{k} \cdot x\right)\right)\right)\right] \textrm{ if } k \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: 45
body: 2
1ExprTuple45
2Conditionalvalue: 3
condition: 4
3Operationoperator: 13
operand: 7
4Operationoperator: 15
operands: 6
5ExprTuple7
6ExprTuple45, 8
7Lambdaparameter: 44
body: 10
8Literal
9ExprTuple44
10Conditionalvalue: 11
condition: 12
11Operationoperator: 13
operand: 17
12Operationoperator: 15
operands: 16
13Literal
14ExprTuple17
15Literal
16ExprTuple44, 18
17Lambdaparameters: 31
body: 19
18Literal
19Operationoperator: 20
operands: 21
20Literal
21ExprTuple22, 23
22Operationoperator: 25
operands: 24
23Operationoperator: 25
operands: 26
24ExprTuple27, 28
25Literal
26ExprTuple29, 30
27Operationoperator: 33
operands: 31
28Operationoperator: 35
operands: 32
29Operationoperator: 33
operands: 34
30Operationoperator: 35
operands: 36
31ExprTuple43, 39
32ExprTuple44, 39
33Literal
34ExprTuple37, 39
35Literal
36ExprTuple38, 39
37Operationoperator: 41
operands: 40
38Operationoperator: 41
operands: 42
39Variable
40ExprTuple43, 45
41Literal
42ExprTuple44, 45
43Variable
44Variable
45Variable