Skip to content

Commit e328070

Browse files
committed
chore(Data/Fin): generalize Nontrivial instance to NeZero (#25003)
This makes the statement a bit weird, but we use `NeZero` frequently in downstream statements, and this makes it available.
1 parent ddbcd9d commit e328070

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Mathlib/Data/Fin/Basic.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2017 Robert Y. Lewis. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Robert Y. Lewis, Keeley Hoek
55
-/
6-
import Mathlib.Algebra.NeZero
76
import Mathlib.Data.Int.DivMod
87
import Mathlib.Logic.Embedding.Basic
98
import Mathlib.Logic.Equiv.Set
@@ -309,8 +308,8 @@ theorem val_one' (n : ℕ) [NeZero n] : ((1 : Fin n) : ℕ) = 1 % n :=
309308
theorem val_one'' {n : ℕ} : ((1 : Fin (n + 1)) : ℕ) = 1 % (n + 1) :=
310309
rfl
311310

312-
instance nontrivial {n : ℕ} : Nontrivial (Fin (n + 2)) where
313-
exists_pair_ne := ⟨0, 1, (ne_iff_vne 0 1).mpr (by simp [val_one, val_zero])⟩
311+
instance nontrivial {n : ℕ} [NeZero n] : Nontrivial (Fin (n + 1)) where
312+
exists_pair_ne := ⟨0, 1, (ne_iff_vne 0 1).mpr (by simp [val_one, val_zero, NeZero.ne])⟩
314313

315314
theorem nontrivial_iff_two_le : Nontrivial (Fin n) ↔ 2 ≤ n := by
316315
rcases n with (_ | _ | n) <;>

0 commit comments

Comments
 (0)