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.logic.sets.functions.bijections import bijection_transitivity
In [2]:
# check that the built expression is the same as the stored expression
assert bijection_transitivity.expr == stored_expr
assert bijection_transitivity.expr._style_id == stored_expr._style_id
print("Passed sanity check: bijection_transitivity matches stored_expr")
Passed sanity check: bijection_transitivity matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{f, g, A, B, C}~\left(\begin{array}{c} \begin{array}{l} \left(\left(f \in \left[A \xrightarrow[\text{onto}]{\text{1-to-1}} B\right]\right) \land \left(g \in \left[B \xrightarrow[\text{onto}]{\text{1-to-1}} C\right]\right)\right) \\  \Rightarrow \left(\left[x \mapsto \left\{g\left(f\left(x\right)\right) \textrm{ if } x \in A\right..\right] \in \left[A \xrightarrow[\text{onto}]{\text{1-to-1}} C\right]\right) \end{array} \end{array}\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: 1
operand: 3
1Literal
2ExprTuple3
3Lambdaparameters: 4
body: 5
4ExprTuple36, 28, 35, 32, 33
5Operationoperator: 6
operands: 7
6Literal
7ExprTuple8, 9
8Operationoperator: 10
operands: 11
9Operationoperator: 30
operands: 12
10Literal
11ExprTuple13, 14
12ExprTuple15, 16
13Operationoperator: 30
operands: 17
14Operationoperator: 30
operands: 18
15Lambdaparameter: 38
body: 19
16Operationoperator: 26
operands: 20
17ExprTuple36, 21
18ExprTuple28, 22
19Conditionalvalue: 23
condition: 24
20ExprTuple35, 33
21Operationoperator: 26
operands: 25
22Operationoperator: 26
operands: 27
23Operationoperator: 28
operand: 34
24Operationoperator: 30
operands: 31
25ExprTuple35, 32
26Literal
27ExprTuple32, 33
28Variable
29ExprTuple34
30Literal
31ExprTuple38, 35
32Variable
33Variable
34Operationoperator: 36
operand: 38
35Variable
36Variable
37ExprTuple38
38Variable