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)), Neg(n)), Exp(a, 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^{b \cdot n}\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: 41
body: 1
1Conditionalvalue: 2
condition: 3
2Operationoperator: 4
operand: 7
3Operationoperator: 25
operands: 6
4Literal
5ExprTuple7
6ExprTuple41, 8
7Lambdaparameters: 9
body: 10
8Literal
9ExprTuple39, 44
10Conditionalvalue: 11
condition: 12
11Operationoperator: 13
operands: 14
12Operationoperator: 15
operands: 16
13Literal
14ExprTuple17, 18
15Literal
16ExprTuple19, 20, 21
17Operationoperator: 34
operands: 22
18Operationoperator: 34
operands: 23
19Operationoperator: 25
operands: 24
20Operationoperator: 25
operands: 26
21Operationoperator: 27
operands: 28
22ExprTuple29, 30
23ExprTuple39, 31
24ExprTuple39, 32
25Literal
26ExprTuple44, 32
27Literal
28ExprTuple39, 33
29Operationoperator: 34
operands: 35
30Operationoperator: 42
operand: 41
31Operationoperator: 37
operands: 38
32Literal
33Literal
34Literal
35ExprTuple39, 40
36ExprTuple41
37Literal
38ExprTuple44, 41
39Variable
40Operationoperator: 42
operand: 44
41Variable
42Literal
43ExprTuple44
44Variable