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
from proveit.numbers import Add, Complex, Exp, NaturalPos, RealPos
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 = [RealPos, Complex]), 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{R}^+,\left(b_{1} \in \mathbb{C}\right), \left(b_{2} \in \mathbb{C}\right), \ldots, \left(b_{m} \in \mathbb{C}\right)}~\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: 43
body: 2
1ExprTuple43
2Conditionalvalue: 3
condition: 4
3Operationoperator: 5
operand: 8
4Operationoperator: 34
operands: 7
5Literal
6ExprTuple8
7ExprTuple43, 9
8Lambdaparameters: 10
body: 11
9Literal
10ExprTuple44, 37
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operands: 15
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18, 19
16Literal
17ExprTuple20, 21
18Operationoperator: 22
operands: 23
19Operationoperator: 39
operands: 24
20Operationoperator: 34
operands: 25
21ExprRangelambda_map: 26
start_index: 42
end_index: 43
22Literal
23ExprTuple27
24ExprTuple44, 28
25ExprTuple44, 29
26Lambdaparameter: 48
body: 30
27ExprRangelambda_map: 31
start_index: 42
end_index: 43
28Operationoperator: 32
operands: 33
29Literal
30Operationoperator: 34
operands: 35
31Lambdaparameter: 48
body: 36
32Literal
33ExprTuple37
34Literal
35ExprTuple45, 38
36Operationoperator: 39
operands: 40
37ExprRangelambda_map: 41
start_index: 42
end_index: 43
38Literal
39Literal
40ExprTuple44, 45
41Lambdaparameter: 48
body: 45
42Literal
43Variable
44Variable
45IndexedVarvariable: 46
index: 48
46Variable
47ExprTuple48
48Variable