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.linear_maps import vec_add_lin_map
In [2]:
# check that the built expression is the same as the stored expression
assert vec_add_lin_map.expr == stored_expr
assert vec_add_lin_map.expr._style_id == stored_expr._style_id
print("Passed sanity check: vec_add_lin_map matches stored_expr")
Passed sanity check: vec_add_lin_map matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{K}~\left[\forall_{V, W \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left[\forall_{A, B \in \mathcal{L}\left(V, W\right)}~\left(\left(A + B\right) = \left[x \mapsto \left\{A\left(x\right) + B\left(x\right) \textrm{ if } x \in 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
2Lambdaparameter: 32
body: 3
3Operationoperator: 9
operand: 5
4ExprTuple5
5Lambdaparameters: 45
body: 6
6Conditionalvalue: 7
condition: 8
7Operationoperator: 9
operand: 12
8Operationoperator: 24
operands: 11
9Literal
10ExprTuple12
11ExprTuple13, 14
12Lambdaparameters: 33
body: 15
13Operationoperator: 17
operands: 16
14Operationoperator: 17
operands: 18
15Conditionalvalue: 19
condition: 20
16ExprTuple48, 21
17Literal
18ExprTuple49, 21
19Operationoperator: 22
operands: 23
20Operationoperator: 24
operands: 25
21Operationoperator: 26
operand: 32
22Literal
23ExprTuple28, 29
24Literal
25ExprTuple30, 31
26Literal
27ExprTuple32
28Operationoperator: 40
operands: 33
29Lambdaparameter: 53
body: 34
30Operationoperator: 42
operands: 35
31Operationoperator: 42
operands: 36
32Variable
33ExprTuple50, 51
34Conditionalvalue: 37
condition: 38
35ExprTuple50, 39
36ExprTuple51, 39
37Operationoperator: 40
operands: 41
38Operationoperator: 42
operands: 43
39Operationoperator: 44
operands: 45
40Literal
41ExprTuple46, 47
42Literal
43ExprTuple53, 48
44Literal
45ExprTuple48, 49
46Operationoperator: 50
operand: 53
47Operationoperator: 51
operand: 53
48Variable
49Variable
50Variable
51Variable
52ExprTuple53
53Variable