logo

Expression of type ExprTuple

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, ExprTuple, 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 = ExprTuple(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())
\left(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..\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: 46
body: 3
2ExprTuple46
3Conditionalvalue: 4
condition: 5
4Operationoperator: 14
operand: 8
5Operationoperator: 16
operands: 7
6ExprTuple8
7ExprTuple46, 9
8Lambdaparameter: 45
body: 11
9Literal
10ExprTuple45
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operand: 18
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18
16Literal
17ExprTuple45, 19
18Lambdaparameters: 32
body: 20
19Literal
20Operationoperator: 21
operands: 22
21Literal
22ExprTuple23, 24
23Operationoperator: 26
operands: 25
24Operationoperator: 26
operands: 27
25ExprTuple28, 29
26Literal
27ExprTuple30, 31
28Operationoperator: 34
operands: 32
29Operationoperator: 36
operands: 33
30Operationoperator: 34
operands: 35
31Operationoperator: 36
operands: 37
32ExprTuple44, 40
33ExprTuple45, 40
34Literal
35ExprTuple38, 40
36Literal
37ExprTuple39, 40
38Operationoperator: 42
operands: 41
39Operationoperator: 42
operands: 43
40Variable
41ExprTuple44, 46
42Literal
43ExprTuple45, 46
44Variable
45Variable
46Variable