Representation of reals in positional system #
This file defines Real.ofDigits
and Real.digits
functions which allows to work with the
representations of reals as sequences of digits in positional system.
Main Definitions #
ofDigits
: takes a sequence of digits(d₀, d₁, ...)
(as anℕ → Fin b
), and returns the real number0.d₀d₁d₂...
.digits
: takes a real number in [0,1) and returns the sequence of its digits.
Main Statements #
ofDigits_digits
states thatofDigits (digits x b) = x
.
ofDigits
takes a sequence of digits (d₀, d₁, ...)
in base b
and returns the
real numnber 0.d₀d₁d₂... = ∑ᵢ(dᵢ/bⁱ)
. This auxiliary definition ofDigitsTerm
sends the
sequence to the function sending i
to dᵢ/bⁱ
.
Instances For
ofDigits d
is the real number 0.d₀d₁d₂...
in base b
.
We allow repeating representations like 0.999...
here.
Equations
- Real.ofDigits digits = ∑' (n : ℕ), Real.ofDigitsTerm digits n