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_numeralembeds a rationalqas a numeral expression into a type supporting the needed operations. It does not need a tactic state. -
rat.reflectspecializesrat.mk_numeraltoℚ. -
expr.of_ratbehaves likerat.mk_numeral, but uses the tactic state to infer the needed structure on the target type. -
expr.to_ratevaluates a normal numeral expression as a rat. -
expr.eval_ratevaluates a numeral expression with arithmetic operations as a rat.