lean4-htt/tests/lean/rat1.lean
Sofia Rodrigues e0d7c3ac79
feat: add date and time functionality (#4904)
This PR introduces date and time functionality to the Lean 4 Std.

Breaking Changes:
- `Lean.Data.Rat` is now `Std.Internal.Rat` because it's used by the
DateTime library.

---------

Co-authored-by: Markus Himmel <markus@himmel-villmar.de>
Co-authored-by: Mac Malone <tydeu@hatpress.net>
2024-11-14 14:04:19 +00:00

21 lines
537 B
Text

import Std.Internal.Rat
open Std.Internal
open Lean
#eval (15 : Rat) / 10
#eval (15 : Rat) / 10 + 2
#eval (15 : Rat) / 10 - 2
#eval (-2 : Rat).inv
#eval (2 : Rat).inv == (1 : Rat) / 2
#eval (-2 : Rat).inv == (-1 : Rat) / 2
#eval (4 : Rat)/9 * (3 : Rat)/10
#eval (4 : Rat)/9 * (-3 : Rat)/10
#eval (1 : Rat) < (-1 : Rat)
#eval (-1 : Rat) < (1 : Rat)
#eval (-1 : Rat)/2 < (1 : Rat)
#eval (-1 : Rat) < 0
#eval (-1 : Rat)/2 < 0
#eval 0 < (-1 : Rat)/2
#eval (1 : Rat)/3 < (1 : Rat)/2
#eval (1 : Rat)/2 < (1 : Rat)/3
-- TODO: add more tests