Skip to content

Commit 8a105e5

Browse files
kim-emtobiasgrosser
authored andcommitted
chore: missing lemma about Fin.ofNat' (leanprover#5250)
1 parent 45bd235 commit 8a105e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Init/Data/Fin/Lemmas.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ theorem mk_val (i : Fin n) : (⟨i, i.isLt⟩ : Fin n) = i := Fin.eta ..
5454
@[simp] theorem val_ofNat' (a : Nat) (is_pos : n > 0) :
5555
(Fin.ofNat' a is_pos).val = a % n := rfl
5656

57+
@[simp] theorem ofNat'_val_eq_self (x : Fin n) (h) : (Fin.ofNat' x h) = x := by
58+
ext
59+
rw [val_ofNat', Nat.mod_eq_of_lt]
60+
exact x.2
61+
5762
@[simp] theorem mod_val (a b : Fin n) : (a % b).val = a.val % b.val :=
5863
rfl
5964

0 commit comments

Comments
 (0)