logo

Expression of type ExprTuple

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, ExprTuple, 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 = ExprTuple(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())
\left(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..\right)
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1
1Lambdaparameter: 45
body: 3
2ExprTuple45
3Conditionalvalue: 4
condition: 5
4Operationoperator: 14
operand: 8
5Operationoperator: 16
operands: 7
6ExprTuple8
7ExprTuple45, 9
8Lambdaparameter: 44
body: 11
9Literal
10ExprTuple44
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operand: 18
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18
16Literal
17ExprTuple44, 19
18Lambdaparameters: 33
body: 20
19Literal
20Conditionalvalue: 21
condition: 22
21Operationoperator: 24
operands: 23
22Operationoperator: 24
operands: 25
23ExprTuple26, 27
24Literal
25ExprTuple28, 29
26Operationoperator: 32
operands: 30
27Operationoperator: 32
operands: 31
28Operationoperator: 32
operands: 33
29Operationoperator: 34
operands: 35
30ExprTuple36, 38
31ExprTuple37, 38
32Literal
33ExprTuple43, 38
34Literal
35ExprTuple44, 38
36Operationoperator: 39
operands: 40
37Operationoperator: 41
operands: 42
38Variable
39Literal
40ExprTuple43, 45
41Literal
42ExprTuple44, 45
43Variable
44Variable
45Variable