Real numbers
Uses
Many programming languages use the label "real numbers" for Floating-point numbers. In Leibniz, real numbers are the real numbers defined in mathematics. Real numbers cannot be represented in a computer, because the information content of a real number is, in general, infinite. Only well-defined subsets, such as the Rational numbers, can be represented as a finite sequence of bits. However, Leibniz is not a programming language, but a specification language. Even if you cannot compute with real numbers, you can still talk about real numbers and define axioms and rules in terms of real numbers.
The sort
There is a subsort
Another subsort,
The positive real numbers,
Arithmetic
Addition
The sum of two real numbers is a real number:
Important special cases are:
Addition is commutative:
and associative:
Rules:
Eliminate zeros:
Subtraction
The difference of two real numbers is a real number:
The negative of a real number is a real number:
Rules
Eliminate zeros:
Multiplication
The product of two real numbers is a real number:
Important special cases are:
Multiplication is commutative:
and associative:
Addition is distributive over multiplication:
Rules:
Eliminate zeros:
Eliminate ones:
Division
The quotient of a real number and a non-zero real number is a real number:
Important special cases are:
Rules:
Elimination of zeros and ones:
Exponentiation
Exponentiation is defined for non-zero real number to any integer power:
The case of zero has already been defined in Integers.
Positive real numbers can be taken to any non-zero real power:
Non-negative real numbers can be taken to any positive real power:
Rules:
Eliminate zeros:
Eliminate ones:
Comparison