Skip to content

Commit d2545b5

Browse files
committed
fix
1 parent c19d3b3 commit d2545b5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Init/Data/Dyadic/Inv.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def invAtPrec (x : Dyadic) (prec : Int) : Dyadic :=
2727
/-- For a positive dyadic `x`, `invAtPrec x prec * x ≤ 1`. -/
2828
theorem invAtPrec_mul_le_one {x : Dyadic} (hx : 0 < x) (prec : Int) :
2929
invAtPrec x prec * x ≤ 1 := by
30-
rw [le_iff_toRat]
30+
rw [← toRat_le_toRat_iff]
3131
rw [toRat_mul]
3232
rw [show (1 : Dyadic).toRat = (1 : Rat) from rfl]
3333
unfold invAtPrec
@@ -39,19 +39,19 @@ theorem invAtPrec_mul_le_one {x : Dyadic} (hx : 0 < x) (prec : Int) :
3939
simp only
4040
have h_le : ((ofOdd n k hn).toRat.inv.toDyadic prec).toRat ≤ (ofOdd n k hn).toRat.inv := Rat.toRat_toDyadic_le
4141
have h_pos : 0 ≤ (ofOdd n k hn).toRat := by
42-
rw [lt_iff_toRat, toRat_zero] at hx
42+
rw [← toRat_lt_toRat_iff, toRat_zero] at hx
4343
exact Rat.le_of_lt hx
4444
calc ((ofOdd n k hn).toRat.inv.toDyadic prec).toRat * (ofOdd n k hn).toRat
4545
≤ (ofOdd n k hn).toRat.inv * (ofOdd n k hn).toRat := Rat.mul_le_mul_of_nonneg_right h_le h_pos
4646
_ = 1 := by
4747
apply Rat.inv_mul_cancel
48-
rw [lt_iff_toRat, toRat_zero] at hx
48+
rw [← toRat_lt_toRat_iff, toRat_zero] at hx
4949
exact Rat.ne_of_gt hx
5050

5151
/-- For a positive dyadic `x`, `1 < (invAtPrec x prec + 2^(-prec)) * x`. -/
5252
theorem one_lt_invAtPrec_add_inc_mul {x : Dyadic} (hx : 0 < x) (prec : Int) :
5353
1 < (invAtPrec x prec + ofIntWithPrec 1 prec) * x := by
54-
rw [lt_iff_toRat]
54+
rw [← toRat_lt_toRat_iff]
5555
rw [toRat_mul]
5656
rw [show (1 : Dyadic).toRat = (1 : Rat) from rfl]
5757
unfold invAtPrec
@@ -64,12 +64,12 @@ theorem one_lt_invAtPrec_add_inc_mul {x : Dyadic} (hx : 0 < x) (prec : Int) :
6464
have h_le : (ofOdd n k hn).toRat.inv < ((ofOdd n k hn).toRat.inv.toDyadic prec + ofIntWithPrec 1 prec).toRat :=
6565
Rat.lt_toRat_toDyadic_add
6666
have h_pos : 0 < (ofOdd n k hn).toRat := by
67-
rwa [lt_iff_toRat, toRat_zero] at hx
67+
rwa [← toRat_lt_toRat_iff, toRat_zero] at hx
6868
calc
6969
1 = (ofOdd n k hn).toRat.inv * (ofOdd n k hn).toRat := by
7070
symm
7171
apply Rat.inv_mul_cancel
72-
rw [lt_iff_toRat, toRat_zero] at hx
72+
rw [← toRat_lt_toRat_iff, toRat_zero] at hx
7373
exact Rat.ne_of_gt hx
7474
_ < ((ofOdd n k hn).toRat.inv.toDyadic prec + ofIntWithPrec 1 prec).toRat * (ofOdd n k hn).toRat :=
7575
Rat.mul_lt_mul_of_pos_right h_le h_pos

0 commit comments

Comments
 (0)