src/HOL/Rat.thy
changeset 65552 f533820e7248
parent 64849 766db3539859
child 66806 a4e82b58d833
equal deleted inserted replaced
65551:d164c4fc0d2c 65552:f533820e7248
     3 *)
     3 *)
     4 
     4 
     5 section \<open>Rational numbers\<close>
     5 section \<open>Rational numbers\<close>
     6 
     6 
     7 theory Rat
     7 theory Rat
     8   imports GCD Archimedean_Field
     8   imports Archimedean_Field
     9 begin
     9 begin
    10 
    10 
    11 subsection \<open>Rational numbers as quotient\<close>
    11 subsection \<open>Rational numbers as quotient\<close>
    12 
    12 
    13 subsubsection \<open>Construction of the type of rational numbers\<close>
    13 subsubsection \<open>Construction of the type of rational numbers\<close>
   401 lemma quotient_of_denom_pos: "quotient_of r = (p, q) \<Longrightarrow> q > 0"
   401 lemma quotient_of_denom_pos: "quotient_of r = (p, q) \<Longrightarrow> q > 0"
   402   by (cases r) (simp add: quotient_of_Fract normalize_denom_pos)
   402   by (cases r) (simp add: quotient_of_Fract normalize_denom_pos)
   403 
   403 
   404 lemma quotient_of_denom_pos': "snd (quotient_of r) > 0"
   404 lemma quotient_of_denom_pos': "snd (quotient_of r) > 0"
   405   using quotient_of_denom_pos [of r] by (simp add: prod_eq_iff)
   405   using quotient_of_denom_pos [of r] by (simp add: prod_eq_iff)
   406     
   406 
   407 lemma quotient_of_coprime: "quotient_of r = (p, q) \<Longrightarrow> coprime p q"
   407 lemma quotient_of_coprime: "quotient_of r = (p, q) \<Longrightarrow> coprime p q"
   408   by (cases r) (simp add: quotient_of_Fract normalize_coprime)
   408   by (cases r) (simp add: quotient_of_Fract normalize_coprime)
   409 
   409 
   410 lemma quotient_of_inject:
   410 lemma quotient_of_inject:
   411   assumes "quotient_of a = quotient_of b"
   411   assumes "quotient_of a = quotient_of b"