-
Notifications
You must be signed in to change notification settings - Fork 251
Closed
Labels
Milestone
Description
The operations such as addition and multiplication in Data.Rational.Base
are defined in terms of the numerator and denominator projection operations, e.g.
agda-stdlib/src/Data/Rational/Base.agda
Lines 206 to 207 in 650e05f
_+_ : ℚ → ℚ → ℚ | |
p + q = (↥ p ℤ.* ↧ q ℤ.+ ↥ q ℤ.* ↧ p) / (↧ₙ p ℕ.* ↧ₙ q) |
This is beautiful and elegant, and arguably the right way to define them. However, it does mean that Agda unfolds these definitions automatically. By the time you have an expression x + y + z + a + b + c
the unfolded expression is over 200 lines long.
This makes the rational numbers almost impossible to work with in large proofs. In recent proofs I've resorted to redefining everything that's needed under the abstract
keyword.