mirror of
https://github.com/Smaug123/agdaproofs
synced 2025-10-12 07:08:40 +00:00
Cleanup finset and modulo (#92)
This commit is contained in:
18
Sets/Cardinality/Finite/Definition.agda
Normal file
18
Sets/Cardinality/Finite/Definition.agda
Normal file
@@ -0,0 +1,18 @@
|
||||
{-# OPTIONS --safe --warning=error --without-K #-}
|
||||
|
||||
open import Functions
|
||||
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
|
||||
open import LogicalFormulae
|
||||
open import Numbers.Naturals.Naturals
|
||||
open import Numbers.Naturals.Definition
|
||||
open import Numbers.Naturals.Order
|
||||
open import Sets.FinSet.Definition
|
||||
|
||||
module Sets.Cardinality.Finite.Definition where
|
||||
|
||||
record FiniteSet {a : _} (A : Set a) : Set a where
|
||||
field
|
||||
size : ℕ
|
||||
mapping : FinSet size → A
|
||||
bij : Bijection mapping
|
||||
|
26
Sets/Cardinality/Finite/Lemmas.agda
Normal file
26
Sets/Cardinality/Finite/Lemmas.agda
Normal file
@@ -0,0 +1,26 @@
|
||||
{-# OPTIONS --safe --warning=error --without-K #-}
|
||||
|
||||
open import Functions
|
||||
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
|
||||
open import LogicalFormulae
|
||||
open import Numbers.Naturals.Naturals
|
||||
open import Numbers.Naturals.Definition
|
||||
open import Numbers.Naturals.Order
|
||||
open import Sets.FinSet.Definition
|
||||
open import Sets.FinSet.Lemmas
|
||||
|
||||
module Sets.Cardinality.Finite.Lemmas where
|
||||
|
||||
finsetInjectIntoℕ : {n : ℕ} → Injection (toNat {n})
|
||||
finsetInjectIntoℕ {zero} {()}
|
||||
finsetInjectIntoℕ {succ n} = ans
|
||||
where
|
||||
ans : {n : ℕ} → {x y : FinSet (succ n)} → (toNat x ≡ toNat y) → x ≡ y
|
||||
ans {zero} {fzero} {fzero} _ = refl
|
||||
ans {zero} {fzero} {fsucc ()}
|
||||
ans {zero} {fsucc ()} {y}
|
||||
ans {succ n} {fzero} {fzero} pr = refl
|
||||
ans {succ n} {fzero} {fsucc y} ()
|
||||
ans {succ n} {fsucc x} {fzero} ()
|
||||
ans {succ n} {fsucc x} {fsucc y} pr with succInjective pr
|
||||
... | pr' = applyEquality fsucc (ans {n} {x} {y} pr')
|
Reference in New Issue
Block a user