Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(Order/Floor): x - 1 / 2 < round x #14964

Closed
wants to merge 14 commits into from
8 changes: 8 additions & 0 deletions Mathlib/Algebra/Order/Floor.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,14 @@ theorem abs_sub_round_div_natCast_eq {m n : ℕ} :
rw [abs_sub_round_eq_min, Nat.cast_min, ← min_div_div_right hn'.le,
fract_div_natCast_eq_div_natCast_mod, Nat.cast_sub (m.mod_lt hn).le, sub_div, div_self hn'.ne']

theorem sub_half_lt_round (x : α) : x - 1 / 2 < round x := by
rw [round_eq x, show x - 1 / 2 = x + 1 / 2 - 1 by nlinarith]
exact Int.sub_one_lt_floor (x + 1 / 2)

theorem round_le_add_half (x : α) : round x ≤ x + 1 / 2 := by
rw [round_eq x]
exact Int.floor_le (x + 1 / 2)

end LinearOrderedField

end round
Expand Down
Loading