Skip to content

Commit

Permalink
chore: missing lemma about Fin.ofNat'
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Sep 4, 2024
1 parent c219303 commit 582295a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Init/Data/Fin/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ theorem mk_val (i : Fin n) : (⟨i, i.isLt⟩ : Fin n) = i := Fin.eta ..
@[simp] theorem val_ofNat' (a : Nat) (is_pos : n > 0) :
(Fin.ofNat' a is_pos).val = a % n := rfl

@[simp] theorem ofNat'_val_eq_self (x : Fin n) (h) : (Fin.ofNat' x h) = x := by
ext
rw [val_ofNat', Nat.mod_eq_of_lt]
exact x.2

@[simp] theorem mod_val (a b : Fin n) : (a % b).val = a.val % b.val :=
rfl

Expand Down

0 comments on commit 582295a

Please sign in to comment.