logo

Expression of type ExprTuple

from the theory of proveit.logic.sets.functions.bijections

In [1]:
import proveit
# Automation is not needed when building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_expr # Load the stored expression as 'stored_expr'
# import Expression classes needed to build the expression
from proveit import A, ExprTuple, Lambda, f, fx, fy, x, y
from proveit.logic import Bijections, Forall, Image, Implies, InSet, NotEquals
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([f, A], Implies(Forall(instance_param_or_params = [x, y], instance_expr = NotEquals(fx, fy), domain = A, condition = NotEquals(x, y)), InSet(f, Bijections(A, Image(f, A))))))
expr:
In [3]:
# check that the built expression is the same as the stored expression
assert expr == stored_expr
assert expr._style_id == stored_expr._style_id
print("Passed sanity check: expr matches stored_expr")
Passed sanity check: expr matches stored_expr
In [4]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\left(\left(f, A\right) \mapsto \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)\right)
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1
1Lambdaparameters: 22
body: 2
2Operationoperator: 3
operands: 4
3Literal
4ExprTuple5, 6
5Operationoperator: 7
operand: 10
6Operationoperator: 32
operands: 9
7Literal
8ExprTuple10
9ExprTuple29, 11
10Lambdaparameters: 35
body: 12
11Operationoperator: 13
operands: 14
12Conditionalvalue: 15
condition: 16
13Literal
14ExprTuple36, 17
15Operationoperator: 34
operands: 18
16Operationoperator: 19
operands: 20
17Operationoperator: 21
operands: 22
18ExprTuple23, 24
19Literal
20ExprTuple25, 26, 27
21Literal
22ExprTuple29, 36
23Operationoperator: 29
operand: 37
24Operationoperator: 29
operand: 38
25Operationoperator: 32
operands: 31
26Operationoperator: 32
operands: 33
27Operationoperator: 34
operands: 35
28ExprTuple37
29Variable
30ExprTuple38
31ExprTuple37, 36
32Literal
33ExprTuple38, 36
34Literal
35ExprTuple37, 38
36Variable
37Variable
38Variable