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 lin_map_def
In [2]:
# check that the built expression is the same as the stored expression
assert lin_map_def.expr == stored_expr
assert lin_map_def.expr._style_id == stored_expr._style_id
print("Passed sanity check: lin_map_def matches stored_expr")
Passed sanity check: lin_map_def 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_{P}~\left(\begin{array}{c} \begin{array}{l} \left(P \in \mathcal{L}\left(V, W\right)\right) \Leftrightarrow  \\ \left(\begin{array}{c} \left[\forall_{x \in V}~\left(P\left(x\right) \in W\right)\right] \land  \\ \left[\forall_{x, y \in V}~\left(P\left(x + y\right) = \left(P\left(x\right) + P\left(y\right)\right)\right)\right] \land  \\ \left[\forall_{c \in K}~\left[\forall_{x \in V}~\left(P\left(c \cdot x\right) = \left(c \cdot P\left(x\right)\right)\right)\right]\right] \end{array}\right) \end{array} \end{array}\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: 53
operand: 2
1ExprTuple2
2Lambdaparameter: 61
body: 3
3Operationoperator: 53
operand: 5
4ExprTuple5
5Lambdaparameters: 33
body: 6
6Conditionalvalue: 7
condition: 8
7Operationoperator: 53
operand: 11
8Operationoperator: 51
operands: 10
9ExprTuple11
10ExprTuple12, 13
11Lambdaparameter: 87
body: 15
12Operationoperator: 17
operands: 16
13Operationoperator: 17
operands: 18
14ExprTuple87
15Operationoperator: 19
operands: 20
16ExprTuple80, 21
17Literal
18ExprTuple56, 21
19Literal
20ExprTuple22, 23
21Operationoperator: 24
operand: 61
22Operationoperator: 75
operands: 26
23Operationoperator: 51
operands: 27
24Literal
25ExprTuple61
26ExprTuple87, 28
27ExprTuple29, 30, 31
28Operationoperator: 32
operands: 33
29Operationoperator: 53
operand: 37
30Operationoperator: 53
operand: 38
31Operationoperator: 53
operand: 39
32Literal
33ExprTuple80, 56
34ExprTuple37
35ExprTuple38
36ExprTuple39
37Lambdaparameter: 90
body: 40
38Lambdaparameters: 71
body: 41
39Lambdaparameter: 89
body: 43
40Conditionalvalue: 44
condition: 69
41Conditionalvalue: 45
condition: 46
42ExprTuple89
43Conditionalvalue: 47
condition: 48
44Operationoperator: 75
operands: 49
45Operationoperator: 73
operands: 50
46Operationoperator: 51
operands: 52
47Operationoperator: 53
operand: 60
48Operationoperator: 75
operands: 55
49ExprTuple84, 56
50ExprTuple57, 58
51Literal
52ExprTuple69, 59
53Literal
54ExprTuple60
55ExprTuple89, 61
56Variable
57Operationoperator: 87
operand: 66
58Operationoperator: 70
operands: 63
59Operationoperator: 75
operands: 64
60Lambdaparameter: 90
body: 65
61Variable
62ExprTuple66
63ExprTuple84, 67
64ExprTuple77, 80
65Conditionalvalue: 68
condition: 69
66Operationoperator: 70
operands: 71
67Operationoperator: 87
operand: 77
68Operationoperator: 73
operands: 74
69Operationoperator: 75
operands: 76
70Literal
71ExprTuple90, 77
72ExprTuple77
73Literal
74ExprTuple78, 79
75Literal
76ExprTuple90, 80
77Variable
78Operationoperator: 87
operand: 83
79Operationoperator: 85
operands: 82
80Variable
81ExprTuple83
82ExprTuple89, 84
83Operationoperator: 85
operands: 86
84Operationoperator: 87
operand: 90
85Literal
86ExprTuple89, 90
87Variable
88ExprTuple90
89Variable
90Variable