Skip to content

Commit

Permalink
chore: Better names for (⌊a⌋₊ : α) = ⌊a⌋ (#10252)
Browse files Browse the repository at this point in the history
The new lemma names are more symmetric, hence hopefully more discoverable
  • Loading branch information
YaelDillies committed Feb 15, 2024
1 parent d639f57 commit 1297e8b
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions Mathlib/Algebra/Order/Floor.lean
Expand Up @@ -1727,21 +1727,27 @@ theorem Nat.ceil_int : (Nat.ceil : ℤ → ℕ) = Int.toNat :=

variable {a : α}

theorem Nat.cast_floor_eq_int_floor (ha : 0 ≤ a) : (⌊a⌋₊ : ℤ) = ⌊a⌋ := by
theorem Int.ofNat_floor_eq_floor (ha : 0 ≤ a) : (⌊a⌋₊ : ℤ) = ⌊a⌋ := by
rw [← Int.floor_toNat, Int.toNat_of_nonneg (Int.floor_nonneg.2 ha)]
#align nat.cast_floor_eq_int_floor Nat.cast_floor_eq_int_floor
#align nat.cast_floor_eq_int_floor Int.ofNat_floor_eq_floor

theorem Nat.cast_floor_eq_cast_int_floor (ha : 0 ≤ a) : (⌊a⌋₊ : α) = ⌊a⌋ := by
rw [← Nat.cast_floor_eq_int_floor ha, Int.cast_ofNat]
#align nat.cast_floor_eq_cast_int_floor Nat.cast_floor_eq_cast_int_floor

theorem Nat.cast_ceil_eq_int_ceil (ha : 0 ≤ a) : (⌈a⌉₊ : ℤ) = ⌈a⌉ := by
theorem Int.ofNat_ceil_eq_ceil (ha : 0 ≤ a) : (⌈a⌉₊ : ℤ) = ⌈a⌉ := by
rw [← Int.ceil_toNat, Int.toNat_of_nonneg (Int.ceil_nonneg ha)]
#align nat.cast_ceil_eq_int_ceil Nat.cast_ceil_eq_int_ceil
#align nat.cast_ceil_eq_int_ceil Int.ofNat_ceil_eq_ceil

theorem natCast_floor_eq_intCast_floor (ha : 0 ≤ a) : (⌊a⌋₊ : α) = ⌊a⌋ := by
rw [← Int.ofNat_floor_eq_floor ha, Int.cast_ofNat]
#align nat.cast_floor_eq_cast_int_floor natCast_floor_eq_intCast_floor

theorem natCast_ceil_eq_intCast_ceil (ha : 0 ≤ a) : (⌈a⌉₊ : α) = ⌈a⌉ := by
rw [← Int.ofNat_ceil_eq_ceil ha, Int.cast_ofNat]
#align nat.cast_ceil_eq_cast_int_ceil natCast_ceil_eq_intCast_ceil

theorem Nat.cast_ceil_eq_cast_int_ceil (ha : 0 ≤ a) : (⌈a⌉₊ : α) = ⌈a⌉ := by
rw [← Nat.cast_ceil_eq_int_ceil ha, Int.cast_ofNat]
#align nat.cast_ceil_eq_cast_int_ceil Nat.cast_ceil_eq_cast_int_ceil
-- 2024-02-14
@[deprecated] alias Nat.cast_floor_eq_int_floor := Int.ofNat_floor_eq_floor
@[deprecated] alias Nat.cast_ceil_eq_int_ceil := Int.ofNat_ceil_eq_ceil
@[deprecated] alias Nat.cast_floor_eq_cast_int_floor := natCast_floor_eq_intCast_floor
@[deprecated] alias Nat.cast_ceil_eq_cast_int_ceil := natCast_ceil_eq_intCast_ceil

end FloorRingToSemiring

Expand Down

0 comments on commit 1297e8b

Please sign in to comment.