I want to implement Dedekind's cut in Agda. I tried to represent real number first. But I am not able to define it in Agda. How to define it??
Real numbers can be constructed in a few different ways:
Following Erret Bishop's construction of real numbers in Constructive Analysis, real numbers can be formalized in Agda as a sequence of rational numbers along with a proof of convergence of this sequence:
-- Constructible Real numbers as described by Bishop
-- A real number is defined to be a sequence along
-- with a proof that the sequence is regular
record ℝ : Set where
constructor Real
field
f : ℕ -> ℚ
reg : {n m : ℕ} -> ∣ f n - f m ∣ ≤ (suc n)⁻¹ + (suc m)⁻¹
Checkout this repository for the formalized construction of an equivalence relation using this definition.
Another way to define real numbers is with Dedekind cuts, which as @vitrus mentioned, is discussed in chapter 11 in the Homotopy Type Theory book
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With