fix(library/data/real): fix num -> rat -> real coercion chain

This commit is contained in:
Rob Lewis 2015-08-03 16:38:42 -04:00
parent 4dd4d7b3b8
commit 78942a0689
2 changed files with 4 additions and 2 deletions

View file

@ -1096,6 +1096,8 @@ protected definition comm_ring [reducible] : algebra.comm_ring :=
apply mul_comm apply mul_comm
end end
open rat -- no coercions before
definition of_rat [coercion] (a : ) : := quot.mk (s.r_const a) definition of_rat [coercion] (a : ) : := quot.mk (s.r_const a)
theorem of_rat_add (a b : ) : of_rat a + of_rat b = of_rat (a + b) := theorem of_rat_add (a b : ) : of_rat a + of_rat b = of_rat (a + b) :=

View file

@ -452,7 +452,7 @@ theorem ex_smallest_of_bdd {P : → Prop} (Hbdd : ∃ b : , ∀ z : ,
have Heltb : elt > b, begin have Heltb : elt > b, begin
apply int.lt_of_not_ge, apply int.lt_of_not_ge,
intro Hge, intro Hge,
apply false.elim ((Hb _ Hge) Helt) apply (Hb _ Hge) Helt
end, end,
have H' : P (b + of_nat (nat_abs (elt - b))), begin have H' : P (b + of_nat (nat_abs (elt - b))), begin
rewrite [of_nat_nat_abs_of_nonneg (int.le_of_lt (iff.mpr !int.sub_pos_iff_lt Heltb)), rewrite [of_nat_nat_abs_of_nonneg (int.le_of_lt (iff.mpr !int.sub_pos_iff_lt Heltb)),
@ -489,7 +489,7 @@ theorem ex_largest_of_bdd {P : → Prop} (Hbdd : ∃ b : , ∀ z : , z
have Heltb : elt < b, begin have Heltb : elt < b, begin
apply int.lt_of_not_ge, apply int.lt_of_not_ge,
intro Hge, intro Hge,
apply false.elim ((Hb _ Hge) Helt) apply (Hb _ Hge) Helt
end, end,
have H' : P (b - of_nat (nat_abs (b - elt))), begin have H' : P (b - of_nat (nat_abs (b - elt))), begin
rewrite [of_nat_nat_abs_of_nonneg (int.le_of_lt (iff.mpr !int.sub_pos_iff_lt Heltb)), rewrite [of_nat_nat_abs_of_nonneg (int.le_of_lt (iff.mpr !int.sub_pos_iff_lt Heltb)),