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 Conditional, ExprTuple, Lambda, a, b, c, d, e
from proveit.logic import And, Equals, Forall, InSet
from proveit.numbers import Complex, ComplexNonZero, Mult, frac
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([a, d], Conditional(Forall(instance_param_or_params = [b, c, e], instance_expr = Equals(Mult(frac(a, Mult(b, c)), frac(Mult(c, d), e)), Mult(frac(a, b), frac(d, e))), domain = ComplexNonZero), And(InSet(a, Complex), InSet(d, Complex)))))
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(a, d\right) \mapsto \left\{\forall_{b, c, e \in \mathbb{C}^{\neq 0}}~\left(\left(\frac{a}{b \cdot c} \cdot \frac{c \cdot d}{e}\right) = \left(\frac{a}{b} \cdot \frac{d}{e}\right)\right) \textrm{ if } a \in \mathbb{C} ,  d \in \mathbb{C}\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
2ExprTuple46, 53
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 21
operands: 8
6Literal
7ExprTuple9
8ExprTuple10, 11
9Lambdaparameters: 12
body: 13
10Operationoperator: 32
operands: 14
11Operationoperator: 32
operands: 15
12ExprTuple51, 52, 47
13Conditionalvalue: 16
condition: 17
14ExprTuple46, 18
15ExprTuple53, 18
16Operationoperator: 19
operands: 20
17Operationoperator: 21
operands: 22
18Literal
19Literal
20ExprTuple23, 24
21Literal
22ExprTuple25, 26, 27
23Operationoperator: 49
operands: 28
24Operationoperator: 49
operands: 29
25Operationoperator: 32
operands: 30
26Operationoperator: 32
operands: 31
27Operationoperator: 32
operands: 33
28ExprTuple34, 35
29ExprTuple36, 37
30ExprTuple51, 38
31ExprTuple52, 38
32Literal
33ExprTuple47, 38
34Operationoperator: 42
operands: 39
35Operationoperator: 42
operands: 40
36Operationoperator: 42
operands: 41
37Operationoperator: 42
operands: 43
38Literal
39ExprTuple46, 44
40ExprTuple45, 47
41ExprTuple46, 51
42Literal
43ExprTuple53, 47
44Operationoperator: 49
operands: 48
45Operationoperator: 49
operands: 50
46Variable
47Variable
48ExprTuple51, 52
49Literal
50ExprTuple52, 53
51Variable
52Variable
53Variable