src/HOL/ex/Dedekind_Real.thy
changeset 73932 fd21b4a93043
parent 73648 1bd3463e30b8
equal deleted inserted replaced
73866:66bff50bc5f1 73932:fd21b4a93043
   213 
   213 
   214 subsection\<open>Properties of Addition\<close>
   214 subsection\<open>Properties of Addition\<close>
   215 
   215 
   216 lemma preal_add_commute: "(x::preal) + y = y + x"
   216 lemma preal_add_commute: "(x::preal) + y = y + x"
   217   unfolding preal_add_def add_set_def
   217   unfolding preal_add_def add_set_def
   218   by (metis (no_types, hide_lams) add.commute)
   218   by (metis (no_types, opaque_lifting) add.commute)
   219 
   219 
   220 text\<open>Lemmas for proving that addition of two positive reals gives
   220 text\<open>Lemmas for proving that addition of two positive reals gives
   221  a positive real\<close>
   221  a positive real\<close>
   222 
   222 
   223 lemma mem_add_set:
   223 lemma mem_add_set:
   299 
   299 
   300 text\<open>Proofs essentially same as for addition\<close>
   300 text\<open>Proofs essentially same as for addition\<close>
   301 
   301 
   302 lemma preal_mult_commute: "(x::preal) * y = y * x"
   302 lemma preal_mult_commute: "(x::preal) * y = y * x"
   303   unfolding preal_mult_def mult_set_def
   303   unfolding preal_mult_def mult_set_def
   304   by (metis (no_types, hide_lams) mult.commute)
   304   by (metis (no_types, opaque_lifting) mult.commute)
   305 
   305 
   306 text\<open>Multiplication of two positive reals gives a positive real.\<close>
   306 text\<open>Multiplication of two positive reals gives a positive real.\<close>
   307 
   307 
   308 lemma mem_mult_set:
   308 lemma mem_mult_set:
   309   assumes "cut A" "cut B"
   309   assumes "cut A" "cut B"
   371 qed
   371 qed
   372 
   372 
   373 lemma preal_mult_assoc: "((x::preal) * y) * z = x * (y * z)"
   373 lemma preal_mult_assoc: "((x::preal) * y) * z = x * (y * z)"
   374   apply (simp add: preal_mult_def mem_mult_set Rep_preal)
   374   apply (simp add: preal_mult_def mem_mult_set Rep_preal)
   375   apply (simp add: mult_set_def)
   375   apply (simp add: mult_set_def)
   376   apply (metis (no_types, hide_lams) ab_semigroup_mult_class.mult_ac(1))
   376   apply (metis (no_types, opaque_lifting) ab_semigroup_mult_class.mult_ac(1))
   377   done
   377   done
   378 
   378 
   379 instance preal :: ab_semigroup_mult
   379 instance preal :: ab_semigroup_mult
   380 proof
   380 proof
   381   fix a b c :: preal
   381   fix a b c :: preal
  1085 
  1085 
  1086 lemma real_mult_congruent2_lemma:
  1086 lemma real_mult_congruent2_lemma:
  1087      "!!(x1::preal). \<lbrakk>x1 + y2 = x2 + y1\<rbrakk> \<Longrightarrow>
  1087      "!!(x1::preal). \<lbrakk>x1 + y2 = x2 + y1\<rbrakk> \<Longrightarrow>
  1088           x * x1 + y * y1 + (x * y2 + y * x2) =
  1088           x * x1 + y * y1 + (x * y2 + y * x2) =
  1089           x * x2 + y * y2 + (x * y1 + y * x1)"
  1089           x * x2 + y * y2 + (x * y1 + y * x1)"
  1090   by (metis (no_types, hide_lams) add.left_commute preal_add_commute preal_add_mult_distrib2)
  1090   by (metis (no_types, opaque_lifting) add.left_commute preal_add_commute preal_add_mult_distrib2)
  1091 
  1091 
  1092 lemma real_mult_congruent2:
  1092 lemma real_mult_congruent2:
  1093   "(\<lambda>p1 p2.
  1093   "(\<lambda>p1 p2.
  1094         (\<lambda>(x1,y1). (\<lambda>(x2,y2). 
  1094         (\<lambda>(x1,y1). (\<lambda>(x2,y2). 
  1095           { Abs_Real (realrel``{(x1*x2 + y1*y2, x1*y2+y1*x2)}) }) p2) p1)
  1095           { Abs_Real (realrel``{(x1*x2 + y1*y2, x1*y2+y1*x2)}) }) p2) p1)