Isabelle/ZF and IsarMathLib do not have a set of real numbers built-in. The Real_ZF and Real_ZF_1 theories provide a construction but here we do not use it in any way and we just assume that we have a model of real numbers (i.e. a completely ordered field) as defined in the Ordered_Field theory. The construction only assures us that objects with the desired properties exist in the ZF world.
In this section we define notation that we will use whenever real numbers play a role, i.e. most of mathematics.
The next locale sets up notation for contexts where real numbers are used. Note we define the (real) natural numbers \(\mathbb{N}\) as starting from one.
locale reals
assumes R_are_reals: \( \text{IsAmodelOfReals}(\mathbb{R} ,Add,Mul, ROrd) \)
defines \( 0 \equiv \text{ TheNeutralElement}(\mathbb{R} ,Add) \)
defines \( 1 \equiv \text{ TheNeutralElement}(\mathbb{R} ,Mul) \)
defines \( x \cdot y \equiv Mul\langle x,y\rangle \)
defines \( x + y \equiv Add\langle x,y\rangle \)
defines \( ( - x) \equiv \text{GroupInv}(\mathbb{R} ,Add)(x) \)
defines \( x - y \equiv x + ( - y) \)
defines \( x \leq y \equiv \langle x,y\rangle \in ROrd \)
defines \( x \lt y \equiv x\leq y \wedge x\neq y \)
defines \( \mathbb{R} ^+ \equiv \text{Nonnegative}(\mathbb{R} ,Add, ROrd) \)
defines \( \mathbb{R} _+ \equiv \text{PositiveSet}(\mathbb{R} ,Add, ROrd) \)
defines \( -A \equiv \text{GroupInv}(\mathbb{R} ,Add)(A) \)
defines \( \mathbb{R} _0 \equiv \mathbb{R} -\{ 0 \} \)
defines \( \vert x\vert \equiv \text{AbsoluteValue}(\mathbb{R} ,Add,ROrd)(x) \)
defines \( dist \equiv \{\langle p,\vert \text{fst}(p) - \text{snd}(p)\vert \rangle .\ p \in \mathbb{R} \times \mathbb{R} \} \)
defines \( 2 \equiv 1 + 1 \)
defines \( x^{-1} \equiv \text{GroupInv}(\mathbb{R} _0,\text{restrict}(Mul,\mathbb{R} _0\times \mathbb{R} _0))(x) \)
defines \( \sum s \equiv \text{Fold}(Add, 0 ,s) \)
defines \( n\cdot x \equiv \sum \{\langle k,x\rangle .\ k\in n\} \)
defines \( x^2 \equiv x\cdot x \)
defines \( f^\circ \equiv \text{OddExtension}(\mathbb{R} ,Add,ROrd,f) \)
defines \( disk(c,r) \equiv \text{Disk}(\mathbb{R} ,dist,ROrd,c,r) \)
defines \( \mathbb{N} \equiv \bigcap \{N \in Pow(\mathbb{R} ).\ 1 \in N \wedge (\forall n.\ n\in N \longrightarrow n + 1 \in N)\} \)
The assumtions of the field1 locale (that sets the context for ordered fields) hold in the reals locale
lemma (in reals) field1_is_valid:
shows \( field1(\mathbb{R} , Add, Mul,ROrd) \)proofWe can use theorems proven in the field1 locale in the reals locale. Note that since the the field1 locale is an extension of the ring1 locale, which is an extension of ring0 locale , this makes available also the theorems proven in the ring1 and ring0 locales.
using field1_is_valid
The group3 locale from the OrderedGroup_ZF theory defines context for theorems about ordered groups. We can use theorems proven in there in the reals locale as real numbers with addition form an ordered group.
unfolding group3_def using OrdRing_ZF_1_L4
Since real numbers with addition form a group we can use the theorems proven in the group0 locale defined in the Group_ZF theory in the reals locale.
unfolding group3_def using OrderedGroup_ZF_1_L1
Let's recall basic properties of the real line.
lemma (in reals) basic_props:
shows \( ROrd \text{ is total on } \mathbb{R} \) and \( Add \text{ is commutative on } \mathbb{R} \) using OrdRing_ZF_1_L4(2,3)The distance function dist defined in the reals locale is a metric.
lemma (in reals) dist_is_metric:
shows \( dist : \mathbb{R} \times \mathbb{R} \rightarrow \mathbb{R} ^+ \), \( \forall x\in \mathbb{R} .\ \forall y\in \mathbb{R} .\ dist\langle x,y\rangle = \vert x - y\vert \), \( \forall x\in \mathbb{R} .\ dist\langle x,x\rangle = 0 \), \( \forall x\in \mathbb{R} .\ \forall y\in \mathbb{R} .\ dist\langle x,y\rangle = dist\langle y,x\rangle \), \( \forall x\in \mathbb{R} .\ \forall y\in \mathbb{R} .\ \forall z\in \mathbb{R} .\ \vert x - z\vert \leq \vert x - y\vert + \vert y - z\vert \), \( \forall x\in \mathbb{R} .\ \forall y\in \mathbb{R} .\ \forall z\in \mathbb{R} .\ dist\langle x,z\rangle \leq dist\langle x, y\rangle + dist\langle y,z\rangle \), \( \forall x\in \mathbb{R} .\ \forall y\in \mathbb{R} .\ dist\langle x,y\rangle = 0 \longrightarrow x=y \), \( \text{IsApseudoMetric}(dist,\mathbb{R} ,\mathbb{R} ,Add,ROrd) \), \( \text{IsAmetric}(dist,\mathbb{R} ,\mathbb{R} ,Add,ROrd) \)proofReal numbers form an ordered loop.
lemma (in reals) reals_loop:
shows \( \text{IsAnOrdLoop}(\mathbb{R} ,Add,ROrd) \)proofThe assumptions of the pmetric_space locale hold in the reals locale.
lemma (in reals) pmetric_space_valid:
shows \( pmetric\_space(\mathbb{R} ,Add, ROrd,dist,\mathbb{R} ) \) unfolding pmetric_space_def, pmetric_space_axioms_def, loop1_def using reals_loop, dist_is_metric(8)The assumptions of the metric_space locale hold in the reals locale.
lemma (in reals) metric_space_valid:
shows \( metric\_space(\mathbb{R} ,Add, ROrd,dist,\mathbb{R} ) \)proofSome properties of the order relation on reals:
lemma (in reals) pos_is_lattice:
shows \( \text{IsLinOrder}(\mathbb{R} ,ROrd) \), \( \text{IsLinOrder}(\mathbb{R} _+,ROrd \cap \mathbb{R} _+\times \mathbb{R} _+) \), \( (ROrd \cap \mathbb{R} _+\times \mathbb{R} _+) \text{ is a lattice on } \mathbb{R} _+ \)proofOf course the set of positive real numbers is nonempty as one is there.
lemma (in reals) pos_non_empty:
shows \( \mathbb{R} _+\neq 0 \) using R_are_reals, ordring_one_is_pos unfolding IsAmodelOfReals_def, IsAnOrdField_defWe say that a relation \(r\) \( down-directs \) a set \(R\) if every two-element subset of \(R\) has a lower bound. The next lemma states that the natural order relation on real numbers down-directs the set of positive reals.
lemma (in reals) rord_down_directs:
shows \( ROrd \text{ down-directs } \mathbb{R} _+ \) using pos_is_lattice(3), pos_non_empty, meet_down_directs, down_dir_mono unfolding IsAlattice_defWe define the topology on reals as the metric topology coming from the dist metric (i.e. consisting of the unions of open disks).
definition (in reals)
\( \tau _\mathbb{R} \equiv \text{MetricTopology}(\mathbb{R} ,\mathbb{R} ,Add,ROrd,dist) \)
A more explicit definition of the real topology in notation used in the reals context.
lemma (in reals) real_toplology_def_alt:
shows \( \tau _\mathbb{R} = \{\bigcup A.\ A \in Pow(\bigcup c\in \mathbb{R} .\ \{disk(c,r).\ r \in \mathbb{R} _+\})\} \) unfolding MetricTopology_def, RealTopology_defReal numbers form a Hausdorff topological space with topology generated by open disks.
theorem (in reals) reals_is_top:
shows \( \tau _\mathbb{R} \text{ is a topology } \), \( \bigcup \tau _\mathbb{R} = \mathbb{R} \), \( \tau _\mathbb{R} \text{ is }T_2 \) using rord_down_directs, metric_space_valid, pmetric_space_valid, pmetric_is_top, metric_top_carrier, metric_space_T2 unfolding RealTopology_defassumes \( a\in G \), \( b\in G \)
shows \( a\cdot b \in G \)assumes \( x\in G \)
shows \( x^{-1}\in G \)assumes \( r \text{ is total on } G \) and \( a\in G \)
shows \( \vert a\vert \in G^+ \)assumes \( \forall x\in X.\ b(x) \in Y \)
shows \( \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y \)assumes \( f:X\rightarrow Y \) and \( f = \{\langle x,b(x)\rangle .\ x\in X\} \)
shows \( \forall x\in X.\ f(x) = b(x) \)assumes \( x\in G \)
shows \( x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 \)assumes \( a\in G \), \( b\in G \)
shows \( (a\cdot b^{-1})^{-1} = b\cdot a^{-1} \), \( (a^{-1}\cdot b)^{-1} = b^{-1}\cdot a \)assumes \( r \text{ is total on } G \) and \( a\in G \)
shows \( \vert a^{-1}\vert = \vert a\vert \)assumes \( a\in G \) and \( \vert a\vert = 1 \)
shows \( a = 1 \)assumes \( a\in G \), \( b\in G \) and \( a\cdot b^{-1} = 1 \)
shows \( a=b \)assumes \( a\in G \), \( b\in G \), \( c\in G \)
shows \( (a\cdot b)^{-1}\cdot (a\cdot c) = b^{-1}\cdot c \), \( (a\cdot b)\cdot (c\cdot b)^{-1} = a\cdot c^{-1} \), \( a^{-1}\cdot (a\cdot b\cdot c)\cdot c^{-1} = b \), \( a\cdot (b\cdot c^{-1})\cdot c = a\cdot b \), \( a\cdot b^{-1}\cdot (b\cdot c^{-1}) = a\cdot c^{-1} \)assumes \( P \text{ is commutative on } G \) and \( r \text{ is total on } G \) and \( a\in G \), \( b\in G \)
shows \( \vert a\cdot b\vert \leq \vert a\vert \cdot \vert b\vert \)assumes \( \text{IsLinOrder}(X,r) \)
shows \( \text{IsPartOrder}(X,r) \)assumes \( a\leq b \), \( c\in G \)
shows \( a\cdot c \leq b\cdot c \) and \( c\cdot a \leq c\cdot b \)assumes \( a\in G \), \( b\in G \), \( c\in G \) and \( a\cdot b \leq c\cdot b \)
shows \( a\leq c \)assumes \( a\in G \), \( b\in G \), \( c\in G \) and \( a\cdot b \leq a\cdot c \)
shows \( b\leq c \)assumes \( \text{IsLinOrder}(X,r) \) and \( A\subseteq X \)
shows \( \text{IsLinOrder}(A,r) \) and \( \text{IsLinOrder}(A,r \cap A\times A) \)assumes \( r\subseteq L\times L \) and \( \text{IsLinOrder}(L,r) \)
shows \( r \text{ is a lattice on } L \)assumes \( 0 \neq 1 \)
shows \( 1 \in R_+ \)assumes \( \text{IsMeetSemilattice}(L,r) \), \( L\neq 0 \)
shows \( r \text{ down-directs } L \)assumes \( r \text{ down-directs } X \), \( r\subseteq R \)
shows \( R \text{ down-directs } X \)assumes \( r \text{ down-directs } L_+ \)
shows \( \tau \text{ is a topology } \)assumes \( r \text{ down-directs } L_+ \)
shows \( \bigcup \tau = X \)assumes \( r \text{ down-directs } L_+ \)
shows \( \tau \text{ is }T_2 \)