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 bijective_by_uniqueness
In [2]:
# check that the built expression is the same as the stored expression
assert bijective_by_uniqueness.expr == stored_expr
assert bijective_by_uniqueness.expr._style_id == stored_expr._style_id
print("Passed sanity check: bijective_by_uniqueness matches stored_expr")
Passed sanity check: bijective_by_uniqueness matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{f, A}~\left(\left[\forall_{x, y \in A~|~x \neq y}~\left(f\left(x\right) \neq f\left(y\right)\right)\right] \Rightarrow \left(f \in \left[A \xrightarrow[\text{onto}]{\text{1-to-1}} f^{\rightarrow}(A)\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: 8
operand: 2
1ExprTuple2
2Lambdaparameters: 23
body: 3
3Operationoperator: 4
operands: 5
4Literal
5ExprTuple6, 7
6Operationoperator: 8
operand: 11
7Operationoperator: 33
operands: 10
8Literal
9ExprTuple11
10ExprTuple30, 12
11Lambdaparameters: 36
body: 13
12Operationoperator: 14
operands: 15
13Conditionalvalue: 16
condition: 17
14Literal
15ExprTuple37, 18
16Operationoperator: 35
operands: 19
17Operationoperator: 20
operands: 21
18Operationoperator: 22
operands: 23
19ExprTuple24, 25
20Literal
21ExprTuple26, 27, 28
22Literal
23ExprTuple30, 37
24Operationoperator: 30
operand: 38
25Operationoperator: 30
operand: 39
26Operationoperator: 33
operands: 32
27Operationoperator: 33
operands: 34
28Operationoperator: 35
operands: 36
29ExprTuple38
30Variable
31ExprTuple39
32ExprTuple38, 37
33Literal
34ExprTuple39, 37
35Literal
36ExprTuple38, 39
37Variable
38Variable
39Variable