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, b, n
from proveit.logic import Equals, Forall, InSet, NotEquals
from proveit.numbers import Complex, Exp, Integer, Mult, Neg, zero
In [2]:
# build up the expression from sub-expressions
expr = Lambda(n, Conditional(Forall(instance_param_or_params = [a, b], instance_expr = Equals(Exp(Exp(a, Neg(b)), n), Exp(a, Neg(Mult(b, n)))), domain = Complex, condition = NotEquals(a, zero)), InSet(n, Integer)))
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())
n \mapsto \left\{\forall_{a, b \in \mathbb{C}~|~a \neq 0}~\left((a^{-b})^{n} = a^{-\left(b \cdot n\right)}\right) \textrm{ if } n \in \mathbb{Z}\right..
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Lambdaparameter: 45
body: 2
1ExprTuple45
2Conditionalvalue: 3
condition: 4
3Operationoperator: 5
operand: 8
4Operationoperator: 26
operands: 7
5Literal
6ExprTuple8
7ExprTuple45, 9
8Lambdaparameters: 10
body: 11
9Literal
10ExprTuple37, 44
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operands: 15
13Operationoperator: 16
operands: 17
14Literal
15ExprTuple18, 19
16Literal
17ExprTuple20, 21, 22
18Operationoperator: 34
operands: 23
19Operationoperator: 34
operands: 24
20Operationoperator: 26
operands: 25
21Operationoperator: 26
operands: 27
22Operationoperator: 28
operands: 29
23ExprTuple30, 45
24ExprTuple37, 31
25ExprTuple37, 32
26Literal
27ExprTuple44, 32
28Literal
29ExprTuple37, 33
30Operationoperator: 34
operands: 35
31Operationoperator: 40
operand: 39
32Literal
33Literal
34Literal
35ExprTuple37, 38
36ExprTuple39
37Variable
38Operationoperator: 40
operand: 44
39Operationoperator: 42
operands: 43
40Literal
41ExprTuple44
42Literal
43ExprTuple44, 45
44Variable
45Variable