logo

Expression of type Lambda

from the theory of proveit.numbers.exponentiation

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, Lambda, a, m
from proveit.core_expr_types import b_1_to_m
from proveit.logic import Equals, Forall, InSet, NotEquals
from proveit.numbers import Add, Complex, Exp, NaturalPos, Real, zero
from proveit.numbers.exponentiation import prod_a_raise_bi__1_to_m
In [2]:
# build up the expression from sub-expressions
expr = Lambda(m, Conditional(Forall(instance_param_or_params = [a, b_1_to_m], instance_expr = Equals(prod_a_raise_bi__1_to_m, Exp(a, Add(b_1_to_m))), domains = [Complex, Real], condition = NotEquals(a, zero)), InSet(m, NaturalPos)))
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())
m \mapsto \left\{\forall_{a \in \mathbb{C},\left(b_{1} \in \mathbb{R}\right), \left(b_{2} \in \mathbb{R}\right), \ldots, \left(b_{m} \in \mathbb{R}\right)~|~a \neq 0}~\left(\left(a^{b_{1}} \cdot  a^{b_{2}} \cdot  \ldots \cdot  a^{b_{m}}\right) = a^{b_{1} +  b_{2} +  \ldots +  b_{m}}\right) \textrm{ if } m \in \mathbb{N}^+\right..
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Lambdaparameter: 47
body: 2
1ExprTuple47
2Conditionalvalue: 3
condition: 4
3Operationoperator: 5
operand: 8
4Operationoperator: 38
operands: 7
5Literal
6ExprTuple8
7ExprTuple47, 9
8Lambdaparameters: 10
body: 11
9Literal
10ExprTuple48, 41
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operands: 15
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18, 19
16Literal
17ExprTuple20, 21, 22
18Operationoperator: 23
operands: 24
19Operationoperator: 43
operands: 25
20Operationoperator: 38
operands: 26
21ExprRangelambda_map: 27
start_index: 46
end_index: 47
22Operationoperator: 28
operands: 29
23Literal
24ExprTuple30
25ExprTuple48, 31
26ExprTuple48, 32
27Lambdaparameter: 52
body: 33
28Literal
29ExprTuple48, 34
30ExprRangelambda_map: 35
start_index: 46
end_index: 47
31Operationoperator: 36
operands: 37
32Literal
33Operationoperator: 38
operands: 39
34Literal
35Lambdaparameter: 52
body: 40
36Literal
37ExprTuple41
38Literal
39ExprTuple49, 42
40Operationoperator: 43
operands: 44
41ExprRangelambda_map: 45
start_index: 46
end_index: 47
42Literal
43Literal
44ExprTuple48, 49
45Lambdaparameter: 52
body: 49
46Literal
47Variable
48Variable
49IndexedVarvariable: 50
index: 52
50Variable
51ExprTuple52
52Variable