logo

Expression of type Forall

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, m, rho, x
from proveit.linear_algebra import MatrixExp, MatrixMult, ScalarMult
from proveit.logic import Equals, Forall
from proveit.numbers import Exp, Mult, NaturalPos, Real, e, i, pi, two
In [2]:
# build up the expression from sub-expressions
expr = Forall(instance_param_or_params = [m], instance_expr = Forall(instance_param_or_params = [rho], instance_expr = 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))), domain = Real), domain = 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())
\forall_{m \in \mathbb{N}^+}~\left[\forall_{\rho \in \mathbb{R}}~\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)\right]\right]
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneNone/False('with_wrapping',)
condition_wrappingWrap 'before' or 'after' the condition (or None).NoneNone/False('with_wrap_after_condition', 'with_wrap_before_condition')
wrap_paramsIf 'True', wraps every two parameters AND wraps the Expression after the parametersNoneNone/False('with_params',)
justificationjustify to the 'left', 'center', or 'right' in the array cellscentercenter('with_justification',)
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 15
operand: 2
1ExprTuple2
2Lambdaparameter: 58
body: 4
3ExprTuple58
4Conditionalvalue: 5
condition: 6
5Operationoperator: 15
operand: 9
6Operationoperator: 17
operands: 8
7ExprTuple9
8ExprTuple58, 10
9Lambdaparameter: 59
body: 12
10Literal
11ExprTuple59
12Conditionalvalue: 13
condition: 14
13Operationoperator: 15
operand: 19
14Operationoperator: 17
operands: 18
15Literal
16ExprTuple19
17Literal
18ExprTuple59, 20
19Lambdaparameters: 34
body: 21
20Literal
21Conditionalvalue: 22
condition: 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
31ExprTuple37, 40
32ExprTuple38, 40
33Literal
34ExprTuple46, 40
35Literal
36ExprTuple39, 40
37Operationoperator: 41
operands: 42
38Operationoperator: 44
operands: 43
39Operationoperator: 44
operands: 45
40Variable
41Literal
42ExprTuple46, 58
43ExprTuple48, 47
44Literal
45ExprTuple48, 49
46Variable
47Operationoperator: 56
operands: 50
48Literal
49Operationoperator: 56
operands: 51
50ExprTuple53, 54, 55, 52
51ExprTuple53, 54, 55, 59
52Operationoperator: 56
operands: 57
53Literal
54Literal
55Literal
56Literal
57ExprTuple58, 59
58Variable
59Variable