-- Dedekind real numbers -- Part of Cumulus, the Grace17 mathematics library. -- Copyright (c) 2026 Grant Passmore. -- Released under the Apache License 2.0. See LICENSE in the repository root. -- Authors: Grant Passmore module Grace.Cumulus.Real.Defs import Rat.OrderedOperations predicate ProperSubset (A B : Set) := (A ⊆ B) ∧ A ≠ B notation infix 50 "⊂" => ProperSubset -- A real is a lower Dedekind cut of the rational quotient set. The order used -- here is the set-valued graph rationalLess. predicate DedekindCut (A : Set) := (A ⊆ ℚ) ∧ Nonempty(A) ∧ A ≠ ℚ ∧ (∀ q ∈ A, ∀ p ∈ ℚ, p < q → p ∈ A) ∧ (∀ q ∈ A, ∃ r ∈ A, relates(rationalLess, q, r)) def ℝ : Set := { A ∈ 𝒫(ℚ) | DedekindCut(A) } class Real (x : Set) := x ∈ ℝ -- Strict real order is proper inclusion of lower cuts. The predicate-level -- view remains useful alongside the instance-selected `<` relation graph. predicate RealLess (x y : Set) := Real(x) ∧ Real(y) ∧ (x ⊂ y) -- The set-valued graph used by algebraic structures and relation theory. -- RealLess remains the convenient proposition-level view. def realLess : Set := { p ∈ ℝ × ℝ | ∃ x ∈ ℝ, ∃ y ∈ ℝ, p = (x, y) ∧ (x ⊂ y) } -- The rational q determines its lower initial segment. Once rationalLess is -- proved dense and unbounded, rationalCut(q) is the canonical Q → R map. def rationalCut (q : Set) : Set := { p ∈ ℚ | relates(rationalLess, p, q) }