# from the theory of proveit.numbers.number_sets.real_numbers¶

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.
# import Expression classes needed to build the expression
from proveit import Conditional, Lambda, a, b, x
from proveit.logic import And, Equals, Forall, InSet
from proveit.numbers import IntervalOO, Less, Real

In [2]:
# build up the expression from sub-expressions
expr = Lambda([a, b], Conditional(Forall(instance_param_or_params = [x], instance_expr = Equals(InSet(x, IntervalOO(a, b)), And(InSet(x, Real), And(Less(a, x), Less(x, b)).with_total_ordering_style()))), And(InSet(a, Real), InSet(b, Real))))

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(a, b\right) \mapsto \left\{\forall_{x}~\left(\left(x \in \left(a,b\right)\right) = \left(\left(x \in \mathbb{R}\right) \land \left(a < x < b\right)\right)\right) \textrm{ if } a \in \mathbb{R} ,  b \in \mathbb{R}\right..

In [5]:
stored_expr.style_options()

no style options
In [6]:
# display the expression information
stored_expr.expr_info()

core typesub-expressionsexpression
0Lambdaparameters: 24
body: 1
1Conditionalvalue: 2
condition: 3
2Operationoperator: 4
operand: 7
3Operationoperator: 27
operands: 6
4Literal
5ExprTuple7
6ExprTuple8, 9
7Lambdaparameter: 36
body: 11
8Operationoperator: 25
operands: 12
9Operationoperator: 25
operands: 13
10ExprTuple36
11Operationoperator: 14
operands: 15
12ExprTuple35, 29
13ExprTuple37, 29
14Literal
15ExprTuple16, 17
16Operationoperator: 25
operands: 18
17Operationoperator: 27
operands: 19
18ExprTuple36, 20
19ExprTuple21, 22
20Operationoperator: 23
operands: 24
21Operationoperator: 25
operands: 26
22Operationoperator: 27
operands: 28
23Literal
24ExprTuple35, 37
25Literal
26ExprTuple36, 29
27Literal
28ExprTuple30, 31
29Literal
30Operationoperator: 33
operands: 32
31Operationoperator: 33
operands: 34
32ExprTuple35, 36
33Literal
34ExprTuple36, 37
35Variable
36Variable
37Variable