# 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.
# import Expression classes needed to build the expression
from proveit import A, m, n
from proveit.linear_algebra import MatrixExp, Unitary
from proveit.logic import Forall, InSet
from proveit.numbers import NaturalPos

In [2]:
# build up the expression from sub-expressions
sub_expr1 = Unitary(n)
expr = Forall(instance_param_or_params = [m, n], instance_expr = Forall(instance_param_or_params = [A], instance_expr = InSet(MatrixExp(A, m), sub_expr1), domain = sub_expr1), 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, n \in \mathbb{N}^+}~\left[\forall_{A \in \textrm{U}\left(n\right)}~\left(A^{m} \in \textrm{U}\left(n\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: 7
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple31, 32
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 11
6Operationoperator: 9
operands: 10
7Literal
8ExprTuple11
9Literal
10ExprTuple12, 13
11Lambdaparameter: 30
body: 15
12Operationoperator: 22
operands: 16
13Operationoperator: 22
operands: 17
14ExprTuple30
15Conditionalvalue: 18
condition: 19
16ExprTuple31, 20
17ExprTuple32, 20
18Operationoperator: 22
operands: 21
19Operationoperator: 22
operands: 23
20Literal
21ExprTuple24, 25
22Literal
23ExprTuple30, 25
24Operationoperator: 26
operands: 27
25Operationoperator: 28
operand: 32
26Literal
27ExprTuple30, 31
28Literal
29ExprTuple32
30Variable
31Variable
32Variable