Zulip Chat Archive

Stream: Is there code for X?

Topic: 0 ≤ b → ((a / b : ℤ) : ℚ) ≤ (a / b : ℚ)


Scott Morrison (Jul 06 2023 at 00:40):

example (a b : ) (w : 0  b) : ((a / b : ) : )  (a / b : ) := sorry

Location in library / proof / name?

(slim_check agrees there are no counterexamples due to misunderstanding rounding!)

Yury G. Kudryashov (Jul 06 2023 at 01:14):

import Mathlib.Data.Rat.Order
import Mathlib.Algebra.Order.Field.Basic

example (a b : ) (w : 0  b) : ((a / b : ) : )  (a / b : ) := by
  rcases w.eq_or_lt with rfl | hb;
  · simp [Int.ediv_zero]
  · rw [le_div_iff (Int.cast_pos.2 hb)]
    norm_cast
    exact Int.ediv_mul_le _ hb.ne'

About location: #find_home?

Yury G. Kudryashov (Jul 06 2023 at 01:15):

If we move lemmas about Rat to Std, then you may need a version of le_div_iff.

Yaël Dillies (Jul 06 2023 at 07:33):

algebra.order.floor

Yaël Dillies (Jul 06 2023 at 07:33):

Your lemma is basically docs3#int.floor_le

Ruben Van de Velde (Jul 06 2023 at 07:45):

Looking at the code, docs#Int.floor_le might be more useful, but I don't see anything similar to docs#Nat.floor_div_eq_div for Int on first sight


Last updated: Dec 20 2023 at 11:08 UTC