Meta operations on ℚ #
This file defines functions for dealing with rational numbers as expressions.
They are not defined earlier in the hierarchy, in the tactic
or meta
folders, since we do not
want to import data.rat.basic
there.
Main definitions #
-
rat.mk_numeral
embeds a rationalq
as a numeral expression into a type supporting the needed operations. It does not need a tactic state. -
rat.reflect
specializesrat.mk_numeral
toℚ
. -
expr.of_rat
behaves likerat.mk_numeral
, but uses the tactic state to infer the needed structure on the target type. -
expr.to_rat
evaluates a normal numeral expression as a rat. -
expr.eval_rat
evaluates a numeral expression with arithmetic operations as a rat.