diff options
| author | Andreas Grois <andi@grois.info> | 2024-12-21 21:37:51 +0100 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2024-12-21 21:37:51 +0100 |
| commit | b37fc3089eb0ca8fc37a82ae6d6071b0accbca19 (patch) | |
| tree | e500a5adc1a3f87a5e7f0608773dc12377e7af40 /Common/Countable.lean | |
| parent | a6e4b8f15c28c374553684f63fa3f4108095da2d (diff) | |
Continue Day17
Diffstat (limited to 'Common/Countable.lean')
| -rw-r--r-- | Common/Countable.lean | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Common/Countable.lean b/Common/Countable.lean new file mode 100644 index 0000000..e19db99 --- /dev/null +++ b/Common/Countable.lean @@ -0,0 +1,9 @@ +import Common.Finite + +class Countable (α : Type u) where + enumerate : α → Nat + injective {a b : α} : enumerate a = enumerate b → a = b + +instance {α : Type u} [Finite α] : Countable α where + enumerate := Fin.val ∘ Finite.enumerate + injective := Finite.injective ∘ Fin.val_inj.mp |
