TheoremBase

The Real Numbers as a Type

The real numbers as a Lean type, with the operations and order of ℝ, declared a commutative ring with a compatible total order so that ring and order arithmetic on real numbers can be done by Lean's algebra procedures.

Statement

In the setting of The Real Numbers, with the Natural Numbers, Integers and Rationals Identified with Subsets of the Reals, and Completeness, where R\mathbb{R} is an ordered field by The Real Numbers Form an Ordered Field in Which Every Nonempty Set Bounded Above Has a Supremum (i): Real\mathrm{Real} is the type whose elements are the real numbers: an element of Real\mathrm{Real} is a set x∈Rx\in\mathbb{R}, carried with the fact that it lies in R\mathbb{R}, and two elements are equal when their sets are (the one place where a real number is handled as a set, as a type requires). The elements 00 and 11, the operations x+yx+y and x⋅yx\cdot y and the order x≤yx\le y of Real\mathrm{Real} are those of R\mathbb{R} (The Real Numbers (iii), The Real Numbers (iv)); −x-x is the negative, which lies in R\mathbb{R} by Negatives, Reciprocals and the Strict Order in an Ordered Field, as Values (i), and x−yx-y the difference x+(−y)x+(-y); x<yx<y is the strict relation of ≤\le. Reciprocals and quotients are not operations of Real\mathrm{Real}; they are taken in R\mathbb{R}. Numerals and powers are read recursively: the natural number 00 is 00, 11 is 11 and n+2n+2 is (n+1)+1(n+1)+1; an integer i≥0i\ge0 is read as the natural number ii, and −(n+1)-(n+1) as the negative of n+1n+1; x0=1x^{0}=1 and xn+1=xn⋅xx^{n+1}=x^{n}\cdot x; and n⋅xn\cdot x and i⋅xi\cdot x, for a natural number nn and an integer ii, are the products of their readings with xx. Since an element of Real\mathrm{Real} is determined by its set and R\mathbb{R} is an ordered field, the laws of R\mathbb{R} hold for these operations and this order: the laws of a commutative ring hold for ++, ⋅\cdot, 00 and 11 on Real\mathrm{Real}, among them 0⋅x=00\cdot x=0, −(−x)=x-(-x)=x and (−x)⋅y=−(x⋅y)(-x)\cdot y=-(x\cdot y) (Rules of Arithmetic and Order in an Ordered Field (i), Rules of Arithmetic and Order in an Ordered Field (ii)) and x+(−x)=0x+(-x)=0 (Negatives, Reciprocals and the Strict Order in an Ordered Field, as Values (i)); ≤\le on Real\mathrm{Real} is reflexive, antisymmetric, transitive and total, as ≤\le is a total order on R\mathbb{R}, and x<yx<y holds exactly when x≤yx\le y and not y≤xy\le x (Negatives, Reciprocals and the Strict Order in an Ordered Field, as Values (iii)); the laws of an ordered ring hold, in the forms x≤yx\le y if and only if x+z≤y+zx+z\le y+z (Rules of Order in an Ordered Ring: Differences, Sums, Negatives, Products and Squares (ii)), 0<10<1 (Rules of Arithmetic and Order in an Ordered Field (vii)), and, if x<yx<y and 0<z0<z, then x⋅z<y⋅zx\cdot z<y\cdot z (Rules of Arithmetic and Order in an Ordered Field (vi)) and hence, by commutativity, z⋅x<z⋅yz\cdot x<z\cdot y. In Lean these clauses are the classes Lean.Grind.CommRing\mathtt{Lean.Grind.CommRing}; Std.IsLinearOrder\mathtt{Std.IsLinearOrder} and Std.LawfulOrderLT\mathtt{Std.LawfulOrderLT}; and Lean.Grind.OrderedAdd\mathtt{Lean.Grind.OrderedAdd} and Lean.Grind.OrderedRing\mathtt{Lean.Grind.OrderedRing}.

Citations

Loading…

Dependencies

Loading…

Related

0 relations

Curated associations between results. These are editable and subjective — they do not replace the dependency graph, which is derived from the references in the text.

No relations recorded yet.

Comments

Log in to comment.

Loading…