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_axiom_expr # Load the stored axiom expression as 'stored_expr'
# import the special expression
from proveit.linear_algebra import linear_map_binary_addition
In [2]:
# check that the built expression is the same as the stored expression
assert linear_map_binary_addition.expr == stored_expr
assert linear_map_binary_addition.expr._style_id == stored_expr._style_id
print("Passed sanity check: linear_map_binary_addition matches stored_expr")
Passed sanity check: linear_map_binary_addition matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{V, W}~\left[\forall_{S, T \in \mathcal{L}\left(V, W\right)}~\left[\forall_{v \in V}~\left(\left(S + T\right)\left(v\right) = \left(S\left(v\right) + T\left(v\right)\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: 9
operand: 2
1ExprTuple2
2Lambdaparameters: 27
body: 3
3Operationoperator: 9
operand: 5
4ExprTuple5
5Lambdaparameters: 36
body: 6
6Conditionalvalue: 7
condition: 8
7Operationoperator: 9
operand: 13
8Operationoperator: 11
operands: 12
9Literal
10ExprTuple13
11Literal
12ExprTuple14, 15
13Lambdaparameter: 42
body: 16
14Operationoperator: 24
operands: 17
15Operationoperator: 24
operands: 18
16Conditionalvalue: 19
condition: 20
17ExprTuple39, 21
18ExprTuple40, 21
19Operationoperator: 22
operands: 23
20Operationoperator: 24
operands: 25
21Operationoperator: 26
operands: 27
22Literal
23ExprTuple28, 29
24Literal
25ExprTuple42, 30
26Literal
27ExprTuple30, 31
28Operationoperator: 32
operand: 42
29Operationoperator: 33
operands: 34
30Variable
31Variable
32Operationoperator: 35
operands: 36
33Literal
34ExprTuple37, 38
35Literal
36ExprTuple39, 40
37Operationoperator: 39
operand: 42
38Operationoperator: 40
operand: 42
39Variable
40Variable
41ExprTuple42
42Variable