Skip to content

Commit b50b129

Browse files
committed
chore(Order/Fin): move coe_max/coe_min (#22448)
Also deprecate `coe_sup`/`coe_inf`, since they're syntatically the same as `coe_max`/`coe_min` now.
1 parent 4d4152a commit b50b129

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

Mathlib/Order/Fin/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ instance instBoundedOrder [NeZero n] : BoundedOrder (Fin n) where
5252
bot := 0
5353
bot_le := Fin.zero_le'
5454

55+
@[simp, norm_cast]
56+
theorem coe_max (a b : Fin n) : ↑(max a b) = (max a b : ℕ) := rfl
57+
58+
@[simp, norm_cast]
59+
theorem coe_min (a b : Fin n) : ↑(min a b) = (min a b : ℕ) := rfl
60+
61+
@[deprecated (since := "2025-03-01")] alias coe_sup := coe_max
62+
@[deprecated (since := "2025-03-01")] alias coe_inf := coe_min
63+
5564
/- There is a slight asymmetry here, in the sense that `0` is of type `Fin n` when we have
5665
`[NeZero n]` whereas `last n` is of type `Fin (n + 1)`. To address this properly would
5766
require a change to std4, defining `NeZero n` and thus re-defining `last n`

Mathlib/Order/Interval/Finset/Fin.lean

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,7 @@ intervals as Finsets and Fintypes.
1414

1515
assert_not_exists MonoidWithZero
1616

17-
namespace Fin
18-
19-
variable {n : ℕ} (a b : Fin n)
20-
21-
@[simp, norm_cast]
22-
theorem coe_sup : ↑(a ⊔ b) = (a ⊔ b : ℕ) := rfl
23-
24-
@[simp, norm_cast]
25-
theorem coe_inf : ↑(a ⊓ b) = (a ⊓ b : ℕ) := rfl
26-
27-
@[simp, norm_cast]
28-
theorem coe_max : ↑(max a b) = (max a b : ℕ) := rfl
29-
30-
@[simp, norm_cast]
31-
theorem coe_min : ↑(min a b) = (min a b : ℕ) := rfl
32-
33-
end Fin
34-
35-
open Finset Fin Function
17+
open Finset Function
3618

3719
namespace Fin
3820

0 commit comments

Comments
 (0)