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.linear_algebra.scalar_multiplication import one_as_scalar_mult_id
In [2]:
# check that the built expression is the same as the stored expression
assert one_as_scalar_mult_id.expr == stored_expr
assert one_as_scalar_mult_id.expr._style_id == stored_expr._style_id
print("Passed sanity check: one_as_scalar_mult_id matches stored_expr")
Passed sanity check: one_as_scalar_mult_id matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{K~|~1 \in K}~\left[\forall_{v \in V, V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left(\left(1 \cdot v\right) = v\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: 6
operand: 2
1ExprTuple2
2Lambdaparameter: 32
body: 3
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 22
operands: 8
6Literal
7ExprTuple9
8ExprTuple26, 32
9Lambdaparameters: 23
body: 10
10Conditionalvalue: 11
condition: 12
11Operationoperator: 13
operands: 14
12Operationoperator: 15
operands: 16
13Literal
14ExprTuple17, 27
15Literal
16ExprTuple18, 19
17Operationoperator: 20
operands: 21
18Operationoperator: 22
operands: 23
19Operationoperator: 24
operands: 25
20Literal
21ExprTuple26, 27
22Literal
23ExprTuple27, 28
24Literal
25ExprTuple28, 29
26Literal
27Variable
28Variable
29Operationoperator: 30
operand: 32
30Literal
31ExprTuple32
32Variable