logo

Expression of type ExprTuple

from the theory of proveit.numbers.division

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 ExprTuple, Lambda, m, n, x, y
from proveit.core_expr_types import w_1_to_m, z_1_to_n
from proveit.logic import Equals, Forall, NotEquals
from proveit.numbers import Complex, Mult, Neg, frac, zero
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([m, n], Forall(instance_param_or_params = [w_1_to_m, x, y, z_1_to_n], instance_expr = Equals(frac(Mult(w_1_to_m, Neg(x), z_1_to_n), y), Neg(frac(Mult(w_1_to_m, x, z_1_to_n), y))), domain = Complex, condition = NotEquals(y, zero))))
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(m, n\right) \mapsto \left[\forall_{w_{1}, w_{2}, \ldots, w_{m}, x, y, z_{1}, z_{2}, \ldots, z_{n} \in \mathbb{C}~|~y \neq 0}~\left(\frac{w_{1} \cdot  w_{2} \cdot  \ldots \cdot  w_{m} \cdot \left(-x\right)\cdot z_{1} \cdot  z_{2} \cdot  \ldots \cdot  z_{n}}{y} = \left(-\frac{w_{1} \cdot  w_{2} \cdot  \ldots \cdot  w_{m} \cdot x\cdot z_{1} \cdot  z_{2} \cdot  \ldots \cdot  z_{n}}{y}\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: 2
body: 3
2ExprTuple53, 56
3Operationoperator: 4
operand: 6
4Literal
5ExprTuple6
6Lambdaparameters: 7
body: 8
7ExprTuple49, 50, 43, 51
8Conditionalvalue: 9
condition: 10
9Operationoperator: 11
operands: 12
10Operationoperator: 13
operands: 14
11Literal
12ExprTuple15, 16
13Literal
14ExprTuple17, 18, 19, 20, 21
15Operationoperator: 36
operands: 22
16Operationoperator: 45
operand: 31
17ExprRangelambda_map: 24
start_index: 55
end_index: 53
18Operationoperator: 39
operands: 25
19Operationoperator: 39
operands: 26
20ExprRangelambda_map: 27
start_index: 55
end_index: 56
21Operationoperator: 28
operands: 29
22ExprTuple30, 43
23ExprTuple31
24Lambdaparameter: 62
body: 32
25ExprTuple50, 44
26ExprTuple43, 44
27Lambdaparameter: 62
body: 33
28Literal
29ExprTuple43, 34
30Operationoperator: 47
operands: 35
31Operationoperator: 36
operands: 37
32Operationoperator: 39
operands: 38
33Operationoperator: 39
operands: 40
34Literal
35ExprTuple49, 41, 51
36Literal
37ExprTuple42, 43
38ExprTuple57, 44
39Literal
40ExprTuple58, 44
41Operationoperator: 45
operand: 50
42Operationoperator: 47
operands: 48
43Variable
44Literal
45Literal
46ExprTuple50
47Literal
48ExprTuple49, 50, 51
49ExprRangelambda_map: 52
start_index: 55
end_index: 53
50Variable
51ExprRangelambda_map: 54
start_index: 55
end_index: 56
52Lambdaparameter: 62
body: 57
53Variable
54Lambdaparameter: 62
body: 58
55Literal
56Variable
57IndexedVarvariable: 59
index: 62
58IndexedVarvariable: 60
index: 62
59Variable
60Variable
61ExprTuple62
62Variable