logo

Expression of type ExprTuple

from the theory of proveit.numbers.multiplication

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 Conditional, ExprTuple, Lambda, b, i, j
from proveit.core_expr_types import a_1_to_i, c_1_to_j
from proveit.logic import And, Equals, Forall, InSet
from proveit.numbers import Complex, Mult, Natural, Neg
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([i, j], Conditional(Forall(instance_param_or_params = [a_1_to_i, b, c_1_to_j], instance_expr = Equals(Mult(a_1_to_i, Neg(b), c_1_to_j), Neg(Mult(a_1_to_i, b, c_1_to_j))), domain = Complex), And(InSet(i, Natural), InSet(j, Natural)))))
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(i, j\right) \mapsto \left\{\forall_{a_{1}, a_{2}, \ldots, a_{i}, b, c_{1}, c_{2}, \ldots, c_{j} \in \mathbb{C}}~\left(\left(a_{1} \cdot  a_{2} \cdot  \ldots \cdot  a_{i} \cdot \left(-b\right)\cdot c_{1} \cdot  c_{2} \cdot  \ldots \cdot  c_{j}\right) = \left(-\left(a_{1} \cdot  a_{2} \cdot  \ldots \cdot  a_{i} \cdot b\cdot c_{1} \cdot  c_{2} \cdot  \ldots \cdot  c_{j}\right)\right)\right) \textrm{ if } i \in \mathbb{N} ,  j \in \mathbb{N}\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
2ExprTuple48, 51
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 20
operands: 8
6Literal
7ExprTuple9
8ExprTuple10, 11
9Lambdaparameters: 39
body: 12
10Operationoperator: 41
operands: 13
11Operationoperator: 41
operands: 14
12Conditionalvalue: 15
condition: 16
13ExprTuple48, 17
14ExprTuple51, 17
15Operationoperator: 18
operands: 19
16Operationoperator: 20
operands: 21
17Literal
18Literal
19ExprTuple22, 23
20Literal
21ExprTuple24, 25, 26
22Operationoperator: 38
operands: 27
23Operationoperator: 36
operand: 33
24ExprRangelambda_map: 29
start_index: 50
end_index: 48
25Operationoperator: 41
operands: 30
26ExprRangelambda_map: 31
start_index: 50
end_index: 51
27ExprTuple43, 32, 45
28ExprTuple33
29Lambdaparameter: 57
body: 34
30ExprTuple44, 46
31Lambdaparameter: 57
body: 35
32Operationoperator: 36
operand: 44
33Operationoperator: 38
operands: 39
34Operationoperator: 41
operands: 40
35Operationoperator: 41
operands: 42
36Literal
37ExprTuple44
38Literal
39ExprTuple43, 44, 45
40ExprTuple52, 46
41Literal
42ExprTuple53, 46
43ExprRangelambda_map: 47
start_index: 50
end_index: 48
44Variable
45ExprRangelambda_map: 49
start_index: 50
end_index: 51
46Literal
47Lambdaparameter: 57
body: 52
48Variable
49Lambdaparameter: 57
body: 53
50Literal
51Variable
52IndexedVarvariable: 54
index: 57
53IndexedVarvariable: 55
index: 57
54Variable
55Variable
56ExprTuple57
57Variable