chore: missing Fin instances
This commit is contained in:
parent
c3bb948009
commit
e4410cfbf8
2 changed files with 6 additions and 0 deletions
|
|
@ -103,6 +103,9 @@ instance : HMod (Fin n) Nat (Fin n) where
|
|||
instance : OfNat (Fin (no_index (n+1))) i where
|
||||
ofNat := Fin.ofNat i
|
||||
|
||||
instance : Inhabited (Fin (no_index (n+1))) where
|
||||
default := 0
|
||||
|
||||
theorem val_ne_of_ne {i j : Fin n} (h : i ≠ j) : val i ≠ val j :=
|
||||
fun h' => absurd (eq_of_val_eq h') h
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ instance : Hashable UInt64 where
|
|||
instance : Hashable USize where
|
||||
hash n := n.toUInt64
|
||||
|
||||
instance : Hashable (Fin n) where
|
||||
hash v := v.val.toUInt64
|
||||
|
||||
instance : Hashable Int where
|
||||
hash
|
||||
| Int.ofNat n => UInt64.ofNat (2 * n)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue