logo
In [1]:
import proveit
# Automation is not needed when only building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_theorem_expr # Load the stored theorem expression as 'stored_expr'
# import the special expression
from proveit.numbers.number_sets.complex_numbers import exp_2pi_i_x
In [2]:
# check that the built expression is the same as the stored expression
assert exp_2pi_i_x.expr == stored_expr
assert exp_2pi_i_x.expr._style_id == stored_expr._style_id
print("Passed sanity check: exp_2pi_i_x matches stored_expr")
Passed sanity check: exp_2pi_i_x matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{x, r \in \mathbb{R}}~\left(\mathsf{e}^{\frac{2 \cdot \pi \cdot \mathsf{i} \cdot \left(x ~\textup{mod}~ r\right)}{r}} = \mathsf{e}^{\frac{2 \cdot \pi \cdot \mathsf{i} \cdot x}{r}}\right)
In [4]:
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 [5]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 1
operand: 3
1Literal
2ExprTuple3
3Lambdaparameters: 38
body: 4
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operands: 8
6Operationoperator: 9
operands: 10
7Literal
8ExprTuple11, 12
9Literal
10ExprTuple13, 14
11Operationoperator: 16
operands: 15
12Operationoperator: 16
operands: 17
13Operationoperator: 19
operands: 18
14Operationoperator: 19
operands: 20
15ExprTuple22, 21
16Literal
17ExprTuple22, 23
18ExprTuple39, 24
19Literal
20ExprTuple40, 24
21Operationoperator: 26
operands: 25
22Literal
23Operationoperator: 26
operands: 27
24Literal
25ExprTuple28, 40
26Literal
27ExprTuple29, 40
28Operationoperator: 31
operands: 30
29Operationoperator: 31
operands: 32
30ExprTuple34, 35, 36, 33
31Literal
32ExprTuple34, 35, 36, 39
33Operationoperator: 37
operands: 38
34Literal
35Literal
36Literal
37Literal
38ExprTuple39, 40
39Variable
40Variable