src/HOL/Real/Rational.thy
changeset 26732 6ea9de67e576
parent 26513 6f306c8c2c54
child 27509 63161d5f8f29
equal deleted inserted replaced
26731:48df747c8543 26732:6ea9de67e576
   667     (auto simp add: Rational_simp of_rat_rat [simplified Fract_of_int_quotient [of k l], symmetric])
   667     (auto simp add: Rational_simp of_rat_rat [simplified Fract_of_int_quotient [of k l], symmetric])
   668 
   668 
   669 instantiation rat :: eq
   669 instantiation rat :: eq
   670 begin
   670 begin
   671 
   671 
   672 definition [code func del]: "eq (r\<Colon>rat) s \<longleftrightarrow> r = s"
   672 definition [code func del]: "eq_class.eq (r\<Colon>rat) s \<longleftrightarrow> r = s"
   673 
   673 
   674 instance by default (simp add: eq_rat_def)
   674 instance by default (simp add: eq_rat_def)
   675 
   675 
   676 lemma rat_eq_code [code]: "eq (Rational x) (Rational y) \<longleftrightarrow> eq (normNum x) (normNum y)"
   676 lemma rat_eq_code [code]: "eq_class.eq (Rational x) (Rational y) \<longleftrightarrow> eq_class.eq (normNum x) (normNum y)"
   677   unfolding Rational_def INum_normNum_iff eq ..
   677   unfolding Rational_def INum_normNum_iff eq ..
   678 
   678 
   679 end
   679 end
   680 
   680 
   681 lemma rat_less_eq_code [code]: "Rational x \<le> Rational y \<longleftrightarrow> normNum x \<le>\<^sub>N normNum y"
   681 lemma rat_less_eq_code [code]: "Rational x \<le> Rational y \<longleftrightarrow> normNum x \<le>\<^sub>N normNum y"