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.division import distribute_frac_through_summation
In [2]:
# check that the built expression is the same as the stored expression
assert distribute_frac_through_summation.expr == stored_expr
assert distribute_frac_through_summation.expr._style_id == stored_expr._style_id
print("Passed sanity check: distribute_frac_through_summation matches stored_expr")
Passed sanity check: distribute_frac_through_summation matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{P, S}~\left(\left[\forall_{y \in S}~\left(P\left(y\right) \in \mathbb{C}\right)\right] \Rightarrow \left[\forall_{z \in \mathbb{C}~|~z \neq 0}~\left(\frac{\sum_{y \in S}~P\left(y\right)}{z} = \left[\sum_{y \in S}~\frac{P\left(y\right)}{z}\right]\right)\right]\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: 10
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple51, 53
4Operationoperator: 5
operands: 6
5Literal
6ExprTuple7, 8
7Operationoperator: 10
operand: 12
8Operationoperator: 10
operand: 13
9ExprTuple12
10Literal
11ExprTuple13
12Lambdaparameter: 54
body: 14
13Lambdaparameter: 48
body: 16
14Conditionalvalue: 17
condition: 46
15ExprTuple48
16Conditionalvalue: 18
condition: 19
17Operationoperator: 49
operands: 20
18Operationoperator: 21
operands: 22
19Operationoperator: 23
operands: 24
20ExprTuple47, 36
21Literal
22ExprTuple25, 26
23Literal
24ExprTuple27, 28
25Operationoperator: 44
operands: 29
26Operationoperator: 38
operand: 35
27Operationoperator: 49
operands: 31
28Operationoperator: 32
operands: 33
29ExprTuple34, 48
30ExprTuple35
31ExprTuple48, 36
32Literal
33ExprTuple48, 37
34Operationoperator: 38
operand: 41
35Lambdaparameter: 54
body: 40
36Literal
37Literal
38Literal
39ExprTuple41
40Conditionalvalue: 42
condition: 46
41Lambdaparameter: 54
body: 43
42Operationoperator: 44
operands: 45
43Conditionalvalue: 47
condition: 46
44Literal
45ExprTuple47, 48
46Operationoperator: 49
operands: 50
47Operationoperator: 51
operand: 54
48Variable
49Literal
50ExprTuple54, 53
51Variable
52ExprTuple54
53Variable
54Variable